OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <apatel@ventanamicro.com>
To: Atish Patra <atishp@rivosinc.com>
Cc: Andrew Jones <ajones@ventanamicro.com>,
	Anup Patel <anup@brainfault.org>,
	opensbi@lists.infradead.org, Anup Patel <apatel@ventanamicro.com>
Subject: [PATCH 4/4] lib: utils/mpxy: Remove p2a_db_index from RPMI system MSI attributes
Date: Mon, 12 May 2025 14:08:27 +0530	[thread overview]
Message-ID: <20250512083827.804151-5-apatel@ventanamicro.com> (raw)
In-Reply-To: <20250512083827.804151-1-apatel@ventanamicro.com>

The discovery of P2A doorbell system MSI index is now through RPMI
shared memory DT node so remove p2a_db_index from RPMI system MSI
attributes and access it as a mailbox channel attribute.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
 include/sbi_utils/mailbox/rpmi_msgprot.h |  1 -
 lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c    | 13 +++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h
index 058b7e90..e0d73882 100644
--- a/include/sbi_utils/mailbox/rpmi_msgprot.h
+++ b/include/sbi_utils/mailbox/rpmi_msgprot.h
@@ -285,7 +285,6 @@ enum rpmi_sysmsi_service_id {
 struct rpmi_sysmsi_get_attributes_resp {
 	s32 status;
 	u32 sys_num_msi;
-	u32 p2a_db_index;
 	u32 flag0;
 	u32 flag1;
 };
diff --git a/lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c b/lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c
index 87e6aa53..b4bab85a 100644
--- a/lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c
+++ b/lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c
@@ -32,10 +32,9 @@ static int mpxy_rpmi_sysmis_xfer(void *context, struct mbox_chan *chan,
 	case RPMI_SYSMSI_SRV_GET_ATTRIBUTES:
 		((u32 *)xfer->rx)[0] = cpu_to_le32(RPMI_SUCCESS);
 		((u32 *)xfer->rx)[1] = cpu_to_le32(smg->sys_num_msi);
-		((u32 *)xfer->rx)[2] = -1U;
+		((u32 *)xfer->rx)[2] = 0;
 		((u32 *)xfer->rx)[3] = 0;
-		((u32 *)xfer->rx)[4] = 0;
-		args->rx_data_len = 5 * sizeof(u32);
+		args->rx_data_len = 4 * sizeof(u32);
 		break;
 	case RPMI_SYSMSI_SRV_GET_MSI_ATTRIBUTES:
 	case RPMI_SYSMSI_SRV_SET_MSI_STATE:
@@ -90,8 +89,14 @@ static int mpxy_rpmi_sysmsi_setup(void **context, struct mbox_chan *chan,
 	struct rpmi_sysmsi_get_msi_attributes_req gmareq;
 	struct rpmi_sysmsi_get_attributes_resp garesp;
 	struct mpxy_rpmi_sysmsi *smg;
+	u32 p2a_db_index;
 	int rc, i;
 
+	rc = mbox_chan_get_attribute(chan, RPMI_CHANNEL_ATTR_P2A_DOORBELL_SYSMSI_INDEX,
+				     &p2a_db_index);
+	if (rc)
+		return rc;
+
 	rc = rpmi_normal_request_with_status(chan, RPMI_SYSMSI_SRV_GET_ATTRIBUTES,
 					     NULL, 0, 0, &garesp, rpmi_u32_count(garesp),
 					     rpmi_u32_count(garesp));
@@ -122,7 +127,7 @@ static int mpxy_rpmi_sysmsi_setup(void **context, struct mbox_chan *chan,
 			return rc;
 		}
 
-		if (garesp.p2a_db_index == i ||
+		if (p2a_db_index == i ||
 		    (gmaresp.flag0 & RPMI_SYSMSI_MSI_ATTRIBUTES_FLAG0_PREF_PRIV))
 			bitmap_set(smg->sys_msi_denied_bmap, i, 1);
 	}
-- 
2.43.0


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

  parent reply	other threads:[~2025-05-12  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12  8:38 [PATCH 0/4] Driver updates to match frozen RPMI specification Anup Patel
2025-05-12  8:38 ` [PATCH 1/4] lib: utils/mailbox: Update DT register name of A2P doorbell Anup Patel
2025-05-12  8:38 ` [PATCH 2/4] lib: utils/mailbox: Parse P2A doorbell system MSI index from DT Anup Patel
2025-05-12  8:38 ` [PATCH 3/4] lib: utils/mailbox: Parse A2P doorbell value " Anup Patel
2025-05-12  8:38 ` Anup Patel [this message]
2025-05-20  5:49 ` [PATCH 0/4] Driver updates to match frozen RPMI specification Anup Patel

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=20250512083827.804151-5-apatel@ventanamicro.com \
    --to=apatel@ventanamicro.com \
    --cc=ajones@ventanamicro.com \
    --cc=anup@brainfault.org \
    --cc=atishp@rivosinc.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