[PATCH 22/28] arm: rockchip: rv1126: Set dram area unsecure for SPL

Jagan Teki jagan at edgeble.ai
Wed Jul 27 19:40:44 CEST 2022


Unsecure the dram area so that MMC, USB, and SFC controllers
can able to read data from dram.

Signed-off-by: Jason Zhu <jason.zhu at rock-chips.com>
Signed-off-by: Jagan Teki <jagan at edgeble.ai>
---
 arch/arm/mach-rockchip/rv1126/rv1126.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/mach-rockchip/rv1126/rv1126.c b/arch/arm/mach-rockchip/rv1126/rv1126.c
index 91554c98b6..f4dc119d40 100644
--- a/arch/arm/mach-rockchip/rv1126/rv1126.c
+++ b/arch/arm/mach-rockchip/rv1126/rv1126.c
@@ -10,6 +10,8 @@
 #include <asm/arch-rockchip/hardware.h>
 #include <asm/arch-rockchip/grf_rv1126.h>
 
+#define FIREWALL_APB_BASE	0xffa60000
+#define FW_DDR_CON_REG		0x80
 #define GRF_BASE		0xFE000000
 
 const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1] = {
@@ -58,6 +60,17 @@ void board_debug_uart_init(void)
 #ifndef CONFIG_TPL_BUILD
 int arch_cpu_init(void)
 {
+#ifdef CONFIG_SPL_BUILD
+	/**
+	 * Set dram area unsecure in spl
+	 *
+	 * usb & mmc & sfc controllers can read data to dram
+	 * since they are unsecure.
+	 * (Note: only secure-world can access this register)
+	 */
+	writel(0, FIREWALL_APB_BASE + FW_DDR_CON_REG);
+#endif
+
 	return 0;
 }
 #endif
-- 
2.25.1



More information about the U-Boot mailing list