All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing
@ 2025-03-13  3:28 Anshul Dalal
  2025-03-13 14:51 ` Tom Rini
  2025-03-14  4:02 ` Anshul Dalal
  0 siblings, 2 replies; 4+ messages in thread
From: Anshul Dalal @ 2025-03-13  3:28 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_BOOT[IZ] with newly added configs
SPL_HAS_BOOT[IZ].

An imply clause has been added for CMD_BOOTZ to avoid breaking configs
that rely on CMD_BOOTZ in falcon boot. There is no such need for
CMD_BOOTI since it's already enabled by default for the platforms that
support the image format.

More info:
https://lore.kernel.org/u-boot/20250310135544.GV2640854@bill-the-cat/

Signed-off-by: Anshul Dalal <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 |  6 ++----
 cmd/Kconfig           |  1 +
 common/spl/Kconfig    | 13 +++++++++++++
 common/spl/spl.c      |  5 +++--
 4 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 1c95dd6fed2..e409f7a7947 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -35,10 +35,8 @@ 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_SPL_HAS_BOOTI) += image.o
+obj-$(CONFIG_SPL_HAS_BOOTZ) += zimage.o
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 endif
 ifdef CONFIG_ARM64
diff --git a/cmd/Kconfig b/cmd/Kconfig
index a04fcaa0e08..9f2ba4d02f8 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -352,6 +352,7 @@ config BOOTM_ELF
 
 config CMD_BOOTZ
 	bool "bootz"
+	imply SPL_HAS_BOOTZ
 	help
 	  Boot the Linux zImage
 
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 21a5cefee7a..49eb513f923 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1153,6 +1153,19 @@ config SPL_OS_BOOT
 	  Enable booting directly to an OS from SPL.
 	  for more info read doc/README.falcon
 
+config SPL_HAS_BOOTZ
+	bool "Allow booting a zImage style Linux kernel from SPL"
+	depends on SPL_OS_BOOT
+	help
+	  Boot a linux zimage from memory in falcon boot.
+
+config SPL_HAS_BOOTI
+	bool "Allow booting an Image style Linux kernel from SPL"
+	depends on SPL_OS_BOOT
+	default y if ARM64 || RISCV
+	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..445c3ef24fe 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) && IS_ENABLED(CONFIG_SPL_HAS_BOOTI)) {
 		ulong start, size;
 
 		if (!booti_setup((ulong)header, &start, &size, 0)) {
@@ -349,7 +349,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 (CONFIG_IS_ENABLED(OS_BOOT) &&
+		   IS_ENABLED(CONFIG_SPL_HAS_BOOTZ)) {
 		ulong start, end;
 
 		if (!bootz_setup((ulong)header, &start, &end)) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing
  2025-03-13  3:28 [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing Anshul Dalal
@ 2025-03-13 14:51 ` Tom Rini
  2025-03-14  4:00   ` Anshul Dalal
  2025-03-14  4:02 ` Anshul Dalal
  1 sibling, 1 reply; 4+ messages in thread
From: Tom Rini @ 2025-03-13 14:51 UTC (permalink / raw)
  To: Anshul Dalal; +Cc: u-boot, vigneshr

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

On Thu, Mar 13, 2025 at 08:58:42AM +0530, Anshul Dalal wrote:

> Using CMD_* configs from spl doesn't make logical sense. Therefore this
> patch replaces the checks for CMD_BOOT[IZ] with newly added configs
> SPL_HAS_BOOT[IZ].
> 
> An imply clause has been added for CMD_BOOTZ to avoid breaking configs
> that rely on CMD_BOOTZ in falcon boot. There is no such need for
> CMD_BOOTI since it's already enabled by default for the platforms that
> support the image format.
> 
> More info:
> https://lore.kernel.org/u-boot/20250310135544.GV2640854@bill-the-cat/
[snip]
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index a04fcaa0e08..9f2ba4d02f8 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -352,6 +352,7 @@ config BOOTM_ELF
>  
>  config CMD_BOOTZ
>  	bool "bootz"
> +	imply SPL_HAS_BOOTZ
>  	help
>  	  Boot the Linux zImage
>  
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 21a5cefee7a..49eb513f923 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1153,6 +1153,19 @@ config SPL_OS_BOOT
>  	  Enable booting directly to an OS from SPL.
>  	  for more info read doc/README.falcon
>  
> +config SPL_HAS_BOOTZ
> +	bool "Allow booting a zImage style Linux kernel from SPL"
> +	depends on SPL_OS_BOOT
> +	help
> +	  Boot a linux zimage from memory in falcon boot.

I was going to say this to v3 but you posted v4 already. The solution to
existing platforms is "default y if ARM && !ARM64" here.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing
  2025-03-13 14:51 ` Tom Rini
@ 2025-03-14  4:00   ` Anshul Dalal
  0 siblings, 0 replies; 4+ messages in thread
From: Anshul Dalal @ 2025-03-14  4:00 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, vigneshr

On Thu Mar 13, 2025 at 8:21 PM IST, Tom Rini wrote:
> On Thu, Mar 13, 2025 at 08:58:42AM +0530, Anshul Dalal wrote:
>
> > Using CMD_* configs from spl doesn't make logical sense. Therefore this
> > patch replaces the checks for CMD_BOOT[IZ] with newly added configs
> > SPL_HAS_BOOT[IZ].
> > 
> > An imply clause has been added for CMD_BOOTZ to avoid breaking configs
> > that rely on CMD_BOOTZ in falcon boot. There is no such need for
> > CMD_BOOTI since it's already enabled by default for the platforms that
> > support the image format.
> > 
> > More info:
> > https://lore.kernel.org/u-boot/20250310135544.GV2640854@bill-the-cat/
> [snip]
> > diff --git a/cmd/Kconfig b/cmd/Kconfig
> > index a04fcaa0e08..9f2ba4d02f8 100644
> > --- a/cmd/Kconfig
> > +++ b/cmd/Kconfig
> > @@ -352,6 +352,7 @@ config BOOTM_ELF
> >  
> >  config CMD_BOOTZ
> >  	bool "bootz"
> > +	imply SPL_HAS_BOOTZ
> >  	help
> >  	  Boot the Linux zImage
> >  
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index 21a5cefee7a..49eb513f923 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -1153,6 +1153,19 @@ config SPL_OS_BOOT
> >  	  Enable booting directly to an OS from SPL.
> >  	  for more info read doc/README.falcon
> >  
> > +config SPL_HAS_BOOTZ
> > +	bool "Allow booting a zImage style Linux kernel from SPL"
> > +	depends on SPL_OS_BOOT
> > +	help
> > +	  Boot a linux zimage from memory in falcon boot.
>
> I was going to say this to v3 but you posted v4 already. The solution to
> existing platforms is "default y if ARM && !ARM64" here.

That makes sense, this keeps the defaults consistent between both
SPL_HAS_BOOTI and BOOTZ. I have addressed the changes in v5.

Thanks for the input :)

Anshul


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing
  2025-03-13  3:28 [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing Anshul Dalal
  2025-03-13 14:51 ` Tom Rini
@ 2025-03-14  4:02 ` Anshul Dalal
  1 sibling, 0 replies; 4+ messages in thread
From: Anshul Dalal @ 2025-03-14  4:02 UTC (permalink / raw)
  To: Anshul Dalal, u-boot; +Cc: vigneshr, trini

On Thu Mar 13, 2025 at 8:58 AM IST, Anshul Dalal wrote:
> Using CMD_* configs from spl doesn't make logical sense. Therefore this
> patch replaces the checks for CMD_BOOT[IZ] with newly added configs
> SPL_HAS_BOOT[IZ].
>
> An imply clause has been added for CMD_BOOTZ to avoid breaking configs
> that rely on CMD_BOOTZ in falcon boot. There is no such need for
> CMD_BOOTI since it's already enabled by default for the platforms that
> support the image format.
>
> More info:
> https://lore.kernel.org/u-boot/20250310135544.GV2640854@bill-the-cat/
>
> Signed-off-by: Anshul Dalal <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 |  6 ++----
>  cmd/Kconfig           |  1 +
>  common/spl/Kconfig    | 13 +++++++++++++
>  common/spl/spl.c      |  5 +++--
>  4 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index 1c95dd6fed2..e409f7a7947 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -35,10 +35,8 @@ 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_SPL_HAS_BOOTI) += image.o
> +obj-$(CONFIG_SPL_HAS_BOOTZ) += zimage.o
>  obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
>  endif
>  ifdef CONFIG_ARM64
> diff --git a/cmd/Kconfig b/cmd/Kconfig
> index a04fcaa0e08..9f2ba4d02f8 100644
> --- a/cmd/Kconfig
> +++ b/cmd/Kconfig
> @@ -352,6 +352,7 @@ config BOOTM_ELF
>  
>  config CMD_BOOTZ
>  	bool "bootz"
> +	imply SPL_HAS_BOOTZ
>  	help
>  	  Boot the Linux zImage
>  
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index 21a5cefee7a..49eb513f923 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -1153,6 +1153,19 @@ config SPL_OS_BOOT
>  	  Enable booting directly to an OS from SPL.
>  	  for more info read doc/README.falcon
>  
> +config SPL_HAS_BOOTZ
> +	bool "Allow booting a zImage style Linux kernel from SPL"
> +	depends on SPL_OS_BOOT
> +	help
> +	  Boot a linux zimage from memory in falcon boot.
> +
> +config SPL_HAS_BOOTI
> +	bool "Allow booting an Image style Linux kernel from SPL"
> +	depends on SPL_OS_BOOT
> +	default y if ARM64 || RISCV
> +	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..445c3ef24fe 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) && IS_ENABLED(CONFIG_SPL_HAS_BOOTI)) {
>  		ulong start, size;
>  
>  		if (!booti_setup((ulong)header, &start, &size, 0)) {
> @@ -349,7 +349,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 (CONFIG_IS_ENABLED(OS_BOOT) &&
> +		   IS_ENABLED(CONFIG_SPL_HAS_BOOTZ)) {
>  		ulong start, end;
>  
>  		if (!bootz_setup((ulong)header, &start, &end)) {

Superseded by v5:
https://lore.kernel.org/u-boot/20250314035505.4029331-1-anshuld@ti.com/

Anshul

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-14  4:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13  3:28 [PATCH v4] spl: remove usage of CMD_BOOT[IZ] from image parsing Anshul Dalal
2025-03-13 14:51 ` Tom Rini
2025-03-14  4:00   ` Anshul Dalal
2025-03-14  4:02 ` Anshul Dalal

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.