[PATCH v3] lib: utils: Add Logging service group handlers

Rahul Pathak rahul.pathak at oss.qualcomm.com
Wed Jun 17 02:00:06 PDT 2026


> +struct rpmi_logging_log_data_req {
> +       u32 type;
> +       u32 len;
> +#define MAX_LOGGING_DLEN  ((RPMI_MSG_DATA_SIZE(RPMI_SLOT_SIZE_MIN) - (sizeof(u32) * 2)) / sizeof(u32))
> +       u32 data[MAX_LOGGING_DLEN];
> +};
NIT: Either add a comment or change the name of the field like the
spec "num_words" to
highlight that "len" and "DLEN" are not bytes but rather words.

> +
> +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..dbbe33ae
> --- /dev/null
> +++ b/lib/utils/mpxy/fdt_mpxy_rpmi_logging.c
> @@ -0,0 +1,44 @@
> +/*
> + * SPDX-License-Identifier: BSD-2-Clause
> + *
> + * Copyright (c) 2026 Qualcomm, Inc
> + *
> + * Authors:
> + *   Subrahmanya Lingappa <subrahmanya.lingappa at oss.qualcomm.com>
> + */
> +
> +#include <sbi_utils/mpxy/fdt_mpxy_rpmi_mbox.h>
> +
> +static struct mpxy_rpmi_service_data logging_services[] = {
> +       [0] = {
> +               .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 = 4,
Instead of hardcoding, this can also be simply 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.
> +        */

With minor comments -

Reviewed-by: Rahul Pathak <rahul.pathak at oss.qualcomm.com>



More information about the opensbi mailing list