* [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing
@ 2025-04-08 14:14 Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 2/4] configs: disable SPL_BOOTZ to preserve spl size Anshul Dalal
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Anshul Dalal @ 2025-04-08 14:14 UTC (permalink / raw)
To: u-boot; +Cc: Anshul Dalal, vigneshr, trini
Using CMD_* configs from spl doesn't make logical sense. Therefore this
patch replaces the checks for CMD_BOOTx with newly added library symbols
BOOTI, BOOTM and BOOTZ which are enabled by their respective CMD_* or
SPL_* counterparts.
SPL_BOOTZ is enabled by default for 32-bit ARM systems and SPL_BOOTI is
enabled by default for 64-bit ARM and RISCV.
The respective C files (image.c/zimage.c) are compiled based on library
symbols BOOTx instead which are in turn selected by both CMD_BOOTx and
SPL_BOOTx as required.
Signed-off-by: Anshul Dalal <anshuld@ti.com>
---
Tested:
* U-Boot CI: https://github.com/u-boot/u-boot/pull/757
Changes in v7:
* Change SPL configs from SPL_HAS_* to SPL_*
* Change library symbol names from LIB_BOOTx to just BOOTx
* Add BOOTM for compiling boot.c
v6:
https://lore.kernel.org/u-boot/20250403215522.1284502-1-anshuld@ti.com/
Changes in v6:
* Add LIB_BOOTx library symbols
* Update existing configs ensuring no change in size or build failure
v5:
https://lore.kernel.org/all/20250314035505.4029331-1-anshuld@ti.com/
Changes in v5:
* Remove imply clause for CMD_BOOTZ instead add default y for
SPL_HAS_BOOTZ
* Update commit message to reflect the changes
* Remove 'More info' link
v4:
https://lore.kernel.org/u-boot/20250313032842.1189977-1-anshuld@ti.com/
Changes in v4:
* Don't set SPL_HAS_BOOTI for sandbox by default
* Updated prompts for SPL_HAS_BOOT[IZ]
* Removed check for SPL_HAS_FRAMEWORK from Makefile
v3:
https://lore.kernel.org/u-boot/20250312124757.789013-1-anshuld@ti.com/
Changes in v3:
* Add imply clause for CMD_BOOTZ to enable SPL_HAS_BOOTZ
* Fix broken check for bootz_setup
v2:
https://lore.kernel.org/u-boot/20250312094241.629707-1-anshuld@ti.com/
Changes in v2:
* Add SPL_HAS_BOOT[IZ] configs
v1:
https://lore.kernel.org/u-boot/20250311093709.3372104-1-anshuld@ti.com/
---
arch/arm/lib/Makefile | 13 +++++++------
arch/riscv/lib/Makefile | 4 ++--
boot/Kconfig | 9 +++++++++
cmd/Kconfig | 3 +++
common/spl/Kconfig | 16 ++++++++++++++++
common/spl/spl.c | 4 ++--
6 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 1c95dd6fed2..162a63b86d9 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -7,6 +7,13 @@ lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \
lib1funcs.o uldivmod.o div0.o \
div64.o muldi3.o
+obj-$(CONFIG_BOOTI) += image.o
+obj-$(CONFIG_BOOTZ) += zimage.o
+
+ifndef CONFIG_XPL_BUILD
+obj-$(CONFIG_BOOTM) += bootm.o
+endif
+
ifdef CONFIG_CPU_V7M
obj-y += vectors_m.o crt0.o
else ifdef CONFIG_ARM64
@@ -30,15 +37,9 @@ endif
obj-$(CONFIG_CPU_V7M) += cmd_boot.o
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
-obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
obj-$(CONFIG_CMD_BOOTM) += bootm.o
-obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
else
obj-$(CONFIG_$(PHASE_)FRAMEWORK) += spl.o
-ifdef CONFIG_SPL_FRAMEWORK
-obj-$(CONFIG_CMD_BOOTI) += image.o
-obj-$(CONFIG_CMD_BOOTZ) += zimage.o
-endif
obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
endif
ifdef CONFIG_ARM64
diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile
index 268116f3757..da173cf6d46 100644
--- a/arch/riscv/lib/Makefile
+++ b/arch/riscv/lib/Makefile
@@ -6,8 +6,8 @@
# Copyright (C) 2017 Andes Technology Corporation
# Rick Chen, Andes Technology Corporation <rick@andestech.com>
-obj-$(CONFIG_CMD_BOOTM) += bootm.o
-obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
+obj-$(CONFIG_BOOTM) += bootm.o
+obj-$(CONFIG_BOOTI) += bootm.o image.o
obj-$(CONFIG_CMD_GO) += boot.o
obj-y += cache.o
obj-$(CONFIG_SIFIVE_CACHE) += sifive_cache.o
diff --git a/boot/Kconfig b/boot/Kconfig
index c09a98c3233..32a4b1703c9 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -22,6 +22,15 @@ config TIMESTAMP
loaded that does not, the message 'Wrong FIT format: no timestamp'
is shown.
+config BOOTI
+ bool
+
+config BOOTM
+ bool
+
+config BOOTZ
+ bool
+
config BUTTON_CMD
bool "Support for running a command if a button is held during boot"
depends on CMDLINE
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 642cc1116e8..489f498123a 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -276,6 +276,7 @@ config CMD_BOOTD
config CMD_BOOTM
bool "bootm"
default y
+ select BOOTM
help
Boot an application image from the memory.
@@ -352,6 +353,7 @@ config BOOTM_ELF
config CMD_BOOTZ
bool "bootz"
+ select BOOTZ
help
Boot the Linux zImage
@@ -359,6 +361,7 @@ config CMD_BOOTI
bool "booti"
depends on ARM64 || RISCV || SANDBOX
default y
+ select BOOTI
help
Boot an AArch64 Linux Kernel image from memory.
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 94e118f8465..aaaada0be30 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1153,6 +1153,22 @@ config SPL_OS_BOOT
Enable booting directly to an OS from SPL.
for more info read doc/README.falcon
+config SPL_BOOTZ
+ bool "Allow booting a zImage style Linux kernel from SPL"
+ depends on SPL_OS_BOOT
+ default y if ARM && !ARM64
+ select BOOTZ
+ help
+ Boot a linux zimage from memory in falcon boot.
+
+config SPL_BOOTI
+ bool "Allow booting an Image style Linux kernel from SPL"
+ depends on SPL_OS_BOOT
+ default y if ARM64 || RISCV
+ select BOOTI
+ help
+ Boot an uncompressed linux kernel image from memory in falcon boot.
+
config SPL_PAYLOAD_ARGS_ADDR
hex "Address in memory to load 'args' file for Falcon Mode to"
depends on SPL_OS_BOOT || SPL_LOAD_FIT_OPENSBI_OS_BOOT
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 76fd56dfe4b..a663d10ec20 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -335,7 +335,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
panic("** no mkimage signature but raw image not supported");
}
- if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTI)) {
+ if (CONFIG_IS_ENABLED(OS_BOOT) && CONFIG_IS_ENABLED(BOOTI)) {
ulong start, size;
if (!booti_setup((ulong)header, &start, &size, 0)) {
@@ -349,7 +349,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
spl_image->load_addr, spl_image->size);
return 0;
}
- } else if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTZ)) {
+ } else if (CONFIG_IS_ENABLED(OS_BOOT) && CONFIG_IS_ENABLED(BOOTZ)) {
ulong start, end;
if (!bootz_setup((ulong)header, &start, &end)) {
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v7 2/4] configs: disable SPL_BOOTZ to preserve spl size
2025-04-08 14:14 [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Anshul Dalal
@ 2025-04-08 14:14 ` Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 3/4] configs: migrate falcon configs to SPL_BOOTx Anshul Dalal
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Anshul Dalal @ 2025-04-08 14:14 UTC (permalink / raw)
To: u-boot; +Cc: Anshul Dalal, vigneshr, trini
In the existing behaviour, CMD_BOOTZ is not enabled by default which
means zimage.o is not compiled in the SPL in falcon mode unless
explicitly enabled. This changes now as SPL_BOOTZ is default y which
leads to larger SPL size with zimage.o being present.
This patch modifies the defconfigs that used falcon mode but don't
require zimage support.
Signed-off-by: Anshul Dalal <anshuld@ti.com>
---
configs/imx28_xea_defconfig | 1 +
configs/imx6qdl_icore_mipi_defconfig | 1 +
configs/imx6qdl_icore_mmc_defconfig | 1 +
configs/imx6qdl_icore_rqs_defconfig | 1 +
4 files changed, 4 insertions(+)
diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig
index 38282e6ea92..cbd5a788c64 100644
--- a/configs/imx28_xea_defconfig
+++ b/configs/imx28_xea_defconfig
@@ -128,3 +128,4 @@ CONFIG_DM_SPI=y
CONFIG_MXS_SPI=y
CONFIG_SPL_CRC8=y
# CONFIG_SPL_OF_LIBFDT is not set
+CONFIG_SPL_BOOTZ=n
diff --git a/configs/imx6qdl_icore_mipi_defconfig b/configs/imx6qdl_icore_mipi_defconfig
index cf4c2d9c6f1..6d556c5fab7 100644
--- a/configs/imx6qdl_icore_mipi_defconfig
+++ b/configs/imx6qdl_icore_mipi_defconfig
@@ -74,3 +74,4 @@ CONFIG_PINCTRL_IMX6=y
CONFIG_DM_SERIAL=y
CONFIG_MXC_UART=y
CONFIG_IMX_THERMAL=y
+CONFIG_SPL_BOOTZ=n
diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig
index fb0787d1beb..f5a1ad0dde7 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -101,3 +101,4 @@ CONFIG_SPLASH_SCREEN=y
CONFIG_SPLASH_SCREEN_ALIGN=y
CONFIG_BMP_16BPP=y
CONFIG_IMX_WATCHDOG=y
+CONFIG_SPL_BOOTZ=n
diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig
index 49feb1af830..e12757545e6 100644
--- a/configs/imx6qdl_icore_rqs_defconfig
+++ b/configs/imx6qdl_icore_rqs_defconfig
@@ -71,3 +71,4 @@ CONFIG_PINCTRL=y
CONFIG_PINCTRL_IMX6=y
CONFIG_DM_SERIAL=y
CONFIG_MXC_UART=y
+CONFIG_SPL_BOOTZ=n
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v7 3/4] configs: migrate falcon configs to SPL_BOOTx
2025-04-08 14:14 [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 2/4] configs: disable SPL_BOOTZ to preserve spl size Anshul Dalal
@ 2025-04-08 14:14 ` Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 4/4] configs: colibri_vf: set CMD_BOOTM Anshul Dalal
2025-04-17 20:58 ` [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Tom Rini
3 siblings, 0 replies; 6+ messages in thread
From: Anshul Dalal @ 2025-04-08 14:14 UTC (permalink / raw)
To: u-boot; +Cc: Anshul Dalal, vigneshr, trini
Replace usage of CMD_BOOTx in falcon mode configs with the newly added
SPL_BOOTx.
Signed-off-by: Anshul Dalal <anshuld@ti.com>
---
configs/display5_defconfig | 2 +-
configs/display5_factory_defconfig | 2 +-
configs/gwventana_emmc_defconfig | 2 +-
configs/gwventana_nand_defconfig | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/configs/display5_defconfig b/configs/display5_defconfig
index 765920bd5d1..487d49ccc72 100644
--- a/configs/display5_defconfig
+++ b/configs/display5_defconfig
@@ -56,7 +56,7 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="display5 > "
CONFIG_SYS_MAXARGS=32
-CONFIG_CMD_BOOTZ=y
+CONFIG_SPL_BOOTZ=y
# CONFIG_CMD_ELF is not set
CONFIG_CMD_SPL=y
CONFIG_CMD_ASKENV=y
diff --git a/configs/display5_factory_defconfig b/configs/display5_factory_defconfig
index 4007c8900ce..7349ffb8abe 100644
--- a/configs/display5_factory_defconfig
+++ b/configs/display5_factory_defconfig
@@ -51,7 +51,7 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="display5 factory > "
CONFIG_SYS_MAXARGS=32
-CONFIG_CMD_BOOTZ=y
+CONFIG_SPL_BOOTZ=y
# CONFIG_CMD_ELF is not set
CONFIG_CMD_SPL=y
CONFIG_CMD_ASKENV=y
diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 95d5b1172ff..0a2aaf6d931 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -59,7 +59,7 @@ CONFIG_SPL_POWER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Ventana > "
CONFIG_SYS_MAXARGS=32
-CONFIG_CMD_BOOTZ=y
+CONFIG_SPL_BOOTZ=y
CONFIG_CMD_SPL_WRITE_SIZE=0x20000
CONFIG_CMD_UNZIP=y
CONFIG_CMD_GPIO=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index 1d8af5ce103..9d93fa8093f 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -61,7 +61,7 @@ CONFIG_SPL_POWER=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="Ventana > "
CONFIG_SYS_MAXARGS=32
-CONFIG_CMD_BOOTZ=y
+CONFIG_SPL_BOOTZ=y
CONFIG_CMD_SPL_NAND_OFS=0x1100000
CONFIG_CMD_SPL_WRITE_SIZE=0x20000
CONFIG_CMD_UNZIP=y
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v7 4/4] configs: colibri_vf: set CMD_BOOTM
2025-04-08 14:14 [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 2/4] configs: disable SPL_BOOTZ to preserve spl size Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 3/4] configs: migrate falcon configs to SPL_BOOTx Anshul Dalal
@ 2025-04-08 14:14 ` Anshul Dalal
2025-04-17 20:58 ` [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Tom Rini
3 siblings, 0 replies; 6+ messages in thread
From: Anshul Dalal @ 2025-04-08 14:14 UTC (permalink / raw)
To: u-boot; +Cc: Anshul Dalal, vigneshr, trini
Currently, CMD_BOOTx selects both bootm.o and the respective image.o or
zimage.o for compilation. After the addition of LIB_BOOTx, the behaviour
changes so CMD_BOOTx would not select bootm.o. This leads to build
failure on calibri_vf since it unsets BOOTM while still using BOOTZ.
This was added in commit c5954431eb6c ("configs: colibri_vf: disable
obscure options") to save size but unsetting BOOTM specifically does not
seem to save any space. So the change can be safely reverted
Signed-off-by: Anshul Dalal <anshuld@ti.com>
---
configs/colibri_vf_defconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index 3a806243b19..823b4f07460 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -34,7 +34,6 @@ CONFIG_HUSH_PARSER=y
# CONFIG_SYS_LONGHELP is not set
CONFIG_SYS_PROMPT="Colibri VFxx # "
# CONFIG_CMD_BOOTD is not set
-# CONFIG_CMD_BOOTM is not set
CONFIG_CMD_BOOTZ=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_IMI is not set
--
2.49.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing
2025-04-08 14:14 [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Anshul Dalal
` (2 preceding siblings ...)
2025-04-08 14:14 ` [PATCH v7 4/4] configs: colibri_vf: set CMD_BOOTM Anshul Dalal
@ 2025-04-17 20:58 ` Tom Rini
2025-04-17 21:37 ` Simon Glass
3 siblings, 1 reply; 6+ messages in thread
From: Tom Rini @ 2025-04-17 20:58 UTC (permalink / raw)
To: Anshul Dalal; +Cc: u-boot, vigneshr, nm
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Tue, Apr 08, 2025 at 07:44:30PM +0530, Anshul Dalal wrote:
> Using CMD_* configs from spl doesn't make logical sense. Therefore this
> patch replaces the checks for CMD_BOOTx with newly added library symbols
> BOOTI, BOOTM and BOOTZ which are enabled by their respective CMD_* or
> SPL_* counterparts.
>
> SPL_BOOTZ is enabled by default for 32-bit ARM systems and SPL_BOOTI is
> enabled by default for 64-bit ARM and RISCV.
>
> The respective C files (image.c/zimage.c) are compiled based on library
> symbols BOOTx instead which are in turn selected by both CMD_BOOTx and
> SPL_BOOTx as required.
>
> Signed-off-by: Anshul Dalal <anshuld@ti.com>
So, for the series, we have a few problems, still. First, this is still
not size neutral as we now end up dropping bootz from a few 32bit
platforms (gwventana_nand, display5, gwventana_emmc, display5_factory)
and growing colibri_vf. Next and more importantly, as after Nishanth's
explanation, TF-A isn't going to support this case either, I believe
it's best to just drop this part of the support as well. Thanks for the
effort all the same.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing
2025-04-17 20:58 ` [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Tom Rini
@ 2025-04-17 21:37 ` Simon Glass
0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2025-04-17 21:37 UTC (permalink / raw)
To: Tom Rini; +Cc: Anshul Dalal, u-boot, vigneshr, nm
Hi Anshul,
On Thu, 17 Apr 2025 at 14:58, Tom Rini <trini@konsulko.com> wrote:
>
> On Tue, Apr 08, 2025 at 07:44:30PM +0530, Anshul Dalal wrote:
>
> > Using CMD_* configs from spl doesn't make logical sense. Therefore this
> > patch replaces the checks for CMD_BOOTx with newly added library symbols
> > BOOTI, BOOTM and BOOTZ which are enabled by their respective CMD_* or
> > SPL_* counterparts.
> >
> > SPL_BOOTZ is enabled by default for 32-bit ARM systems and SPL_BOOTI is
> > enabled by default for 64-bit ARM and RISCV.
> >
> > The respective C files (image.c/zimage.c) are compiled based on library
> > symbols BOOTx instead which are in turn selected by both CMD_BOOTx and
> > SPL_BOOTx as required.
> >
> > Signed-off-by: Anshul Dalal <anshuld@ti.com>
>
> So, for the series, we have a few problems, still. First, this is still
> not size neutral as we now end up dropping bootz from a few 32bit
> platforms (gwventana_nand, display5, gwventana_emmc, display5_factory)
> and growing colibri_vf. Next and more importantly, as after Nishanth's
> explanation, TF-A isn't going to support this case either, I believe
> it's best to just drop this part of the support as well. Thanks for the
> effort all the same.
With the size issues resolved this patch is a good step forward
towards being able to entirely disable CMDLINE in U-Boot and boot with
standard boot:
Reviewed-by: Simon Glass <sjg@chromium.org>
Regards,
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-04-17 21:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 14:14 [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 2/4] configs: disable SPL_BOOTZ to preserve spl size Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 3/4] configs: migrate falcon configs to SPL_BOOTx Anshul Dalal
2025-04-08 14:14 ` [PATCH v7 4/4] configs: colibri_vf: set CMD_BOOTM Anshul Dalal
2025-04-17 20:58 ` [PATCH v7 1/4] spl: remove usage of CMD_BOOTx from image parsing Tom Rini
2025-04-17 21:37 ` Simon Glass
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.