From 6a26726e08e4d1e23b2e6cce073689ecdabf9291 Mon Sep 17 00:00:00 2001 From: Rahul Pathak Date: Tue, 6 Aug 2024 10:24:19 +0530 Subject: lib/utils: reset: Add RPMI System Reset driver Add RPMI based driver for system reset and enable it in the generic platform defconfig Signed-off-by: Rahul Pathak Signed-off-by: Anup Patel --- include/sbi_utils/mailbox/rpmi_msgprot.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include') diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h index f9f65447..31c3034b 100644 --- a/include/sbi_utils/mailbox/rpmi_msgprot.h +++ b/include/sbi_utils/mailbox/rpmi_msgprot.h @@ -196,6 +196,7 @@ struct rpmi_message_args { enum rpmi_servicegroup_id { RPMI_SRVGRP_ID_MIN = 0, RPMI_SRVGRP_BASE = 0x0001, + RPMI_SRVGRP_SYSTEM_RESET = 0x0002, RPMI_SRVGRP_ID_MAX_COUNT, /* Reserved range for service groups */ @@ -252,4 +253,30 @@ struct rpmi_base_get_platform_info_resp { char plat_info[]; }; +/** RPMI System Reset ServiceGroup Service IDs */ +enum rpmi_system_reset_service_id { + RPMI_SYSRST_SRV_ENABLE_NOTIFICATION = 0x01, + RPMI_SYSRST_SRV_GET_ATTRIBUTES = 0x02, + RPMI_SYSRST_SRV_SYSTEM_RESET = 0x03, + RPMI_SYSRST_SRV_ID_MAX_COUNT, +}; + +/** RPMI System Reset types */ +enum rpmi_sysrst_reset_type { + RPMI_SYSRST_TYPE_SHUTDOWN = 0x0, + RPMI_SYSRST_TYPE_COLD_REBOOT = 0x1, + RPMI_SYSRST_TYPE_WARM_REBOOT = 0x2, + RPMI_SYSRST_TYPE_MAX, +}; + +#define RPMI_SYSRST_ATTRS_FLAGS_RESETTYPE_POS (1) +#define RPMI_SYSRST_ATTRS_FLAGS_RESETTYPE_MASK \ + (1U << RPMI_SYSRST_ATTRS_FLAGS_RESETTYPE_POS) + +/** Response for system reset attributes */ +struct rpmi_sysrst_get_reset_attributes_resp { + s32 status; + u32 flags; +}; + #endif /* !__RPMI_MSGPROT_H__ */ -- cgit v1.3.1