[PATCH 2/5] arm: mach-k3: am642: Add support for triggering ddr init from SPL

Dave Gerlach d-gerlach at ti.com
Wed May 5 01:00:53 CEST 2021


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: Dave Gerlach <d-gerlach at ti.com>
---
 arch/arm/mach-k3/am642_init.c | 6 ++++++
 board/ti/am64x/Kconfig        | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 8931aaabf2f9..f9f28194e0d3 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -131,6 +131,12 @@ void board_init_f(ulong dummy)
 
 	/* Output System Firmware version info */
 	k3_sysfw_print_ver();
+
+#if defined(CONFIG_K3_AM64_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)
diff --git a/board/ti/am64x/Kconfig b/board/ti/am64x/Kconfig
index a49e22266983..6cee535df70e 100644
--- a/board/ti/am64x/Kconfig
+++ b/board/ti/am64x/Kconfig
@@ -19,6 +19,9 @@ config TARGET_AM642_R5_EVM
 	select SYS_THUMB_BUILD
 	select K3_LOAD_SYSFW
 	select SOC_K3_AM642
+	select RAM
+	select SPL_RAM
+	select K3_DDRSS
 	imply SYS_K3_SPL_ATF
 
 endchoice
-- 
2.28.0



More information about the U-Boot mailing list