diff --git a/src/arch/armv8/armv8-a/cpu.c b/src/arch/armv8/armv8-a/cpu.c index 32710cc2..227a8f7b 100644 --- a/src/arch/armv8/armv8-a/cpu.c +++ b/src/arch/armv8/armv8-a/cpu.c @@ -31,16 +31,7 @@ void cpu_arch_profile_idle() { int64_t err = psci_power_down(PSCI_WAKEUP_IDLE); if (err) { - switch (err) { - case PSCI_E_NOT_SUPPORTED: - /** - * If power down is not supported let's just wait for an interrupt - */ - __asm__ volatile("wfi"); - break; - default: - ERROR("PSCI cpu%d power down failed with error %ld", cpu()->id, err); - } + ERROR("PSCI cpu%d power down failed with error %ld", cpu()->id, err); } /** diff --git a/src/arch/armv8/armv8-a/psci.c b/src/arch/armv8/armv8-a/psci.c index da8cf041..1f39af00 100644 --- a/src/arch/armv8/armv8-a/psci.c +++ b/src/arch/armv8/armv8-a/psci.c @@ -90,6 +90,13 @@ int32_t psci_standby() int32_t psci_power_down(enum wakeup_reason reason) { + /* We've observed that some platforms behave unexpectedly when performing + * power down. In these cases, after powerdown, the CPU cores are not awaken + * by interrupts as expected by Bao. */ + if (DEFINED(PLAT_PSCI_POWERDOWN_NOT_SUPPORTED)) { + return psci_standby(); + } + extern void psci_boot_entry(unsigned long x0); uint32_t pwr_state_aux = PSCI_POWER_STATE_LVL_0 | PSCI_STATE_TYPE_POWERDOWN;