mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
Remove ns_entrypoint
and mpidr
from parameters in pm_ops
This patch removes the non-secure entry point information being passed to the platform pm_ops which is not needed. Also, it removes the `mpidr` parameter for platform pm hooks which are meant to do power management operations only on the current cpu. NOTE: PLATFORM PORTS MUST BE UPDATED AFTER MERGING THIS COMMIT. Change-Id: If632376a990b7f3b355f910e78771884bf6b12e7
This commit is contained in:
parent
eadd7a1b1e
commit
e146f4cc6c
7 changed files with 83 additions and 103 deletions
|
@ -1105,8 +1105,8 @@ passed argument.
|
||||||
#### plat_pm_ops.affinst_on()
|
#### plat_pm_ops.affinst_on()
|
||||||
|
|
||||||
Perform the platform specific setup to power on an affinity instance, specified
|
Perform the platform specific setup to power on an affinity instance, specified
|
||||||
by the `MPIDR` (first argument) and `affinity level` (fourth argument). The
|
by the `MPIDR` (first argument) and `affinity level` (third argument). The
|
||||||
`state` (fifth argument) contains the current state of that affinity instance
|
`state` (fourth argument) contains the current state of that affinity instance
|
||||||
(ON or OFF). This is useful to determine whether any action must be taken. For
|
(ON or OFF). This is useful to determine whether any action must be taken. For
|
||||||
example, while powering on a CPU, the cluster that contains this CPU might
|
example, while powering on a CPU, the cluster that contains this CPU might
|
||||||
already be in the ON state. The platform decides what actions must be taken to
|
already be in the ON state. The platform decides what actions must be taken to
|
||||||
|
@ -1115,14 +1115,13 @@ management operation).
|
||||||
|
|
||||||
#### plat_pm_ops.affinst_off()
|
#### plat_pm_ops.affinst_off()
|
||||||
|
|
||||||
Perform the platform specific setup to power off an affinity instance in the
|
Perform the platform specific setup to power off an affinity instance of the
|
||||||
`MPIDR` of the calling CPU. It is called by the PSCI `CPU_OFF` API
|
calling CPU. It is called by the PSCI `CPU_OFF` API implementation.
|
||||||
implementation.
|
|
||||||
|
|
||||||
The `MPIDR` (first argument), `affinity level` (second argument) and `state`
|
The `affinity level` (first argument) and `state` (second argument) have
|
||||||
(third argument) have a similar meaning as described in the `affinst_on()`
|
a similar meaning as described in the `affinst_on()` operation. They are
|
||||||
operation. They are used to identify the affinity instance on which the call
|
used to identify the affinity instance on which the call is made and its
|
||||||
is made and its current state. This gives the platform port an indication of the
|
current state. This gives the platform port an indication of the
|
||||||
state transition it must make to perform the requested action. For example, if
|
state transition it must make to perform the requested action. For example, if
|
||||||
the calling CPU is the last powered on CPU in the cluster, after powering down
|
the calling CPU is the last powered on CPU in the cluster, after powering down
|
||||||
affinity level 0 (CPU), the platform port should power down affinity level 1
|
affinity level 0 (CPU), the platform port should power down affinity level 1
|
||||||
|
@ -1130,18 +1129,17 @@ affinity level 0 (CPU), the platform port should power down affinity level 1
|
||||||
|
|
||||||
#### plat_pm_ops.affinst_suspend()
|
#### plat_pm_ops.affinst_suspend()
|
||||||
|
|
||||||
Perform the platform specific setup to power off an affinity instance in the
|
Perform the platform specific setup to power off an affinity instance of the
|
||||||
`MPIDR` of the calling CPU. It is called by the PSCI `CPU_SUSPEND` API
|
calling CPU. It is called by the PSCI `CPU_SUSPEND` API
|
||||||
implementation.
|
implementation.
|
||||||
|
|
||||||
The `MPIDR` (first argument), `affinity level` (third argument) and `state`
|
The `affinity level` (second argument) and `state` (third argument) have a
|
||||||
(fifth argument) have a similar meaning as described in the `affinst_on()`
|
similar meaning as described in the `affinst_on()` operation. They are used to
|
||||||
operation. They are used to identify the affinity instance on which the call
|
identify the affinity instance on which the call is made and its current state.
|
||||||
is made and its current state. This gives the platform port an indication of the
|
This gives the platform port an indication of the state transition it must
|
||||||
state transition it must make to perform the requested action. For example, if
|
make to perform the requested action. For example, if the calling CPU is the
|
||||||
the calling CPU is the last powered on CPU in the cluster, after powering down
|
last powered on CPU in the cluster, after powering down affinity level 0 (CPU),
|
||||||
affinity level 0 (CPU), the platform port should power down affinity level 1
|
the platform port should power down affinity level 1 (the cluster) as well.
|
||||||
(the cluster) as well.
|
|
||||||
|
|
||||||
The difference between turning an affinity instance off versus suspending it
|
The difference between turning an affinity instance off versus suspending it
|
||||||
is that in the former case, the affinity instance is expected to re-initialize
|
is that in the former case, the affinity instance is expected to re-initialize
|
||||||
|
@ -1158,8 +1156,8 @@ It performs the platform-specific setup required to initialize enough state for
|
||||||
this CPU to enter the normal world and also provide secure runtime firmware
|
this CPU to enter the normal world and also provide secure runtime firmware
|
||||||
services.
|
services.
|
||||||
|
|
||||||
The `MPIDR` (first argument), `affinity level` (second argument) and `state`
|
The `affinity level` (first argument) and `state` (second argument) have a
|
||||||
(third argument) have a similar meaning as described in the previous operations.
|
similar meaning as described in the previous operations.
|
||||||
|
|
||||||
#### plat_pm_ops.affinst_on_suspend()
|
#### plat_pm_ops.affinst_on_suspend()
|
||||||
|
|
||||||
|
@ -1170,8 +1168,8 @@ event, for example a timer interrupt that was programmed by the CPU during the
|
||||||
restore the saved state for this CPU to resume execution in the normal world
|
restore the saved state for this CPU to resume execution in the normal world
|
||||||
and also provide secure runtime firmware services.
|
and also provide secure runtime firmware services.
|
||||||
|
|
||||||
The `MPIDR` (first argument), `affinity level` (second argument) and `state`
|
The `affinity level` (first argument) and `state` (second argument) have a
|
||||||
(third argument) have a similar meaning as described in the previous operations.
|
similar meaning as described in the previous operations.
|
||||||
|
|
||||||
BL3-1 platform initialization code must also detect the system topology and
|
BL3-1 platform initialization code must also detect the system topology and
|
||||||
the state of each affinity instance in the topology. This information is
|
the state of each affinity instance in the topology. This information is
|
||||||
|
|
|
@ -161,22 +161,18 @@ typedef struct psci_cpu_data {
|
||||||
* perform common low level pm functions
|
* perform common low level pm functions
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
typedef struct plat_pm_ops {
|
typedef struct plat_pm_ops {
|
||||||
int (*affinst_standby)(unsigned int);
|
int (*affinst_standby)(unsigned int power_state);
|
||||||
int (*affinst_on)(unsigned long,
|
int (*affinst_on)(unsigned long mpidr,
|
||||||
unsigned long,
|
unsigned long sec_entrypoint,
|
||||||
unsigned long,
|
unsigned int afflvl,
|
||||||
unsigned int,
|
unsigned int state);
|
||||||
unsigned int);
|
int (*affinst_off)(unsigned int afflvl, unsigned int state);
|
||||||
int (*affinst_off)(unsigned long, unsigned int, unsigned int);
|
int (*affinst_suspend)(unsigned long sec_entrypoint,
|
||||||
int (*affinst_suspend)(unsigned long,
|
unsigned int afflvl,
|
||||||
unsigned long,
|
unsigned int state);
|
||||||
unsigned long,
|
int (*affinst_on_finish)(unsigned int afflvl, unsigned int state);
|
||||||
unsigned int,
|
int (*affinst_suspend_finish)(unsigned int afflvl,
|
||||||
unsigned int);
|
unsigned int state);
|
||||||
int (*affinst_on_finish)(unsigned long, unsigned int, unsigned int);
|
|
||||||
int (*affinst_suspend_finish)(unsigned long,
|
|
||||||
unsigned int,
|
|
||||||
unsigned int);
|
|
||||||
void (*system_off)(void) __dead2;
|
void (*system_off)(void) __dead2;
|
||||||
void (*system_reset)(void) __dead2;
|
void (*system_reset)(void) __dead2;
|
||||||
} plat_pm_ops_t;
|
} plat_pm_ops_t;
|
||||||
|
|
|
@ -149,7 +149,6 @@ int fvp_affinst_standby(unsigned int power_state)
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int fvp_affinst_on(unsigned long mpidr,
|
int fvp_affinst_on(unsigned long mpidr,
|
||||||
unsigned long sec_entrypoint,
|
unsigned long sec_entrypoint,
|
||||||
unsigned long ns_entrypoint,
|
|
||||||
unsigned int afflvl,
|
unsigned int afflvl,
|
||||||
unsigned int state)
|
unsigned int state)
|
||||||
{
|
{
|
||||||
|
@ -191,8 +190,7 @@ int fvp_affinst_on(unsigned long mpidr,
|
||||||
* global variables across calls. It will be wise to do flush a write to the
|
* global variables across calls. It will be wise to do flush a write to the
|
||||||
* global to prevent unpredictable results.
|
* global to prevent unpredictable results.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int fvp_affinst_off(unsigned long mpidr,
|
int fvp_affinst_off(unsigned int afflvl,
|
||||||
unsigned int afflvl,
|
|
||||||
unsigned int state)
|
unsigned int state)
|
||||||
{
|
{
|
||||||
/* Determine if any platform actions need to be executed */
|
/* Determine if any platform actions need to be executed */
|
||||||
|
@ -223,18 +221,21 @@ int fvp_affinst_off(unsigned long mpidr,
|
||||||
* global variables across calls. It will be wise to do flush a write to the
|
* global variables across calls. It will be wise to do flush a write to the
|
||||||
* global to prevent unpredictable results.
|
* global to prevent unpredictable results.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int fvp_affinst_suspend(unsigned long mpidr,
|
int fvp_affinst_suspend(unsigned long sec_entrypoint,
|
||||||
unsigned long sec_entrypoint,
|
|
||||||
unsigned long ns_entrypoint,
|
|
||||||
unsigned int afflvl,
|
unsigned int afflvl,
|
||||||
unsigned int state)
|
unsigned int state)
|
||||||
{
|
{
|
||||||
|
unsigned long mpidr;
|
||||||
|
|
||||||
/* Determine if any platform actions need to be executed. */
|
/* Determine if any platform actions need to be executed. */
|
||||||
if (fvp_do_plat_actions(afflvl, state) == -EAGAIN)
|
if (fvp_do_plat_actions(afflvl, state) == -EAGAIN)
|
||||||
return PSCI_E_SUCCESS;
|
return PSCI_E_SUCCESS;
|
||||||
|
|
||||||
/* Program the jump address for the target cpu */
|
/* Get the mpidr for this cpu */
|
||||||
fvp_program_mailbox(read_mpidr_el1(), sec_entrypoint);
|
mpidr = read_mpidr_el1();
|
||||||
|
|
||||||
|
/* Program the jump address for the this cpu */
|
||||||
|
fvp_program_mailbox(mpidr, sec_entrypoint);
|
||||||
|
|
||||||
/* Program the power controller to enable wakeup interrupts. */
|
/* Program the power controller to enable wakeup interrupts. */
|
||||||
fvp_pwrc_set_wen(mpidr);
|
fvp_pwrc_set_wen(mpidr);
|
||||||
|
@ -256,16 +257,19 @@ int fvp_affinst_suspend(unsigned long mpidr,
|
||||||
* was turned off prior to wakeup and do what's necessary to setup it up
|
* was turned off prior to wakeup and do what's necessary to setup it up
|
||||||
* correctly.
|
* correctly.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int fvp_affinst_on_finish(unsigned long mpidr,
|
int fvp_affinst_on_finish(unsigned int afflvl,
|
||||||
unsigned int afflvl,
|
|
||||||
unsigned int state)
|
unsigned int state)
|
||||||
{
|
{
|
||||||
int rc = PSCI_E_SUCCESS;
|
int rc = PSCI_E_SUCCESS;
|
||||||
|
unsigned long mpidr;
|
||||||
|
|
||||||
/* Determine if any platform actions need to be executed. */
|
/* Determine if any platform actions need to be executed. */
|
||||||
if (fvp_do_plat_actions(afflvl, state) == -EAGAIN)
|
if (fvp_do_plat_actions(afflvl, state) == -EAGAIN)
|
||||||
return PSCI_E_SUCCESS;
|
return PSCI_E_SUCCESS;
|
||||||
|
|
||||||
|
/* Get the mpidr for this cpu */
|
||||||
|
mpidr = read_mpidr_el1();
|
||||||
|
|
||||||
/* Perform the common cluster specific operations */
|
/* Perform the common cluster specific operations */
|
||||||
if (afflvl != MPIDR_AFFLVL0) {
|
if (afflvl != MPIDR_AFFLVL0) {
|
||||||
/*
|
/*
|
||||||
|
@ -290,7 +294,7 @@ int fvp_affinst_on_finish(unsigned long mpidr,
|
||||||
fvp_pwrc_clr_wen(mpidr);
|
fvp_pwrc_clr_wen(mpidr);
|
||||||
|
|
||||||
/* Zero the jump address in the mailbox for this cpu */
|
/* Zero the jump address in the mailbox for this cpu */
|
||||||
fvp_program_mailbox(read_mpidr_el1(), 0);
|
fvp_program_mailbox(mpidr, 0);
|
||||||
|
|
||||||
/* Enable the gic cpu interface */
|
/* Enable the gic cpu interface */
|
||||||
arm_gic_cpuif_setup();
|
arm_gic_cpuif_setup();
|
||||||
|
@ -308,11 +312,10 @@ int fvp_affinst_on_finish(unsigned long mpidr,
|
||||||
* TODO: At the moment we reuse the on finisher and reinitialize the secure
|
* TODO: At the moment we reuse the on finisher and reinitialize the secure
|
||||||
* context. Need to implement a separate suspend finisher.
|
* context. Need to implement a separate suspend finisher.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int fvp_affinst_suspend_finish(unsigned long mpidr,
|
int fvp_affinst_suspend_finish(unsigned int afflvl,
|
||||||
unsigned int afflvl,
|
|
||||||
unsigned int state)
|
unsigned int state)
|
||||||
{
|
{
|
||||||
return fvp_affinst_on_finish(mpidr, afflvl, state);
|
return fvp_affinst_on_finish(afflvl, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
|
@ -90,7 +90,6 @@ static int32_t juno_do_plat_actions(uint32_t afflvl, uint32_t state)
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int32_t juno_affinst_on(uint64_t mpidr,
|
int32_t juno_affinst_on(uint64_t mpidr,
|
||||||
uint64_t sec_entrypoint,
|
uint64_t sec_entrypoint,
|
||||||
uint64_t ns_entrypoint,
|
|
||||||
uint32_t afflvl,
|
uint32_t afflvl,
|
||||||
uint32_t state)
|
uint32_t state)
|
||||||
{
|
{
|
||||||
|
@ -119,12 +118,17 @@ int32_t juno_affinst_on(uint64_t mpidr,
|
||||||
* was turned off prior to wakeup and do what's necessary to setup it up
|
* was turned off prior to wakeup and do what's necessary to setup it up
|
||||||
* correctly.
|
* correctly.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int32_t juno_affinst_on_finish(uint64_t mpidr, uint32_t afflvl, uint32_t state)
|
int32_t juno_affinst_on_finish(uint32_t afflvl, uint32_t state)
|
||||||
{
|
{
|
||||||
|
unsigned long mpidr;
|
||||||
|
|
||||||
/* Determine if any platform actions need to be executed. */
|
/* Determine if any platform actions need to be executed. */
|
||||||
if (juno_do_plat_actions(afflvl, state) == -EAGAIN)
|
if (juno_do_plat_actions(afflvl, state) == -EAGAIN)
|
||||||
return PSCI_E_SUCCESS;
|
return PSCI_E_SUCCESS;
|
||||||
|
|
||||||
|
/* Get the mpidr for this cpu */
|
||||||
|
mpidr = read_mpidr_el1();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform the common cluster specific operations i.e enable coherency
|
* Perform the common cluster specific operations i.e enable coherency
|
||||||
* if this cluster was off.
|
* if this cluster was off.
|
||||||
|
@ -187,7 +191,7 @@ static int32_t juno_power_down_common(uint32_t afflvl)
|
||||||
* global variables across calls. It will be wise to do flush a write to the
|
* global variables across calls. It will be wise to do flush a write to the
|
||||||
* global to prevent unpredictable results.
|
* global to prevent unpredictable results.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
static int32_t juno_affinst_off(uint64_t mpidr, uint32_t afflvl, uint32_t state)
|
static int32_t juno_affinst_off(uint32_t afflvl, uint32_t state)
|
||||||
{
|
{
|
||||||
/* Determine if any platform actions need to be executed */
|
/* Determine if any platform actions need to be executed */
|
||||||
if (juno_do_plat_actions(afflvl, state) == -EAGAIN)
|
if (juno_do_plat_actions(afflvl, state) == -EAGAIN)
|
||||||
|
@ -208,9 +212,7 @@ static int32_t juno_affinst_off(uint64_t mpidr, uint32_t afflvl, uint32_t state)
|
||||||
* global variables across calls. It will be wise to do flush a write to the
|
* global variables across calls. It will be wise to do flush a write to the
|
||||||
* global to prevent unpredictable results.
|
* global to prevent unpredictable results.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
static int32_t juno_affinst_suspend(uint64_t mpidr,
|
static int32_t juno_affinst_suspend(uint64_t sec_entrypoint,
|
||||||
uint64_t sec_entrypoint,
|
|
||||||
uint64_t ns_entrypoint,
|
|
||||||
uint32_t afflvl,
|
uint32_t afflvl,
|
||||||
uint32_t state)
|
uint32_t state)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +223,7 @@ static int32_t juno_affinst_suspend(uint64_t mpidr,
|
||||||
/*
|
/*
|
||||||
* Setup mailbox with address for CPU entrypoint when it next powers up.
|
* Setup mailbox with address for CPU entrypoint when it next powers up.
|
||||||
*/
|
*/
|
||||||
juno_program_mailbox(mpidr, sec_entrypoint);
|
juno_program_mailbox(read_mpidr_el1(), sec_entrypoint);
|
||||||
|
|
||||||
return juno_power_down_common(afflvl);
|
return juno_power_down_common(afflvl);
|
||||||
}
|
}
|
||||||
|
@ -233,11 +235,10 @@ static int32_t juno_affinst_suspend(uint64_t mpidr,
|
||||||
* TODO: At the moment we reuse the on finisher and reinitialize the secure
|
* TODO: At the moment we reuse the on finisher and reinitialize the secure
|
||||||
* context. Need to implement a separate suspend finisher.
|
* context. Need to implement a separate suspend finisher.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
static int32_t juno_affinst_suspend_finish(uint64_t mpidr,
|
static int32_t juno_affinst_suspend_finish(uint32_t afflvl,
|
||||||
uint32_t afflvl,
|
|
||||||
uint32_t state)
|
uint32_t state)
|
||||||
{
|
{
|
||||||
return juno_affinst_on_finish(mpidr, afflvl, state);
|
return juno_affinst_on_finish(afflvl, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "psci_private.h"
|
#include "psci_private.h"
|
||||||
|
|
||||||
typedef int (*afflvl_off_handler_t)(aff_map_node_t *);
|
typedef int (*afflvl_off_handler_t)(aff_map_node_t *node);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* The next three functions implement a handler for each supported affinity
|
* The next three functions implement a handler for each supported affinity
|
||||||
|
@ -75,8 +75,7 @@ static int psci_afflvl0_off(aff_map_node_t *cpu_node)
|
||||||
* Plat. management: Perform platform specific actions to turn this
|
* Plat. management: Perform platform specific actions to turn this
|
||||||
* cpu off e.g. exit cpu coherency, program the power controller etc.
|
* cpu off e.g. exit cpu coherency, program the power controller etc.
|
||||||
*/
|
*/
|
||||||
return psci_plat_pm_ops->affinst_off(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_off(cpu_node->level,
|
||||||
cpu_node->level,
|
|
||||||
psci_get_phys_state(cpu_node));
|
psci_get_phys_state(cpu_node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +98,7 @@ static int psci_afflvl1_off(aff_map_node_t *cluster_node)
|
||||||
* specific bookeeping e.g. turn off interconnect coherency,
|
* specific bookeeping e.g. turn off interconnect coherency,
|
||||||
* program the power controller etc.
|
* program the power controller etc.
|
||||||
*/
|
*/
|
||||||
return psci_plat_pm_ops->affinst_off(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_off(cluster_node->level,
|
||||||
cluster_node->level,
|
|
||||||
psci_get_phys_state(cluster_node));
|
psci_get_phys_state(cluster_node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,8 +125,7 @@ static int psci_afflvl2_off(aff_map_node_t *system_node)
|
||||||
* Plat. Management : Allow the platform to do its bookeeping
|
* Plat. Management : Allow the platform to do its bookeeping
|
||||||
* at this affinity level
|
* at this affinity level
|
||||||
*/
|
*/
|
||||||
return psci_plat_pm_ops->affinst_off(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_off(system_node->level,
|
||||||
system_node->level,
|
|
||||||
psci_get_phys_state(system_node));
|
psci_get_phys_state(system_node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,10 +39,10 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "psci_private.h"
|
#include "psci_private.h"
|
||||||
|
|
||||||
typedef int (*afflvl_on_handler_t)(unsigned long,
|
typedef int (*afflvl_on_handler_t)(unsigned long target_cpu,
|
||||||
aff_map_node_t *,
|
aff_map_node_t *node,
|
||||||
unsigned long,
|
unsigned long ns_entrypoint,
|
||||||
unsigned long);
|
unsigned long context_id);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* This function checks whether a cpu which has been requested to be turned on
|
* This function checks whether a cpu which has been requested to be turned on
|
||||||
|
@ -122,7 +122,6 @@ static int psci_afflvl0_on(unsigned long target_cpu,
|
||||||
*/
|
*/
|
||||||
return psci_plat_pm_ops->affinst_on(target_cpu,
|
return psci_plat_pm_ops->affinst_on(target_cpu,
|
||||||
psci_entrypoint,
|
psci_entrypoint,
|
||||||
ns_entrypoint,
|
|
||||||
cpu_node->level,
|
cpu_node->level,
|
||||||
psci_get_phys_state(cpu_node));
|
psci_get_phys_state(cpu_node));
|
||||||
}
|
}
|
||||||
|
@ -159,7 +158,6 @@ static int psci_afflvl1_on(unsigned long target_cpu,
|
||||||
psci_entrypoint = (unsigned long) psci_aff_on_finish_entry;
|
psci_entrypoint = (unsigned long) psci_aff_on_finish_entry;
|
||||||
return psci_plat_pm_ops->affinst_on(target_cpu,
|
return psci_plat_pm_ops->affinst_on(target_cpu,
|
||||||
psci_entrypoint,
|
psci_entrypoint,
|
||||||
ns_entrypoint,
|
|
||||||
cluster_node->level,
|
cluster_node->level,
|
||||||
psci_get_phys_state(cluster_node));
|
psci_get_phys_state(cluster_node));
|
||||||
}
|
}
|
||||||
|
@ -197,7 +195,6 @@ static int psci_afflvl2_on(unsigned long target_cpu,
|
||||||
psci_entrypoint = (unsigned long) psci_aff_on_finish_entry;
|
psci_entrypoint = (unsigned long) psci_aff_on_finish_entry;
|
||||||
return psci_plat_pm_ops->affinst_on(target_cpu,
|
return psci_plat_pm_ops->affinst_on(target_cpu,
|
||||||
psci_entrypoint,
|
psci_entrypoint,
|
||||||
ns_entrypoint,
|
|
||||||
system_node->level,
|
system_node->level,
|
||||||
psci_get_phys_state(system_node));
|
psci_get_phys_state(system_node));
|
||||||
}
|
}
|
||||||
|
@ -258,7 +255,7 @@ static int psci_call_on_handlers(aff_map_node_t *target_cpu_nodes[],
|
||||||
*
|
*
|
||||||
* The affinity level specific handlers are called in descending order i.e. from
|
* The affinity level specific handlers are called in descending order i.e. from
|
||||||
* the highest to the lowest affinity level implemented by the platform because
|
* the highest to the lowest affinity level implemented by the platform because
|
||||||
* to turn on affinity level X it is neccesary to turn on affinity level X + 1
|
* to turn on affinity level X it is necessary to turn on affinity level X + 1
|
||||||
* first.
|
* first.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
int psci_afflvl_on(unsigned long target_cpu,
|
int psci_afflvl_on(unsigned long target_cpu,
|
||||||
|
@ -347,8 +344,7 @@ static unsigned int psci_afflvl0_on_finish(aff_map_node_t *cpu_node)
|
||||||
|
|
||||||
/* Get the physical state of this cpu */
|
/* Get the physical state of this cpu */
|
||||||
plat_state = get_phys_state(state);
|
plat_state = get_phys_state(state);
|
||||||
rc = psci_plat_pm_ops->affinst_on_finish(read_mpidr_el1(),
|
rc = psci_plat_pm_ops->affinst_on_finish(cpu_node->level,
|
||||||
cpu_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
assert(rc == PSCI_E_SUCCESS);
|
assert(rc == PSCI_E_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -405,8 +401,7 @@ static unsigned int psci_afflvl1_on_finish(aff_map_node_t *cluster_node)
|
||||||
* situation.
|
* situation.
|
||||||
*/
|
*/
|
||||||
plat_state = psci_get_phys_state(cluster_node);
|
plat_state = psci_get_phys_state(cluster_node);
|
||||||
return psci_plat_pm_ops->affinst_on_finish(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_on_finish(cluster_node->level,
|
||||||
cluster_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,8 +430,7 @@ static unsigned int psci_afflvl2_on_finish(aff_map_node_t *system_node)
|
||||||
* situation.
|
* situation.
|
||||||
*/
|
*/
|
||||||
plat_state = psci_get_phys_state(system_node);
|
plat_state = psci_get_phys_state(system_node);
|
||||||
return psci_plat_pm_ops->affinst_on_finish(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_on_finish(system_node->level,
|
||||||
system_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,10 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "psci_private.h"
|
#include "psci_private.h"
|
||||||
|
|
||||||
typedef int (*afflvl_suspend_handler_t)(aff_map_node_t *,
|
typedef int (*afflvl_suspend_handler_t)(aff_map_node_t *node,
|
||||||
unsigned long,
|
unsigned long ns_entrypoint,
|
||||||
unsigned long,
|
unsigned long context_id,
|
||||||
unsigned int);
|
unsigned int power_state);
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* This function saves the power state parameter passed in the current PSCI
|
* This function saves the power state parameter passed in the current PSCI
|
||||||
|
@ -161,9 +161,7 @@ static int psci_afflvl0_suspend(aff_map_node_t *cpu_node,
|
||||||
* platform defined mailbox with the psci entrypoint,
|
* platform defined mailbox with the psci entrypoint,
|
||||||
* program the power controller etc.
|
* program the power controller etc.
|
||||||
*/
|
*/
|
||||||
return psci_plat_pm_ops->affinst_suspend(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_suspend(psci_entrypoint,
|
||||||
psci_entrypoint,
|
|
||||||
ns_entrypoint,
|
|
||||||
cpu_node->level,
|
cpu_node->level,
|
||||||
psci_get_phys_state(cpu_node));
|
psci_get_phys_state(cpu_node));
|
||||||
}
|
}
|
||||||
|
@ -198,9 +196,7 @@ static int psci_afflvl1_suspend(aff_map_node_t *cluster_node,
|
||||||
*/
|
*/
|
||||||
plat_state = psci_get_phys_state(cluster_node);
|
plat_state = psci_get_phys_state(cluster_node);
|
||||||
psci_entrypoint = (unsigned long) psci_aff_suspend_finish_entry;
|
psci_entrypoint = (unsigned long) psci_aff_suspend_finish_entry;
|
||||||
return psci_plat_pm_ops->affinst_suspend(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_suspend(psci_entrypoint,
|
||||||
psci_entrypoint,
|
|
||||||
ns_entrypoint,
|
|
||||||
cluster_node->level,
|
cluster_node->level,
|
||||||
plat_state);
|
plat_state);
|
||||||
}
|
}
|
||||||
|
@ -244,9 +240,7 @@ static int psci_afflvl2_suspend(aff_map_node_t *system_node,
|
||||||
*/
|
*/
|
||||||
plat_state = psci_get_phys_state(system_node);
|
plat_state = psci_get_phys_state(system_node);
|
||||||
psci_entrypoint = (unsigned long) psci_aff_suspend_finish_entry;
|
psci_entrypoint = (unsigned long) psci_aff_suspend_finish_entry;
|
||||||
return psci_plat_pm_ops->affinst_suspend(read_mpidr_el1(),
|
return psci_plat_pm_ops->affinst_suspend(psci_entrypoint,
|
||||||
psci_entrypoint,
|
|
||||||
ns_entrypoint,
|
|
||||||
system_node->level,
|
system_node->level,
|
||||||
plat_state);
|
plat_state);
|
||||||
}
|
}
|
||||||
|
@ -415,8 +409,7 @@ static unsigned int psci_afflvl0_suspend_finish(aff_map_node_t *cpu_node)
|
||||||
|
|
||||||
/* Get the physical state of this cpu */
|
/* Get the physical state of this cpu */
|
||||||
plat_state = get_phys_state(state);
|
plat_state = get_phys_state(state);
|
||||||
rc = psci_plat_pm_ops->affinst_suspend_finish(read_mpidr_el1(),
|
rc = psci_plat_pm_ops->affinst_suspend_finish(cpu_node->level,
|
||||||
cpu_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
assert(rc == PSCI_E_SUCCESS);
|
assert(rc == PSCI_E_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -479,8 +472,7 @@ static unsigned int psci_afflvl1_suspend_finish(aff_map_node_t *cluster_node)
|
||||||
|
|
||||||
/* Get the physical state of this cpu */
|
/* Get the physical state of this cpu */
|
||||||
plat_state = psci_get_phys_state(cluster_node);
|
plat_state = psci_get_phys_state(cluster_node);
|
||||||
rc = psci_plat_pm_ops->affinst_suspend_finish(read_mpidr_el1(),
|
rc = psci_plat_pm_ops->affinst_suspend_finish(cluster_node->level,
|
||||||
cluster_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
assert(rc == PSCI_E_SUCCESS);
|
assert(rc == PSCI_E_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -513,8 +505,7 @@ static unsigned int psci_afflvl2_suspend_finish(aff_map_node_t *system_node)
|
||||||
|
|
||||||
/* Get the physical state of the system */
|
/* Get the physical state of the system */
|
||||||
plat_state = psci_get_phys_state(system_node);
|
plat_state = psci_get_phys_state(system_node);
|
||||||
rc = psci_plat_pm_ops->affinst_suspend_finish(read_mpidr_el1(),
|
rc = psci_plat_pm_ops->affinst_suspend_finish(system_node->level,
|
||||||
system_node->level,
|
|
||||||
plat_state);
|
plat_state);
|
||||||
assert(rc == PSCI_E_SUCCESS);
|
assert(rc == PSCI_E_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue