Skip to contentSkip to conversation

imx9: scmi: Move u-boot early MMU table to top 2MB of first 64MB DDR

PATCH Superseded [email protected] 3 participants 6 messages Oct 10 – Oct 13

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 imx9: scmi: Move u-boot early MMU table to top 2MB of first 64MB DDR

From: Ye Li <[email protected]>

The default u-boot early MMU table address is at CFG_SYS_SDRAM_BASE. The same address is used as alias target on Toradex's iMX95 boards in RAM-size probe. When a probe address aliases that location, the test temporarily overwrites an entry in the active page tables.

To avoid such overlap, move u-boot early MMU table to top 2MB of first 64MB DDR.

---
 arch/arm/mach-imx/imx9/scmi/soc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-imx/imx9/scmi/soc.c +4 -1
index 22f9c9d045b..fa6b9a0e53d 100644
@@ -613,9 +613,12 @@ __weak unsigned long board_spl_mmu_tlb_base(void)
 #endif
 }
 
+/* Uboot early MMU only map first 64MB DDR before DM init.
+ * Set default early MMU table at top 2MB of first 64MB DDR
+ */
 __weak unsigned long board_early_mmu_tlb_base(void)
 {
-	return CFG_SYS_SDRAM_BASE;
+	return CFG_SYS_SDRAM_BASE + SZ_64M - SZ_2M;
 }
 
 /*
Signature · 1 line
2.50.1
#1 lore raw

PATCH 2/2 toradex: {aquila, smarc, verdin}-imx95: Enable caches in SPL

From: Ye Li <[email protected]>

To enable icache and dcache in SPL, add the definition of secure DDR space which could be accessed by SPL and move arch_cpu_init before spl_early_init.

---
 board/toradex/aquila-imx95/spl.c      | 4 ++--
 board/toradex/smarc-imx95/spl.c       | 4 ++--
 board/toradex/verdin-imx95/spl.c      | 4 ++--
 include/configs/aquila-imx95.h        | 2 +-
 include/configs/toradex-smarc-imx95.h | 3 +++
 include/configs/verdin-imx95.h        | 3 +++
 6 files changed, 13 insertions(+), 7 deletions(-)
board/toradex/aquila-imx95/spl.c +2 -2
index 93e76be6145..31730fc22c8 100644
@@ -58,6 +58,8 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
+	arch_cpu_init();
+
 	/* Need dm_init() to run before any SCMI calls */
 	spl_early_init();
 
@@ -66,8 +68,6 @@ void board_init_f(ulong dummy)
 	if (ret)
 		hang(); /* MU not probed, nothing can be outputed, hang */
 
-	arch_cpu_init();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
board/toradex/smarc-imx95/spl.c +2 -2
index aebb4a2f0b6..a3fd11a50db 100644
@@ -99,6 +99,8 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
+	arch_cpu_init();
+
 	/* Need dm_init() to run before any SCMI calls */
 	spl_early_init();
 
@@ -107,8 +109,6 @@ void board_init_f(ulong dummy)
 	if (ret)
 		hang(); /* MU not probed, nothing can be outputed, hang */
 
-	arch_cpu_init();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
board/toradex/verdin-imx95/spl.c +2 -2
index 93e76be6145..31730fc22c8 100644
@@ -58,6 +58,8 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
+	arch_cpu_init();
+
 	/* Need dm_init() to run before any SCMI calls */
 	spl_early_init();
 
@@ -66,8 +68,6 @@ void board_init_f(ulong dummy)
 	if (ret)
 		hang(); /* MU not probed, nothing can be outputed, hang */
 
-	arch_cpu_init();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
include/configs/aquila-imx95.h +1 -1
index 96c11ff2d5b..9c48d2b2736 100644
@@ -26,6 +26,6 @@
 #define PHYS_SDRAM_2_SIZE	SZ_6G
 
 #define CFG_SYS_SECURE_SDRAM_BASE	0x8A000000 /* Secure DDR region for A55, SPL could use first 2MB */
-#define CFG_SYS_SECURE_SDRAM_SIZE	0x06000000
+#define CFG_SYS_SECURE_SDRAM_SIZE	SZ_64M
 
 #endif
include/configs/toradex-smarc-imx95.h +3 -0
index 97e3322ac28..5e23db7c9e5 100644
@@ -22,4 +22,7 @@
 #define PHYS_SDRAM_SIZE		(SZ_2G - PHYS_SDRAM_FW_RSVD)
 #define PHYS_SDRAM_2_SIZE	SZ_6G
 
+#define CFG_SYS_SECURE_SDRAM_BASE      0x8A000000 /* Secure DDR region for A55 */
+#define CFG_SYS_SECURE_SDRAM_SIZE      SZ_64M
+
 #endif
include/configs/verdin-imx95.h +3 -0
index b6df4d48695..87085cc8719 100644
@@ -22,4 +22,7 @@
 #define PHYS_SDRAM_SIZE		(SZ_2G - PHYS_SDRAM_FW_RSVD)
 #define PHYS_SDRAM_2_SIZE	SZ_30G
 
+#define CFG_SYS_SECURE_SDRAM_BASE      0x8A000000 /* Secure DDR region for A55 */
+#define CFG_SYS_SECURE_SDRAM_SIZE      SZ_64M
+
 #endif
Signature · 1 line
2.50.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] toradex: {aquila, smarc, verdin}-imx95: Enable caches in SPL

Quoted 7 lines · On Sat, Oct 10, 2026 at 03:59:51PM +0800, [email protected] wrote:

From: Ye Li <[email protected]>

To enable icache and dcache in SPL, add the definition of secure DDR space which could be accessed by SPL and move arch_cpu_init before spl_early_init.

Reviewed-by Tested-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] toradex: {aquila, smarc, verdin}-imx95: Enable caches in SPL

In reply to [email protected]
Quoted 17 lines · On 10/10/26 09:59, [email protected] wrote:

From: Ye Li <[email protected]>

To enable icache and dcache in SPL, add the definition of secure DDR space which could be accessed by SPL and move arch_cpu_init before spl_early_init.

---
 board/toradex/aquila-imx95/spl.c      | 4 ++--
 board/toradex/smarc-imx95/spl.c       | 4 ++--
 board/toradex/verdin-imx95/spl.c      | 4 ++--
 include/configs/aquila-imx95.h        | 2 +-
 include/configs/toradex-smarc-imx95.h | 3 +++
 include/configs/verdin-imx95.h        | 3 +++
 6 files changed, 13 insertions(+), 7 deletions(-)

board/toradex/aquila-imx95/spl.c

Quoted 1 line
board/toradex/aquila-imx95/spl.c +0 -0
[...]

Hello Ye,

Nit: spaces instead of tabs after the added #defines in toradex-smarc-imx95.h and verdin-imx95.h.

#4 lore raw
In reply to [email protected]

Hello Ye,
thanks for the patch, appreciated.

Quoted 11 lines · On Sat, Oct 10, 2026 at 03:59:50PM +0800, [email protected] wrote:

From: Ye Li <[email protected]>

The default u-boot early MMU table address is at CFG_SYS_SDRAM_BASE. The same address is used as alias target on Toradex's iMX95 boards in RAM-size probe. When a probe address aliases that location, the test temporarily overwrites an entry in the active page tables.

To avoid such overlap, move u-boot early MMU table to top 2MB of first 64MB DDR.

Emanuele, can you please review this and the following one?

Francesco

Reviewed-by Tested-by on v1 1/2
#5 lore raw
In reply to [email protected]
Quoted 23 lines · On 10/10/26 09:59, [email protected] wrote:

From: Ye Li <[email protected]>

The default u-boot early MMU table address is at CFG_SYS_SDRAM_BASE. The same address is used as alias target on Toradex's iMX95 boards in RAM-size probe. When a probe address aliases that location, the test temporarily overwrites an entry in the active page tables.

To avoid such overlap, move u-boot early MMU table to top 2MB of first 64MB DDR.

---
 arch/arm/mach-imx/imx9/scmi/soc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-imx/imx9/scmi/soc.c +0 -0
index 22f9c9d045b..fa6b9a0e53d 100644
@@ -613,9 +613,12 @@ __weak unsigned long board_spl_mmu_tlb_base(void)
 #endif
 }
 

arch/arm/mach-imx/imx9/scmi/soc.c __weak unsigned long board_spl_mmu_tlb_base(void) · line 624

Quoted 10 lines
arch/arm/mach-imx/imx9/scmi/soc.c +4 -1
+/* Uboot early MMU only map first 64MB DDR before DM init.
+ * Set default early MMU table at top 2MB of first 64MB DDR
+ */
 __weak unsigned long board_early_mmu_tlb_base(void)
 {
-	return CFG_SYS_SDRAM_BASE;
+	return CFG_SYS_SDRAM_BASE + SZ_64M - SZ_2M;
 }
 
 /*

Hello Ye,
thanks for the patch.