public inbox for opensbi@lists.infradead.org
 help / color / mirror / Atom feed
From: "David E. Garcia Porras" <david.garcia@aheadcomputing.com>
To: opensbi@lists.infradead.org
Cc: "David E. Garcia Porras" <david.garcia@aheadcomputing.com>
Subject: [PATCH 2/2] include: mailbox: Update RPMI notification structs and add Performance event definitions
Date: Thu,  9 Apr 2026 08:57:16 -0600	[thread overview]
Message-ID: <20260409145716.2611852-3-david.garcia@aheadcomputing.com> (raw)
In-Reply-To: <20260409145716.2611852-1-david.garcia@aheadcomputing.com>

Add RPMI notification header size and offset macros, and event header
composition macro. Add rpmi_event_notification_state enum with disable,
enable, and return current state IDs. Add req_state field to
rpmi_enable_notification_req and current_state field to
rpmi_enable_notification_resp for RPMI spec compliance.

Add notification event ID enum and data structures for RPMI Performance
service group events: power change, limit change, and level change.

Signed-off-by: David E. Garcia Porras <david.garcia@aheadcomputing.com>
---
 include/sbi_utils/mailbox/rpmi_msgprot.h | 49 ++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h
index c35788f0..8526ace3 100644
--- a/include/sbi_utils/mailbox/rpmi_msgprot.h
+++ b/include/sbi_utils/mailbox/rpmi_msgprot.h
@@ -87,6 +87,18 @@
 #define RPMI_DEF_TX_TIMEOUT			20
 #define RPMI_DEF_RX_TIMEOUT			20
 
+/** RPMI Notification header size */
+#define RPMI_NOTIF_HDR_SIZE 16
+
+/** RPMI Notification header offsets */
+#define RPMI_NOTIF_HDR_REMAINING_OFFSET 0x00
+#define RPMI_NOTIF_HDR_RETURNED_OFFSET 0x04
+#define RPMI_NOTIF_HDR_LOST_OFFSET 0x08
+#define RPMI_NOTIF_HDR_RESERVED_OFFSET 0x0C
+
+/** RPMI Notification event header constructor */
+#define RPMI_NOTIF_EVENT_HDR(eid, dlen) ((u32)(eid) << 16) | ((u32)(dlen) & 0xFFFF)
+
 /**
  * Common macro to generate composite version from major
  * and minor version numbers.
@@ -232,14 +244,24 @@ enum rpmi_servicegroup_id {
 	RPMI_SRVGRP_VENDOR_END = 0xFFFF,
 };
 
+/** RPMI event notification state IDs */
+enum rpmi_event_notification_state {
+	RPMI_EVENT_NOTIF_DISABLE_STATE = 0,
+	RPMI_EVENT_NOTIF_ENABLE_STATE = 1,
+	RPMI_EVENT_NOTIF_RET_CURR_STATE = 2,
+	RPMI_EVENT_NOTIF_MAX_COUNT = 3,
+};
+
 /** RPMI enable notification request */
 struct rpmi_enable_notification_req {
 	u32 eventid;
+	u32 req_state;
 };
 
 /** RPMI enable notification response */
 struct rpmi_enable_notification_resp {
 	s32 status;
+	u32 current_state;
 };
 
 /** RPMI Base ServiceGroup Service IDs */
@@ -846,6 +868,33 @@ enum rpmi_performance_service_id {
 	RPMI_PERF_SRV_MAX_COUNT,
 };
 
+/** RPMI Performance ServiceGroup Notification Event IDs */
+enum rpmi_performance_event_id {
+	RPMI_PERF_EVENT_POWER_CHANGE = 0x01,
+	RPMI_PERF_EVENT_LIMIT_CHANGE = 0x02,
+	RPMI_PERF_EVENT_LEVEL_CHANGE = 0x03,
+	RPMI_PERF_EVENT_MAX_COUNT,
+};
+
+/** RPMI Performance power change notification data */
+struct rpmi_perf_event_power_change {
+	u32 domain_id;
+	u32 power_uw;
+};
+
+/** RPMI Performance limit change notification data */
+struct rpmi_perf_event_limit_change {
+	u32 domain_id;
+	u32 max_level;
+	u32 min_level;
+};
+
+/** RPMI Performance level change notification data */
+struct rpmi_perf_event_level_change {
+	u32 domain_id;
+	u32 level;
+};
+
 struct rpmi_perf_get_num_domain_resp {
 	s32 status;
 	u32 num_domains;
-- 
2.43.0


-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

      parent reply	other threads:[~2026-04-09 14:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 14:57 [PATCH 0/2] MPXY MSI availability and RPMI notification updates David E. Garcia Porras
2026-04-09 14:57 ` [PATCH 1/2] lib: sbi_mpxy: Enable MPXY channel MSI availability determination David E. Garcia Porras
2026-04-09 14:57 ` David E. Garcia Porras [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260409145716.2611852-3-david.garcia@aheadcomputing.com \
    --to=david.garcia@aheadcomputing.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox