diff options
author | Aaron Durbin <adurbin@chromium.org> | 2014-10-30 13:13:50 -0500 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-10 12:01:29 +0200 |
commit | 0179fcfaab2fdbff0da00bf76be08e913d5a0f47 (patch) | |
tree | 7e7583044408b51c426215cb4d743f0a64e94725 /src/arch/arm64/include | |
parent | 6cdacb37f0e84666831d78f4bf9af2cbc30cbb81 (diff) |
arm64: Implement PSCI command support
Provide support for SoCs to participate in PSCI commands.
There are 2 steps to a command:
1. prepare() - look at request and adjust state accordingly
2. commit() - take action on the command
The prepare() function is called with psci locks held while
the commit() function is called with the locks dropped.
No SoC implements the appropriate logic yet.
BUG=chrome-os-partner:32136
BRANCH=None
TEST=Booted PSCI kernel -- no SMP because cmd_prepare()
knowingly fails. Spintable kernel still brings up both
CPUs.
Change-Id: I2ae4d1c3f3eac4d1060c1b41472909933815d078
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 698d38b53bbc2bc043548792cea7219542b5fe6b
Original-Change-Id: I0821dc2ee8dc6bd1e8bc1c10f8b98b10e24fc97e
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/226485
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/9423
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/arch/arm64/include')
-rw-r--r-- | src/arch/arm64/include/arch/psci.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/arch/arm64/include/arch/psci.h b/src/arch/arm64/include/arch/psci.h index 555333a44d..b408f3d28c 100644 --- a/src/arch/arm64/include/arch/psci.h +++ b/src/arch/arm64/include/arch/psci.h @@ -104,12 +104,47 @@ static inline int psci_root_node(const struct psci_node *n) return psci_node_parent(n) == NULL; } +enum { + PSCI_CMD_ON, + PSCI_CMD_OFF, + PSCI_CMD_STANDBY, +}; + +/* + * PSCI actions are serialized into a command for the SoC to process. There are + * 2 phases of a command being processed: prepare and commit. The prepare() is + * called with the PSCI locks held for the state of the PSCI nodes. If + * successful, the appropriate locks will be dropped and commit() will be + * called with the same structure. It is permissible for the SoC support code + * to modify the struture passed in (e.g. to update the requested state_id to + * reflect dynamic constraints on how deep of a state to enter). + */ +struct psci_cmd { + /* Command type. */ + int type; + /* + * PSCI state id for PSCI_CMD_OFF and PSCI_CMD_STANDBY commands. + * A value of -1 indicates a CPU_OFF request. + */ + int state_id; + /* + * target is the command's target, but it can affect up to the + * ancestor entity. If target == ancestor then it only affects + * target, otherwise all entites up the hierarchy including ancestor. + */ + struct psci_node *target; + struct psci_node *ancestor; +}; + struct psci_soc_ops { /* * Return number of entities one level below given parent affinitly * level and mpidr. */ size_t (*children_at_level)(int parent_level, uint64_t mpidr); + + int (*cmd_prepare)(struct psci_cmd *cmd); + int (*cmd_commit)(struct psci_cmd *cmd); }; /* Each SoC needs to provide the functions in the psci_soc_ops structure. */ |