summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSubrahmanya Lingappa <[email protected]>2024-08-06 10:29:32 +0530
committerAnup Patel <[email protected]>2024-12-06 09:26:32 +0530
commit13f55f33a1d361784fd250b9e3897918b7ae82d4 (patch)
tree4846b41045c97c55861414f913d44621f06efbbc /include
parent3676324b0e13b97f2f56507434034833877afc08 (diff)
lib: utils/suspend: Add RPMI system suspend driver
Add RPMI based system suspend driver. To test this, execute the follwoing in Linux: $ echo mem > /sys/power/state To wake up, execute the following command on qemu monitor terminal: (qemu) system_wakeup Signed-off-by: Subrahmanya Lingappa <[email protected]> Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/mailbox/rpmi_msgprot.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h
index 31c3034b..4de86adf 100644
--- a/include/sbi_utils/mailbox/rpmi_msgprot.h
+++ b/include/sbi_utils/mailbox/rpmi_msgprot.h
@@ -5,6 +5,7 @@
*
* Authors:
* Rahul Pathak <[email protected]>
+ * Subrahmanya Lingappa <[email protected]>
*/
#ifndef __RPMI_MSGPROT_H__
@@ -197,6 +198,7 @@ enum rpmi_servicegroup_id {
RPMI_SRVGRP_ID_MIN = 0,
RPMI_SRVGRP_BASE = 0x0001,
RPMI_SRVGRP_SYSTEM_RESET = 0x0002,
+ RPMI_SRVGRP_SYSTEM_SUSPEND = 0x0003,
RPMI_SRVGRP_ID_MAX_COUNT,
/* Reserved range for service groups */
@@ -279,4 +281,37 @@ struct rpmi_sysrst_get_reset_attributes_resp {
u32 flags;
};
+/** RPMI System Suspend ServiceGroup Service IDs */
+enum rpmi_system_suspend_service_id {
+ RPMI_SYSSUSP_SRV_ENABLE_NOTIFICATION = 0x01,
+ RPMI_SYSSUSP_SRV_GET_ATTRIBUTES = 0x02,
+ RPMI_SYSSUSP_SRV_SYSTEM_SUSPEND = 0x03,
+ RPMI_SYSSUSP_SRV_ID_MAX_COUNT,
+};
+
+/** Request for system suspend attributes */
+struct rpmi_syssusp_get_attr_req {
+ u32 susp_type;
+};
+
+#define RPMI_SYSSUSP_ATTRS_FLAGS_RESUMEADDR (1U << 1)
+#define RPMI_SYSSUSP_ATTRS_FLAGS_SUSPENDTYPE 1U
+
+/** Response for system suspend attributes */
+struct rpmi_syssusp_get_attr_resp {
+ s32 status;
+ u32 flags;
+};
+
+struct rpmi_syssusp_suspend_req {
+ u32 hartid;
+ u32 suspend_type;
+ u32 resume_addr_lo;
+ u32 resume_addr_hi;
+};
+
+struct rpmi_syssusp_suspend_resp {
+ s32 status;
+};
+
#endif /* !__RPMI_MSGPROT_H__ */