mirror of
https://github.com/apache/nuttx.git
synced 2026-03-23 13:14:50 +08:00
openamp: add patch for VIRTIO_RPMSG_F_BUFADDR buffer address support
Add open-amp patch 0019 to extend fw_rsc_config with h2r_buf_addr and r2h_buf_addr fields, allowing the host and remote sides to specify buffer physical addresses through the resource table. This enables splitting the shared memory pool into separate regions. Also update open-amp.defs and open-amp.cmake to apply the new patch during the open-amp build process. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
From a01c2ad26ec50cc480933a2b92017a9287909af8 Mon Sep 17 00:00:00 2001
|
||||
From: yintao <yintao@xiaomi.com>
|
||||
Date: Fri, 11 Apr 2025 15:23:07 +0800
|
||||
Subject: [PATCH 19/19] rpmsg: Add VIRTIO_RPMSG_F_BUFADDR to support specify
|
||||
the address
|
||||
|
||||
add h2r_buf_addr and r2h_buf_addr at fw_rsc_config to support specify the address
|
||||
|
||||
Signed-off-by: yintao <yintao@xiaomi.com>
|
||||
---
|
||||
lib/include/openamp/remoteproc.h | 8 +++++++-
|
||||
lib/include/openamp/rpmsg_virtio.h | 1 +
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/include/openamp/remoteproc.h open-amp/lib/include/openamp/remoteproc.h
|
||||
index ea2c39ecfe..62ae76a380 100644
|
||||
--- a/lib/include/openamp/remoteproc.h
|
||||
+++ open-amp/lib/include/openamp/remoteproc.h
|
||||
@@ -372,6 +372,12 @@ struct fw_rsc_config {
|
||||
/** The remote to host buffer size (if VIRTIO_RPMSG_F_BUFSZ) */
|
||||
uint32_t r2h_buf_size;
|
||||
|
||||
+ /** The host physical address (if VIRTIO_RPMSG_F_BUFADDR) */
|
||||
+ uint64_t h2r_buf_addr;
|
||||
+
|
||||
+ /** The remote physical address (if VIRTIO_RPMSG_F_BUFADDR) */
|
||||
+ uint64_t r2h_buf_addr;
|
||||
+
|
||||
/* The host side cpu name (if VIRTIO_RPMSG_F_CPUNAME) */
|
||||
|
||||
uint8_t host_cpuname[VIRTIO_RPMSG_CPUNAME_SIZE];
|
||||
@@ -382,7 +388,7 @@ struct fw_rsc_config {
|
||||
|
||||
/* Reserve for the future use */
|
||||
|
||||
- uint32_t reserved[10];
|
||||
+ uint32_t reserved[6];
|
||||
|
||||
/** Put the customize config here */
|
||||
} METAL_PACKED_END;
|
||||
diff --git a/lib/include/openamp/rpmsg_virtio.h open-amp/lib/include/openamp/rpmsg_virtio.h
|
||||
index 8d686f72f1..5eef8b7c6a 100644
|
||||
--- a/lib/include/openamp/rpmsg_virtio.h
|
||||
+++ open-amp/lib/include/openamp/rpmsg_virtio.h
|
||||
@@ -32,6 +32,7 @@ extern "C" {
|
||||
#define VIRTIO_RPMSG_F_ACK 1 /* RP supports name service acknowledge */
|
||||
#define VIRTIO_RPMSG_F_BUFSZ 2 /* RP supports get buffer size from config space */
|
||||
#define VIRTIO_RPMSG_F_CPUNAME 3 /* RP supports get local and peer cpu name */
|
||||
+#define VIRTIO_RPMSG_F_BUFADDR 4 /* RP supports get buffer address from config space */
|
||||
|
||||
#if defined(VIRTIO_USE_DCACHE)
|
||||
#define BUFFER_FLUSH(x, s) metal_cache_flush(x, s)
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -74,6 +74,8 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/open-amp)
|
||||
${CMAKE_CURRENT_LIST_DIR}/0017-lib-virtio-virtqueue-change-the-virtqueue-dump-log-l.patch
|
||||
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||
${CMAKE_CURRENT_LIST_DIR}/0018-lib-rpmsg-add-priority-support-for-rpmsg-endpoint.patch
|
||||
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR} <
|
||||
${CMAKE_CURRENT_LIST_DIR}/0019-rpmsg-Add-VIRTIO_RPMSG_F_BUFADDR-to-support-specify-.patch
|
||||
DOWNLOAD_NO_PROGRESS true
|
||||
TIMEOUT 30)
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ open-amp.zip:
|
||||
$(Q) patch -p0 < 0016-lib-rpmsg_virtio-support-release-the-name-service-me.patch
|
||||
$(Q) patch -p0 < 0017-lib-virtio-virtqueue-change-the-virtqueue-dump-log-l.patch
|
||||
$(Q) patch -p0 < 0018-lib-rpmsg-add-priority-support-for-rpmsg-endpoint.patch
|
||||
$(Q) patch -p0 < 0019-rpmsg-Add-VIRTIO_RPMSG_F_BUFADDR-to-support-specify-.patch
|
||||
|
||||
.openamp_headers: open-amp.zip
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user