Commit 57e92daf authored by David Pu's avatar David Pu Committed by Manish Pandey
Browse files

Tegra: common: make plat_psci_ops routines static



This patch makes Tegra platform psci ops routines to static. These
routines are called by PSCI framework and no external linkage is
necessary. This patch also fixes MISRA C-2012 Rule 8.6 violations.

Change-Id: Idd2381809f76dc0fd578c1c92c0f8eea124f2e88
Signed-off-by: default avatarDavid Pu <dpu@nvidia.com>
parent 3ee8e4d8
...@@ -34,7 +34,7 @@ extern uint64_t tegra_sec_entry_point; ...@@ -34,7 +34,7 @@ extern uint64_t tegra_sec_entry_point;
* the appropriate State-ID field within the `power_state` parameter which can * the appropriate State-ID field within the `power_state` parameter which can
* be utilized in `pwr_domain_suspend()` to suspend to system affinity level. * be utilized in `pwr_domain_suspend()` to suspend to system affinity level.
******************************************************************************/ ******************************************************************************/
void tegra_get_sys_suspend_power_state(psci_power_state_t *req_state) static void tegra_get_sys_suspend_power_state(psci_power_state_t *req_state)
{ {
/* all affinities use system suspend state id */ /* all affinities use system suspend state id */
for (uint32_t i = MPIDR_AFFLVL0; i <= PLAT_MAX_PWR_LVL; i++) { for (uint32_t i = MPIDR_AFFLVL0; i <= PLAT_MAX_PWR_LVL; i++) {
...@@ -45,7 +45,7 @@ void tegra_get_sys_suspend_power_state(psci_power_state_t *req_state) ...@@ -45,7 +45,7 @@ void tegra_get_sys_suspend_power_state(psci_power_state_t *req_state)
/******************************************************************************* /*******************************************************************************
* Handler called when an affinity instance is about to enter standby. * Handler called when an affinity instance is about to enter standby.
******************************************************************************/ ******************************************************************************/
void tegra_cpu_standby(plat_local_state_t cpu_state) static void tegra_cpu_standby(plat_local_state_t cpu_state)
{ {
u_register_t saved_scr_el3; u_register_t saved_scr_el3;
...@@ -84,7 +84,7 @@ void tegra_cpu_standby(plat_local_state_t cpu_state) ...@@ -84,7 +84,7 @@ void tegra_cpu_standby(plat_local_state_t cpu_state)
* Handler called when an affinity instance is about to be turned on. The * Handler called when an affinity instance is about to be turned on. The
* level and mpidr determine the affinity instance. * level and mpidr determine the affinity instance.
******************************************************************************/ ******************************************************************************/
int32_t tegra_pwr_domain_on(u_register_t mpidr) static int32_t tegra_pwr_domain_on(u_register_t mpidr)
{ {
return tegra_soc_pwr_domain_on(mpidr); return tegra_soc_pwr_domain_on(mpidr);
} }
...@@ -93,7 +93,7 @@ int32_t tegra_pwr_domain_on(u_register_t mpidr) ...@@ -93,7 +93,7 @@ int32_t tegra_pwr_domain_on(u_register_t mpidr)
* Handler called when a power domain is about to be turned off. The * Handler called when a power domain is about to be turned off. The
* target_state encodes the power state that each level should transition to. * target_state encodes the power state that each level should transition to.
******************************************************************************/ ******************************************************************************/
void tegra_pwr_domain_off(const psci_power_state_t *target_state) static void tegra_pwr_domain_off(const psci_power_state_t *target_state)
{ {
(void)tegra_soc_pwr_domain_off(target_state); (void)tegra_soc_pwr_domain_off(target_state);
} }
...@@ -113,7 +113,7 @@ void tegra_pwr_domain_suspend_pwrdown_early(const psci_power_state_t *target_sta ...@@ -113,7 +113,7 @@ void tegra_pwr_domain_suspend_pwrdown_early(const psci_power_state_t *target_sta
* Handler called when a power domain is about to be suspended. The * Handler called when a power domain is about to be suspended. The
* target_state encodes the power state that each level should transition to. * target_state encodes the power state that each level should transition to.
******************************************************************************/ ******************************************************************************/
void tegra_pwr_domain_suspend(const psci_power_state_t *target_state) static void tegra_pwr_domain_suspend(const psci_power_state_t *target_state)
{ {
(void)tegra_soc_pwr_domain_suspend(target_state); (void)tegra_soc_pwr_domain_suspend(target_state);
...@@ -132,7 +132,7 @@ void tegra_pwr_domain_suspend(const psci_power_state_t *target_state) ...@@ -132,7 +132,7 @@ void tegra_pwr_domain_suspend(const psci_power_state_t *target_state)
* Handler called at the end of the power domain suspend sequence. The * Handler called at the end of the power domain suspend sequence. The
* target_state encodes the power state that each level should transition to. * target_state encodes the power state that each level should transition to.
******************************************************************************/ ******************************************************************************/
__dead2 void tegra_pwr_domain_power_down_wfi(const psci_power_state_t static __dead2 void tegra_pwr_domain_power_down_wfi(const psci_power_state_t
*target_state) *target_state)
{ {
/* call the chip's power down handler */ /* call the chip's power down handler */
...@@ -147,7 +147,7 @@ __dead2 void tegra_pwr_domain_power_down_wfi(const psci_power_state_t ...@@ -147,7 +147,7 @@ __dead2 void tegra_pwr_domain_power_down_wfi(const psci_power_state_t
* being turned off earlier. The target_state encodes the low power state that * being turned off earlier. The target_state encodes the low power state that
* each level has woken up from. * each level has woken up from.
******************************************************************************/ ******************************************************************************/
void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state) static void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state)
{ {
const plat_params_from_bl2_t *plat_params; const plat_params_from_bl2_t *plat_params;
...@@ -198,7 +198,7 @@ void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state) ...@@ -198,7 +198,7 @@ void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state)
* having been suspended earlier. The target_state encodes the low power state * having been suspended earlier. The target_state encodes the low power state
* that each level has woken up from. * that each level has woken up from.
******************************************************************************/ ******************************************************************************/
void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state) static void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
{ {
tegra_pwr_domain_on_finish(target_state); tegra_pwr_domain_on_finish(target_state);
} }
...@@ -206,7 +206,7 @@ void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state) ...@@ -206,7 +206,7 @@ void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
/******************************************************************************* /*******************************************************************************
* Handler called when the system wants to be powered off * Handler called when the system wants to be powered off
******************************************************************************/ ******************************************************************************/
__dead2 void tegra_system_off(void) static __dead2 void tegra_system_off(void)
{ {
INFO("Powering down system...\n"); INFO("Powering down system...\n");
...@@ -216,7 +216,7 @@ __dead2 void tegra_system_off(void) ...@@ -216,7 +216,7 @@ __dead2 void tegra_system_off(void)
/******************************************************************************* /*******************************************************************************
* Handler called when the system wants to be restarted. * Handler called when the system wants to be restarted.
******************************************************************************/ ******************************************************************************/
__dead2 void tegra_system_reset(void) static __dead2 void tegra_system_reset(void)
{ {
INFO("Restarting system...\n"); INFO("Restarting system...\n");
...@@ -232,7 +232,7 @@ __dead2 void tegra_system_reset(void) ...@@ -232,7 +232,7 @@ __dead2 void tegra_system_reset(void)
/******************************************************************************* /*******************************************************************************
* Handler called to check the validity of the power state parameter. * Handler called to check the validity of the power state parameter.
******************************************************************************/ ******************************************************************************/
int32_t tegra_validate_power_state(uint32_t power_state, static int32_t tegra_validate_power_state(uint32_t power_state,
psci_power_state_t *req_state) psci_power_state_t *req_state)
{ {
assert(req_state != NULL); assert(req_state != NULL);
...@@ -243,7 +243,7 @@ int32_t tegra_validate_power_state(uint32_t power_state, ...@@ -243,7 +243,7 @@ int32_t tegra_validate_power_state(uint32_t power_state,
/******************************************************************************* /*******************************************************************************
* Platform handler called to check the validity of the non secure entrypoint. * Platform handler called to check the validity of the non secure entrypoint.
******************************************************************************/ ******************************************************************************/
int32_t tegra_validate_ns_entrypoint(uintptr_t entrypoint) static int32_t tegra_validate_ns_entrypoint(uintptr_t entrypoint)
{ {
int32_t ret = PSCI_E_INVALID_ADDRESS; int32_t ret = PSCI_E_INVALID_ADDRESS;
......
...@@ -112,19 +112,6 @@ __dead2 void tegra_soc_prepare_system_off(void); ...@@ -112,19 +112,6 @@ __dead2 void tegra_soc_prepare_system_off(void);
plat_local_state_t tegra_soc_get_target_pwr_state(uint32_t lvl, plat_local_state_t tegra_soc_get_target_pwr_state(uint32_t lvl,
const plat_local_state_t *states, const plat_local_state_t *states,
uint32_t ncpu); uint32_t ncpu);
void tegra_get_sys_suspend_power_state(psci_power_state_t *req_state);
void tegra_cpu_standby(plat_local_state_t cpu_state);
int32_t tegra_pwr_domain_on(u_register_t mpidr);
void tegra_pwr_domain_off(const psci_power_state_t *target_state);
void tegra_pwr_domain_suspend(const psci_power_state_t *target_state);
void __dead2 tegra_pwr_domain_power_down_wfi(const psci_power_state_t *target_state);
void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state);
void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state);
__dead2 void tegra_system_off(void);
__dead2 void tegra_system_reset(void);
int32_t tegra_validate_power_state(uint32_t power_state,
psci_power_state_t *req_state);
int32_t tegra_validate_ns_entrypoint(uintptr_t entrypoint);
/* Declarations for tegraXXX_pm.c */ /* Declarations for tegraXXX_pm.c */
int tegra_prepare_cpu_suspend(unsigned int id, unsigned int afflvl); int tegra_prepare_cpu_suspend(unsigned int id, unsigned int afflvl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment