[PATCH 2/2] imx9: scmi: soc: Add support for detecting primary/secondary bmode on MX95
Fedor Ross
fedor.ross at ifm.com
Thu Apr 23 13:54:43 CEST 2026
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 <fedor.ross at ifm.com>
---
arch/arm/mach-imx/Kconfig | 2 +-
arch/arm/mach-imx/imx9/scmi/soc.c | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
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)
--
2.47.3
More information about the U-Boot
mailing list