openamp: Update to 2020.04.0 release

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-05-02 01:29:40 +08:00 committed by patacongo
parent 2aa85fd17e
commit 17112f4eed
13 changed files with 48 additions and 83 deletions

View File

@ -1,29 +0,0 @@
From e84d8dd13d31de4942bbf4ec8093932961b9d1b9 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Tue, 21 Apr 2020 22:02:38 +0800
Subject: [PATCH] nuttx: change sched_kfree to metal_free_memory
since the upstream remove sched_kfree and put the similar logic into kmm_free:
https://github.com/apache/incubator-nuttx/commit/231ad202ee0a3abfd2e14fab1f218b588f61284b
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
lib/system/nuttx/irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/system/nuttx/irq.c libmetal/lib/system/nuttx/irq.c
index 476eab9..84200d3 100644
--- a/lib/system/nuttx/irq.c
+++ libmetal/lib/system/nuttx/irq.c
@@ -45,7 +45,7 @@ static int metal_cntr_irq_handler(int irq, void *context, void *data)
/* context == NULL mean unregister */
irqchain_detach(irq, metal_cntr_irq_handler, data);
- sched_kfree(data);
+ metal_free_memory(data);
return 0;
}
--
2.17.1

View File

@ -1,4 +1,4 @@
From aca01202ec47984ea90d3904560b973976cab1e5 Mon Sep 17 00:00:00 2001
From 5bc0ae0942fa9a4b9d321e31445457c31c888530 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Fri, 24 Apr 2020 01:44:31 +0800
Subject: [PATCH 01/10] rpmsg: remove the address check in

View File

@ -1,4 +1,4 @@
From c4c3577a3d7a1e957c84f86caa64b7e076b9db89 Mon Sep 17 00:00:00 2001
From d58fa6ab189fded40786e7d025036a1c16c773c4 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Fri, 24 Apr 2020 03:40:56 +0800
Subject: [PATCH 02/10] rpmsg: merge rpmsg_register_endpoint into
@ -108,7 +108,7 @@ index f63c958..9c46970 100644
static inline struct rpmsg_endpoint *
rpmsg_get_ept_from_addr(struct rpmsg_device *rdev, uint32_t addr)
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
index cf3ec21..ff1226b 100644
index 8165216..4dea4c0 100644
--- a/lib/rpmsg/rpmsg_virtio.c
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
@@ -636,10 +636,9 @@ int rpmsg_init_vdev(struct rpmsg_virtio_device *rvdev,

View File

@ -1,4 +1,4 @@
From 373d773c188920088af1673867de5cfed12ea4de Mon Sep 17 00:00:00 2001
From ca34df45f5d4893be223346b06cc75f370452386 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Fri, 24 Apr 2020 01:33:12 +0800
Subject: [PATCH 03/10] rpmsg: shouldn't allocate 0-1023 address in

View File

@ -1,4 +1,4 @@
From 2a82b3350bc5eb44d6ffd66da6e3bae6d15ec84c Mon Sep 17 00:00:00 2001
From 8a55f0f3c2fec8c817ad579b070040ee8058c536 Mon Sep 17 00:00:00 2001
From: ligd <liguiding@pinecone.net>
Date: Wed, 20 Feb 2019 11:36:57 +0800
Subject: [PATCH 04/10] rpmsg: wait ept ready in rpmsg_send
@ -99,7 +99,7 @@ index 3403240..7000453 100644
}
#endif
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
index ff1226b..17f2998 100644
index 4dea4c0..44b46d4 100644
--- a/lib/rpmsg/rpmsg_virtio.c
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
@@ -8,7 +8,6 @@

View File

@ -1,4 +1,4 @@
From 8169c7954d432c6abd8db8f1bde35890bba672ff Mon Sep 17 00:00:00 2001
From 3ea6f30819b25281ec80c68b3abd779981311a77 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Fri, 24 Apr 2020 02:22:15 +0800
Subject: [PATCH 05/10] rpmsg: return fail if either source or destination

View File

@ -1,4 +1,4 @@
From bdadd236975ba4b4d9011d3b86d528d305476cb2 Mon Sep 17 00:00:00 2001
From 27026fc4c781a9dbd328059884b9b94ff39ad6b9 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Fri, 15 Mar 2019 01:51:03 +0800
Subject: [PATCH 06/10] remoteproc_mmap support va to pa/da conversion
@ -10,16 +10,16 @@ Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
.../load_fw/zynqmp_r5_lcm_rproc_example.c | 69 +++++------
apps/machine/zynq7/platform_info.c | 16 +--
apps/machine/zynq7/zynq_a9_rproc.c | 40 +++----
apps/machine/zynq7/zynq_a9_rproc.c | 40 ++++---
apps/machine/zynqmp/platform_info.c | 6 +-
apps/machine/zynqmp/zynqmp_linux_r5_proc.c | 40 ++++---
apps/machine/zynqmp_r5/platform_info.c | 16 +--
apps/machine/zynqmp_r5/zynqmp_r5_a53_rproc.c | 38 +++---
.../linux/machine/generic/platform_info.c | 52 ++++----
lib/include/openamp/remoteproc.h | 19 +--
lib/remoteproc/remoteproc.c | 112 ++++++++++--------
apps/machine/zynqmp_r5/zynqmp_r5_a53_rproc.c | 38 +++----
.../linux/machine/generic/platform_info.c | 52 +++++----
lib/include/openamp/remoteproc.h | 19 ++--
lib/remoteproc/remoteproc.c | 107 ++++++++++--------
lib/remoteproc/rsc_table_parser.c | 2 +-
11 files changed, 212 insertions(+), 198 deletions(-)
11 files changed, 209 insertions(+), 196 deletions(-)
diff --git a/apps/examples/load_fw/zynqmp_r5_lcm_rproc_example.c open-amp/apps/examples/load_fw/zynqmp_r5_lcm_rproc_example.c
index 26a09e5..e224631 100644
@ -429,10 +429,10 @@ index ee25368..ef5299c 100644
static int zynqmp_r5_a53_proc_notify(struct remoteproc *rproc, uint32_t id)
diff --git a/apps/system/linux/machine/generic/platform_info.c open-amp/apps/system/linux/machine/generic/platform_info.c
index 5743c5c..66d15c1 100644
index 0b0f721..748fd83 100644
--- a/apps/system/linux/machine/generic/platform_info.c
+++ open-amp/apps/system/linux/machine/generic/platform_info.c
@@ -319,39 +319,43 @@ static void linux_proc_remove(struct remoteproc *rproc)
@@ -300,39 +300,43 @@ static void linux_proc_remove(struct remoteproc *rproc)
}
}
@ -497,7 +497,7 @@ index 5743c5c..66d15c1 100644
}
static int linux_proc_notify(struct remoteproc *rproc, uint32_t id)
@@ -420,7 +424,7 @@ static struct remoteproc *
@@ -391,7 +395,7 @@ static struct remoteproc *
platform_create_proc(int proc_index, int rsc_index)
{
struct remoteproc_priv *prproc;
@ -506,7 +506,7 @@ index 5743c5c..66d15c1 100644
int rsc_size;
int ret;
metal_phys_addr_t pa;
@@ -449,8 +453,8 @@ platform_create_proc(int proc_index, int rsc_index)
@@ -420,8 +424,8 @@ platform_create_proc(int proc_index, int rsc_index)
/* Mmap resource table */
pa = RSC_MEM_PA;
@ -560,7 +560,7 @@ index a83aa12..b34cb1a 100644
/**
* remoteproc_set_rsc_table
diff --git a/lib/remoteproc/remoteproc.c open-amp/lib/remoteproc/remoteproc.c
index 057edc6..27fcdb4 100644
index 5afb40c..34b8cb8 100644
--- a/lib/remoteproc/remoteproc.c
+++ open-amp/lib/remoteproc/remoteproc.c
@@ -295,13 +295,14 @@ struct metal_io_region *
@ -702,18 +702,17 @@ index 057edc6..27fcdb4 100644
}
int remoteproc_load(struct remoteproc *rproc, const char *path,
@@ -529,8 +542,8 @@ int remoteproc_load(struct remoteproc *rproc, const char *path,
@@ -529,8 +542,7 @@ int remoteproc_load(struct remoteproc *rproc, const char *path,
img_data = NULL;
/* get the I/O region from remoteproc */
pa = METAL_BAD_PHYS;
- (void)remoteproc_mmap(rproc, &pa, &da, nmemsize, 0, &io);
- if (pa == METAL_BAD_PHYS || io == NULL) {
- (void)remoteproc_mmap(rproc, &pa, &da, nmemsize, 0,
- &io);
+ remoteproc_mmap(rproc, &pa, &da, NULL, nmemsize, 0, &io);
+ if (pa == METAL_BAD_PHYS || !io) {
if (pa == METAL_BAD_PHYS || !io) {
metal_log(METAL_LOG_ERROR,
"load failed, no mapping for 0x%llx.\r\n",
da);
@@ -599,8 +612,9 @@ int remoteproc_load(struct remoteproc *rproc, const char *path,
@@ -600,8 +612,9 @@ int remoteproc_load(struct remoteproc *rproc, const char *path,
metal_log(METAL_LOG_DEBUG,
"%s, update resource table\r\n", __func__);
@ -725,31 +724,27 @@ index 057edc6..27fcdb4 100644
if (rsc_table) {
size_t rsc_io_offset;
@@ -759,8 +773,8 @@ int remoteproc_load_noblock(struct remoteproc *rproc,
@@ -760,7 +773,7 @@ int remoteproc_load_noblock(struct remoteproc *rproc,
if (da != RPROC_LOAD_ANYADDR) {
/* get the I/O region from remoteproc */
*pa = METAL_BAD_PHYS;
- (void)remoteproc_mmap(rproc, pa, &da, *nmlen, 0, io);
- if (*pa == METAL_BAD_PHYS || io == NULL) {
+ remoteproc_mmap(rproc, pa, &da, NULL, *nmlen, 0, io);
+ if (*pa == METAL_BAD_PHYS || !io) {
if (*pa == METAL_BAD_PHYS || !io) {
metal_log(METAL_LOG_ERROR,
"load failed, no mapping for 0x%llx.\r\n",
da);
@@ -784,9 +798,9 @@ int remoteproc_load_noblock(struct remoteproc *rproc,
@@ -785,8 +798,8 @@ int remoteproc_load_noblock(struct remoteproc *rproc,
ret = -RPROC_ENOMEM;
goto error1;
}
- rsc_table = remoteproc_mmap(rproc, NULL, &rsc_da,
- rsc_size, 0, io);
- if (*io == NULL) {
+ remoteproc_mmap(rproc, NULL, &rsc_da,
+ &rsc_table, rsc_size, 0, io);
+ if (!*io) {
if (!*io) {
metal_log(METAL_LOG_ERROR,
"load failed: failed to mmap rsc\r\n");
metal_free_memory(lrsc_table);
@@ -923,7 +937,7 @@ remoteproc_create_virtio(struct remoteproc *rproc,
@@ -924,7 +937,7 @@ remoteproc_create_virtio(struct remoteproc *rproc,
metal_phys_addr_t da;
unsigned int num_descs, align;
struct metal_io_region *io;
@ -758,7 +753,7 @@ index 057edc6..27fcdb4 100644
size_t size;
int ret;
@@ -933,7 +947,7 @@ remoteproc_create_virtio(struct remoteproc *rproc,
@@ -934,7 +947,7 @@ remoteproc_create_virtio(struct remoteproc *rproc,
num_descs = vring_rsc->num;
align = vring_rsc->align;
size = vring_size(num_descs, align);
@ -768,7 +763,7 @@ index 057edc6..27fcdb4 100644
goto err1;
ret = rproc_virtio_init_vring(vdev, i, notifyid,
diff --git a/lib/remoteproc/rsc_table_parser.c open-amp/lib/remoteproc/rsc_table_parser.c
index 184a463..816a0ee 100644
index e43fa72..0bfd163 100644
--- a/lib/remoteproc/rsc_table_parser.c
+++ open-amp/lib/remoteproc/rsc_table_parser.c
@@ -109,7 +109,7 @@ int handle_carve_out_rsc(struct remoteproc *rproc, void *rsc)

View File

@ -1,4 +1,4 @@
From 4224f5f028aec8ebc13e1e203cbae3127b07605e Mon Sep 17 00:00:00 2001
From e2233e080ef0ad62682f1725e17abb07e939ed50 Mon Sep 17 00:00:00 2001
From: anchao <anchao@pinecone.net>
Date: Mon, 10 Dec 2018 19:39:01 +0800
Subject: [PATCH 07/10] rpmsg: bring back zero copy transfer
@ -297,7 +297,7 @@ index 9c46970..3db6b24 100644
/**
* enum rpmsg_ns_flags - dynamic name service announcement flags
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
index 17f2998..a525066 100644
index 44b46d4..195189d 100644
--- a/lib/rpmsg/rpmsg_virtio.c
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
@@ -140,6 +140,7 @@ static void *rpmsg_virtio_get_tx_buffer(struct rpmsg_virtio_device *rvdev,
@ -453,7 +453,7 @@ index 17f2998..a525066 100644
+ }
rp_hdr = rpmsg_virtio_get_rx_buffer(rvdev, &len, &idx);
if (rp_hdr == NULL) {
if (!rp_hdr) {
@@ -522,6 +644,10 @@ int rpmsg_init_vdev(struct rpmsg_virtio_device *rvdev,
rvdev->vdev = vdev;
rdev->ns_bind_cb = ns_bind_cb;

View File

@ -1,4 +1,4 @@
From c2d2e03d9a0ddf9e1782c33fd459973c9bc7275a Mon Sep 17 00:00:00 2001
From 3ea08a8002de5e4992bed32567ecb05c887f31be Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Mon, 7 Jan 2019 02:15:42 +0800
Subject: [PATCH 08/10] ns: acknowledge the received creation message
@ -28,7 +28,7 @@ index 0b46ee1..318acd1 100644
/**
diff --git a/lib/include/openamp/rpmsg_virtio.h open-amp/lib/include/openamp/rpmsg_virtio.h
index 528b9bf..a2dd504 100644
index 2209a48..e6e5fa2 100644
--- a/lib/include/openamp/rpmsg_virtio.h
+++ open-amp/lib/include/openamp/rpmsg_virtio.h
@@ -28,6 +28,7 @@ extern "C" {
@ -79,7 +79,7 @@ index 3db6b24..d513a56 100644
/**
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
index a525066..e57b1c2 100644
index 195189d..9988a1e 100644
--- a/lib/rpmsg/rpmsg_virtio.c
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
@@ -586,13 +586,13 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,

View File

@ -1,4 +1,4 @@
From 1d94cd9ae8345543fa93c12cdc11ccbc2ca5b127 Mon Sep 17 00:00:00 2001
From 9bbc2dcd43f6107a7e0b1eec16bab10e533329f2 Mon Sep 17 00:00:00 2001
From: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Thu, 3 Jan 2019 14:20:48 +0800
Subject: [PATCH 09/10] implement
@ -14,7 +14,7 @@ Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
3 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/lib/include/openamp/rpmsg_virtio.h open-amp/lib/include/openamp/rpmsg_virtio.h
index a2dd504..e7c670e 100644
index e6e5fa2..4d3093b 100644
--- a/lib/include/openamp/rpmsg_virtio.h
+++ open-amp/lib/include/openamp/rpmsg_virtio.h
@@ -86,6 +86,20 @@ rpmsg_virtio_get_features(struct rpmsg_virtio_device *rvdev)
@ -39,7 +39,7 @@ index a2dd504..e7c670e 100644
rpmsg_virtio_create_virtqueues(struct rpmsg_virtio_device *rvdev,
int flags, unsigned int nvqs,
diff --git a/lib/include/openamp/virtio.h open-amp/lib/include/openamp/virtio.h
index 7085554..a93e0d9 100644
index 55c8ea5..9c8376e 100644
--- a/lib/include/openamp/virtio.h
+++ open-amp/lib/include/openamp/virtio.h
@@ -100,6 +100,7 @@ struct virtio_device {
@ -51,10 +51,10 @@ index 7085554..a93e0d9 100644
struct virtio_vring_info *vrings_info;
};
diff --git a/lib/remoteproc/remoteproc_virtio.c open-amp/lib/remoteproc/remoteproc_virtio.c
index e495d81..6a3b28b 100644
index aafc48c..7505f64 100644
--- a/lib/remoteproc/remoteproc_virtio.c
+++ open-amp/lib/remoteproc/remoteproc_virtio.c
@@ -126,20 +126,43 @@ static uint32_t rproc_virtio_negotiate_features(struct virtio_device *vdev,
@@ -128,20 +128,43 @@ static uint32_t rproc_virtio_negotiate_features(struct virtio_device *vdev,
static void rproc_virtio_read_config(struct virtio_device *vdev,
uint32_t offset, void *dst, int length)
{
@ -106,7 +106,7 @@ index e495d81..6a3b28b 100644
}
static void rproc_virtio_reset_device(struct virtio_device *vdev)
@@ -220,6 +243,7 @@ rproc_virtio_create_vdev(unsigned int role, unsigned int notifyid,
@@ -222,6 +245,7 @@ rproc_virtio_create_vdev(unsigned int role, unsigned int notifyid,
vdev->notifyid = notifyid;
vdev->role = role;
vdev->reset_cb = rst_cb;

View File

@ -1,4 +1,4 @@
From f5f905a5c7b63e0b90a6b67e45d70305e6dfaa2c Mon Sep 17 00:00:00 2001
From 2a64e1f23b140e1e2fdabfe77ed7a11062ef341a Mon Sep 17 00:00:00 2001
From: anchao <anchao@pinecone.net>
Date: Mon, 10 Dec 2018 16:26:39 +0800
Subject: [PATCH 10/10] Negotiate individual buffer size dynamically
@ -43,7 +43,7 @@ index b34cb1a..ee9162a 100644
* struct fw_rsc_vendor - remote processor vendor specific resource
* @len: length of the resource
diff --git a/lib/include/openamp/rpmsg_virtio.h open-amp/lib/include/openamp/rpmsg_virtio.h
index e7c670e..e58c84e 100644
index 4d3093b..7f0c573 100644
--- a/lib/include/openamp/rpmsg_virtio.h
+++ open-amp/lib/include/openamp/rpmsg_virtio.h
@@ -16,6 +16,7 @@
@ -79,12 +79,12 @@ index e7c670e..e58c84e 100644
struct virtqueue *rvq;
struct virtqueue *svq;
diff --git a/lib/rpmsg/rpmsg_virtio.c open-amp/lib/rpmsg/rpmsg_virtio.c
index e57b1c2..792a3b1 100644
index 9988a1e..d127084 100644
--- a/lib/rpmsg/rpmsg_virtio.c
+++ open-amp/lib/rpmsg/rpmsg_virtio.c
@@ -138,8 +138,8 @@ static void *rpmsg_virtio_get_tx_buffer(struct rpmsg_virtio_device *rvdev,
data = virtqueue_get_buffer(rvdev->svq, len, idx);
if (data == NULL) {
if (!data) {
data = rpmsg_virtio_shm_pool_get_buffer(rvdev->shpool,
- RPMSG_BUFFER_SIZE);
- *len = RPMSG_BUFFER_SIZE;

View File

@ -41,7 +41,7 @@ CSRCS =
VPATH := $(SRCDIR)
DEPPATH = --dep-path .
VERSION ?= 2020.01.0
VERSION ?= 2020.04.0
include libmetal.defs
include open-amp.defs

View File

@ -76,7 +76,6 @@ libmetal.zip:
$(Q) wget https://github.com/OpenAMP/libmetal/archive/v$(VERSION).zip -O libmetal.zip
$(Q) unzip -o libmetal.zip
$(Q) mv libmetal-$(VERSION) libmetal
$(Q) patch -p0 < 0001-nuttx-change-sched_kfree-to-metal_free_memory.patch
.libmetal_headers: libmetal.zip
$(eval headers := $(wildcard libmetal/lib/compiler/gcc/*.h))