feat(allwinner): choose PSCI states to avoid translation

Aligning the PSCI and SCPI power states avoids some code to translate
between the two. This also makes room for an intermediate power state,
for future firmware capability growth.

Change-Id: I26691085f277a96bd405e3305ab0fe390a92b418
Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2021-03-18 22:55:15 -05:00 committed by Joanna Farley
parent 2b2b565717
commit 159c36fd2f
2 changed files with 6 additions and 16 deletions

View File

@ -57,9 +57,10 @@
#define PLAT_CSS_SCP_COM_SHARED_MEM_BASE \
(SUNXI_SRAM_A2_BASE + SUNXI_SRAM_A2_SIZE - 0x200)
#define PLAT_MAX_PWR_LVL_STATES U(2)
/* These states are used directly for SCPI communication. */
#define PLAT_MAX_PWR_LVL_STATES U(3)
#define PLAT_MAX_RET_STATE U(1)
#define PLAT_MAX_OFF_STATE U(2)
#define PLAT_MAX_OFF_STATE U(3)
#define PLAT_MAX_PWR_LVL U(2)
#define PLAT_NUM_PWR_DOMAINS (U(1) + \

View File

@ -44,17 +44,6 @@
#define SYSTEM_PWR_STATE(state) \
((state)->pwr_domain_state[SYSTEM_PWR_LVL])
static inline scpi_power_state_t scpi_map_state(plat_local_state_t psci_state)
{
if (is_local_state_run(psci_state)) {
return scpi_power_on;
}
if (is_local_state_retn(psci_state)) {
return scpi_power_retention;
}
return scpi_power_off;
}
static void sunxi_cpu_standby(plat_local_state_t cpu_state)
{
u_register_t scr = read_scr_el3();
@ -87,9 +76,9 @@ static void sunxi_pwr_domain_off(const psci_power_state_t *target_state)
}
scpi_set_css_power_state(read_mpidr(),
scpi_map_state(cpu_pwr_state),
scpi_map_state(cluster_pwr_state),
scpi_map_state(system_pwr_state));
cpu_pwr_state,
cluster_pwr_state,
system_pwr_state);
}
static void sunxi_pwr_domain_on_finish(const psci_power_state_t *target_state)