From: Peng Fan <peng.fan@oss.nxp.com>
To: Heiko Schocher <hs@nabladev.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Walter Schweizer <walter.schweizer@siemens.com>,
Fabio Estevam <festevam@gmail.com>,
"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
Stefano Babic <sbabic@nabladev.com>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v1 2/2] imx8qx: misc: add command for getting boottype
Date: Mon, 26 Jan 2026 09:50:07 +0800 [thread overview]
Message-ID: <aXbITzhaa+NVZV5H@shlinux89> (raw)
In-Reply-To: <20260124055044.8149-3-hs@nabladev.com>
Hi Heiko,
On Sat, Jan 24, 2026 at 06:50:44AM +0100, Heiko Schocher wrote:
>add boottype command, which saves the boot_type
>primary (0) or fallback (1) in environment
>variable "boottype". If argument "print" is
>passed, it also prints the boottype on console.
>
>Signed-off-by: Heiko Schocher <hs@nabladev.com>
>Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
>---
>
> arch/arm/mach-imx/imx8/misc.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
>diff --git a/arch/arm/mach-imx/imx8/misc.c b/arch/arm/mach-imx/imx8/misc.c
>index c77104d0338..f233432f608 100644
>--- a/arch/arm/mach-imx/imx8/misc.c
>+++ b/arch/arm/mach-imx/imx8/misc.c
>@@ -1,4 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0+
>+#include <command.h>
>+#include <env.h>
> #include <log.h>
> #include <firmware/imx/sci/sci.h>
> #include <asm/mach-imx/sys_proto.h>
>@@ -62,3 +64,28 @@ void build_info(void)
> printf("Build: SCFW %08x, SECO-FW %08x, ATF %s\n",
> sc_commit, seco_commit, (char *)&atf_commit);
> }
>+
>+int do_boottype(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
>+{
>+ sc_misc_bt_t boot_type;
>+
>+ if (argc > 2)
>+ return CMD_RET_USAGE;
>+
>+ if (sc_misc_get_boot_type(-1, &boot_type) != 0) {
>+ puts("boottype cannot be retrieved\n");
>+ return CMD_RET_FAILURE;
>+ }
>+
>+ if (argc > 1)
>+ printf("Boottype: %d\n", boot_type);
>+
>+ env_set_ulong("boottype", boot_type);
>+
>+ return CMD_RET_SUCCESS;
>+}
>+
>+U_BOOT_CMD(boottype, CONFIG_SYS_MAXARGS, 2, do_boottype,
>+ "save current boot-container in env variable 'boottype'",
>+ "[print] - print current boottype"
An description to describe the value, saying which value is for eMMC,
and which for SD. Or even better to decode the value in above function.
Thanks,
Peng
>+);
>--
>2.20.1
>
prev parent reply other threads:[~2026-01-26 1:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-24 5:50 [PATCH v1 0/2] Add for imx8x SoC get_boot_type command Heiko Schocher
2026-01-24 5:50 ` [PATCH v1 1/2] imx: scu_api: implement sc_misc_get_boot_type Heiko Schocher
2026-01-26 1:47 ` Peng Fan
2026-01-24 5:50 ` [PATCH v1 2/2] imx8qx: misc: add command for getting boottype Heiko Schocher
2026-01-26 1:50 ` Peng Fan [this message]
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=aXbITzhaa+NVZV5H@shlinux89 \
--to=peng.fan@oss.nxp.com \
--cc=festevam@gmail.com \
--cc=hs@nabladev.com \
--cc=sbabic@nabladev.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-imx@nxp.com \
--cc=walter.schweizer@siemens.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