[RFC PATCH] am335x* defconfig: Increase u-boot partition in mtdparts

From: Hong Guan hguan@ti.com
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.
Signed-off-by: Hong Guan hguan@ti.com [Judith: extend fix to HS defconfigs and add commit msg] Signed-off-by: Judith Mendez jm@ti.com --- 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(-)
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index 6d1da0cfc7c..787a919855e 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -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" diff --git a/configs/am335x_hs_evm_defconfig b/configs/am335x_hs_evm_defconfig index 396e7432c40..ea2e12f737f 100644 --- a/configs/am335x_hs_evm_defconfig +++ b/configs/am335x_hs_evm_defconfig @@ -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" diff --git a/configs/am335x_hs_evm_uart_defconfig b/configs/am335x_hs_evm_uart_defconfig index 4be0b2f3933..58e12ca4bd8 100644 --- a/configs/am335x_hs_evm_uart_defconfig +++ b/configs/am335x_hs_evm_uart_defconfig @@ -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"

On Tue, Jan 07, 2025 at 04:50:55PM -0600, Judith Mendez wrote:
From: Hong Guan hguan@ti.com
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.
Signed-off-by: Hong Guan hguan@ti.com [Judith: extend fix to HS defconfigs and add commit msg] Signed-off-by: Judith Mendez jm@ti.com
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.

Hi Tom,
On 1/8/25 10:57 AM, Tom Rini wrote:
On Tue, Jan 07, 2025 at 04:50:55PM -0600, Judith Mendez wrote:
From: Hong Guan hguan@ti.com
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.
Signed-off-by: Hong Guan hguan@ti.com [Judith: extend fix to HS defconfigs and add commit msg] Signed-off-by: Judith Mendez jm@ti.com
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.
Thanks so much for your feedback, I will look some more into this.
~ Judith
participants (2)
-
Judith Mendez
-
Tom Rini