mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-11-19 18:21:41 +00:00
sbi_utils: mpxy: Add FDT-based MPXY RPMI bridge driver
Introduce an FDT-configured MPXY RPMI bridge driver that enables
cooperative message passing between two SBI domains sharing the
same physical hart via domain context switching.
MPXY channels are registered at runtime when the named domains
appear via the domain registration notifier:
- src_ch: used by the source domain to send messages
- dst_ch: used by the destination domain to retrieve and
complete forwarded messages via RPMI REQFWD service group
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Oza Pawandeep <pawandeep.oza@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20261118215549.2499040-4-pawandeep.oza@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
1 parent
f3b940b112
commit
af43217332
7 files changed
+1054
No files matched your search
@@ -0,0 +1,61 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
/*
|
||||
* Copyright (c) 2026 Qualcomm, Inc
|
||||
*
|
||||
* Authors:
|
||||
* Pawandeep Oza <pawandeep.oza@oss.qualcomm.com>
|
||||
*/
|
||||
|
||||
#ifndef __FDT_MPXY_BRIDGE_H__
|
||||
#define __FDT_MPXY_BRIDGE_H__
|
||||
|
||||
#include <sbi/sbi_console.h>
|
||||
#include <sbi/sbi_types.h>
|
||||
#include <sbi/sbi_domain.h>
|
||||
#include <sbi/sbi_string.h>
|
||||
#include <sbi_utils/mpxy/fdt_mpxy_rpmi.h>
|
||||
|
||||
#define SBI_MPXY_BRIDGE_DEFAULT_MSG_DATA_MAXLEN 4096
|
||||
#define SBI_MPXY_BRIDGE_DOMAIN_NAME_MAXLEN 64
|
||||
|
||||
struct mpxy_bridge_source;
|
||||
|
||||
struct mpxy_bridge_dst_ctx {
|
||||
void *respbuf;
|
||||
u32 resp_bufsize;
|
||||
unsigned long *resp_len_ptr;
|
||||
u32 start_index;
|
||||
};
|
||||
|
||||
struct mpxy_bridge_src_ctx {
|
||||
struct rpmi_message_header header;;
|
||||
bool occupied;
|
||||
bool retrieved;
|
||||
bool completed;
|
||||
void *msgbuf;
|
||||
void *respbuf;
|
||||
u32 msg_len;
|
||||
u32 resp_bufsize;
|
||||
u32 resp_length;
|
||||
};
|
||||
|
||||
struct mpxy_bridge_source_driver {
|
||||
const struct fdt_match *match_table;
|
||||
int (*probe)(const void *fdt,
|
||||
int nodeoff, const struct fdt_match *match);
|
||||
};
|
||||
|
||||
struct mpxy_bridge_source_ops {
|
||||
int (*xfer) (struct mpxy_bridge_src_ctx *src,
|
||||
struct mpxy_bridge_dst_ctx *dst);
|
||||
int (*complete) (struct mpxy_bridge_src_ctx *src,
|
||||
void *msgbuf, u32 msg_len);
|
||||
};
|
||||
|
||||
int mpxy_bridge_register_source(const void *fdt, int nodeoff,
|
||||
const struct mpxy_bridge_source_ops *ops,
|
||||
struct mpxy_rpmi_service_data *srvcdata,
|
||||
u32 num_services,
|
||||
enum rpmi_servicegroup_id srvgrpid);
|
||||
|
||||
#endif /* __FDT_MPXY_BRIDGE_H__ */
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef __MPXY_RPMI_BRIDGE_SRC_H__
|
||||
#define __MPXY_RPMI_BRIDGE_SRC_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
struct sbi_rpmi_bridge_src {
|
||||
const char *compatible;
|
||||
int (*probe)(const void *fdt, int nodeoff);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user