mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-11-21 02:52:15 +00:00
lib: utils/mpxy: Rename fdt_mpxy_rpmi_mbox to fdt_mpxy_rpmi
The common fdt_mpxy_rpmi_mbox driver is being upgraded to support emulated MPXY channels hence drop term "mbox" from fdt_mpxy_rpmi_mbox everywhere. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Reviewed-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com> Tested-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260923032359.4041876-2-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
1 parent
fde5dfe96f
commit
0298a2c343
12 files changed
+76
-84
No files matched your search
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2024 Ventana Micro Systems Inc.
|
||||
*
|
||||
* Authors:
|
||||
* Anup Patel <apatel@ventanamicro.com>
|
||||
*/
|
||||
|
||||
#ifndef __FDT_MPXY_RPMI_H__
|
||||
#define __FDT_MPXY_RPMI_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
#include <sbi/sbi_mpxy.h>
|
||||
#include <sbi_utils/mailbox/fdt_mailbox.h>
|
||||
#include <sbi_utils/mailbox/rpmi_msgprot.h>
|
||||
#include <sbi_utils/mpxy/fdt_mpxy.h>
|
||||
|
||||
/** Convert the mpxy attribute ID to attribute array index */
|
||||
#define attr_id2index(attr_id) (attr_id - SBI_MPXY_ATTR_MSGPROTO_ATTR_START)
|
||||
|
||||
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_IMPL_ID,
|
||||
MPXY_MSGPROT_RPMI_ATTR_IMPL_VERSION,
|
||||
MPXY_MSGPROT_RPMI_ATTR_MAX_ID
|
||||
};
|
||||
|
||||
/**
|
||||
* MPXY message protocol attributes for RPMI
|
||||
* Order of attribute fields must follow the
|
||||
* attribute IDs in `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 */
|
||||
#define assert_field_offset(field, attr_offset) \
|
||||
_Static_assert( \
|
||||
((offsetof(struct mpxy_rpmi_channel_attrs, field)) / \
|
||||
sizeof(u32)) == (attr_offset - SBI_MPXY_ATTR_MSGPROTO_ATTR_START),\
|
||||
"field " #field \
|
||||
" from struct mpxy_rpmi_channel_attrs invalid offset, expected " #attr_offset)
|
||||
|
||||
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 {
|
||||
u8 id;
|
||||
u32 min_tx_len;
|
||||
u32 max_tx_len;
|
||||
u32 min_rx_len;
|
||||
u32 max_rx_len;
|
||||
};
|
||||
|
||||
/** MPXY RPMI data for each service group */
|
||||
struct mpxy_rpmi_data {
|
||||
u32 servicegrp_id;
|
||||
u32 num_services;
|
||||
struct mpxy_rpmi_service_data *service_data;
|
||||
|
||||
/** Transfer RPMI service group message */
|
||||
int (*xfer_group)(void *context, struct mbox_chan *chan,
|
||||
struct mbox_xfer *xfer);
|
||||
|
||||
/** Setup RPMI service group context for MPXY */
|
||||
int (*setup_group)(void **context, struct mbox_chan *chan,
|
||||
const struct mpxy_rpmi_data *data);
|
||||
|
||||
/** Cleanup RPMI service group context for MPXY */
|
||||
void (*cleanup_group)(void *context);
|
||||
};
|
||||
|
||||
/** Common probe function for MPXY RPMI drivers */
|
||||
int fdt_mpxy_rpmi_init(const void *fdt, int nodeoff, const struct fdt_match *match);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user