[PATCH v5 4/4] board: add call to k3_mem_map_init for all k3 boards
Anshul Dalal
anshuld at ti.com
Thu Jul 3 15:35:29 CEST 2025
k3_mem_map_init configures the MMU at runtime by querying the
device-tree for DDR size for each bank as well as creating carveouts for
OPTEE and ATF in the first bank.
Therefore add a call to k3_mem_map_init in dram_init for all k3 vendor
boards.
Signed-off-by: Anshul Dalal <anshuld at ti.com>
---
board/beagle/beagleplay/beagleplay.c | 9 ++++++++-
board/phytec/phycore_am62ax/phycore-am62ax.c | 9 ++++++++-
board/phytec/phycore_am62x/phycore-am62x.c | 3 ++-
board/phytec/phycore_am64x/phycore-am64x.c | 3 ++-
board/siemens/iot2050/board.c | 3 ++-
board/toradex/verdin-am62/verdin-am62.c | 3 ++-
6 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/board/beagle/beagleplay/beagleplay.c b/board/beagle/beagleplay/beagleplay.c
index 78635810585..c87ed925da8 100644
--- a/board/beagle/beagleplay/beagleplay.c
+++ b/board/beagle/beagleplay/beagleplay.c
@@ -13,6 +13,7 @@
#include <spl.h>
#include <asm/arch/hardware.h>
+#include <mach/k3-ddr.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -48,7 +49,13 @@ int board_init(void)
int dram_init(void)
{
- return fdtdec_setup_mem_size_base();
+ int ret;
+
+ ret = fdtdec_setup_mem_size_base();
+ if (ret)
+ return ret;
+
+ return k3_mem_map_init();
}
int dram_init_banksize(void)
diff --git a/board/phytec/phycore_am62ax/phycore-am62ax.c b/board/phytec/phycore_am62ax/phycore-am62ax.c
index 14b8959c07a..5d61866d556 100644
--- a/board/phytec/phycore_am62ax/phycore-am62ax.c
+++ b/board/phytec/phycore_am62ax/phycore-am62ax.c
@@ -8,6 +8,7 @@
#include <asm/io.h>
#include <spl.h>
#include <fdt_support.h>
+#include <mach/k3-ddr.h>
#include "../common/am6_som_detection.h"
@@ -18,7 +19,13 @@ int board_init(void)
int dram_init(void)
{
- return fdtdec_setup_mem_size_base();
+ int ret;
+
+ ret = fdtdec_setup_mem_size_base();
+ if (ret)
+ return ret;
+
+ return k3_mem_map_init();
}
int dram_init_banksize(void)
diff --git a/board/phytec/phycore_am62x/phycore-am62x.c b/board/phytec/phycore_am62x/phycore-am62x.c
index b199fdaa59b..ebf7697709d 100644
--- a/board/phytec/phycore_am62x/phycore-am62x.c
+++ b/board/phytec/phycore_am62x/phycore-am62x.c
@@ -9,6 +9,7 @@
#include <spl.h>
#include <asm/arch/k3-ddr.h>
#include <fdt_support.h>
+#include <mach/k3-ddr.h>
#include "phycore-ddr-data.h"
#include "../common/k3/k3_ddrss_patch.h"
@@ -81,7 +82,7 @@ int dram_init(void)
gd->ram_size = 0x80000000;
}
- return 0;
+ return k3_mem_map_init();
}
phys_size_t board_get_usable_ram_top(phys_size_t total_size)
diff --git a/board/phytec/phycore_am64x/phycore-am64x.c b/board/phytec/phycore_am64x/phycore-am64x.c
index f14c87f5c72..4cd44d6e538 100644
--- a/board/phytec/phycore_am64x/phycore-am64x.c
+++ b/board/phytec/phycore_am64x/phycore-am64x.c
@@ -16,6 +16,7 @@
#include <asm/arch/hardware.h>
#include "../common/am6_som_detection.h"
+#include <mach/k3-ddr.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -64,7 +65,7 @@ int dram_init(void)
gd->ram_size = 0x80000000;
}
- return 0;
+ return k3_mem_map_init();
}
int dram_init_banksize(void)
diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c
index d827f728a08..fca8270fda9 100644
--- a/board/siemens/iot2050/board.c
+++ b/board/siemens/iot2050/board.c
@@ -24,6 +24,7 @@
#include <asm/arch/hardware.h>
#include <asm/gpio.h>
#include <asm/io.h>
+#include <mach/k3-ddr.h>
#include "../../../../drivers/sysinfo/iot2050.h"
@@ -383,7 +384,7 @@ int dram_init(void)
gd->ram_size = ((phys_size_t)(ddr_size_mb)) << 20;
- return 0;
+ return k3_mem_map_init();
}
ulong board_get_usable_ram_top(ulong total_size)
diff --git a/board/toradex/verdin-am62/verdin-am62.c b/board/toradex/verdin-am62/verdin-am62.c
index 7b2eecbf659..4c900663506 100644
--- a/board/toradex/verdin-am62/verdin-am62.c
+++ b/board/toradex/verdin-am62/verdin-am62.c
@@ -16,6 +16,7 @@
#include <k3-ddrss.h>
#include <spl.h>
#include <asm/arch/k3-ddr.h>
+#include <mach/k3-ddr.h>
#include "../common/tdx-cfg-block.h"
@@ -33,7 +34,7 @@ int dram_init(void)
if (gd->ram_size < SZ_512M)
puts("## WARNING: Less than 512MB RAM detected\n");
- return 0;
+ return k3_mem_map_init();
}
int dram_init_banksize(void)
--
2.49.0
More information about the U-Boot
mailing list