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>
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
}
}
}
-#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)
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();