* [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks
@ 2025-10-31 16:17 Anshul Dalal
2025-11-04 10:31 ` Emanuele Ghidoli
2025-11-04 16:39 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Anshul Dalal @ 2025-10-31 16:17 UTC (permalink / raw)
To: u-boot
Cc: Tom Rini, Ilias Apalodimas, Dhruva Gole, Casey Connolly,
Patrice Chotard, Sam Protsenko, Neha Malcom Francis,
Beleswar Padhi, Moteen Shah, Chintan Vankar, Wadim Egorov,
Bryan Brattlof, Francesco Dolcini, Emanuele Ghidoli, Anshul Dalal
mem_map_from_dram_banks calls fdtdec_setup_memory_banksize to setup the
dram banks though that is expected to be done by dram_init_banksize as
part of board_r sequence.
This has the side effect of modifying gd->bd->bi_dram as well, therefore
this patch removes the call and updates spl_enable_cache for K3 to call
dram_init_banksize.
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Reported-by: Francesco Dolcini <francesco@dolcini.it>
Closes: https://lore.kernel.org/u-boot/20251027165225.GA71553@francesco-nb/
Fixes: fe2647f2a0d4 ("arm: armv8: mmu: add mem_map_from_dram_banks")
---
arch/arm/cpu/armv8/cache_v8.c | 6 ------
arch/arm/mach-k3/common.c | 1 +
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index 672ec16d4834be501d5bfa343af9537aa9285252..0309da6d3971af6f2a349ce0760507765da9af4f 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -61,12 +61,6 @@ static int get_effective_el(void)
int mem_map_from_dram_banks(unsigned int index, unsigned int len, u64 attrs)
{
unsigned int i;
- int ret = fdtdec_setup_memory_banksize();
-
- if (ret) {
- log_err("%s: Failed to setup dram banks\n", __func__);
- return ret;
- }
if (index + CONFIG_NR_DRAM_BANKS >= len) {
log_err("%s: Provided mem_map array has insufficient size for DRAM entries\n",
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
index 7c06764af8256b7fd27f8e7f208a597b1b91652b..82a31b5178b9b5abdf7eae68cbbd22fe2a86dbee 100644
--- a/arch/arm/mach-k3/common.c
+++ b/arch/arm/mach-k3/common.c
@@ -311,6 +311,7 @@ void spl_enable_cache(void)
int ret = 0;
dram_init();
+ dram_init_banksize();
/* reserve TLB table */
gd->arch.tlb_size = PGTABLE_SIZE;
---
base-commit: 08bf42e1faa4411cd347c2e370da790a0116e318
change-id: 20251031-k3_fix_mmu-bd62988ed62d
Best regards,
--
Anshul Dalal <anshuld@ti.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks
2025-10-31 16:17 [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks Anshul Dalal
@ 2025-11-04 10:31 ` Emanuele Ghidoli
2025-11-04 16:39 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Emanuele Ghidoli @ 2025-11-04 10:31 UTC (permalink / raw)
To: Anshul Dalal, u-boot
Cc: Tom Rini, Ilias Apalodimas, Dhruva Gole, Casey Connolly,
Patrice Chotard, Sam Protsenko, Neha Malcom Francis,
Beleswar Padhi, Moteen Shah, Chintan Vankar, Wadim Egorov,
Bryan Brattlof, Francesco Dolcini, Emanuele Ghidoli
On 31/10/2025 17:17, Anshul Dalal wrote:
> mem_map_from_dram_banks calls fdtdec_setup_memory_banksize to setup the
> dram banks though that is expected to be done by dram_init_banksize as
> part of board_r sequence.
>
> This has the side effect of modifying gd->bd->bi_dram as well, therefore
> this patch removes the call and updates spl_enable_cache for K3 to call
> dram_init_banksize.
>
> Signed-off-by: Anshul Dalal <anshuld@ti.com>
> Reported-by: Francesco Dolcini <francesco@dolcini.it>
> Closes: https://lore.kernel.org/u-boot/20251027165225.GA71553@francesco-nb/
> Fixes: fe2647f2a0d4 ("arm: armv8: mmu: add mem_map_from_dram_banks")
> ---
> arch/arm/cpu/armv8/cache_v8.c | 6 ------
> arch/arm/mach-k3/common.c | 1 +
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
> index 672ec16d4834be501d5bfa343af9537aa9285252..0309da6d3971af6f2a349ce0760507765da9af4f 100644
> --- a/arch/arm/cpu/armv8/cache_v8.c
> +++ b/arch/arm/cpu/armv8/cache_v8.c
> @@ -61,12 +61,6 @@ static int get_effective_el(void)
> int mem_map_from_dram_banks(unsigned int index, unsigned int len, u64 attrs)
> {
> unsigned int i;
> - int ret = fdtdec_setup_memory_banksize();
> -
> - if (ret) {
> - log_err("%s: Failed to setup dram banks\n", __func__);
> - return ret;
> - }
>
> if (index + CONFIG_NR_DRAM_BANKS >= len) {
> log_err("%s: Provided mem_map array has insufficient size for DRAM entries\n",
> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c
> index 7c06764af8256b7fd27f8e7f208a597b1b91652b..82a31b5178b9b5abdf7eae68cbbd22fe2a86dbee 100644
> --- a/arch/arm/mach-k3/common.c
> +++ b/arch/arm/mach-k3/common.c
> @@ -311,6 +311,7 @@ void spl_enable_cache(void)
> int ret = 0;
>
> dram_init();
> + dram_init_banksize();
>
> /* reserve TLB table */
> gd->arch.tlb_size = PGTABLE_SIZE;
>
> ---
> base-commit: 08bf42e1faa4411cd347c2e370da790a0116e318
> change-id: 20251031-k3_fix_mmu-bd62988ed62d
>
> Best regards,
Hello Anshul,
this effectively fixes the regression.
Thanks!
Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks
2025-10-31 16:17 [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks Anshul Dalal
2025-11-04 10:31 ` Emanuele Ghidoli
@ 2025-11-04 16:39 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2025-11-04 16:39 UTC (permalink / raw)
To: u-boot, Anshul Dalal
Cc: Ilias Apalodimas, Dhruva Gole, Casey Connolly, Patrice Chotard,
Sam Protsenko, Neha Malcom Francis, Beleswar Padhi, Moteen Shah,
Chintan Vankar, Wadim Egorov, Bryan Brattlof, Francesco Dolcini,
Emanuele Ghidoli
On Fri, 31 Oct 2025 21:47:31 +0530, Anshul Dalal wrote:
> mem_map_from_dram_banks calls fdtdec_setup_memory_banksize to setup the
> dram banks though that is expected to be done by dram_init_banksize as
> part of board_r sequence.
>
> This has the side effect of modifying gd->bd->bi_dram as well, therefore
> this patch removes the call and updates spl_enable_cache for K3 to call
> dram_init_banksize.
>
> [...]
Applied to u-boot/master, thanks!
[1/1] arm: armv8: mmu: fix mem_map_from_dram_banks
commit: 45b7857d3b5b4cb12a5cc0a121bc8ac4b57427fa
--
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-04 16:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 16:17 [PATCH] arm: armv8: mmu: fix mem_map_from_dram_banks Anshul Dalal
2025-11-04 10:31 ` Emanuele Ghidoli
2025-11-04 16:39 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox