{"id":2219595,"url":"http://patchwork.ozlabs.org/api/patches/2219595/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260403-cmdline-v2-1-83e22c82f02f@missingno.tech/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260403-cmdline-v2-1-83e22c82f02f@missingno.tech>","list_archive_url":null,"date":"2026-04-03T14:28:23","name":"[v2] arch/x86/lib: implement cmdline configuration property","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a8161a073d7892cdbc6feaf168ff926a5221ffb8","submitter":{"id":91669,"url":"http://patchwork.ozlabs.org/api/people/91669/?format=json","name":"Guillaume Ranquet","email":"ranquet.guillaume@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260403-cmdline-v2-1-83e22c82f02f@missingno.tech/mbox/","series":[{"id":498636,"url":"http://patchwork.ozlabs.org/api/series/498636/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=498636","date":"2026-04-03T14:28:23","name":"[v2] arch/x86/lib: implement cmdline configuration property","version":2,"mbox":"http://patchwork.ozlabs.org/series/498636/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2219595/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2219595/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=JZR6eurf;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"JZR6eurf\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=ranquet.guillaume@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnLgk252tz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 01:28:50 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 9E95C83642;\n\tFri,  3 Apr 2026 16:28:44 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 2C8D383642; Fri,  3 Apr 2026 16:28:43 +0200 (CEST)","from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n [IPv6:2a00:1450:4864:20::436])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id BC851800AE\n for <u-boot@lists.denx.de>; Fri,  3 Apr 2026 16:28:40 +0200 (CEST)","by mail-wr1-x436.google.com with SMTP id\n ffacd0b85a97d-43d23305225so1422439f8f.2\n for <u-boot@lists.denx.de>; Fri, 03 Apr 2026 07:28:40 -0700 (PDT)","from [192.168.0.79]\n (laubervilliers-659-1-61-87.w80-13.abo.wanadoo.fr. [80.13.212.87])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43d1e2a6f1esm16960266f8f.2.2026.04.03.07.28.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 03 Apr 2026 07:28:38 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775226520; x=1775831320; darn=lists.denx.de;\n h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n :date:from:from:to:cc:subject:date:message-id:reply-to;\n bh=LJLHq7UfGWVfNp2yiXg+NEq0ZJqVdoCSXBUylA3Pz34=;\n b=JZR6eurfJQC+5IF3qnr+m7pWR9XcH4OkecQ/VNmfGpwFpAzMSA9qHiryaTSB2PsgPR\n MAqCaPC2g9UAvXn+IkFCUoCuq1NVY9VXkVSVmVLd7Ow1pdVkyiLT4s+pjobYlesqZgV0\n EmpTl1bLSKVmkw4MBPp8OtgAUc5RYeCCW+yxM/ERymv8yRpaL1cYjYoltasmtV/34myT\n Hgc7ZQqXYm4eB2KIR2Sbml14JoMsjNqxAheZTQaxESRP1SpKjwxcFI5p1/1nGF2FGO0l\n n1U5PnvTWpUgIyNo5Q0y4Cxfg+IVKX7MNC956j8EH0zAT2ny6S2LbZPeHZ8+v1xCLBIX\n mkrQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775226520; x=1775831320;\n h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n :date:from: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2fzYJOfZH3dbma6EotQtwfyGRZUXUUuIb9GS91+nXeS+5Ai4Wo\n cT3/kAdqlvy4g==","X-Received":"by 2002:a05:6000:1869:b0:43c:f95c:3e70 with SMTP id\n ffacd0b85a97d-43d292c76e3mr5356376f8f.25.1775226519627;\n Fri, 03 Apr 2026 07:28:39 -0700 (PDT)","From":"Guillaume Ranquet <ranquet.guillaume@gmail.com>","X-Google-Original-From":"Guillaume Ranquet <granquet@missingno.tech>","Date":"Fri, 03 Apr 2026 16:28:23 +0200","Subject":"[PATCH v2] arch/x86/lib: implement cmdline configuration property","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260403-cmdline-v2-1-83e22c82f02f@missingno.tech>","X-B4-Tracking":"v=1; b=H4sIAAAAAAAC/2XMQQ6DIBCF4auYWZcGCCh21Xs0LiiOOkkFA4a0M\n dy91G2X38vLf0DCSJjg1hwQMVOi4CvkpQG3WD8jo7EaJJctV1wwt44v8sjss9fKKjRGGqjvLeJ\n E77P0GKoXSnuInzOcxW/9b2TBKnSru24ysm/5faWUyM8+XHd0CwyllC/jjK8kowAAAA==","X-Change-ID":"20260401-cmdline-ab954a4e8828","To":"u-boot@lists.denx.de","Cc":"Simon Glass <sjg@chromium.org>, Bin Meng <bmeng.cn@gmail.com>,\n Tom Rini <trini@konsulko.com>,\n Jeremy Compostella <jeremy.compostella@intel.com>,\n Peng Fan <peng.fan@nxp.com>, Yao Zi <me@ziyao.cc>,\n Patrice Chotard <patrice.chotard@foss.st.com>,\n Quentin Schulz <quentin.schulz@cherry.de>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n James Hilliard <james.hilliard1@gmail.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Frank Wunderlich <frank-w@public-files.de>,\n Mayuresh Chitale <mchitale@ventanamicro.com>,\n Neil Armstrong <neil.armstrong@linaro.org>,\n Shiji Yang <yangshiji66@outlook.com>, Jonas Karlman <jonas@kwiboo.se>,\n Wolfgang Wallner <wolfgang.wallner@at.abb.com>,\n Guillaume Ranquet <granquet@missingno.tech>","X-Mailer":"b4 0.14.2","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Implement the cmdline configuration property as described in the spec\n[1]\n\n[1]: https://fitspec.osfw.foundation/#id10\n\nSigned-off-by: Guillaume Ranquet <granquet@missingno.tech>\n---\nChanges in v2:\n- EDITME: describe what is new in this series revision.\n- EDITME: use bulletpoints and terse descriptions.\n- Link to v1: https://lore.kernel.org/r/20260401-cmdline-v1-1-c56577f82960@missingno.tech\n---\n arch/x86/include/asm/zimage.h |  2 +-\n arch/x86/lib/bootm.c          | 10 +++++++++-\n arch/x86/lib/zimage.c         |  6 +++---\n boot/image-fit.c              | 30 +++++++++++++++++++++++++++++-\n include/image.h               |  3 +++\n 5 files changed, 45 insertions(+), 6 deletions(-)\n\n\n---\nbase-commit: 98cf83d81617f489d7ff7bf78d33e693e2799254\nchange-id: 20260401-cmdline-ab954a4e8828\n\nBest regards,","diff":"diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h\nindex 8b5426051701c8266395afd9232eb1ff30d38304..ee0114a227a2b067a3a3126d7d80ab0cc89cea6e 100644\n--- a/arch/x86/include/asm/zimage.h\n+++ b/arch/x86/include/asm/zimage.h\n@@ -132,7 +132,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,\n  * Return: 0 (always)\n  */\n int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,\n-\t\t ulong initrd_addr, ulong initrd_size, ulong cmdline_force);\n+\t\t ulong initrd_addr, ulong initrd_size, const char *cmdline_force);\n \n /**\n  * zboot_start() - Prepare to boot a zimage\ndiff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c\nindex cde4fbf35574a267b856a668659ece7e0a36367f..e029cc1ff18bd53eb873c0e56fd9d3b0a331b4c2 100644\n--- a/arch/x86/lib/bootm.c\n+++ b/arch/x86/lib/bootm.c\n@@ -61,6 +61,7 @@ int arch_fixup_memory_node(void *blob)\n static int boot_prep_linux(struct bootm_headers *images)\n {\n \tchar *cmd_line_dest = NULL;\n+\tconst char *cmd_line_override = NULL;\n \tstruct legacy_img_hdr *hdr;\n \tint is_zimage = 0;\n \tvoid *data = NULL;\n@@ -99,6 +100,13 @@ static int boot_prep_linux(struct bootm_headers *images)\n \t\t\tputs(\"Can't get image data/size!\\n\");\n \t\t\tgoto error;\n \t\t}\n+\n+\t\tret = fit_image_get_cmdline(images->fit_hdr_os,\n+\t\t\t\t\t    images->fit_noffset_cfg,\n+\t\t\t\t\t    &cmd_line_override);\n+\t\tif (ret)\n+\t\t\tdebug(\"unable to retrieve cmdline for zimage\\n\");\n+\n \t\tis_zimage = 1;\n #endif\n \t}\n@@ -125,7 +133,7 @@ static int boot_prep_linux(struct bootm_headers *images)\n \tprintf(\"Setup at %#08lx\\n\", images->ep);\n \tret = setup_zimage((void *)images->ep, cmd_line_dest,\n \t\t\t0, images->rd_start,\n-\t\t\timages->rd_end - images->rd_start, 0);\n+\t\t\timages->rd_end - images->rd_start, cmd_line_override);\n \n \tif (ret) {\n \t\tprintf(\"## Setting up boot parameters failed ...\\n\");\ndiff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c\nindex a5f2231aa523356de93368338b5fd249b8abad6e..af7ee8dbcf3e8f402cb0c76767b8a587f205ad5d 100644\n--- a/arch/x86/lib/zimage.c\n+++ b/arch/x86/lib/zimage.c\n@@ -276,7 +276,7 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,\n }\n \n int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,\n-\t\t ulong initrd_addr, ulong initrd_size, ulong cmdline_force)\n+\t\t ulong initrd_addr, ulong initrd_size, const char *cmdline_force)\n {\n \tstruct setup_header *hdr = &setup_base->hdr;\n \tint bootproto = get_boot_protocol(hdr, false);\n@@ -333,7 +333,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,\n \n \t\t/* build command line at COMMAND_LINE_OFFSET */\n \t\tif (cmdline_force)\n-\t\t\tstrcpy(cmd_line, (char *)cmdline_force);\n+\t\t\tstrcpy(cmd_line, cmdline_force);\n \t\telse\n \t\t\tbuild_command_line(cmd_line, auto_boot);\n \t\tif (IS_ENABLED(CONFIG_CMD_BOOTM)) {\n@@ -404,7 +404,7 @@ int zboot_setup(void)\n \n \tret = setup_zimage(base_ptr, (char *)base_ptr + COMMAND_LINE_OFFSET,\n \t\t\t   0, state.initrd_addr, state.initrd_size,\n-\t\t\t   (ulong)state.cmdline);\n+\t\t\t   state.cmdline);\n \tif (ret)\n \t\treturn -EINVAL;\n \ndiff --git a/boot/image-fit.c b/boot/image-fit.c\nindex e7c7212195f4a291e26ed6d3440a1b42274dacab..1790af4a8e5a9c7d11f7dee5f67226071f8f057e 100644\n--- a/boot/image-fit.c\n+++ b/boot/image-fit.c\n@@ -1096,6 +1096,32 @@ int fit_image_get_data(const void *fit, int noffset, const void **data,\n \treturn ret;\n }\n \n+/**\n+ * fit_image_get_cmdline - get image configuration command line\n+ * @fit: pointer to the FIT format image header\n+ * @cfg_noffset: configuration node offset\n+ * @cmdline: double pointer to char, will hold pointer to the cmdline\n+ *\n+ * fit_image_get_cmdline() gets the cmdline from the configuration node.\n+ * If the property is found its data start address is returned to the caller.\n+ *\n+ * returns:\n+ *     0, on success\n+ *     -1, on failure\n+ */\n+int fit_image_get_cmdline(const void *fit, int noffset, const char **cmdline)\n+{\n+\tint len;\n+\n+\t*cmdline = (const char *)fdt_getprop(fit, noffset, FIT_CMDLINE_PROP, &len);\n+\tif (!*cmdline) {\n+\t\tfit_get_debug(fit, noffset, FIT_CMDLINE_PROP, len);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n /**\n  * fit_image_hash_get_algo - get hash algorithm name\n  * @fit: pointer to the FIT format image header\n@@ -2136,8 +2162,10 @@ int fit_image_load(struct bootm_headers *images, ulong addr,\n \t\tfit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL);\n \t\tprintf(\"   Using '%s' configuration\\n\", fit_base_uname_config);\n \t\t/* Remember this config */\n-\t\tif (image_type == IH_TYPE_KERNEL)\n+\t\tif (image_type == IH_TYPE_KERNEL) {\n \t\t\timages->fit_uname_cfg = fit_base_uname_config;\n+\t\t\timages->fit_noffset_cfg = cfg_noffset;\n+\t\t}\n \n \t\tif (FIT_IMAGE_ENABLE_VERIFY && images->verify) {\n \t\t\tputs(\"   Verifying Hash Integrity ... \");\ndiff --git a/include/image.h b/include/image.h\nindex 34efac6056dd29307df359dce21e4f94d5fcbf2d..9916e67168e3a4f5412fc26d318af32047c239e2 100644\n--- a/include/image.h\n+++ b/include/image.h\n@@ -365,6 +365,7 @@ struct bootm_headers {\n \t * format, even for SPL, this extra data size seems worth it.\n \t */\n \tconst char\t*fit_uname_cfg;\t/* configuration node unit name */\n+\tint\t\tfit_noffset_cfg;\t/* configuration node offset */\n \n \tvoid\t\t*fit_hdr_os;\t/* os FIT image header */\n \tconst char\t*fit_uname_os;\t/* os subimage node unit name */\n@@ -1108,6 +1109,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,\n #define FIT_TFA_BL31_PROP\t\"tfa-bl31\"\n #define FIT_TEE_PROP\t\t\"tee\"\n #define FIT_COMPAT_PROP\t\t\"compatible\"\n+#define FIT_CMDLINE_PROP\t\"cmdline\"\n \n #define FIT_MAX_HASH_LEN\tHASH_MAX_DIGEST_SIZE\n \n@@ -1259,6 +1261,7 @@ int fit_get_data_node(const void *fit, const char *image_uname,\n int fit_get_data_conf_prop(const void *fit, const char *prop_name,\n \t\t\t   const void **data, size_t *size);\n \n+int fit_image_get_cmdline(const void *fit, int noffset, const char **cmdline);\n int fit_image_hash_get_algo(const void *fit, int noffset, const char **algo);\n int fit_image_hash_get_value(const void *fit, int noffset, uint8_t **value,\n \t\t\t\tint *value_len);\n","prefixes":["v2"]}