mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bootm: add fitimage command line to bootargs
@ 2026-08-27 12:16 Thomas Bonnefille
  2026-08-27 14:16 ` Ahmad Fatoum
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Bonnefille @ 2026-08-27 12:16 UTC (permalink / raw)
  To: Sascha Hauer, open list:BAREBOX
  Cc: Thomas Petazzoni, Miquèl Raynal, Hervé Codina,
	Thomas Bonnefille

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.
This create a `linux.bootargs.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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/common/bootm-fit.c b/common/bootm-fit.c
index f7742b8717..313d12ca74 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,18 @@ 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 (of_property_read_string(config, "cmdline", &cmdline))
+		return;
+
+	globalvar_add_simple("linux.bootargs.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 +159,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;

---
base-commit: df1055a2e0ddd3f96939327f2f0eb9db13a2bdc6
change-id: 20260827-add-cmdline-fitimage-42f6b2e930c1

Best regards,
--  
Thomas Bonnefille <thomas.bonnefille@bootlin.com>




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

end of thread, other threads:[~2026-08-27 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 12:16 [PATCH] bootm: add fitimage command line to bootargs Thomas Bonnefille
2026-08-27 14:16 ` Ahmad Fatoum
2026-08-27 15:08   ` Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox