From a28e51016e7715f2baeea18a07cef93a7cb603af Mon Sep 17 00:00:00 2001 From: Joshua Yeong Date: Mon, 13 Oct 2025 23:31:37 +0800 Subject: lib: utils: Add MPXY RPMI mailbox driver for device power Add MPXY RPMI mailbox driver for device power. Signed-off-by: Joshua Yeong Reviewed-by: Rahul Pathak Link: https://lore.kernel.org/r/20251013153138.1574512-3-joshua.yeong@starfivetech.com Signed-off-by: Anup Patel --- include/sbi_utils/mailbox/rpmi_msgprot.h | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'include') diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h index 6b5a553c..4e915a08 100644 --- a/include/sbi_utils/mailbox/rpmi_msgprot.h +++ b/include/sbi_utils/mailbox/rpmi_msgprot.h @@ -218,6 +218,7 @@ enum rpmi_servicegroup_id { RPMI_SRVGRP_CPPC = 0x0006, RPMI_SRVGRP_VOLTAGE = 0x00007, RPMI_SRVGRP_CLOCK = 0x0008, + RPMI_SRVGRP_DEVICE_POWER = 0x0009, RPMI_SRVGRP_ID_MAX_COUNT, /* Reserved range for service groups */ @@ -784,4 +785,48 @@ struct rpmi_clock_get_rate_resp { u32 clock_rate_high; }; +/** RPMI Device Power ServiceGroup Service IDs */ +enum rpmi_dpwr_service_id { + RPMI_DPWR_SRV_ENABLE_NOTIFICATION = 0x01, + RPMI_DPWR_SRV_GET_NUM_DOMAINS = 0x02, + RPMI_DPWR_SRV_GET_ATTRIBUTES = 0x03, + RPMI_DPWR_SRV_SET_STATE = 0x04, + RPMI_DPWR_SRV_GET_STATE = 0x05, + RPMI_DPWR_SRV_MAX_COUNT, +}; + +struct rpmi_dpwr_get_num_domain_resp { + s32 status; + u32 num_domain; +}; + +struct rpmi_dpwr_get_attrs_req { + u32 domain_id; +}; + +struct rpmi_dpwr_get_attrs_resp { + s32 status; + u32 flags; + u32 transition_latency; + u8 name[16]; +}; + +struct rpmi_dpwr_set_state_req { + u32 domain_id; + u32 state; +}; + +struct rpmi_dpwr_set_state_resp { + s32 status; +}; + +struct rpmi_dpwr_get_state_req { + u32 domain_id; +}; + +struct rpmi_dpwr_get_state_resp { + s32 status; + u32 state; +}; + #endif /* !__RPMI_MSGPROT_H__ */ -- cgit v1.2.3