armv7R: K3: j721e: Add support for triggering ddr init from SPL
authorLokesh Vutla <lokeshvutla@ti.com>
Mon, 7 Oct 2019 13:56:38 +0000 (19:26 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 25 Oct 2019 21:33:21 +0000 (17:33 -0400)
In SPL, DDR should be made available by the end of board_init_f()
so that apis in board_init_r() can use ddr. Adding support for
triggering DDR initialization from board_init_f().

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
arch/arm/mach-k3/j721e_init.c
board/ti/j721e/Kconfig

index 733e4146545edab9536c6a27d8923e56a842a8b9..5e3813252baed24f5a6553e5444edee4860c53b2 100644 (file)
@@ -73,7 +73,7 @@ static void store_boot_index_from_rom(void)
 
 void board_init_f(ulong dummy)
 {
-#if defined(CONFIG_K3_LOAD_SYSFW)
+#if defined(CONFIG_K3_J721E_DDRSS) || defined(CONFIG_K3_LOAD_SYSFW)
        struct udevice *dev;
        int ret;
 #endif
@@ -117,6 +117,12 @@ void board_init_f(ulong dummy)
        /* Prepare console output */
        preloader_console_init();
 #endif
+
+#if defined(CONFIG_K3_J721E_DDRSS)
+       ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+       if (ret)
+               panic("DRAM init failed: %d\n", ret);
+#endif
 }
 
 u32 spl_boot_mode(const u32 boot_device)
index c2deb6916acebc7cf0505ab6fe02733838556421..88097df6530416b98cae05f4ac0453f016f8312e 100644 (file)
@@ -21,6 +21,7 @@ config TARGET_J721E_R5_EVM
        select K3_LOAD_SYSFW
        select RAM
        select SPL_RAM
+       select K3_J721E_DDRSS
        imply SYS_K3_SPL_ATF
 
 endchoice