{"id":2196214,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2196214/?format=json","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.0/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},"msgid":"<20260213051507.23466-3-hs@nabladev.com>","date":"2026-02-13T05:15:07","name":"[v2,2/2] imx8qx: misc: add command for getting boottype","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"33df90b57152fef869e4e4a727eadd263295c892","submitter":{"id":91409,"url":"http://patchwork.ozlabs.org/api/1.0/people/91409/?format=json","name":"Heiko Schocher","email":"hs@nabladev.com"},"delegate":{"id":151988,"url":"http://patchwork.ozlabs.org/api/1.0/users/151988/?format=json","username":"festevam","first_name":"Fabio","last_name":"Estevam","email":"festevam@gmail.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260213051507.23466-3-hs@nabladev.com/mbox/","series":[{"id":492058,"url":"http://patchwork.ozlabs.org/api/1.0/series/492058/?format=json","date":"2026-02-13T05:15:05","name":"Add for imx8x SoC get_boot_type command","version":2,"mbox":"http://patchwork.ozlabs.org/series/492058/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2196214/checks/","tags":{},"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=nabladev.com header.i=@nabladev.com header.a=rsa-sha256\n header.s=dkim header.b=D7ZLDCLI;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=nabladev.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=nabladev.com header.i=@nabladev.com\n header.b=\"D7ZLDCLI\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=nabladev.com","phobos.denx.de; spf=pass smtp.mailfrom=hs@nabladev.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fC0k21CJQz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 16:15:38 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 8206983DAE;\n\tFri, 13 Feb 2026 06:15:25 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id 4C41D83AA9; Fri, 13 Feb 2026 06:15:21 +0100 (CET)","from mx.nabladev.com (mx.nabladev.com\n [IPv6:2a00:f820:417:0:178:251:229:89])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 6608D83CEE\n for <u-boot@lists.denx.de>; Fri, 13 Feb 2026 06:15:18 +0100 (CET)","from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id CAB7C110824; Fri, 13 Feb 2026 06:15:17 +0100 (CET)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nabladev.com;\n s=dkim; t=1770959718; h=from:subject:date:message-id:to:cc:mime-version:\n content-transfer-encoding:in-reply-to:references;\n bh=+oiMQ1Wf0InG+pCsI23T1R6CBkDfegjQTreIUhFmS2I=;\n b=D7ZLDCLIT/sO1amT0oVAvzFpkdKT1WfQYF2WkgUMCKBpA8BdNpP6kblw30KIlBMncmiDXE\n IWfEzda8MXKkVM5XNhrbbG2lRspkpRD459ueS/UDha5C7pZZCyd8xiZe9UYTa79uKYIbn/\n AbGCeeoPkLVavSceStLOZ0xo/eB0J0q8UvDRujrP8/NXtb7y1lKqHn2F0PwqIOem35rHz9\n wCPBP3fKNFUl3NTnGYn0YYTC/AiRX5NX37O2AoJecR4vn5/TNrPGxnaWQfS/22KEszzMtO\n T14MeC+UYXY58HLzRrHUw12qqpSPZbeuQN6PHdr8TNUvjzsQ0kaFRpWuKgYC9A==","From":"Heiko Schocher <hs@nabladev.com>","To":"U-Boot Mailing List <u-boot@lists.denx.de>","Cc":"Peng Fan <peng.fan@oss.nxp.com>, Heiko Schocher <hs@nabladev.com>,\n Walter Schweizer <walter.schweizer@siemens.com>,\n Fabio Estevam <festevam@gmail.com>,\n \"NXP i.MX U-Boot Team\" <uboot-imx@nxp.com>,\n Stefano Babic <sbabic@nabladev.com>, Tom Rini <trini@konsulko.com>","Subject":"[PATCH v2 2/2] imx8qx: misc: add command for getting boottype","Date":"Fri, 13 Feb 2026 06:15:07 +0100","Message-Id":"<20260213051507.23466-3-hs@nabladev.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20260213051507.23466-1-hs@nabladev.com>","References":"<20260213051507.23466-1-hs@nabladev.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Last-TLS-Session-Version":"TLSv1.3","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":"add boottype command, which saves the boot_type\nprimary (0) or fallback (1) in environment\nvariable \"boottype\". If argument \"print\" is\npassed, it also prints the boottype on console.\n\nSigned-off-by: Heiko Schocher <hs@nabladev.com>\nSigned-off-by: Walter Schweizer <walter.schweizer@siemens.com>\n\n---\n\nChanges in v2:\n- add description for the values returned, as suggested from Peng\n\n arch/arm/mach-imx/imx8/misc.c | 33 +++++++++++++++++++++++++++++++++\n 1 file changed, 33 insertions(+)","diff":"diff --git a/arch/arm/mach-imx/imx8/misc.c b/arch/arm/mach-imx/imx8/misc.c\nindex c77104d0338..22d6959f74f 100644\n--- a/arch/arm/mach-imx/imx8/misc.c\n+++ b/arch/arm/mach-imx/imx8/misc.c\n@@ -1,4 +1,6 @@\n // SPDX-License-Identifier: GPL-2.0+\n+#include <command.h>\n+#include <env.h>\n #include <log.h>\n #include <firmware/imx/sci/sci.h>\n #include <asm/mach-imx/sys_proto.h>\n@@ -62,3 +64,34 @@ void build_info(void)\n \tprintf(\"Build: SCFW %08x, SECO-FW %08x, ATF %s\\n\",\n \t       sc_commit, seco_commit, (char *)&atf_commit);\n }\n+\n+int do_boottype(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])\n+{\n+\tsc_misc_bt_t boot_type;\n+\n+\tif (argc > 2)\n+\t\treturn CMD_RET_USAGE;\n+\n+\tif (sc_misc_get_boot_type(-1, &boot_type) != 0) {\n+\t\tputs(\"boottype cannot be retrieved\\n\");\n+\t\treturn CMD_RET_FAILURE;\n+\t}\n+\n+\tif (argc > 1)\n+\t\tprintf(\"Boottype: %d\\n\", boot_type);\n+\n+\tenv_set_ulong(\"boottype\", boot_type);\n+\n+\treturn CMD_RET_SUCCESS;\n+}\n+\n+U_BOOT_CMD(boottype, CONFIG_SYS_MAXARGS, 2, do_boottype,\n+\t   \"save current boot-container in env variable 'boottype'\",\n+\t   \"possible values for boottype:\\n\"\n+\t   \"0: SC_MISC_BT_PRIMARY\\n\"\n+\t   \"1: SC_MISC_BT_SECONDARY\\n\"\n+\t   \"2: SC_MISC_BT_RECOVERY\\n\"\n+\t   \"3: SC_MISC_BT_MANUFACTURE\\n\"\n+\t   \"4: SC_MISC_BT_SERIAL\\n\"\n+\t   \"[print] - print current boottype\"\n+);\n","prefixes":["v2","2/2"]}