firmware: arm_scmi: Add system power protocol support

Add bare protocol support for SCMI system power protocol as needed by
an OSPM agent: basic initialization and SYSTEM_POWER_STATE_NOTIFIER
core notification support.

No event-handling logic is attached to such notification..

Link: https://lore.kernel.org/r/20200907174657.32466-2-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Cristian Marussi 2020-09-07 18:46:55 +01:00 committed by Sudeep Holla
parent 3de7b83017
commit a880305512
3 changed files with 155 additions and 1 deletions

View file

@ -292,6 +292,7 @@ struct scmi_handle {
void *sensor_priv;
void *reset_priv;
void *notify_priv;
void *system_priv;
};
enum scmi_std_protocol {
@ -304,6 +305,15 @@ enum scmi_std_protocol {
SCMI_PROTOCOL_RESET = 0x16,
};
enum scmi_system_events {
SCMI_SYSTEM_SHUTDOWN,
SCMI_SYSTEM_COLDRESET,
SCMI_SYSTEM_WARMRESET,
SCMI_SYSTEM_POWERUP,
SCMI_SYSTEM_SUSPEND,
SCMI_SYSTEM_MAX
};
struct scmi_device {
u32 id;
u8 protocol_id;
@ -378,6 +388,7 @@ enum scmi_notification_events {
SCMI_EVENT_SENSOR_TRIP_POINT_EVENT = 0x0,
SCMI_EVENT_RESET_ISSUED = 0x0,
SCMI_EVENT_BASE_ERROR_EVENT = 0x0,
SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER = 0x0,
};
struct scmi_power_state_changed_report {
@ -387,6 +398,13 @@ struct scmi_power_state_changed_report {
unsigned int power_state;
};
struct scmi_system_power_state_notifier_report {
ktime_t timestamp;
unsigned int agent_id;
unsigned int flags;
unsigned int system_state;
};
struct scmi_perf_limits_report {
ktime_t timestamp;
unsigned int agent_id;