Use arch_cpu_init() to init SoC secure region and move it to
rk322x.c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
TIMER_CONTROL_REG);
}
-#define SGRF_DDR_CON0 0x10150000
+__weak int arch_cpu_init(void)
+{
+ return 0;
+}
+
void board_init_f(ulong dummy)
{
int ret;
rockchip_stimer_init();
/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
timer_init();
-
- /* Disable the ddr secure region setting to make it non-secure */
- rk_clrreg(SGRF_DDR_CON0, 0x4000);
+ arch_cpu_init();
}
#ifdef CONFIG_SPL_LOAD_FIT
CON_IOMUX_UART2SEL_21 << CON_IOMUX_UART2SEL_SHIFT);
}
#endif
+
+int arch_cpu_init(void)
+{
+#ifdef CONFIG_SPL_BUILD
+#define SGRF_BASE 0x10150000
+ static struct rk322x_sgrf * const sgrf = (void *)SGRF_BASE;
+
+ /* Disable the ddr secure region setting to make it non-secure */
+ rk_clrreg(&sgrf->soc_con[0], 0x4000);
+#endif
+ return 0;
+}