diff options
| author | Tom Rini <[email protected]> | 2025-11-03 11:52:09 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-03 13:18:22 -0600 |
| commit | 28b81c07beec2b6bfc08b36bd4ba87699a9a4280 (patch) | |
| tree | 71c6da17478492d874dbb7ab476a040315fdf67a | |
| parent | 9ccda31f54881d3321263a81599454a1d6efb65e (diff) | |
| parent | 1dde581e1affbbfad285a75b892cbebaa3f0bf19 (diff) | |
Merge patch series "Remove usage of CMD_BOOTx from SPL code"
Anshul Dalal <[email protected]> says:
Hi all,
We currently make use of CMD_BOOTI and CMD_BOOTZ in the SPL boot flow in
falcon mode, this isn't correct since all CMD_* configs are only meant
for U-Boot proper and not the SPL.
Therefore this patch set adds new LIB_BOOT[IMZ] configs that allow for
more granular selection of their respective compilation targets.
Additionally, this also allows us to more easily disable support for
raw images from secure falcon mode (SPL_OS_BOOT_SECURE) by doing the
following:
config LIB_SPL_BOOTI
...
depends on SPL_OS_BOOT && !SPL_OS_BOOT_SECURE
...
Link: https://lore.kernel.org/r/[email protected]
| -rw-r--r-- | arch/arm/lib/Makefile | 10 | ||||
| -rw-r--r-- | arch/riscv/lib/Makefile | 4 | ||||
| -rw-r--r-- | boot/Kconfig | 18 | ||||
| -rw-r--r-- | cmd/Kconfig | 5 | ||||
| -rw-r--r-- | common/spl/Kconfig | 16 | ||||
| -rw-r--r-- | common/spl/spl.c | 5 | ||||
| -rw-r--r-- | configs/imx28_btt3_defconfig | 1 | ||||
| -rw-r--r-- | configs/imx28_xea_defconfig | 1 | ||||
| -rw-r--r-- | configs/imx6qdl_icore_mipi_defconfig | 1 | ||||
| -rw-r--r-- | configs/imx6qdl_icore_mmc_defconfig | 1 | ||||
| -rw-r--r-- | configs/imx6qdl_icore_rqs_defconfig | 1 |
11 files changed, 53 insertions, 10 deletions
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index ade42d0ca43..05263eadad0 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -7,6 +7,10 @@ lib-$(CONFIG_USE_PRIVATE_LIBGCC) += ashldi3.o ashrdi3.o lshrdi3.o \ lib1funcs.o uldivmod.o div0.o \ div64.o muldi3.o +obj-$(CONFIG_$(PHASE_)LIB_BOOTI) += image.o +obj-$(CONFIG_$(PHASE_)LIB_BOOTZ) += zimage.o +obj-$(CONFIG_$(PHASE_)LIB_BOOTM) += bootm.o + ifdef CONFIG_CPU_V7M obj-y += vectors_m.o crt0.o else ifdef CONFIG_ARM64 @@ -30,15 +34,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 db8d235c699..f1f50918eff 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 <[email protected]> -obj-$(CONFIG_CMD_BOOTM) += bootm.o -obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o +obj-$(CONFIG_$(PHASE_)LIB_BOOTM) += bootm.o +obj-$(CONFIG_$(PHASE_)LIB_BOOTI) += 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 921f096da56..d4655f70448 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -33,6 +33,24 @@ config TIMESTAMP loaded that does not, the message 'Wrong FIT format: no timestamp' is shown. +config LIB_BOOTI + bool + +config LIB_BOOTM + bool + +config LIB_BOOTZ + bool + +config SPL_LIB_BOOTI + bool + +config SPL_LIB_BOOTM + bool + +config SPL_LIB_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 d9d93c95588..5b9c13d85e7 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -284,6 +284,7 @@ config CMD_BOOTD config CMD_BOOTM bool "bootm" default y + select LIB_BOOTM help Boot an application image from the memory. @@ -360,6 +361,8 @@ config BOOTM_ELF config CMD_BOOTZ bool "bootz" + select LIB_BOOTZ + select LIB_BOOTM help Boot the Linux zImage @@ -367,6 +370,8 @@ config CMD_BOOTI bool "booti" depends on ARM64 || RISCV || SANDBOX default y + select LIB_BOOTI + select LIB_BOOTM help Boot an AArch64 Linux Kernel image from memory. diff --git a/common/spl/Kconfig b/common/spl/Kconfig index 24d6ce5d739..6027f24b1fe 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -1216,6 +1216,22 @@ config SPL_OS_BOOT_SECURE to use falcon mode by disabling certain inherently non-securable options in the SPL boot flow. +config SPL_BOOTZ + bool "Allow booting a zImage style Linux kernel from SPL" + depends on SPL_OS_BOOT && !SPL_OS_BOOT_SECURE + default y if ARM && !ARM64 + select SPL_LIB_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 && !SPL_OS_BOOT_SECURE + default y if ARM64 || RISCV + select SPL_LIB_BOOTI + help + Boot an uncompressed linux kernel image from memory in falcon boot. + config SPL_OS_BOOT_ARGS bool "Allow SPL to load args for kernel in falcon mode" depends on (SPL_OS_BOOT || SPL_LOAD_FIT_OPENSBI_OS_BOOT) && !SPL_OS_BOOT_SECURE diff --git a/common/spl/spl.c b/common/spl/spl.c index 64313cb8dfe..4dae3d0940d 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -340,7 +340,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 (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_BOOTI)) { ulong start, size; if (!booti_setup((ulong)header, &start, &size, 0)) { @@ -354,7 +354,8 @@ 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 (IS_ENABLED(CONFIG_SPL_OS_BOOT) && + IS_ENABLED(CONFIG_SPL_BOOTZ)) { ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { diff --git a/configs/imx28_btt3_defconfig b/configs/imx28_btt3_defconfig index 07c805faa2f..72dd639ffb8 100644 --- a/configs/imx28_btt3_defconfig +++ b/configs/imx28_btt3_defconfig @@ -138,3 +138,4 @@ CONFIG_DM_SPI=y CONFIG_MXS_SPI=y CONFIG_SPL_CRC8=y # CONFIG_SPL_OF_LIBFDT is not set +# CONFIG_SPL_BOOTZ is not set diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index 8715893bbcc..0bb2e447250 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -132,3 +132,4 @@ CONFIG_DM_SPI=y CONFIG_MXS_SPI=y CONFIG_SPL_CRC8=y # CONFIG_SPL_OF_LIBFDT is not set +# CONFIG_SPL_BOOTZ is not set diff --git a/configs/imx6qdl_icore_mipi_defconfig b/configs/imx6qdl_icore_mipi_defconfig index c322fd3eff1..cc05ecf587f 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 is not set diff --git a/configs/imx6qdl_icore_mmc_defconfig b/configs/imx6qdl_icore_mmc_defconfig index 0b82fbecbee..169903266cd 100644 --- a/configs/imx6qdl_icore_mmc_defconfig +++ b/configs/imx6qdl_icore_mmc_defconfig @@ -102,3 +102,4 @@ CONFIG_SPLASH_SCREEN=y CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_BMP_16BPP=y CONFIG_IMX_WATCHDOG=y +# CONFIG_SPL_BOOTZ is not set diff --git a/configs/imx6qdl_icore_rqs_defconfig b/configs/imx6qdl_icore_rqs_defconfig index 8520f90c867..34d834ec8e1 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 is not set |
