mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-09 02:51:21 +00:00
reset2: Add css_system_reset2()
This function implements the platform dependant part of PSCI system reset2 for CSS platforms using SCMI. Change-Id: I724389decab484043cadf577aeed96b349c1466d Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
This commit is contained in:
parent
ed3c0ef8ac
commit
b48ae263d2
3 changed files with 32 additions and 6 deletions
|
@ -300,4 +300,7 @@ plat_psci_ops_t plat_arm_psci_pm_ops = {
|
|||
.read_mem_protect = arm_psci_read_mem_protect,
|
||||
.write_mem_protect = arm_nor_psci_write_mem_protect,
|
||||
#endif
|
||||
#if CSS_USE_SCMI_SDS_DRIVER
|
||||
.system_reset2 = css_system_reset2,
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -358,13 +358,35 @@ const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)
|
|||
ops->system_off = NULL;
|
||||
ops->system_reset = NULL;
|
||||
ops->get_sys_suspend_power_state = NULL;
|
||||
} else if (!(msg_attr & SCMI_SYS_PWR_SUSPEND_SUPPORTED)) {
|
||||
/*
|
||||
* System power management protocol is available, but it does
|
||||
* not support SYSTEM SUSPEND.
|
||||
*/
|
||||
ops->get_sys_suspend_power_state = NULL;
|
||||
} else {
|
||||
if (!(msg_attr & SCMI_SYS_PWR_SUSPEND_SUPPORTED)) {
|
||||
/*
|
||||
* System power management protocol is available, but
|
||||
* it does not support SYSTEM SUSPEND.
|
||||
*/
|
||||
ops->get_sys_suspend_power_state = NULL;
|
||||
}
|
||||
if (!(msg_attr & SCMI_SYS_PWR_WARM_RESET_SUPPORTED)) {
|
||||
/*
|
||||
* WARM reset is not available.
|
||||
*/
|
||||
ops->system_reset2 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return ops;
|
||||
}
|
||||
|
||||
int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie)
|
||||
{
|
||||
if (is_vendor || (reset_type != PSCI_RESET2_SYSTEM_WARM_RESET))
|
||||
return PSCI_E_INVALID_PARAMS;
|
||||
|
||||
css_scp_system_off(SCMI_SYS_PWR_WARM_RESET);
|
||||
/*
|
||||
* css_scp_system_off cannot return (it is a __dead function),
|
||||
* but css_system_reset2 has to return some value, even in
|
||||
* this case.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
struct psci_power_state;
|
||||
|
||||
/* API for power management by SCP */
|
||||
int css_system_reset2(int is_vendor, int reset_type, u_register_t cookie);
|
||||
void css_scp_suspend(const struct psci_power_state *target_state);
|
||||
void css_scp_off(const struct psci_power_state *target_state);
|
||||
void css_scp_on(u_register_t mpidr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue