refactor(plat/synquacer): update PSCI system_off handling

SynQuacer SoC contains a Cortex-M3 System Control Processor(SCP)
which manages system power.
This commit modifies the PSCI system_off handling to call SCMI,
same as other PSCI calls. System power-off is done by turing off
the ATX power supply through GPIO, this operation is transferred
to SCP.

Note that this commit modifies only the SCMI case, obsolete SCPI
implementation is not updated.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Change-Id: I6c1009e67cccd1eb5d14c338c3df9103d63709dd
This commit is contained in:
Masahisa Kojima 2021-11-11 10:17:09 +09:00
parent 73193689c0
commit e01acbe903
3 changed files with 10 additions and 0 deletions

View File

@ -189,6 +189,11 @@ void __dead2 sq_scmi_system_off(int state)
/*
* Helper function to reset the system via SCMI.
*/
void __dead2 sq_scmi_sys_shutdown(void)
{
sq_scmi_system_off(SCMI_SYS_PWR_SHUTDOWN);
}
void __dead2 sq_scmi_sys_reboot(void)
{
sq_scmi_system_off(SCMI_SYS_PWR_COLD_RESET);

View File

@ -45,6 +45,7 @@ void sq_mmap_setup(uintptr_t total_base, size_t total_size,
/* SCMI API for power management by SCP */
void sq_scmi_off(const struct psci_power_state *target_state);
void sq_scmi_on(u_register_t mpidr);
void __dead2 sq_scmi_sys_shutdown(void);
void __dead2 sq_scmi_sys_reboot(void);
void __dead2 sq_scmi_system_off(int state);
/* SCMI API for vendor specific protocol */

View File

@ -113,6 +113,9 @@ void sq_pwr_domain_off(const psci_power_state_t *target_state)
void __dead2 sq_system_off(void)
{
#if SQ_USE_SCMI_DRIVER
sq_scmi_sys_shutdown();
#else
volatile uint32_t *gpio = (uint32_t *)PLAT_SQ_GPIO_BASE;
/* set PD[9] high to power off the system */
@ -139,6 +142,7 @@ void __dead2 sq_system_off(void)
wfi();
ERROR("SQ System Off: operation not handled.\n");
panic();
#endif
}
void __dead2 sq_system_reset(void)