mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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:
committed by
Fabio Estevam
parent
e1a7afcf92
commit
c8ca3314f2
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user