Skip to content

Commit

Permalink
core: arm: sm: add PSCI system suspend
Browse files Browse the repository at this point in the history
Add __weak property for the function, developers
could have their own implementation.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
  • Loading branch information
JosephChen2017 committed Aug 16, 2017
1 parent d4c2757 commit 1d40eb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/arch/arm/include/sm/psci.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void psci_system_off(void);
void psci_system_reset(void);
int psci_features(uint32_t psci_fid);
int psci_node_hw_state(uint32_t cpu_id, uint32_t power_level);
int psci_system_suspend(uintptr_t entry, uint32_t context_id);
int psci_stat_residency(uint32_t cpu_id, uint32_t power_state);
int psci_stat_count(uint32_t cpu_id, uint32_t power_state);
void tee_psci_handler(struct thread_smc_args *args);
Expand Down
9 changes: 9 additions & 0 deletions core/arch/arm/sm/psci.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ __weak int psci_node_hw_state(uint32_t cpu_id __unused,
return PSCI_RET_NOT_SUPPORTED;
}

__weak int psci_system_suspend(uintptr_t entry __unused,
uint32_t context_id __unused)
{
return PSCI_RET_NOT_SUPPORTED;
}

__weak int psci_stat_residency(uint32_t cpu_id __unused,
uint32_t power_state __unused)
{
Expand Down Expand Up @@ -159,6 +165,9 @@ void tee_psci_handler(struct thread_smc_args *args)
case PSCI_NODE_HW_STATE:
args->a0 = psci_node_hw_state(a1, a2);
break;
case PSCI_SYSTEM_SUSPEND:
args->a0 = psci_system_suspend(a1, a2);
break;
default:
args->a0 = OPTEE_SMC_RETURN_UNKNOWN_FUNCTION;
break;
Expand Down

0 comments on commit 1d40eb8

Please sign in to comment.