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 <marex@nabladev.com>
Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
This commit is contained in:
Marek Vasut
2026-04-27 15:32:50 +02:00
committed by Fabio Estevam
parent e1a7afcf92
commit c8ca3314f2
3 changed files with 22 additions and 1 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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();