aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2014-02-11 09:46:14 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2014-03-12 16:03:32 +0000
commitdbf5789ea66058be431569cc16d88448baafe644 (patch)
treebbf28a185a02ccb9c72427798896625c6c90ae4c
parent0aadcc0f19d19c7bf24cb2695724f26e87841d30 (diff)
juno: Implement SCPI Set CSS Power State command
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--plat/juno/scpi.c11
-rw-r--r--plat/juno/scpi.h9
2 files changed, 20 insertions, 0 deletions
diff --git a/plat/juno/scpi.c b/plat/juno/scpi.c
index 44498e5..6b7d9a7 100644
--- a/plat/juno/scpi.c
+++ b/plat/juno/scpi.c
@@ -112,3 +112,14 @@ int scpi_wait_ready(void)
return response == SCP_OK ? 0 : -1;
}
+
+void scpi_set_css_power_state(unsigned mpidr, scpi_power_state cpu_state,
+ scpi_power_state cluster_state, scpi_power_state css_state)
+{
+ uint32_t state = mpidr & 0x0f; /* CPU ID */
+ state |= (mpidr & 0xf00) >> 4; /* Cluster ID */
+ state |= cpu_state << 8;
+ state |= cluster_state << 12;
+ state |= css_state << 16;
+ scpi_secure_send32(SCPI_CMD_SET_CSS_POWER_STATE, state);
+}
diff --git a/plat/juno/scpi.h b/plat/juno/scpi.h
index 63c6c4a..9d77a92 100644
--- a/plat/juno/scpi.h
+++ b/plat/juno/scpi.h
@@ -58,8 +58,17 @@ typedef uint32_t spci_status;
typedef enum {
SCPI_CMD_SCP_READY = 0x01,
+ SCPI_CMD_SET_CSS_POWER_STATE = 0x04,
} spci_command;
+typedef enum {
+ scpi_power_on = 0,
+ scpi_power_retention = 1,
+ scpi_power_off = 3,
+} scpi_power_state;
+
extern int scpi_wait_ready(void);
+extern void scpi_set_css_power_state(unsigned mpidr, scpi_power_state cpu_state,
+ scpi_power_state cluster_state, scpi_power_state css_state);
#endif /* __SCPI_H__ */