mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 14:25:56 +00:00
ARM: imx: Add support for reading out the primary/secondary bmode
Add new 'getprisec' subcommand to 'bmode' command, which sets the return value of the 'bmode' command to either 0 if the system booted from primary copy or to 1 if the system booted from secondary copy. This can be used e.g. in 'test' command to determine which copy of the system is running. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Stefano Babic <sbabic@denx.de>
This commit is contained in:
parent
5ec83561c4
commit
3c0fbbfd95
1 changed files with 12 additions and 0 deletions
|
@ -51,9 +51,19 @@ static int create_usage(char *dest)
|
||||||
if (dest)
|
if (dest)
|
||||||
memcpy(dest - 1, " [noreset]", 11); /* include trailing 0 */
|
memcpy(dest - 1, " [noreset]", 11); /* include trailing 0 */
|
||||||
size += 10;
|
size += 10;
|
||||||
|
|
||||||
|
if (dest)
|
||||||
|
memcpy(dest - 1, "\nbmode - getprisec", 19);
|
||||||
|
size += 18;
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__weak int boot_mode_getprisec(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int do_boot_mode(struct cmd_tbl *cmdtp, int flag, int argc,
|
static int do_boot_mode(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
|
@ -62,6 +72,8 @@ static int do_boot_mode(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
if (!strcmp(argv[1], "getprisec"))
|
||||||
|
return boot_mode_getprisec();
|
||||||
p = search_modes(argv[1]);
|
p = search_modes(argv[1]);
|
||||||
if (!p)
|
if (!p)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue