Skip to contentSkip to conversation

lib: utils: Add Implementation ID and Version as RPMI MPXY attributes

PATCH Applied Rahul Pathak 2 participants 5 messages Jun 18, 2025 – Jun 24, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 include/sbi_utils/mailbox/rpmi_msgprot.h    |  2 ++
 include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h |  8 +++++++-
 lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c  |  6 ++++++
 lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c         | 15 +++++++++++++++
 4 files changed, 30 insertions(+), 1 deletion(-)
include/sbi_utils/mailbox/rpmi_msgprot.h +2 -0
index e317ba097c17..c79070a6f121 100644
@@ -198,6 +198,8 @@ enum rpmi_channel_attribute_id {
 	RPMI_CHANNEL_ATTR_RX_TIMEOUT,
 	RPMI_CHANNEL_ATTR_SERVICEGROUP_ID,
 	RPMI_CHANNEL_ATTR_SERVICEGROUP_VERSION,
+	RPMI_CHANNEL_ATTR_IMPL_ID,
+	RPMI_CHANNEL_ATTR_IMPL_VERSION,
 	RPMI_CHANNEL_ATTR_MAX,
 };
 
include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h +7 -1
index 068a1a557fe2..3a1c11774851 100644
@@ -22,7 +22,9 @@
 enum mpxy_msgprot_rpmi_attr_id {
 	MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID = SBI_MPXY_ATTR_MSGPROTO_ATTR_START,
 	MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION,
-	MPXY_MSGPROT_RPMI_ATTR_MAX_ID,
+	MPXY_MSGPROT_RPMI_ATTR_IMPL_ID,
+	MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION,
+	MPXY_MSGPROT_RPMI_ATTR_MAX_ID
 };
 
 /**
@@ -33,6 +35,8 @@ enum mpxy_msgprot_rpmi_attr_id {
 struct mpxy_rpmi_channel_attrs {
 	u32 servicegrp_id;
 	u32 servicegrp_ver;
+	u32 impl_id;
+	u32 impl_ver;
 };
 
 /** Make sure all attributes are packed for direct memcpy */
@@ -45,6 +49,8 @@ struct mpxy_rpmi_channel_attrs {
 
 assert_field_offset(servicegrp_id, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID);
 assert_field_offset(servicegrp_ver, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION);
+assert_field_offset(impl_id, MPXY_MSGPROT_RPMI_ATTR_IMPL_ID);
+assert_field_offset(impl_ver, MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION);
 
 /** MPXY RPMI service data for each service group */
 struct mpxy_rpmi_service_data {
lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c +6 -0
index aad68b5a996b..fdb04915ba70 100644
@@ -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;
 	}
lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c +15 -0
index 48dfe4762799..84b7a67dc7a4 100644
@@ -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;
Signature · 7 lines
2.48.1


-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
#1 lore raw

PATCH 2/2 lib: rpmi: Make RPMI drivers as non-experimental

As RPMI v1.0 specification is frozen, disable the
experimental tag for such RPMI drivers.

---
 lib/utils/cppc/fdt_cppc_rpmi.c             | 1 -
 lib/utils/hsm/fdt_hsm_rpmi.c               | 1 -
 lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c | 1 -
 lib/utils/mpxy/fdt_mpxy_rpmi_clock.c       | 1 -
 lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c      | 1 -
 lib/utils/reset/fdt_reset_rpmi.c           | 1 -
 lib/utils/suspend/fdt_suspend_rpmi.c       | 1 -
 7 files changed, 7 deletions(-)
lib/utils/cppc/fdt_cppc_rpmi.c +0 -1
index efcea652f1d6..7bd3b0f90d6a 100644
@@ -370,5 +370,4 @@ static const struct fdt_match rpmi_cppc_match[] = {
 const struct fdt_driver fdt_cppc_rpmi = {
 	.match_table = rpmi_cppc_match,
 	.init = rpmi_cppc_cold_init,
-	.experimental = true,
 };
lib/utils/hsm/fdt_hsm_rpmi.c +0 -1
index cc78436f9a4a..06e4b17976aa 100644
@@ -359,5 +359,4 @@ static const struct fdt_match rpmi_hsm_match[] = {
 const struct fdt_driver fdt_hsm_rpmi = {
 	.match_table = rpmi_hsm_match,
 	.init = rpmi_hsm_cold_init,
-	.experimental = true,
 };
lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c +0 -1
index fdb04915ba70..521e06735873 100644
@@ -819,7 +819,6 @@ struct fdt_mailbox fdt_mailbox_rpmi_shmem = {
 	.driver = {
 		.match_table = rpmi_shmem_mbox_match,
 		.init = rpmi_shmem_mbox_init,
-		.experimental = true,
 	},
 	.xlate = fdt_mailbox_simple_xlate,
 };
lib/utils/mpxy/fdt_mpxy_rpmi_clock.c +0 -1
index 7d2b4a20c934..585c2bf348d5 100644
@@ -83,5 +83,4 @@ static const struct fdt_match clock_match[] = {
 const struct fdt_driver fdt_mpxy_rpmi_clock = {
 	.match_table = clock_match,
 	.init = mpxy_rpmi_mbox_init,
-	.experimental = true,
 };
lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c +0 -1
index b4bab85aeb95..94a5af8cf04d 100644
@@ -205,5 +205,4 @@ static const struct fdt_match sysmsi_match[] = {
 const struct fdt_driver fdt_mpxy_rpmi_sysmsi = {
 	.match_table = sysmsi_match,
 	.init = mpxy_rpmi_mbox_init,
-	.experimental = true,
 };
lib/utils/reset/fdt_reset_rpmi.c +0 -1
index 81b21d0f5dd9..edc53932ccc0 100644
@@ -138,5 +138,4 @@ static const struct fdt_match rpmi_reset_match[] = {
 const struct fdt_driver fdt_reset_rpmi = {
 	.match_table = rpmi_reset_match,
 	.init = rpmi_reset_init,
-	.experimental = true,
 };
lib/utils/suspend/fdt_suspend_rpmi.c +0 -1
index f9baa23c9168..055ab2ff8bb2 100644
@@ -135,5 +135,4 @@ static const struct fdt_match rpmi_suspend_match[] = {
 const struct fdt_driver fdt_suspend_rpmi = {
 	.match_table = rpmi_suspend_match,
 	.init = rpmi_suspend_init,
-	.experimental = true,
 };
Signature · 7 lines
2.48.1


-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
Reviewed-by on v1 2/2 Applied
#2 lore raw

Re: [PATCH 2/2] lib: rpmi: Make RPMI drivers as non-experimental

Quoted 5 lines · Rahul Pathak

As RPMI v1.0 specification is frozen, disable the
experimental tag for such RPMI drivers.

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 90 lines
---
 lib/utils/cppc/fdt_cppc_rpmi.c             | 1 -
 lib/utils/hsm/fdt_hsm_rpmi.c               | 1 -
 lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c | 1 -
 lib/utils/mpxy/fdt_mpxy_rpmi_clock.c       | 1 -
 lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c      | 1 -
 lib/utils/reset/fdt_reset_rpmi.c           | 1 -
 lib/utils/suspend/fdt_suspend_rpmi.c       | 1 -
 7 files changed, 7 deletions(-)
lib/utils/cppc/fdt_cppc_rpmi.c +0 -1
index efcea652f1d6..7bd3b0f90d6a 100644
@@ -370,5 +370,4 @@ static const struct fdt_match rpmi_cppc_match[] = {
 const struct fdt_driver fdt_cppc_rpmi = {
        .match_table = rpmi_cppc_match,
        .init = rpmi_cppc_cold_init,
-       .experimental = true,
 };
lib/utils/hsm/fdt_hsm_rpmi.c +0 -1
index cc78436f9a4a..06e4b17976aa 100644
@@ -359,5 +359,4 @@ static const struct fdt_match rpmi_hsm_match[] = {
 const struct fdt_driver fdt_hsm_rpmi = {
        .match_table = rpmi_hsm_match,
        .init = rpmi_hsm_cold_init,
-       .experimental = true,
 };
lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c +0 -1
index fdb04915ba70..521e06735873 100644
@@ -819,7 +819,6 @@ struct fdt_mailbox fdt_mailbox_rpmi_shmem = {
        .driver = {
                .match_table = rpmi_shmem_mbox_match,
                .init = rpmi_shmem_mbox_init,
-               .experimental = true,
        },
        .xlate = fdt_mailbox_simple_xlate,
 };
lib/utils/mpxy/fdt_mpxy_rpmi_clock.c +0 -1
index 7d2b4a20c934..585c2bf348d5 100644
@@ -83,5 +83,4 @@ static const struct fdt_match clock_match[] = {
 const struct fdt_driver fdt_mpxy_rpmi_clock = {
        .match_table = clock_match,
        .init = mpxy_rpmi_mbox_init,
-       .experimental = true,
 };
lib/utils/mpxy/fdt_mpxy_rpmi_sysmsi.c +0 -1
index b4bab85aeb95..94a5af8cf04d 100644
@@ -205,5 +205,4 @@ static const struct fdt_match sysmsi_match[] = {
 const struct fdt_driver fdt_mpxy_rpmi_sysmsi = {
        .match_table = sysmsi_match,
        .init = mpxy_rpmi_mbox_init,
-       .experimental = true,
 };
lib/utils/reset/fdt_reset_rpmi.c +0 -1
index 81b21d0f5dd9..edc53932ccc0 100644
@@ -138,5 +138,4 @@ static const struct fdt_match rpmi_reset_match[] = {
 const struct fdt_driver fdt_reset_rpmi = {
        .match_table = rpmi_reset_match,
        .init = rpmi_reset_init,
-       .experimental = true,
 };
lib/utils/suspend/fdt_suspend_rpmi.c +0 -2
index f9baa23c9168..055ab2ff8bb2 100644
@@ -135,5 +135,4 @@ static const struct fdt_match rpmi_suspend_match[] = {
 const struct fdt_driver fdt_suspend_rpmi = {
        .match_table = rpmi_suspend_match,
        .init = rpmi_suspend_init,
-       .experimental = true,
 };
--

2.48.1

--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
Reviewed-by on v1 1/2
#3 lore raw
In reply to Rahul Pathak
Quoted 6 lines · Rahul Pathak

The latest frozen RPMI spec has added Implementation ID and Implementation Version as message protocol specific mpxy attributes. Add support for these.

LGTM.

Regards,
Anup

Quoted 118 lines
---
 include/sbi_utils/mailbox/rpmi_msgprot.h    |  2 ++
 include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h |  8 +++++++-
 lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c  |  6 ++++++
 lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c         | 15 +++++++++++++++
 4 files changed, 30 insertions(+), 1 deletion(-)
include/sbi_utils/mailbox/rpmi_msgprot.h +2 -0
index e317ba097c17..c79070a6f121 100644
@@ -198,6 +198,8 @@ enum rpmi_channel_attribute_id {
        RPMI_CHANNEL_ATTR_RX_TIMEOUT,
        RPMI_CHANNEL_ATTR_SERVICEGROUP_ID,
        RPMI_CHANNEL_ATTR_SERVICEGROUP_VERSION,
+       RPMI_CHANNEL_ATTR_IMPL_ID,
+       RPMI_CHANNEL_ATTR_IMPL_VERSION,
        RPMI_CHANNEL_ATTR_MAX,
 };
 
include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h +7 -1
index 068a1a557fe2..3a1c11774851 100644
@@ -22,7 +22,9 @@
 enum mpxy_msgprot_rpmi_attr_id {
        MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID = SBI_MPXY_ATTR_MSGPROTO_ATTR_START,
        MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION,
-       MPXY_MSGPROT_RPMI_ATTR_MAX_ID,
+       MPXY_MSGPROT_RPMI_ATTR_IMPL_ID,
+       MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION,
+       MPXY_MSGPROT_RPMI_ATTR_MAX_ID
 };
 
 /**
@@ -33,6 +35,8 @@ enum mpxy_msgprot_rpmi_attr_id {
 struct mpxy_rpmi_channel_attrs {
        u32 servicegrp_id;
        u32 servicegrp_ver;
+       u32 impl_id;
+       u32 impl_ver;
 };
 
 /** Make sure all attributes are packed for direct memcpy */
@@ -45,6 +49,8 @@ struct mpxy_rpmi_channel_attrs {
 
 assert_field_offset(servicegrp_id, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID);
 assert_field_offset(servicegrp_ver, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION);
+assert_field_offset(impl_id, MPXY_MSGPROT_RPMI_ATTR_IMPL_ID);
+assert_field_offset(impl_ver, MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION);
 
 /** MPXY RPMI service data for each service group */
 struct mpxy_rpmi_service_data {
lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c +6 -0
index aad68b5a996b..fdb04915ba70 100644
@@ -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;
        }
lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c +15 -1
index 48dfe4762799..84b7a67dc7a4 100644
@@ -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;
--

2.48.1

--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
Applied
#4 lore raw
In reply to Rahul Pathak
Quoted 6 lines · Rahul Pathak

The latest frozen RPMI spec has added Implementation ID and Implementation Version as message protocol specific mpxy attributes. Add support for these.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 118 lines
---
 include/sbi_utils/mailbox/rpmi_msgprot.h    |  2 ++
 include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h |  8 +++++++-
 lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c  |  6 ++++++
 lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c         | 15 +++++++++++++++
 4 files changed, 30 insertions(+), 1 deletion(-)
include/sbi_utils/mailbox/rpmi_msgprot.h +2 -0
index e317ba097c17..c79070a6f121 100644
@@ -198,6 +198,8 @@ enum rpmi_channel_attribute_id {
        RPMI_CHANNEL_ATTR_RX_TIMEOUT,
        RPMI_CHANNEL_ATTR_SERVICEGROUP_ID,
        RPMI_CHANNEL_ATTR_SERVICEGROUP_VERSION,
+       RPMI_CHANNEL_ATTR_IMPL_ID,
+       RPMI_CHANNEL_ATTR_IMPL_VERSION,
        RPMI_CHANNEL_ATTR_MAX,
 };
 
include/sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h +7 -1
index 068a1a557fe2..3a1c11774851 100644
@@ -22,7 +22,9 @@
 enum mpxy_msgprot_rpmi_attr_id {
        MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID = SBI_MPXY_ATTR_MSGPROTO_ATTR_START,
        MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION,
-       MPXY_MSGPROT_RPMI_ATTR_MAX_ID,
+       MPXY_MSGPROT_RPMI_ATTR_IMPL_ID,
+       MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION,
+       MPXY_MSGPROT_RPMI_ATTR_MAX_ID
 };
 
 /**
@@ -33,6 +35,8 @@ enum mpxy_msgprot_rpmi_attr_id {
 struct mpxy_rpmi_channel_attrs {
        u32 servicegrp_id;
        u32 servicegrp_ver;
+       u32 impl_id;
+       u32 impl_ver;
 };
 
 /** Make sure all attributes are packed for direct memcpy */
@@ -45,6 +49,8 @@ struct mpxy_rpmi_channel_attrs {
 
 assert_field_offset(servicegrp_id, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_ID);
 assert_field_offset(servicegrp_ver, MPXY_MSGPROT_RPMI_ATTR_SERVICEGROUP_VERSION);
+assert_field_offset(impl_id, MPXY_MSGPROT_RPMI_ATTR_IMPL_ID);
+assert_field_offset(impl_ver, MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION);
 
 /** MPXY RPMI service data for each service group */
 struct mpxy_rpmi_service_data {
lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c +6 -0
index aad68b5a996b..fdb04915ba70 100644
@@ -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;
        }
lib/utils/mpxy/fdt_mpxy_rpmi_mbox.c +15 -1
index 48dfe4762799..84b7a67dc7a4 100644
@@ -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;
--

2.48.1

--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi