summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Ross <[email protected]>2026-04-27 15:32:51 +0200
committerFabio Estevam <[email protected]>2026-05-15 17:31:39 -0300
commit9dd6b95453b28426d081dfa21f600870fddd5c6f (patch)
tree95a9ce689d903de35b51597f7640dc48777edec7
parentc8ca3314f24293be5d595857efeba56a87be4f7c (diff)
imx9: scmi: soc: Add support for detecting primary/secondary bmode on MX95
Implement the 'getprisec' subcommand of 'bmode' command for i.MX95 by reading out the ROM log events. This event is set by the BootROM if it switched to the secondary copy due to primary copy being corrupted. Signed-off-by: Fedor Ross <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-imx/imx9/scmi/soc.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index e4014226582..259f4a4ce99 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -74,7 +74,7 @@ config CSF_SIZE
config CMD_BMODE
bool "Support the 'bmode' command"
default y
- depends on ARCH_IMX8M || ARCH_MX7 || ARCH_MX6 || ARCH_MX5
+ depends on IMX95 || ARCH_IMX8M || ARCH_MX7 || ARCH_MX6 || ARCH_MX5
help
This enables the 'bmode' (bootmode) command for forcing
a boot from specific media.
diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c
index 330b276b23a..47e8fc247df 100644
--- a/arch/arm/mach-imx/imx9/scmi/soc.c
+++ b/arch/arm/mach-imx/imx9/scmi/soc.c
@@ -756,6 +756,11 @@ u8 imx95_detect_secondary_image_boot(void)
return 0;
}
+
+int boot_mode_getprisec(void)
+{
+ return !!imx95_detect_secondary_image_boot();
+}
#endif
int arch_misc_init(void)