mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 Ahmad Fatoum <a.fatoum@pengutronix.de>,
	 "open list:BAREBOX" <barebox@lists.infradead.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	"Hervé Codina" <herve.codina@bootlin.com>,
	"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>
Subject: [PATCH v2 1/3] bootm: add fitimage command line to bootargs
Date: Thu, 24 Sep 2026 19:59:31 +0200	[thread overview]
Message-ID: <20260924-add-cmdline-fitimage-v2-1-4a665e165002@bootlin.com> (raw)
In-Reply-To: <20260924-add-cmdline-fitimage-v2-0-4a665e165002@bootlin.com>

Since FIT image specification v0.9, it is now possible to pass command
line arguments for the next boot stage in FIT images.

Add parsing of the cmdline optional property when reading the fitimage.
Create a `linux.bootargs.dyn.bootentries.fit` global variable that will
be appended to the command line when CONFIG_FLEXIBLE_BOOTARGS is
enabled.

Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
---
 common/bootm-fit.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/bootm-fit.c b/common/bootm-fit.c
index f7742b8717..c7142f490f 100644
--- a/common/bootm-fit.c
+++ b/common/bootm-fit.c
@@ -3,6 +3,7 @@
 #include <bootm.h>
 #include <image-fit.h>
 #include <bootm-fit.h>
+#include <globalvar.h>
 #include <memory.h>
 #include <string.h>
 #include <zero_page.h>
@@ -97,6 +98,21 @@ static bool bootm_fit_config_valid(struct fit_handle *fit,
 	return !!fit_has_image(fit, config, "kernel");
 }
 
+static void bootm_fit_config_cmdline(struct device_node *config)
+{
+	const char *cmdline;
+
+	if (!IS_ENABLED(CONFIG_FLEXIBLE_BOOTARGS))
+		return;
+
+	if (of_property_read_string(config, "cmdline", &cmdline))
+		return;
+
+	globalvar_add_simple("linux.bootargs.dyn.bootentries.fit", cmdline);
+
+	pr_info("Using command line from FIT configuration: %s\n", cmdline);
+}
+
 static enum filetype bootm_fit_update_os_header(struct image_data *data)
 {
 	size_t size;
@@ -146,6 +162,8 @@ int bootm_open_fit(struct image_data *data, bool override)
 		goto err;
 	}
 
+	bootm_fit_config_cmdline(fit_config);
+
 	loadable_from_fit_os(data, fit, fit_config);
 	if (override)
 		data->is_override.os = true;

-- 
2.55.0




  reply	other threads:[~2026-09-24 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 17:59 [PATCH v2 0/3] FIT: parse and use the cmdline property of FIT images Thomas Bonnefille
2026-09-24 17:59 ` Thomas Bonnefille [this message]
2026-09-24 17:59 ` [PATCH v2 2/3] test: py: add test for fit cmdline parameter Thomas Bonnefille
2026-09-24 17:59 ` [PATCH v2 3/3] FIT: add cmdline to whitelist of non-hashed properties Thomas Bonnefille

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260924-add-cmdline-fitimage-v2-1-4a665e165002@bootlin.com \
    --to=thomas.bonnefille@bootlin.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=herve.codina@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=s.hauer@pengutronix.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox