Skip to contentSkip to conversation

am57xx: restore bootm_size for ARMv7 HighMem constraint

PATCH Superseded Moteen Shah 2 participants 2 messages May 20

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 am57xx: restore bootm_size for ARMv7 HighMem constraint

babae80169d removed bootm_size from ti_common.env to allow K3 boards to process images larger than 256MB, but preserved it in ti_armv7_keystone2.env for ARMv7 Keystone2 boards. AM57xx (also ARMv7) was not covered by that preservation.

Without bootm_size, env_get_bootm_size() falls back to gd->ram_size, causing initrd_high to be computed as the top of all RAM. On ARM32 boards with more RAM than the DMA zone (e.g. AM572x IDK with 2GiB), this places the ramdisk above 0xafe00000 (HighMem), which is not directly accessible by the kernel after MMU setup, causing a silent crash.

With bootm_size=0x10000000, initrd_high is constrained to 0x80000000 + 0x10000000 = 0x90000000, keeping the ramdisk in the DMA zone and allowing the kernel to access it correctly.

Fixes babae80169dd ("include: env: ti_common: remove bootm_size")

---
Changelog:
- Fixed the prefix of the commit message subject line
- Fixed the fixed tag to follow the guidelines

 board/ti/am57xx/am57xx.env | 1 +
 1 file changed, 1 insertion(+)
board/ti/am57xx/am57xx.env +1 -0
index a7cbbced099..74659279484 100644
@@ -1,6 +1,7 @@
 #include <env/ti/ti_common.env>
 #include <env/ti/mmc.env>
 #include <env/ti/dfu.env>
+bootm_size=0x10000000
 
 bootpart=0:2
 bootdir=/boot
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw

Hi Moteen

Quoted 31 lines · Moteen Shah

babae80169d removed bootm_size from ti_common.env to allow K3 boards to process images larger than 256MB, but preserved it in ti_armv7_keystone2.env for ARMv7 Keystone2 boards. AM57xx (also ARMv7) was not covered by that preservation.

Without bootm_size, env_get_bootm_size() falls back to gd->ram_size, causing initrd_high to be computed as the top of all RAM. On ARM32 boards with more RAM than the DMA zone (e.g. AM572x IDK with 2GiB), this places the ramdisk above 0xafe00000 (HighMem), which is not directly accessible by the kernel after MMU setup, causing a silent crash.

With bootm_size=0x10000000, initrd_high is constrained to 0x80000000 + 0x10000000 = 0x90000000, keeping the ramdisk in the DMA zone and allowing the kernel to access it correctly.

Fixes babae80169dd ("include: env: ti_common: remove bootm_size")

---
Changelog:
- Fixed the prefix of the commit message subject line
- Fixed the fixed tag to follow the guidelines

 board/ti/am57xx/am57xx.env | 1 +
 1 file changed, 1 insertion(+)
board/ti/am57xx/am57xx.env +0 -0
index a7cbbced099..74659279484 100644

board/ti/am57xx/am57xx.env line 5

Quoted 5 lines
board/ti/am57xx/am57xx.env +1 -0
@@ -1,6 +1,7 @@
 #include <env/ti/ti_common.env>
 #include <env/ti/mmc.env>
 #include <env/ti/dfu.env>
+bootm_size=0x10000000
 

Move the bootm_size below the empty line (nitpick)

board/ti/am57xx/am57xx.env line 7

Quoted 2 lines
board/ti/am57xx/am57xx.env +0 -0
 bootpart=0:2
 bootdir=/boot

With that,

Signature · 2 lines
Thanking You
Neha Malcom Francis