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

Rahul Pathak <[email protected]> Wed, 17 Jun 2026 14:30:06 +0530
Newsgroups org.infradead.lists.opensbi
Message-ID <CAFR3w35G1=2NVD_RDkdJCXr1X07ytw9zH7Vm6YAjpPVh5zHS4Q@mail.gmail.com>
> +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 <[email protected]>
> + */
> +
> +#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 <[email protected]>

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