Re: [PATCH v5] lib: utils: Add Logging service group handlers
Anup Patel <[email protected]> Wed, 1 Jul 2026 21:35:06 +0530
| Newsgroups | org.infradead.lists.opensbi |
|---|---|
| Message-ID | <CAK9=C2XzXseep+tV0k7+JuA2Sg1A0BpaRGEHneFZ6qKamWKL=A@mail.gmail.com> |
On Fri, Jun 19, 2026 at 4:05 PM Subrahmanya Lingappa <[email protected]> wrote: > > Add various services of LOGGING service group > > The service is exported on MPXY with RPMI as backend. The patch subject and description is over simplified. I will rewrite this at the time of merging this patch. Applied this patch to the riscv/opensbi repo. Thanks, Anup > > Reviewed-by: Rahul Pathak <[email protected]> > Signed-off-by: Subrahmanya Lingappa <[email protected]> > --- > include/sbi_utils/mailbox/rpmi_msgprot.h | 19 +++++++++ > lib/utils/mpxy/Kconfig | 4 ++ > lib/utils/mpxy/fdt_mpxy_rpmi_logging.c | 51 ++++++++++++++++++++++++ > lib/utils/mpxy/objects.mk | 3 ++ > platform/generic/configs/defconfig | 1 + > 5 files changed, 78 insertions(+) > create mode 100644 lib/utils/mpxy/fdt_mpxy_rpmi_logging.c > > diff --git a/include/sbi_utils/mailbox/rpmi_msgprot.h b/include/sbi_utils/mailbox/rpmi_msgprot.h > index 4fec6402..aeaee575 100644 > --- a/include/sbi_utils/mailbox/rpmi_msgprot.h > +++ b/include/sbi_utils/mailbox/rpmi_msgprot.h > @@ -221,6 +221,7 @@ enum rpmi_servicegroup_id { > RPMI_SRVGRP_DEVICE_POWER = 0x0009, > RPMI_SRVGRP_PERFORMANCE = 0x0000A, > RPMI_SRVGRP_MANAGEMENT_MODE = 0x000B, > + RPMI_SRVGRP_LOGGING = 0x000E, > RPMI_SRVGRP_ID_MAX_COUNT, > > /* Reserved range for service groups */ > @@ -1032,4 +1033,22 @@ struct rpmi_ras_sync_err_resp { > u32 pending_vecs[MAX_PEND_VECS]; > }; > > +/** RPMI LOGGING ServiceGroup Service IDs */ > +enum rpmi_logging_service_id { > + RPMI_LOGGING_SRV_ENABLE_NOTIFICATION = 0x01, > + RPMI_LOGGING_SRV_LOG_DATA = 0x02, > + RPMI_LOGGING_SRV_MAX_COUNT, > +}; > + > +struct rpmi_logging_log_data_req { > + u32 type; > + u32 num_dwords; > +#define MAX_LOGGING_DLEN ((RPMI_MSG_DATA_SIZE(RPMI_SLOT_SIZE_MIN) - (sizeof(u32) * 2)) / sizeof(u32)) > + u32 data[MAX_LOGGING_DLEN]; > +}; > + > +struct rpmi_logging_log_data_resp { > + s32 status; > +}; > + > #endif /* !__RPMI_MSGPROT_H__ */ > diff --git a/lib/utils/mpxy/Kconfig b/lib/utils/mpxy/Kconfig > index 1a38b792..a3ed1c22 100644 > --- a/lib/utils/mpxy/Kconfig > +++ b/lib/utils/mpxy/Kconfig > @@ -18,6 +18,10 @@ config FDT_MPXY_RPMI_CLOCK > bool "MPXY driver for RPMI clock service group" > default n > > +config FDT_MPXY_RPMI_LOGGING > + bool "MPXY driver for RPMI logging service group" > + default n > + > config FDT_MPXY_RPMI_SYSMSI > bool "MPXY driver for RPMI system MSI service group" > default n > diff --git a/lib/utils/mpxy/fdt_mpxy_rpmi_logging.c b/lib/utils/mpxy/fdt_mpxy_rpmi_logging.c > new file mode 100644 > index 00000000..e8f085eb > --- /dev/null > +++ b/lib/utils/mpxy/fdt_mpxy_rpmi_logging.c > @@ -0,0 +1,51 @@ > +/* > + * SPDX-License-Identifier: BSD-2-Clause > + * > + * Copyright (c) 2026 Qualcomm, Inc > + * > + * Authors: > + * Subrahmanya Lingappa <[email protected]> > + */ > + > +#include <sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h> > + > +static struct mpxy_rpmi_service_data logging_services[] = { > + [0] = { > + .id = RPMI_MM_SRV_ENABLE_NOTIFICATION, > + .min_tx_len = sizeof(struct rpmi_enable_notification_req), > + .max_tx_len = sizeof(struct rpmi_enable_notification_req), > + .min_rx_len = sizeof(struct rpmi_enable_notification_resp), > + .max_rx_len = sizeof(struct rpmi_enable_notification_resp), > + }, > + [1] = { > + .id = RPMI_LOGGING_SRV_LOG_DATA, > + .min_tx_len = sizeof(u32) * 2, > + .max_tx_len = sizeof(struct rpmi_logging_log_data_req), > + .min_rx_len = sizeof(struct rpmi_logging_log_data_resp), > + .max_rx_len = sizeof(struct rpmi_logging_log_data_resp), > + }, > + /* > + * Keep a local terminator for safe lookup because only service ID 0x02 > + * is intentionally exposed by this MPXY service group handler. > + */ > + [2] = { > + .id = RPMI_LOGGING_SRV_MAX_COUNT, > + }, > +}; > + > +static const struct mpxy_rpmi_mbox_data logging_data = { > + .servicegrp_id = RPMI_SRVGRP_LOGGING, > + .num_services = RPMI_LOGGING_SRV_MAX_COUNT, > + .service_data = logging_services, > +}; > + > +static const struct fdt_match logging_match[] = { > + { .compatible = "riscv,rpmi-mpxy-logging", .data = &logging_data }, > + { }, > +}; > + > +const struct fdt_driver fdt_mpxy_rpmi_logging = { > + .match_table = logging_match, > + .init = mpxy_rpmi_mbox_init, > + .experimental = true, > +}; > diff --git a/lib/utils/mpxy/objects.mk b/lib/utils/mpxy/objects.mk > index 9cfd86bc..1f1bf0a0 100644 > --- a/lib/utils/mpxy/objects.mk > +++ b/lib/utils/mpxy/objects.mk > @@ -29,3 +29,6 @@ libsbiutils-objs-$(CONFIG_FDT_MPXY_RPMI_DEVICE_POWER) += mpxy/fdt_mpxy_rpmi_devi > > carray-fdt_mpxy_drivers-$(CONFIG_FDT_MPXY_RPMI_MM) += fdt_mpxy_rpmi_mm > libsbiutils-objs-$(CONFIG_FDT_MPXY_RPMI_MM) += mpxy/fdt_mpxy_rpmi_mm.o > + > +carray-fdt_mpxy_drivers-$(CONFIG_FDT_MPXY_RPMI_LOGGING) += fdt_mpxy_rpmi_logging > +libsbiutils-objs-$(CONFIG_FDT_MPXY_RPMI_LOGGING) += mpxy/fdt_mpxy_rpmi_logging.o > diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig > index 01d112c7..b0b6282e 100644 > --- a/platform/generic/configs/defconfig > +++ b/platform/generic/configs/defconfig > @@ -83,3 +83,4 @@ CONFIG_FDT_MPXY_RPMI_DEVICE_POWER=y > CONFIG_FDT_MPXY_RPMI_PERFORMANCE=y > CONFIG_FDT_MPXY_RPMI_SYSMSI=y > CONFIG_FDT_MPXY_RPMI_MM=y > +CONFIG_FDT_MPXY_RPMI_LOGGING=y > -- > 2.43.0 > > > -- > opensbi mailing list > [email protected] > http://lists.infradead.org/mailman/listinfo/opensbi -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi