nuttx/openamp/0005-openamp-add-VIRTIO_RING_F_MUST_NOTIFY-event.patch
Bowen Wang 0a26f09c6b openamp: make the remoteproc virtio fit more virtio devices
1. add cpuname config for the rpmsg virtio devices, so the rpmsg virtio
driver can get the local and remote cpuname from the virtio config
space, and we can distinguish the differnt channel when there are
two rpmsg virtio devices in the same resource table;
2. optimize the remoteproc virtio transport layer to make it can
work with all the virtio devices instead only work with rpmsg virtio
devices;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-01-19 14:18:27 +08:00

42 lines
1.5 KiB
Diff

From 7c6597d46da6d1c3c085dda33262c89b633707ae Mon Sep 17 00:00:00 2001
From: ligd <liguiding1@xiaomi.com>
Date: Thu, 23 Jun 2022 00:41:13 +0800
Subject: [PATCH 05/12] openamp: add VIRTIO_RING_F_MUST_NOTIFY event
Signed-off-by: ligd <liguiding1@xiaomi.com>
---
lib/include/openamp/virtqueue.h | 3 +++
lib/virtio/virtqueue.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/lib/include/openamp/virtqueue.h open-amp/lib/include/openamp/virtqueue.h
index 7921948c8e..92a4a87f10 100644
--- a/lib/include/openamp/virtqueue.h
+++ open-amp/lib/include/openamp/virtqueue.h
@@ -48,6 +48,9 @@ extern "C" {
/* Support to suppress interrupt until specific index is reached. */
#define VIRTIO_RING_F_EVENT_IDX (1 << 29)
+/* Support to can't suppress interrupt. */
+#define VIRTIO_RING_F_MUST_NOTIFY (1 << 30)
+
#if defined(VIRTIO_USE_DCACHE)
#define VRING_FLUSH(x, s) metal_cache_flush(x, s)
#define VRING_INVALIDATE(x, s) metal_cache_invalidate(x, s)
diff --git a/lib/virtio/virtqueue.c open-amp/lib/virtio/virtqueue.c
index ed7af3fccd..d2738faaba 100644
--- a/lib/virtio/virtqueue.c
+++ open-amp/lib/virtio/virtqueue.c
@@ -633,6 +633,9 @@ static int vq_ring_must_notify(struct virtqueue *vq)
{
uint16_t new_idx, prev_idx, event_idx;
+ if (vq->vq_dev->features & VIRTIO_RING_F_MUST_NOTIFY)
+ return 1;
+
if (vq->vq_dev->features & VIRTIO_RING_F_EVENT_IDX) {
if (VIRTIO_ROLE_IS_DRIVER(vq->vq_dev)) {
/* CACHE: no need to invalidate avail */
--
2.34.1