int imx8_power_domain_lookup_name(const char *name,
struct power_domain *power_domain);
void imx8_power_off_pd_devices(const char *permanent_on_devices[], int size);
+bool m4_parts_booted(void);
spl_boot_list[0] = BOOT_DEVICE_NOR;
}
}
+
+bool m4_parts_booted(void)
+{
+ sc_rm_pt_t m4_parts[2];
+ int err;
+
+ err = sc_rm_get_resource_owner(-1, SC_R_M4_0_PID0, &m4_parts[0]);
+ if (err) {
+ printf("%s get resource [%d] owner error: %d\n", __func__,
+ SC_R_M4_0_PID0, err);
+ return false;
+ }
+
+ if (sc_pm_is_partition_started(-1, m4_parts[0]))
+ return true;
+
+ if (is_imx8qm()) {
+ err = sc_rm_get_resource_owner(-1, SC_R_M4_1_PID0, &m4_parts[1]);
+ if (err) {
+ printf("%s get resource [%d] owner error: %d\n",
+ __func__, SC_R_M4_1_PID0, err);
+ return false;
+ }
+
+ if (sc_pm_is_partition_started(-1, m4_parts[1]))
+ return true;
+ }
+
+ return false;
+}
void spl_board_prepare_for_boot(void)
{
- imx_power_off_pd_devices(NULL, 0);
+ imx8_power_off_pd_devices(NULL, 0);
}
#ifdef CONFIG_SPL_LOAD_FIT