diff options
| author | Marek Vasut <[email protected]> | 2026-04-27 15:32:50 +0200 |
|---|---|---|
| committer | Fabio Estevam <[email protected]> | 2026-05-15 17:31:39 -0300 |
| commit | c8ca3314f24293be5d595857efeba56a87be4f7c (patch) | |
| tree | 310ab3b5022b11b4781d032ece8bb87a3f1ba2e3 /arch | |
| parent | e1a7afcf92a33a6c8c2bdf8b2264d2a6e11804d1 (diff) | |
imx: Add SPI NOR A/B switching support
Query the SM via SCMI, obtain rom_passover_t->img_set_sel and based on
that, add 0 or 0x400000 offset (A or B copy offset) to boot container
read address.
Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: Fedor Ross <[email protected]>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/include/asm/arch-imx9/sys_proto.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-imx/image-container.c | 8 | ||||
| -rw-r--r-- | arch/arm/mach-imx/imx9/scmi/soc.c | 13 |
3 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/include/asm/arch-imx9/sys_proto.h b/arch/arm/include/asm/arch-imx9/sys_proto.h index dead7a99a66..73df8715f22 100644 --- a/arch/arm/include/asm/arch-imx9/sys_proto.h +++ b/arch/arm/include/asm/arch-imx9/sys_proto.h @@ -23,6 +23,8 @@ int low_drive_freq_update(void *blob); enum imx9_soc_voltage_mode soc_target_voltage_mode(void); int get_reset_reason(bool sys, bool lm); +u8 imx95_detect_secondary_image_boot(void); + #define is_voltage_mode(mode) (soc_target_voltage_mode() == (mode)) #endif diff --git a/arch/arm/mach-imx/image-container.c b/arch/arm/mach-imx/image-container.c index 7bfcc9d7e9d..63cf8596316 100644 --- a/arch/arm/mach-imx/image-container.c +++ b/arch/arm/mach-imx/image-container.c @@ -225,9 +225,15 @@ static bool check_secondary_cnt_set(unsigned long *set_off) } } } -#endif +#elif IS_ENABLED(CONFIG_IMX95) + u8 img_set_sel = imx95_detect_secondary_image_boot(); + + *set_off = img_set_sel ? 0x400000 : 0; + return !!img_set_sel; +#else return false; +#endif } static unsigned long get_boot_device_offset(void *dev, int dev_type) diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c index fbee435786c..330b276b23a 100644 --- a/arch/arm/mach-imx/imx9/scmi/soc.c +++ b/arch/arm/mach-imx/imx9/scmi/soc.c @@ -745,6 +745,19 @@ void build_info(void) puts("\n"); } +#if IS_ENABLED(CONFIG_IMX95) +u8 imx95_detect_secondary_image_boot(void) +{ + rom_passover_t rdata = { 0 }; + int ret = scmi_get_rom_data(&rdata); + + if (!ret) + return rdata.img_set_sel; + + return 0; +} +#endif + int arch_misc_init(void) { build_info(); |
