arch/x86/lib: implement cmdline configuration property

Simon Glass sjg at chromium.org
Thu Apr 2 01:34:33 CEST 2026


Hi Guillaume,

On 2026-04-01T20:52:14, Guillaume Ranquet <ranquet.guillaume at gmail.com> wrote:
> arch/x86/lib: implement cmdline configuration property
> arch/x86/lib: implement cmdline configuration property
>
> Implement the cmdline configuration property as described in the spec
> [1]
>
> [1]: https://fitspec.osfw.foundation/#id10
>
> Signed-off-by: Guillaume Ranquet <granquet at missingno.tech>

> diff --git a/boot/image-fit.c b/boot/image-fit.c
> @@ -1096,6 +1096,32 @@ int fit_image_get_data(const void *fit, int noffset, const void **data,
> +int fit_image_get_cmdline(const void *fit, int noffset, const char **cmdline)
> +{
> +     int len;
> +
> +     *cmdline = (const char *)fdt_getprop(fit, noffset, FIT_CMDLINE, &len);
> +     if (!cmdline) {

This should be 'if (!*cmdline)', right?

> diff --git a/include/image.h b/include/image.h
> @@ -1108,6 +1109,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
> +#define FIT_CMDLINE                  "cmdline"

Please can you rename this to FIT_CMDLINE_PROP to match the naming
convention used by all the other property macros in this list.

> diff --git a/include/image.h b/include/image.h
> @@ -365,6 +365,7 @@ struct bootm_headers {
>       const char      *fit_uname_cfg; /* configuration node unit name */
> +     int             fit_noffset_cfg;        /* os subimage node offset */

The comment is misleading - this is a configuration node offset, not
an os subimage node offset.

> diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
> @@ -279,7 +279,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,
> +              ulong initrd_addr, ulong initrd_size, char *cmdline_force)

Since the cmdline data comes from the FIT and should not be modified,
please can you use 'const char *cmdline_force'

Regards,
Simon


More information about the U-Boot mailing list