Skip to contentSkip to conversation

am335x* defconfig: Increase u-boot partition in mtdparts

RFC PATCH In review Judith Mendez 2 participants 3 messages Jan 7, 2025 – Jan 8, 2025

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 am335x* defconfig: Increase u-boot partition in mtdparts

From: Hong Guan <[email protected]>

Fix u-boot NAND partition in MTDPARTS_DEFAULT since the size of u-boot image has grown beyond 1MB and no longer fits in 1MB NAND partition, thus we are failing to flash and boot via GPMC NAND.

Increase the size of NAND.u-boot to 2MB since the size of u-boot.img is currently 1.4M.

[Judith: extend fix to HS defconfigs and add commit msg]

---
This patch is marked RFC to understand if solution is acceptable since changing partition sizes will not be backwards compatible solution.

One other solution was too try to reduce the size of u-boot proper, but removing features (boot modes.. etc) did not seem to get the size of u-boot proper to 1MB with a usable u-boot proper.

---
 configs/am335x_evm_defconfig         | 2 +-
 configs/am335x_hs_evm_defconfig      | 2 +-
 configs/am335x_hs_evm_uart_defconfig | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
configs/am335x_evm_defconfig +1 -1
index 6d1da0cfc7c..787a919855e 100644
@@ -49,7 +49,7 @@ CONFIG_CMD_NAND=y
 CONFIG_BOOTP_DNS2=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),2m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="am335x-evm am335x-bone am335x-sancloud-bbe am335x-sancloud-bbe-lite am335x-sancloud-bbe-extended-wifi am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
configs/am335x_hs_evm_defconfig +1 -1
index 396e7432c40..ea2e12f737f 100644
@@ -36,7 +36,7 @@ CONFIG_CMD_NAND=y
 CONFIG_BOOTP_DNS2=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),2m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
configs/am335x_hs_evm_uart_defconfig +1 -1
index 4be0b2f3933..58e12ca4bd8 100644
@@ -38,7 +38,7 @@ CONFIG_CMD_NAND=y
 CONFIG_BOOTP_DNS2=y
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
-CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),2m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2 am335x-pocketbeagle"
Signature · 1 line
2.47.1
#1 lore raw
Quoted 13 lines · Judith Mendez

From: Hong Guan <[email protected]>

Fix u-boot NAND partition in MTDPARTS_DEFAULT since the size of u-boot image has grown beyond 1MB and no longer fits in 1MB NAND partition, thus we are failing to flash and boot via GPMC NAND.

Increase the size of NAND.u-boot to 2MB since the size of u-boot.img is currently 1.4M.

[Judith: extend fix to HS defconfigs and add commit msg]
Quoted 8 lines

---
This patch is marked RFC to understand if solution is acceptable since changing partition sizes will not be backwards compatible solution.

One other solution was too try to reduce the size of u-boot proper, but removing features (boot modes.. etc) did not seem to get the size of u-boot proper to 1MB with a usable u-boot proper.

So the big problem here is that we have more space being taken up by device trees than U-Boot itself. A quick mkimage -l and adding things up shows that we have 851936 bytes of device trees. You should look at switching to MULTI_DTB_FIT and enabling some compression, along with possibly LTO of U-Boot itself.

Signature · 1 line
Tom
#2 lore raw

Hi Tom,

Quoted 24 lines · Tom Rini
Quoted 13 lines · Judith Mendez

From: Hong Guan <[email protected]>

Fix u-boot NAND partition in MTDPARTS_DEFAULT since the size of u-boot image has grown beyond 1MB and no longer fits in 1MB NAND partition, thus we are failing to flash and boot via GPMC NAND.

Increase the size of NAND.u-boot to 2MB since the size of u-boot.img is currently 1.4M.

[Judith: extend fix to HS defconfigs and add commit msg]
Quoted 8 lines

---
This patch is marked RFC to understand if solution is acceptable since changing partition sizes will not be backwards compatible solution.

One other solution was too try to reduce the size of u-boot proper, but removing features (boot modes.. etc) did not seem to get the size of u-boot proper to 1MB with a usable u-boot proper.

Quoted 6 lines

So the big problem here is that we have more space being taken up by device trees than U-Boot itself. A quick mkimage -l and adding things up shows that we have 851936 bytes of device trees. You should look at switching to MULTI_DTB_FIT and enabling some compression, along with possibly LTO of U-Boot itself.

Thanks so much for your feedback, I will look some more into this.

~ Judith