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);
+int scmi_get_boot_device_offset(unsigned long *img_off);
+int scmi_get_boot_stage(u8 *stage);
+u8 scmi_get_imgset_sel(void);
#define is_voltage_mode(mode) (soc_target_voltage_mode() == (mode))
}
}
}
-#elif IS_ENABLED(CONFIG_IMX95)
- u8 img_set_sel = imx95_detect_secondary_image_boot();
-
- *set_off = img_set_sel ? 0x400000 : 0;
+#endif
- return !!img_set_sel;
-#else
return false;
-#endif
}
static unsigned long get_boot_device_offset(void *dev, int dev_type)
return offset;
}
+#if IS_ENABLED(CONFIG_ARCH_IMX9) && IS_ENABLED(CONFIG_SCMI_FIRMWARE)
+ int ret;
+ ret = scmi_get_boot_device_offset(&offset);
+ if (!ret)
+ return offset;
+ /* fall back to boot from primary set if get rom passover failed */
+#endif
+
sec_boot = check_secondary_cnt_set(&sec_set_off);
if (sec_boot)
printf("Secondary set selected\n");
part = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
if (part == EMMC_BOOT_PART_BOOT1 || part == EMMC_BOOT_PART_BOOT2) {
- unsigned long sec_set_off = 0;
bool sec_boot = false;
-
+#if IS_ENABLED(CONFIG_ARCH_IMX9) && IS_ENABLED(CONFIG_SCMI_FIRMWARE)
+ u8 stage;
+ int ret;
+ ret = scmi_get_boot_stage(&stage);
+ if (!ret)
+ sec_boot = (stage == 0x9);
+#else
+ unsigned long sec_set_off = 0;
sec_boot = check_secondary_cnt_set(&sec_set_off);
+#endif
if (sec_boot)
part = (part == EMMC_BOOT_PART_BOOT1) ? EMMC_HWPART_BOOT2 : EMMC_HWPART_BOOT1;
} else if (part == EMMC_BOOT_PART_USER) {
puts("\n");
}
-#if IS_ENABLED(CONFIG_IMX95)
-u8 imx95_detect_secondary_image_boot(void)
+int scmi_get_boot_device_offset(unsigned long *img_off)
+{
+ int ret;
+ rom_passover_t rom_data = {0};
+
+ ret = scmi_get_rom_data(&rom_data);
+ if (!ret)
+ *img_off = rom_data.img_ofs;
+
+ return 0;
+}
+
+int scmi_get_boot_stage(u8 *stage)
+{
+ int ret;
+ rom_passover_t rom_data = {0};
+
+ ret = scmi_get_rom_data(&rom_data);
+ if (!ret)
+ *stage = rom_data.boot_stage;
+
+ return ret;
+}
+
+u8 scmi_get_imgset_sel(void)
{
rom_passover_t rdata = { 0 };
int ret = scmi_get_rom_data(&rdata);
int boot_mode_getprisec(void)
{
- return !!imx95_detect_secondary_image_boot();
+ return !!scmi_get_imgset_sel();
}
-#endif
int arch_misc_init(void)
{