summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2022-08-23 11:30:14 +0200
committerPeng Fan <peng.fan@nxp.com>2022-09-06 09:10:41 +0800
commit6622c30f2e033eb4268720c1927a52062406f870 (patch)
tree8dffd95d8e771c0177f3ac6ec04c2b8676cbab1a /arch
parent427aa3c9b72b6672f714389a6f71b6cc2841d559 (diff)
armv8: layerscape: spl: mark OCRAM as non-secure
By default the OCRAM is marked as secure. While the SPL runs in EL3 and thus can access it, DMA devices cannot. Mark the whole OCRAM as non-secure. This will fix MMC and SD card boot on LS1028A when using SPL instead of TF-A. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv8/fsl-layerscape/spl.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/spl.c b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
index 5f09ef0a4a..3a4b665f24 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/spl.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/spl.c
@@ -67,11 +67,24 @@ void spl_board_init(void)
#endif
}
+void tzpc_init(void)
+{
+ /*
+ * Mark the whole OCRAM as non-secure, otherwise DMA devices cannot
+ * access it. This is for example necessary for MMC boot.
+ */
+#ifdef TZPCR0SIZE_BASE
+ out_le32(TZPCR0SIZE_BASE, 0);
+#endif
+}
+
void board_init_f(ulong dummy)
{
int ret;
icache_enable();
+ tzpc_init();
+
/* Clear global data */
memset((void *)gd, 0, sizeof(gd_t));
if (IS_ENABLED(CONFIG_DEBUG_UART))