diff --git a/plat/allwinner/common/sunxi_scpi_pm.c b/plat/allwinner/common/sunxi_scpi_pm.c index 41dc56397..6a0e96701 100644 --- a/plat/allwinner/common/sunxi_scpi_pm.c +++ b/plat/allwinner/common/sunxi_scpi_pm.c @@ -125,6 +125,32 @@ static void __dead2 sunxi_system_reset(void) psci_power_down_wfi(); } +static int sunxi_system_reset2(int is_vendor, int reset_type, u_register_t cookie) +{ + uint32_t ret; + + if (is_vendor || (reset_type != PSCI_RESET2_SYSTEM_WARM_RESET)) + return PSCI_E_NOT_SUPPORTED; + + gicv2_cpuif_disable(); + + /* Send the system reset request to the SCP. */ + ret = scpi_sys_power_state(scpi_system_reset); + if (ret != SCP_OK) { + ERROR("PSCI: SCPI %s failed: %d\n", "reset", ret); + return PSCI_E_INVALID_PARAMS; + } + + psci_power_down_wfi(); + + /* + * Should not reach here. + * However sunxi_system_reset2 has to return some value + * according to PSCI v1.1 spec. + */ + return PSCI_E_SUCCESS; +} + static int sunxi_validate_power_state(unsigned int power_state, psci_power_state_t *req_state) { @@ -177,6 +203,7 @@ static const plat_psci_ops_t sunxi_scpi_psci_ops = { .pwr_domain_suspend_finish = sunxi_pwr_domain_on_finish, .system_off = sunxi_system_off, .system_reset = sunxi_system_reset, + .system_reset2 = sunxi_system_reset2, .validate_power_state = sunxi_validate_power_state, .validate_ns_entrypoint = sunxi_validate_ns_entrypoint, .get_sys_suspend_power_state = sunxi_get_sys_suspend_power_state,