summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorRahul Pathak <[email protected]>2025-06-18 11:08:53 +0530
committerAnup Patel <[email protected]>2025-06-24 08:42:27 +0530
commita5fdef45dbd50d40162852a2b7333135fe3439be (patch)
tree5e17dc8db7a18802b12070d2f02abfc3caaf2357 /lib/utils
parent13abda516928a8823e6b7b65b0a29bb338484227 (diff)
lib: utils: Add Implementation ID and Version as RPMI MPXY attributes
The latest frozen RPMI spec has added Implementation ID and Implementation Version as message protocol specific mpxy attributes. Add support for these. Signed-off-by: Rahul Pathak <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c6
-rw-r--r--lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c15
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c b/lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c
index aad68b5a..fdb04915 100644
--- a/lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c
+++ b/lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c
@@ -523,6 +523,12 @@ static int rpmi_shmem_mbox_get_attribute(struct mbox_chan *chan,
case RPMI_CHANNEL_ATTR_SERVICEGROUP_VERSION:
*((u32 *)out_value) = srvgrp_chan->servicegroup_version;
break;
+ case RPMI_CHANNEL_ATTR_IMPL_ID:
+ *((u32 *)out_value) = mctl->impl_id;
+ break;
+ case RPMI_CHANNEL_ATTR_IMPL_VERSION:
+ *((u32 *)out_value) = mctl->impl_version;
+ break;
default:
return SBI_ENOTSUPP;
}
diff --git a/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c b/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
index 48dfe476..84b7a67d 100644
--- a/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
+++ b/lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c
@@ -213,6 +213,7 @@ static int mpxy_mbox_send_message_withoutresp(struct sbi_mpxy_channel *channel,
int mpxy_rpmi_mbox_init(const void *fdt, int nodeoff, const struct fdt_match *match)
{
u32 channel_id, servicegrp_ver, pro_ver, max_data_len, tx_tout, rx_tout;
+ u32 impl_id, impl_ver;
const struct mpxy_rpmi_mbox_data *data = match->data;
struct mpxy_rpmi_mbox *rmb;
struct mbox_chan *chan;
@@ -270,6 +271,18 @@ int mpxy_rpmi_mbox_init(const void *fdt, int nodeoff, const struct fdt_match *ma
if (rc)
goto fail_free_chan;
+ /* Get channel implementation id */
+ rc = mbox_chan_get_attribute(chan, RPMI_CHANNEL_ATTR_IMPL_ID,
+ &impl_id);
+ if (rc)
+ goto fail_free_chan;
+
+ /* Get channel implementation version */
+ rc = mbox_chan_get_attribute(chan, RPMI_CHANNEL_ATTR_IMPL_VERSION,
+ &impl_ver);
+ if (rc)
+ goto fail_free_chan;
+
/*
* The "riscv,sbi-mpxy-channel-id" DT property is mandatory
* for MPXY RPMI mailbox client driver so if this is not
@@ -316,6 +329,8 @@ int mpxy_rpmi_mbox_init(const void *fdt, int nodeoff, const struct fdt_match *ma
/* RPMI service group attributes */
rmb->msgprot_attrs.servicegrp_id = data->servicegrp_id;
rmb->msgprot_attrs.servicegrp_ver = servicegrp_ver;
+ rmb->msgprot_attrs.impl_id = impl_id;
+ rmb->msgprot_attrs.impl_ver = impl_ver;
rmb->mbox_data = data;
rmb->chan = chan;