[U-Boot] [PATCH 05/10] armv7R: K3: am654: Add support for triggering ddr init from SPL

Lokesh Vutla lokeshvutla at ti.com
Mon Oct 22 09:36:51 UTC 2018


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 at ti.com>
---
 arch/arm/mach-k3/am6_init.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index fef0107505..6a4e75a36e 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -57,6 +57,9 @@ static void store_boot_index_from_rom(void)
 
 void board_init_f(ulong dummy)
 {
+#if defined(CONFIG_K3_AM654_DDRSS)
+	struct udevice *dev;
+#endif
 	/*
 	 * Cannot delay this further as there is a chance that
 	 * K3_BOOT_PARAM_TABLE_INDEX can be over written by SPL MALLOC section.
@@ -75,6 +78,14 @@ void board_init_f(ulong dummy)
 
 	/* Prepare console output */
 	preloader_console_init();
+
+#ifdef CONFIG_K3_AM654_DDRSS
+	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (ret) {
+		printf("DRAM init failed: %d\n", ret);
+		return;
+	}
+#endif
 }
 
 u32 spl_boot_mode(const u32 boot_device)
-- 
2.19.1



More information about the U-Boot mailing list