mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 02:24:18 +00:00
feat(sc7280): add support for PSCI_OS_INIT_MODE
Enable PSCI_OS_INIT_MODE support for sc7280. Change-Id: If94d59190c0bd876e748cd80b2641ce7616fd817 Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
This commit is contained in:
parent
e75cc247c7
commit
e528bbec74
2 changed files with 30 additions and 2 deletions
|
@ -24,6 +24,12 @@
|
|||
#define QTI_LOCAL_PSTATE_WIDTH 4
|
||||
#define QTI_LOCAL_PSTATE_MASK ((1 << QTI_LOCAL_PSTATE_WIDTH) - 1)
|
||||
|
||||
#if PSCI_OS_INIT_MODE
|
||||
#define QTI_LAST_AT_PLVL_MASK (QTI_LOCAL_PSTATE_MASK << \
|
||||
(QTI_LOCAL_PSTATE_WIDTH * \
|
||||
(PLAT_MAX_PWR_LVL + 1)))
|
||||
#endif
|
||||
|
||||
/* Make composite power state parameter till level 0 */
|
||||
#define qti_make_pwrstate_lvl0(lvl0_state, type) \
|
||||
(((lvl0_state) << PSTATE_ID_SHIFT) | ((type) << PSTATE_TYPE_SHIFT))
|
||||
|
@ -88,7 +94,12 @@ int qti_validate_power_state(unsigned int power_state,
|
|||
* search if the number of entries justify the additional complexity.
|
||||
*/
|
||||
for (i = 0; !!qti_pm_idle_states[i]; i++) {
|
||||
#if PSCI_OS_INIT_MODE
|
||||
if ((power_state & ~QTI_LAST_AT_PLVL_MASK) ==
|
||||
qti_pm_idle_states[i])
|
||||
#else
|
||||
if (power_state == qti_pm_idle_states[i])
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -100,11 +111,14 @@ int qti_validate_power_state(unsigned int power_state,
|
|||
state_id = psci_get_pstate_id(power_state);
|
||||
|
||||
/* Parse the State ID and populate the state info parameter */
|
||||
while (state_id) {
|
||||
req_state->pwr_domain_state[i++] = state_id &
|
||||
for (i = QTI_PWR_LVL0; i <= PLAT_MAX_PWR_LVL; i++) {
|
||||
req_state->pwr_domain_state[i] = state_id &
|
||||
QTI_LOCAL_PSTATE_MASK;
|
||||
state_id >>= QTI_LOCAL_PSTATE_WIDTH;
|
||||
}
|
||||
#if PSCI_OS_INIT_MODE
|
||||
req_state->last_at_pwrlvl = state_id & QTI_LOCAL_PSTATE_MASK;
|
||||
#endif
|
||||
|
||||
return PSCI_E_SUCCESS;
|
||||
}
|
||||
|
@ -177,6 +191,18 @@ static void qti_node_power_off(const psci_power_state_t *target_state)
|
|||
}
|
||||
}
|
||||
|
||||
#if PSCI_OS_INIT_MODE
|
||||
static int qti_node_suspend(const psci_power_state_t *target_state)
|
||||
{
|
||||
qtiseclib_psci_node_suspend((const uint8_t *)target_state->
|
||||
pwr_domain_state);
|
||||
if (is_cpu_off(target_state)) {
|
||||
plat_qti_gic_cpuif_disable();
|
||||
qti_set_cpupwrctlr_val();
|
||||
}
|
||||
return PSCI_E_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static void qti_node_suspend(const psci_power_state_t *target_state)
|
||||
{
|
||||
qtiseclib_psci_node_suspend((const uint8_t *)target_state->
|
||||
|
@ -186,6 +212,7 @@ static void qti_node_suspend(const psci_power_state_t *target_state)
|
|||
qti_set_cpupwrctlr_val();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void qti_node_suspend_finish(const psci_power_state_t *target_state)
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@ ENABLE_PLAT_COMPAT := 0
|
|||
# Enable PSCI v1.0 extended state ID format
|
||||
PSCI_EXTENDED_STATE_ID := 1
|
||||
ARM_RECOM_STATE_ID_ENC := 1
|
||||
PSCI_OS_INIT_MODE := 1
|
||||
|
||||
COLD_BOOT_SINGLE_CPU := 1
|
||||
PROGRAMMABLE_RESET_ADDRESS := 1
|
||||
|
|
Loading…
Add table
Reference in a new issue