From: Anshul Dalal <anshuld@ti.com>
To: <u-boot@lists.denx.de>
Cc: Anshul Dalal <anshuld@ti.com>, <vigneshr@ti.com>,
<trini@konsulko.com>, <nm@ti.com>, <robertcnelson@gmail.com>,
<w.egorov@phytec.de>, <francesco.dolcini@toradex.com>,
<ggiordano@phytec.com>, <m-chawdhry@ti.com>, <a-nandan@ti.com>,
<afd@ti.com>, <bb@ti.com>, <u-kumar1@ti.com>, <devarsht@ti.com>
Subject: [PATCH v5 4/4] board: add call to k3_mem_map_init for all k3 boards
Date: Thu, 3 Jul 2025 19:05:29 +0530 [thread overview]
Message-ID: <20250703133533.104758-5-anshuld@ti.com> (raw)
In-Reply-To: <20250703133533.104758-1-anshuld@ti.com>
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@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
prev parent reply other threads:[~2025-07-03 13:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 13:35 [PATCH v5 0/4] Add support for dynamic MMU configuration Anshul Dalal
2025-07-03 13:35 ` [PATCH v5 1/4] mach-k3: use minimal MMU table for all k3 Anshul Dalal
2025-07-03 13:35 ` [PATCH v5 2/4] mach-k3: add runtime configuration of MMU table Anshul Dalal
2025-07-07 20:15 ` Ilias Apalodimas
2025-08-14 14:11 ` Anshul Dalal
2025-08-21 6:20 ` Ilias Apalodimas
2025-07-03 13:35 ` [PATCH v5 3/4] mach-k3: add dynamic mmu fixups for SPL stage Anshul Dalal
2025-07-07 20:09 ` Ilias Apalodimas
2025-08-14 14:51 ` Anshul Dalal
2025-08-21 6:17 ` Ilias Apalodimas
2025-07-03 13:35 ` Anshul Dalal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250703133533.104758-5-anshuld@ti.com \
--to=anshuld@ti.com \
--cc=a-nandan@ti.com \
--cc=afd@ti.com \
--cc=bb@ti.com \
--cc=devarsht@ti.com \
--cc=francesco.dolcini@toradex.com \
--cc=ggiordano@phytec.com \
--cc=m-chawdhry@ti.com \
--cc=nm@ti.com \
--cc=robertcnelson@gmail.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=u-kumar1@ti.com \
--cc=vigneshr@ti.com \
--cc=w.egorov@phytec.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox