diff options
| author | Marek Vasut <[email protected]> | 2020-08-05 15:34:07 +0200 |
|---|---|---|
| committer | Stefano Babic <[email protected]> | 2020-08-17 17:55:31 +0200 |
| commit | 4b44bea701a67e3b83cb82f44fa40485b111d394 (patch) | |
| tree | ecff81bb0a6ea41d6cf52baeb2fbd4b615eaddef | |
| parent | 3c0fbbfd9572cd8c9fa562c4ebfe69d3d962f2f5 (diff) | |
ARM: imx: Add support for reading out the primary/secondary bmode to MX7
Implement the 'getprisec' subcommand of 'bmode' command for i.MX7 by
reading out the SRC GPR10 bit 30. This bit is either set by the BootROM
if it switched to the secondary copy due to primary copy being corrupted
OR it can be overridden by the user.
Signed-off-by: Marek Vasut <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP i.MX U-Boot Team <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Stefano Babic <[email protected]>
Reviewed-by: Stefano Babic <[email protected]>
| -rw-r--r-- | arch/arm/mach-imx/mx7/soc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index b70ef80131e..d0385b36e43 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -418,6 +418,13 @@ const struct boot_mode soc_boot_modes[] = { {"secondary", MAKE_CFGVAL_SECONDARY_BOOT}, {NULL, 0}, }; + +int boot_mode_getprisec(void) +{ + struct src *psrc = (struct src *)SRC_BASE_ADDR; + + return !!(readl(&psrc->gpr10) & IMX7_SRC_GPR10_PERSIST_SECONDARY_BOOT); +} #endif void reset_misc(void) |
