summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTingting Meng <[email protected]>2025-03-10 15:31:24 +0800
committerTien Fong Chee <[email protected]>2025-04-22 11:47:40 +0800
commitd0bf7bebfd5c045b96686e314177b2e01d0695e3 (patch)
tree246bdc58ed31e05fb6fc03fb8a01b5d13ec33e97
parent1f8d5085e985884ae1c82254d6e1af231f9d9e8b (diff)
arm: socfpga: socfpga_soc64: Enable LMB_ARCH_MEM_MAP
LMB_ARCH_MEM_MAP is enabled, and lmb_arch_add_memory() is introduced to correctly handle memory reservations for the second and third DDR memory banks. Signed-off-by: Tingting Meng <[email protected]>
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/mach-socfpga/board.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 83f6cb6edcc..df373d38a55 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1138,6 +1138,7 @@ config ARCH_SOCFPGA
select DM_SERIAL
select GPIO_EXTRA_HEADER
select ENABLE_ARM_SOC_BOOT0_HOOK if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
+ select LMB_ARCH_MEM_MAP if TARGET_SOCFPGA_SOC64
select OF_CONTROL
select SPL_DM_RESET if DM_RESET
select SPL_DM_SERIAL
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 27072e53135..8506d510413 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -195,3 +195,16 @@ void board_prep_linux(struct bootm_headers *images)
}
}
#endif
+
+#if CONFIG_IS_ENABLED(LMB_ARCH_MEM_MAP)
+void lmb_arch_add_memory(void)
+{
+ int i;
+ struct bd_info *bd = gd->bd;
+
+ for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
+ if (bd->bi_dram[i].size)
+ lmb_add(bd->bi_dram[i].start, bd->bi_dram[i].size);
+ }
+}
+#endif