mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-02-06 02:54:32 +08:00
Terminology: Replace potentially offensive terms in documentation
In line with the terminology changes proposed by the OpenAMP Technical Steering committee. Suppress "master and "slave" terms in comments and documentations. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
ef7a9d014d
commit
afed3bd117
16
README.md
16
README.md
@@ -11,9 +11,9 @@ enable development of software applications for Asymmetric Multiprocessing
|
||||
environments
|
||||
3. Compatibility with upstream Linux remoteproc and rpmsg components
|
||||
4. Following AMP configurations supported
|
||||
a. Linux master/Generic(Baremetal) remote
|
||||
b. Generic(Baremetal) master/Linux remote
|
||||
5. Proxy infrastructure and supplied demos showcase ability of proxy on master
|
||||
a. Linux host/Generic(Baremetal) remote
|
||||
b. Generic(Baremetal) host/Linux remote
|
||||
5. Proxy infrastructure and supplied demos showcase ability of proxy on host
|
||||
to handle printf, scanf, open, close, read, write calls from Bare metal
|
||||
based remote contexts.
|
||||
|
||||
@@ -96,7 +96,7 @@ library for it project:
|
||||
enabled on buffers.
|
||||
* **RPMSG_BUFFER_SIZE** (default 512): adjust the size of the RPMsg buffers.
|
||||
The default value of the RPMsg size is compatible with the Linux Kernel hard
|
||||
coded value. If you AMP configuration is Linux kernel master/ OpenAMP remote,
|
||||
coded value. If you AMP configuration is Linux kernel host/ OpenAMP remote,
|
||||
this option must not be used.
|
||||
|
||||
### Example to compile OpenAMP for Zephyr
|
||||
@@ -264,11 +264,11 @@ The OpenAMP version follows the set of rule proposed in [Semantic Versioning spe
|
||||
|
||||
## Supported System and Machines
|
||||
For now, it supports:
|
||||
* Zynq generic slave
|
||||
* Zynq UltraScale+ MPSoC R5 generic slave
|
||||
* Zynq generic remote
|
||||
* Zynq UltraScale+ MPSoC R5 generic remote
|
||||
* Linux host OpenAMP between Linux userspace processes
|
||||
* Linux userspace OpenAMP RPMsg master
|
||||
* Linux userspace OpenAMP RPMsg slave
|
||||
* Linux userspace OpenAMP RPMsg host
|
||||
* Linux userspace OpenAMP RPMsg remote
|
||||
* Linux userspace OpenAMP RPMsg and MicroBlaze bare metal remote
|
||||
|
||||
## Known Limitations:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application echoes back data that was sent to it by the master core.
|
||||
* This application echoes back data that was sent to it by the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -41,7 +41,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,
|
||||
return RPMSG_SUCCESS;
|
||||
}
|
||||
|
||||
/* Send data back to master */
|
||||
/* Send data back to host */
|
||||
if (rpmsg_send(ept, data, len) < 0) {
|
||||
LPERROR("rpmsg_send failed\r\n");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application echoes back data that was sent to it by the master core.
|
||||
* This application echoes back data that was sent to it by the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# linux_rpc_demo
|
||||
This readme is about the OpenAMP linux_rpc_demo.
|
||||
|
||||
The linux_rpc_demo is about remote procedure calls between linux master and linux
|
||||
slave using rpmsg to perform
|
||||
The linux_rpc_demo is about remote procedure calls between linux host and linux
|
||||
remote using rpmsg to perform
|
||||
1. File operations such as open, read, write and close
|
||||
2. I/O operation such as printf, scanf
|
||||
|
||||
@@ -51,7 +51,7 @@ generated to `build/usr/local/bin` directory.
|
||||
$ sudo LD_LIBRARY_PATH=<openamp_built>/usr/local/lib:<libmetal_built>/usr/local/lib \
|
||||
build-openamp/usr/local/bin/linux_rpc_demo-shared 1
|
||||
```
|
||||
Enter the inputs on the master side the same gets printed on the remote side. You will see communication between the master and remote process using rpmsg calls.
|
||||
Enter the inputs on the host side the same gets printed on the remote side. You will see communication between the host and remote process using rpmsg calls.
|
||||
|
||||
## Note:
|
||||
`sudo` is required to run the OpenAMP demos between Linux processes, as it doesn't work on
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*This is a sample demonstration application that showcases usage of proxy
|
||||
*from the remote core.
|
||||
*This application is meant to run on the remote CPU running linux.
|
||||
*This application can print to the master console and perform file I/O through
|
||||
*This application can print to the host console and perform file I/O through
|
||||
*rpmsg channels.
|
||||
*/
|
||||
|
||||
@@ -482,10 +482,10 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
|
||||
printf("\nRemote>Rpmsg based retargetting to proxy initialized..\r\n");
|
||||
|
||||
/* Remote performing file IO on Master */
|
||||
/* Remote performing file IO on Host */
|
||||
printf("\nRemote>FileIO demo ..\r\n");
|
||||
|
||||
printf("\nRemote>Creating a file on master and writing to it..\r\n");
|
||||
printf("\nRemote>Creating a file on host and writing to it..\r\n");
|
||||
rpmsg_open(fname, REDEF_O_CREAT | REDEF_O_WRONLY | REDEF_O_APPEND,
|
||||
S_IRUSR | S_IWUSR);
|
||||
printf("\nRemote>Opened file '%s' with fd = %d\r\n", fname, fd);
|
||||
@@ -496,8 +496,8 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
rpmsg_close(fd);
|
||||
printf("\nRemote>Closed fd = %d\r\n", fd);
|
||||
|
||||
/* Remote performing file IO on Master */
|
||||
printf("\nRemote>Reading a file on master and displaying its "
|
||||
/* Remote performing file IO on Host */
|
||||
printf("\nRemote>Reading a file on host and displaying its "
|
||||
"contents..\r\n");
|
||||
rpmsg_open(fname, REDEF_O_RDONLY, S_IRUSR | S_IWUSR);
|
||||
printf("\nRemote>Opened file '%s' with fd = %d\r\n", fname, fd);
|
||||
@@ -509,10 +509,10 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
printf("\nRemote>Closed fd = %d\r\n", fd);
|
||||
|
||||
while (1) {
|
||||
/* Remote performing STDIO on Master */
|
||||
/* Remote performing STDIO on Host */
|
||||
printf("\nRemote>Remote firmware using scanf and printf .."
|
||||
"\r\n");
|
||||
printf("\nRemote>Scanning user input from master..\r\n");
|
||||
printf("\nRemote>Scanning user input from host..\r\n");
|
||||
printf("\nRemote>Enter name\r\n");
|
||||
rpmsg_input(ubuff, sizeof(ubuff));
|
||||
ret = bytes_read;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/*This is a sample demonstration application that showcases usage of proxy
|
||||
*from the remote core.
|
||||
*This application is meant to run on the remote CPU running linux.
|
||||
*This application can print to the master console and perform file I/O through
|
||||
*This application can print to the host console and perform file I/O through
|
||||
*rpmsg channels.
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define REDEF_O_ACCMODE 3
|
||||
|
||||
#define raw_printf(format, ...) printf(format, ##__VA_ARGS__)
|
||||
#define LPRINTF(format, ...) raw_printf("Master> " format, ##__VA_ARGS__)
|
||||
#define LPRINTF(format, ...) raw_printf("Host> " format, ##__VA_ARGS__)
|
||||
#define LPERROR(format, ...) LPRINTF("ERROR: " format, ##__VA_ARGS__)
|
||||
|
||||
static void *platform;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of remoteproc
|
||||
* and rpmsg APIs on the remote core. This application is meant to run on the remote CPU
|
||||
* running baremetal code. This applicationr receives two matrices from the master,
|
||||
* multiplies them and returns the result to the master core.
|
||||
* running baremetal code. This applicationr receives two matrices from the host,
|
||||
* multiplies them and returns the result to the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of remoteproc
|
||||
* and rpmsg APIs on the remote core. This application is meant to run on the remote CPU
|
||||
* running baremetal code. This applicationr receives two matrices from the master,
|
||||
* multiplies them and returns the result to the master core.
|
||||
* running baremetal code. This applicationr receives two matrices from the host,
|
||||
* multiplies them and returns the result to the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -76,7 +76,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,
|
||||
/* Process received data and multiple matrices. */
|
||||
Matrix_Multiply(&matrix_array[0], &matrix_array[1], &matrix_result);
|
||||
|
||||
/* Send the result of matrix multiplication back to master. */
|
||||
/* Send the result of matrix multiplication back to host. */
|
||||
if (rpmsg_send(ept, &matrix_result, sizeof(matrix)) < 0) {
|
||||
LPERROR("rpmsg_send failed\r\n");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application echoes back data that was sent to it by the master core.
|
||||
* This application echoes back data that was sent to it by the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -111,7 +111,7 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
break;
|
||||
}
|
||||
while (rpmsg_list) {
|
||||
/* Send data back to master */
|
||||
/* Send data back to host */
|
||||
ret = rpmsg_send(rpmsg_list->ept, rpmsg_list->data,
|
||||
rpmsg_list->len);
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of proxy from the remote core.
|
||||
* This application is meant to run on the remote CPU running baremetal.
|
||||
* This application can print to the master console and perform file I/O using proxy mechanism.
|
||||
* This application can print to the host console and perform file I/O using proxy mechanism.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -69,10 +69,10 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
|
||||
printf("\nRemote>Rpmsg based retargetting to proxy initialized..\r\n");
|
||||
|
||||
/* Remote performing file IO on Master */
|
||||
/* Remote performing file IO on Host */
|
||||
printf("\nRemote>FileIO demo ..\r\n");
|
||||
|
||||
printf("\nRemote>Creating a file on master and writing to it..\r\n");
|
||||
printf("\nRemote>Creating a file on host and writing to it..\r\n");
|
||||
fd = open(fname, REDEF_O_CREAT | REDEF_O_WRONLY | REDEF_O_APPEND,
|
||||
S_IRUSR | S_IWUSR);
|
||||
printf("\nRemote>Opened file '%s' with fd = %d\r\n", fname, fd);
|
||||
@@ -84,8 +84,8 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
close(fd);
|
||||
printf("\nRemote>Closed fd = %d\r\n", fd);
|
||||
|
||||
/* Remote performing file IO on Master */
|
||||
printf("\nRemote>Reading a file on master and displaying its contents..\r\n");
|
||||
/* Remote performing file IO on Host */
|
||||
printf("\nRemote>Reading a file on host and displaying its contents..\r\n");
|
||||
fd = open(fname, REDEF_O_RDONLY, S_IRUSR | S_IWUSR);
|
||||
printf("\nRemote>Opened file '%s' with fd = %d\r\n", fname, fd);
|
||||
bytes_read = read(fd, rbuff, 1024);
|
||||
@@ -96,9 +96,9 @@ int app(struct rpmsg_device *rdev, void *priv)
|
||||
printf("\nRemote>Closed fd = %d\r\n", fd);
|
||||
|
||||
while (1) {
|
||||
/* Remote performing STDIO on Master */
|
||||
/* Remote performing STDIO on Host */
|
||||
printf("\nRemote>Remote firmware using scanf and printf ..\r\n");
|
||||
printf("\nRemote>Scanning user input from master..\r\n");
|
||||
printf("\nRemote>Scanning user input from host..\r\n");
|
||||
printf("\nRemote>Enter name\r\n");
|
||||
ret = scanf("%s", ubuff);
|
||||
if (ret) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of proxy from the remote core.
|
||||
* This application is meant to run on the remote CPU running baremetal.
|
||||
* This applicationr can print to to master console and perform file I/O using proxy mechanism.
|
||||
* This applicationr can print to to host console and perform file I/O using proxy mechanism.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
@@ -29,7 +29,7 @@
|
||||
#define REDEF_O_ACCMODE 3
|
||||
|
||||
#define raw_printf(format, ...) printf(format, ##__VA_ARGS__)
|
||||
#define LPRINTF(format, ...) raw_printf("Master> " format, ##__VA_ARGS__)
|
||||
#define LPRINTF(format, ...) raw_printf("Host> " format, ##__VA_ARGS__)
|
||||
#define LPERROR(format, ...) LPRINTF("ERROR: " format, ##__VA_ARGS__)
|
||||
|
||||
static void *platform;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application allows to check the compatibility with linux OS running on
|
||||
* the master CPU. For this it echo MSG_LIMIT time message sent by the rpmsg
|
||||
* the host CPU. For this it echo MSG_LIMIT time message sent by the rpmsg
|
||||
* sample client available in linux kernel distribution.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,
|
||||
static uint32_t count = 0;
|
||||
char payload[RPMSG_BUFFER_SIZE];
|
||||
|
||||
/* Send data back MSG_LIMIT time to master */
|
||||
/* Send data back MSG_LIMIT time to host */
|
||||
memset(payload, 0, RPMSG_BUFFER_SIZE);
|
||||
memcpy(payload, data, len);
|
||||
if (++count <= MSG_LIMIT) {
|
||||
|
||||
@@ -153,14 +153,14 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
|
||||
|
||||
xil_printf("initializing rpmsg shared buffer pool\r\n");
|
||||
/*
|
||||
* Only RPMsg virtio master needs to initialize the shared buffers
|
||||
* Only RPMsg virtio driver needs to initialize the shared buffers
|
||||
* pool
|
||||
*/
|
||||
rpmsg_virtio_init_shm_pool(&shpool, shbuf,
|
||||
(SHARED_MEM_SIZE - SHARED_BUF_OFFSET));
|
||||
|
||||
xil_printf("initializing rpmsg vdev\r\n");
|
||||
/* RPMsg virtio slave can set shared buffers pool argument to NULL */
|
||||
/* RPMsg virtio device can set shared buffers pool argument to NULL */
|
||||
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
|
||||
shbuf_io,
|
||||
&shpool);
|
||||
|
||||
@@ -55,7 +55,7 @@ int platform_init(int argc, char *argv[], void **platform);
|
||||
* @platform: pointer to the private data
|
||||
* @vdev_index: index of the virtio device, there can more than one vdev
|
||||
* on the platform.
|
||||
* @role: virtio master or virtio slave of the vdev
|
||||
* @role: virtio driver or virtio device of the vdev
|
||||
* @rst_cb: virtio device reset callback
|
||||
* @ns_bind_cb: rpmsg name service bind callback
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#include <openamp/open_amp.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/*
|
||||
* Resource table declarations. Resource table is placed in a separate
|
||||
* section of a bare-metal binary or firmware. It's used to describe
|
||||
* shared memory (virtIO devices) resources the remoteproc master should
|
||||
* shared memory (virtIO devices) resources the remoteproc host should
|
||||
* initialize and / or use to communicate with the firmware.
|
||||
*/
|
||||
#ifndef RSC_TABLE_H_
|
||||
|
||||
@@ -198,14 +198,14 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
|
||||
|
||||
xil_printf("initializing rpmsg vdev\r\n");
|
||||
if (role == VIRTIO_DEV_DRIVER) {
|
||||
/* Only RPMsg virtio master needs to initialize the
|
||||
/* Only RPMsg virtio driver needs to initialize the
|
||||
* shared buffers pool
|
||||
*/
|
||||
rpmsg_virtio_init_shm_pool(&shpool, shbuf,
|
||||
(SHARED_MEM_SIZE -
|
||||
SHARED_BUF_OFFSET));
|
||||
|
||||
/* RPMsg virtio slave can set shared buffers pool
|
||||
/* RPMsg virtio device can set shared buffers pool
|
||||
* argument to NULL
|
||||
*/
|
||||
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
|
||||
|
||||
@@ -72,7 +72,7 @@ int platform_init(int argc, char *argv[], void **platform);
|
||||
* @platform: pointer to the private data
|
||||
* @vdev_index: index of the virtio device, there can more than one vdev
|
||||
* on the platform.
|
||||
* @role: virtio master or virtio slave of the vdev
|
||||
* @role: virtio driver or virtio device of the vdev
|
||||
* @rst_cb: virtio device reset callback
|
||||
* @ns_bind_cb: rpmsg name service bind callback
|
||||
*
|
||||
|
||||
@@ -35,10 +35,10 @@ extern struct hil_platform_ops zynq_a9_proc_ops;
|
||||
#define REMOTE_CPU_ID 1
|
||||
|
||||
/**
|
||||
* This array provdes defnition of CPU nodes for master and remote
|
||||
* This array provdes defnition of CPU nodes for host and remote
|
||||
* context. It contains two nodes because the same file is intended
|
||||
* to use with both master and remote configurations. On zynq platform
|
||||
* only one node definition is required for master/remote as there
|
||||
* to use with both host and remote configurations. On zynq platform
|
||||
* only one node definition is required for host/remote as there
|
||||
* are only two cores present in the platform.
|
||||
*
|
||||
* Only platform specific info is populated here. Rest of information
|
||||
@@ -63,15 +63,15 @@ extern struct hil_platform_ops zynq_a9_proc_ops;
|
||||
*
|
||||
*
|
||||
* 1) First node in the array is intended for the remote contexts and it
|
||||
* defines Master CPU ID, shared memory, interrupts info, number of channels
|
||||
* defines Host CPU ID, shared memory, interrupts info, number of channels
|
||||
* and there names. This node defines only one channel
|
||||
* "rpmsg-openamp-demo-channel".
|
||||
*
|
||||
* 2)Second node is required by the master and it defines remote CPU ID,
|
||||
* 2)Second node is required by the host and it defines remote CPU ID,
|
||||
* shared memory and interrupts info. In general no channel info is required by the
|
||||
* Master node, however in baremetal master and linux remote case the linux
|
||||
* rpmsg bus driver behaves as master so the rpmsg driver on linux side still needs
|
||||
* channel info. This information is not required by the masters for baremetal
|
||||
* Host node, however in baremetal host and linux remote case the linux
|
||||
* rpmsg bus driver behaves as host so the rpmsg driver on linux side still needs
|
||||
* channel info. This information is not required by the hosts for baremetal
|
||||
* remotes.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#include <openamp/open_amp.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#ifndef RSC_TABLE_H_
|
||||
|
||||
@@ -212,11 +212,11 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
|
||||
}
|
||||
printf("Successfully created virtio device.\r\n");
|
||||
|
||||
/* Only RPMsg virtio master needs to initialize the shared buffers pool */
|
||||
/* Only RPMsg virtio driver needs to initialize the shared buffers pool */
|
||||
rpmsg_virtio_init_shm_pool(&shpool, shbuf, SHARED_BUF_SIZE);
|
||||
|
||||
printf("initializing rpmsg vdev\r\n");
|
||||
/* RPMsg virtio slave can set shared buffers pool argument to NULL */
|
||||
/* RPMsg virtio device can set shared buffers pool argument to NULL */
|
||||
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
|
||||
shbuf_io, &shpool);
|
||||
if (ret) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_INFO_H_
|
||||
@@ -74,7 +74,7 @@ int platform_init(int argc, char *argv[], void **platform);
|
||||
* @platform: pointer to the private data
|
||||
* @vdev_index: index of the virtio device, there can more than one vdev
|
||||
* on the platform.
|
||||
* @role: virtio master or virtio slave of the vdev
|
||||
* @role: virtio driver or virtio device of the vdev
|
||||
* @rst_cb: virtio device reset callback
|
||||
* @ns_bind_cb: rpmsg name service bind callback
|
||||
*
|
||||
|
||||
@@ -215,12 +215,12 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
|
||||
}
|
||||
|
||||
xil_printf("initializing rpmsg shared buffer pool\r\n");
|
||||
/* Only RPMsg virtio master needs to initialize the shared buffers pool */
|
||||
/* Only RPMsg virtio driver needs to initialize the shared buffers pool */
|
||||
rpmsg_virtio_init_shm_pool(&shpool, shbuf,
|
||||
(SHARED_MEM_SIZE - SHARED_BUF_OFFSET));
|
||||
|
||||
xil_printf("initializing rpmsg vdev\r\n");
|
||||
/* RPMsg virtio slave can set shared buffers pool argument to NULL */
|
||||
/* RPMsg virtio device can set shared buffers pool argument to NULL */
|
||||
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
|
||||
shbuf_io,
|
||||
&shpool);
|
||||
|
||||
@@ -95,7 +95,7 @@ int platform_init(int argc, char *argv[], void **platform);
|
||||
* @platform: pointer to the private data
|
||||
* @vdev_index: index of the virtio device, there can more than one vdev
|
||||
* on the platform.
|
||||
* @role: virtio master or virtio slave of the vdev
|
||||
* @role: virtio driver or virtio device of the vdev
|
||||
* @rst_cb: virtio device reset callback
|
||||
* @ns_bind_cb: rpmsg name service bind callback
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#include <openamp/open_amp.h>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#ifndef RSC_TABLE_H_
|
||||
|
||||
@@ -497,11 +497,11 @@ platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index,
|
||||
}
|
||||
|
||||
printf("initializing rpmsg shared buffer pool\r\n");
|
||||
/* Only RPMsg virtio master needs to initialize the shared buffers pool */
|
||||
/* Only RPMsg virtio driver needs to initialize the shared buffers pool */
|
||||
rpmsg_virtio_init_shm_pool(&shpool, shbuf, SHARED_BUF_SIZE);
|
||||
|
||||
printf("initializing rpmsg vdev\r\n");
|
||||
/* RPMsg virtio slave can set shared buffers pool argument to NULL */
|
||||
/* RPMsg virtio device can set shared buffers pool argument to NULL */
|
||||
ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb,
|
||||
shbuf_io,
|
||||
&shpool);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#ifndef PLATFORM_INFO_H
|
||||
@@ -42,7 +42,7 @@ int platform_init(int argc, char *argv[], void **platform);
|
||||
* @platform: pointer to the private data
|
||||
* @vdev_index: index of the virtio device, there can more than one vdev
|
||||
* on the platform.
|
||||
* @role: virtio master or virtio slave of the vdev
|
||||
* @role: virtio driver or virtio device of the vdev
|
||||
* @rst_cb: virtio device reset callback
|
||||
* @ns_bind_cb: rpmsg name service bind callback
|
||||
*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#include <openamp/open_amp.h>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/*
|
||||
* This file populates resource table for BM remote
|
||||
* for use by the Linux Master
|
||||
* for use by the Linux host
|
||||
*/
|
||||
|
||||
#ifndef RSC_TABLE_H_
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application echoes back data that was sent to it by the master core.
|
||||
* This application echoes back data that was sent to it by the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/*
|
||||
* This is a sample demonstration application that showcases usage of rpmsg
|
||||
* This application is meant to run on the remote CPU running baremetal code.
|
||||
* This application echoes back data that was sent to it by the master core.
|
||||
* This application echoes back data that was sent to it by the host core.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -43,7 +43,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len,
|
||||
return RPMSG_SUCCESS;
|
||||
}
|
||||
|
||||
/* Send data back to master */
|
||||
/* Send data back to host */
|
||||
while (1) {
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@ You will need to manually compile the following kernel modules with your Linux k
|
||||
|
||||
#### Linux Userspace Compliation
|
||||
* Compile `obsolete/apps/echo_test/system/linux/userspace/echo_test` into your Linux OS.
|
||||
* If you are running generic(baremetal) system as remoteproc slave, and Linux as remoteproc master, please also add the built generic `echo_test` executable to the firmware of your Linux OS.
|
||||
* If you are running generic(baremetal) system as remoteproc remote, and Linux as remoteproc host, please also add the built generic `echo_test` executable to the firmware of your Linux OS.
|
||||
|
||||
## Run the Demo
|
||||
|
||||
### Load the Demo
|
||||
After Linux boots,
|
||||
* Load the machine remoteproc. If Linux runs as remoteproc master, you will need to pass the other processor's echo_test binary as firmware argument to the remoteproc module.
|
||||
* Load the machine remoteproc. If Linux runs as remoteproc host, you will need to pass the other processor's echo_test binary as firmware argument to the remoteproc module.
|
||||
* If you run the Linux kernel application demo, load the `rpmsg_echo_test_kern_app` module. You will see the kernel application send the message to remote and the remote reply back and the kernel application will verify the result.
|
||||
* If you run the userspace application demo, load the `rpmsg_user_dev_driver` module.
|
||||
* If you run the userspace application demo, you will see the similar output on the console:
|
||||
|
||||
@@ -28,13 +28,13 @@ You will need to manually compile the following kernel modules with your Linux k
|
||||
|
||||
#### Linux Userspace Compliation
|
||||
* Compile `obsolete/apps/matrix_multiply/system/linux/userspace/mat_mul_demo` into your Linux OS.
|
||||
* If you are running generic(baremetal) system as remoteproc slave, and Linux as remoteproc master, please also add the built generic `matrix_multiply` executable to the firmware of your Linux OS.
|
||||
* If you are running generic(baremetal) system as remoteproc remote, and Linux as remoteproc host, please also add the built generic `matrix_multiply` executable to the firmware of your Linux OS.
|
||||
|
||||
## Run the Demo
|
||||
|
||||
### Load the Demo
|
||||
After Linux boots,
|
||||
* Load the machine remoteproc. If Linux runs as remoteproc master, you will need to pass the other processor's matrix_multiply binary as firmware argument to the remoteproc module.
|
||||
* Load the machine remoteproc. If Linux runs as remoteproc host, you will need to pass the other processor's matrix_multiply binary as firmware argument to the remoteproc module.
|
||||
* If you run the Linux kernel application demo, load the `rpmsg_mat_mul_kern_app` module, you will see the kernel app will generate two matrices to the other processor, and output the result matrix returned by the other processor.
|
||||
* If you run the userspace application demo, load the `rpmsg_user_dev_driver` module.
|
||||
* If you run the userspace application demo `mat_mul_demo`, you will see the similar output on the console:
|
||||
|
||||
@@ -5,8 +5,8 @@ digraph G {
|
||||
|
||||
subgraph roles {
|
||||
node [style="filled", fillcolor="lightblue"];
|
||||
master [label="Master"];
|
||||
slave [label="Slave"];
|
||||
host [label="Host"];
|
||||
remote [label="Remote"];
|
||||
}
|
||||
|
||||
subgraph m_comment_nodes {
|
||||
@@ -26,7 +26,7 @@ digraph G {
|
||||
m_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"]
|
||||
m_remoteproc_load [label="calls remoteproc_load() to load application"];
|
||||
m_remoteproc_boot [shape="box", label="ret=remoteproc_boot(&rproc)"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, MASTER, NULL);"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DRIVER, NULL);"];
|
||||
m_rpmsg_shmpool_init[label="rpmsg_virtio_init_shm_pool(shpool, shbuf, shbuf_pool_size);"];
|
||||
m_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, shpool);"];
|
||||
m_rpmsg_ns_cb [label="\lrpmsg_ns_callback() will see if there is a local ep registered.\lIf yes, bind the ep; otherwise, call ns_bind_cb.\l"];
|
||||
@@ -48,7 +48,7 @@ digraph G {
|
||||
s_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"];
|
||||
|
||||
s_remoteproc_parse_rsc [label="ret = remoteproc_set_rsc_table(rproc, &rsc_table, rsc_size)"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, SLAVE, rst_cb);"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DEVICE, rst_cb);"];
|
||||
s_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, NULL);"];
|
||||
s_rpmsg_ns_cb [label="\lrpmsg_ns_callback() will see if there is a local ep registered.\lIf yes, bind the ep; otherwise, it will call ns_bind_cb()."];
|
||||
s_rpmsg_ns_bind_cb [label="s_rpsmg_ns_bind_cb(ept_name, remote_addr)"];
|
||||
@@ -69,12 +69,12 @@ digraph G {
|
||||
subgraph s_comment_nodes {
|
||||
node [group=s_comment, shape="note", style="filled", fillcolor="yellow"];
|
||||
rank="same";
|
||||
s_rpmsg_vdev_init_comment [label="\l* If vdev supports name service, it will create name service endpoint;\l* It will not return until the master set status to DRIVER READY\l"];
|
||||
s_rpmsg_vdev_init_comment [label="\l* If vdev supports name service, it will create name service endpoint;\l* It will not return until the host set status to DRIVER READY\l"];
|
||||
s_rpmsg_rx_cb_comment [label="\l* It will look for the endpoint which matches the destination address.\lIf the two endpoints hasn't binded yet,\lit will set the local endpoint's destination address with the source address in the message\l"];
|
||||
}
|
||||
|
||||
master -> m_remoteproc_init [dir="none"];
|
||||
slave -> s_remoteproc_init [dir="none"];
|
||||
host -> m_remoteproc_init [dir="none"];
|
||||
remote -> s_remoteproc_init [dir="none"];
|
||||
s_rpmsg_create_ep -> m_rpmsg_ns_cb [label="NS announcement"];
|
||||
m_rpmsg_create_ep -> s_rpmsg_ns_cb [label="NS announcement"];
|
||||
m_rpmsg_send -> s_rpmsg_rx_cb [label="RPMsg data"];
|
||||
@@ -90,8 +90,8 @@ digraph G {
|
||||
s_rpmsg_vdev_init -> s_rpmsg_vdev_init_comment [dir="none"];
|
||||
s_rpmsg_rx_cb -> s_rpmsg_rx_cb_comment [dir="none"];
|
||||
|
||||
{rank=same; master; m_remoteproc_init}
|
||||
{rank=same; slave; s_remoteproc_init}
|
||||
{rank=same; host; m_remoteproc_init}
|
||||
{rank=same; remote; s_remoteproc_init}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ digraph G {
|
||||
|
||||
subgraph roles {
|
||||
node [style="filled", fillcolor="lightblue"];
|
||||
master [label="Master"];
|
||||
slave [label="Slave"];
|
||||
host [label="Host"];
|
||||
remote [label="Remote"];
|
||||
}
|
||||
|
||||
subgraph m_comment_nodes {
|
||||
@@ -26,7 +26,7 @@ digraph G {
|
||||
m_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"]
|
||||
m_remoteproc_load [label="calls remoteproc_load() to load application"];
|
||||
m_remoteproc_boot [shape="box", label="ret=remoteproc_boot(&rproc)"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, MASTER, NULL);"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DRIVER, NULL);"];
|
||||
m_rpmsg_shmpool_init[label="rpmsg_virtio_init_shm_pool(shpool, shbuf, shbuf_pool_size);"];
|
||||
m_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, shpool);"];
|
||||
m_rpmsg_ns_cb [label="\lrpmsg_ns_callback() will see if there is a local ep registered.\lIf yes, bind the ep; otherwise, call ns_bind_cb.\l"];
|
||||
@@ -48,7 +48,7 @@ digraph G {
|
||||
s_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"];
|
||||
|
||||
s_remoteproc_parse_rsc [label="ret = remoteproc_set_rsc_table(rproc, &rsc_table, rsc_size)"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, SLAVE, rst_cb);"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DEVICE, rst_cb);"];
|
||||
s_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, NULL);"];
|
||||
s_rpmsg_create_ep [label="\lept=rpmsg_create_ept(ept, rdev, ept_name, ept_addr, dest_addr, \lendpoint_cb, ns_unbind_cb);\l"];
|
||||
s_rpmsg_ns_cb [label="\lrpmsg_ns_callback() will see if there is a local ep registered.\lIf yes, bind the ep; otherwise, call ns_binc_cb.\l"];
|
||||
@@ -67,12 +67,12 @@ digraph G {
|
||||
subgraph s_comment_nodes {
|
||||
node [group=s_comment, shape="note", style="filled", fillcolor="yellow"];
|
||||
rank="same";
|
||||
s_rpmsg_vdev_init_comment [label="\l* If vdev supports name service, it will create name service endpoint;\l* It will not return until the master set status to DRIVER READY\l"];
|
||||
s_rpmsg_vdev_init_comment [label="\l* If vdev supports name service, it will create name service endpoint;\l* It will not return until the host set status to DRIVER READY\l"];
|
||||
s_rpmsg_rx_cb_comment [label="\l* It will look for the endpoint which matches the destination address.\lIf the two endpoints hasn't binded yet,\lit will set the local endpoint's destination address with the source address in the message\l"];
|
||||
}
|
||||
|
||||
master -> m_remoteproc_init [dir="none"];
|
||||
slave -> s_remoteproc_init [dir="none"];
|
||||
host -> m_remoteproc_init [dir="none"];
|
||||
remote -> s_remoteproc_init [dir="none"];
|
||||
s_rpmsg_create_ep -> m_rpmsg_ns_cb [label="NS announcement"];
|
||||
m_rpmsg_create_ep -> s_rpmsg_ns_cb [label="NS announcement"];
|
||||
m_rpmsg_send -> s_rpmsg_rx_cb [label="RPMsg data"];
|
||||
@@ -88,8 +88,8 @@ digraph G {
|
||||
s_rpmsg_vdev_init -> s_rpmsg_vdev_init_comment [dir="none"];
|
||||
s_rpmsg_rx_cb -> s_rpmsg_rx_cb_comment [dir="none"];
|
||||
|
||||
{rank=same; master; m_remoteproc_init}
|
||||
{rank=same; slave; s_remoteproc_init}
|
||||
{rank=same; host; m_remoteproc_init}
|
||||
{rank=same; remote; s_remoteproc_init}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ digraph G {
|
||||
|
||||
subgraph roles {
|
||||
node [style="filled", fillcolor="lightblue"];
|
||||
master [label="Master"];
|
||||
slave [label="Slave"];
|
||||
host [label="Host"];
|
||||
remote [label="Remote"];
|
||||
}
|
||||
|
||||
subgraph m_comment_nodes {
|
||||
@@ -24,7 +24,7 @@ digraph G {
|
||||
m_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"];
|
||||
m_remoteproc_load [label="calls remoteproc_load() to load application"];
|
||||
m_remoteproc_boot [shape="box", label="ret=remoteproc_boot(&rproc)"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, MASTER, NULL);"];
|
||||
m_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DRIVER, NULL);"];
|
||||
m_rpmsg_shmpool_init[label="rpmsg_virtio_init_shm_pool(shpool, shbuf, shbuf_pool_size);"];
|
||||
m_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, shpool);"];
|
||||
m_rpmsg_create_ep [label="\lept=rpmsg_create_ept(ept, rdev, ept_name, ept_addr, dest_addr, \lendpoint_cb, ns_unbind_cb);\l"];
|
||||
@@ -45,7 +45,7 @@ digraph G {
|
||||
s_remoteproc_init [label="rproc = remoteproc_init(&remoteproc_ops, &arg);"];
|
||||
|
||||
s_remoteproc_parse_rsc [label="ret = remoteproc_set_rsc_table(rproc, &rsc_table, rsc_size)"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, SLAVE, rst_cb);"];
|
||||
s_remoteproc_get_vdev [label="vdev=remoteproc_create_virtio(rproc, rpmsg_vdev_id, VIRTIO_DEV_DEVICE, rst_cb);"];
|
||||
s_rpmsg_vdev_init [label="rpdev=rpmsg_init_vdev(rpvdev, vdev, ns_bind_cb, &shm_io, NULL);"];
|
||||
s_rpmsg_create_ep [label="\lept=rpmsg_create_ept(ept, rdev, ept_name, ept_addr, dest_addr, \lendpoint_cb, ns_unbind_cb);\l"];
|
||||
s_rpmsg_send [label="rpmsg_send(ept,data)"];
|
||||
@@ -63,12 +63,12 @@ digraph G {
|
||||
subgraph s_comment_nodes {
|
||||
node [group=s_comment, shape="note", style="filled", fillcolor="yellow"];
|
||||
rank="same";
|
||||
s_rpmsg_vdev_init_comment [label="\l* As vdev doesn't support name service, it will not create name service endpoint;\l* It will not return until the master set status to DRIVER READY\l"];
|
||||
s_rpmsg_vdev_init_comment [label="\l* As vdev doesn't support name service, it will not create name service endpoint;\l* It will not return until the host set status to DRIVER READY\l"];
|
||||
s_rpmsg_rx_cb_comment [label="\l* It will look for the endpoint which matches the destination address.\lIf no endpoint has found, it will drop the message.\l"];
|
||||
}
|
||||
|
||||
master -> m_remoteproc_init [dir="none"];
|
||||
slave -> s_remoteproc_init [dir="none"];
|
||||
host -> m_remoteproc_init [dir="none"];
|
||||
remote -> s_remoteproc_init [dir="none"];
|
||||
m_rpmsg_send -> s_rpmsg_rx_cb [label="RPMsg data"];
|
||||
s_rpmsg_send -> m_rpmsg_rx_cb [label="RPMsg data"];
|
||||
|
||||
@@ -80,8 +80,8 @@ digraph G {
|
||||
s_rpmsg_vdev_init -> s_rpmsg_vdev_init_comment [dir="none"];
|
||||
s_rpmsg_rx_cb -> s_rpmsg_rx_cb_comment [dir="none"];
|
||||
|
||||
{rank=same; master; m_remoteproc_init}
|
||||
{rank=same; slave; s_remoteproc_init}
|
||||
{rank=same; host; m_remoteproc_init}
|
||||
{rank=same; remote; s_remoteproc_init}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ running on two processors.
|
||||

|
||||
|
||||
## RPMsg User APIs
|
||||
* RPMsg virtio master to initialize the shared buffers pool(RPMsg virtio slave
|
||||
* RPMsg virtio driver to initialize the shared buffers pool(RPMsg virtio device
|
||||
doesn't need to use this API):
|
||||
```
|
||||
void rpmsg_virtio_init_shm_pool(struct rpmsg_virtio_shm_pool *shpool,
|
||||
|
||||
@@ -46,7 +46,7 @@ struct remoteproc_virtio {
|
||||
*
|
||||
* Create rproc virtio vdev
|
||||
*
|
||||
* @role: 0 - virtio master, 1 - virtio slave
|
||||
* @role: VIRTIO_DEV_DRIVER or VIRTIO_DEV_DEVICE
|
||||
* @notifyid: virtio device notification id
|
||||
* @rsc: pointer to the virtio device resource
|
||||
* @rsc_io: pointer to the virtio device resource I/O region
|
||||
|
||||
@@ -182,7 +182,7 @@ static const struct virtio_dispatch remoteproc_virtio_dispatch_funcs = {
|
||||
#ifndef VIRTIO_DEVICE_ONLY
|
||||
/*
|
||||
* We suppose here that the vdev is in a shared memory so that can
|
||||
* be access only by one core: the master. In this case salve core has
|
||||
* be access only by one core: the host. In this case salve core has
|
||||
* only read access right.
|
||||
*/
|
||||
.set_status = rproc_virtio_set_status,
|
||||
@@ -250,7 +250,7 @@ rproc_virtio_create_vdev(unsigned int role, unsigned int notifyid,
|
||||
#ifndef VIRTIO_DEVICE_ONLY
|
||||
if (role == VIRTIO_DEV_DRIVER) {
|
||||
uint32_t dfeatures = rproc_virtio_get_dfeatures(vdev);
|
||||
/* Assume the master support all slave features */
|
||||
/* Assume the virtio driver support all remote features */
|
||||
rproc_virtio_negotiate_features(vdev, dfeatures);
|
||||
}
|
||||
#endif
|
||||
@@ -336,9 +336,9 @@ void rproc_virtio_wait_remote_ready(struct virtio_device *vdev)
|
||||
uint8_t status;
|
||||
|
||||
/*
|
||||
* No status available for slave. As Master has not to wait
|
||||
* slave action, we can return. Behavior should be updated
|
||||
* in future if a slave status is added.
|
||||
* No status available for remote. As virtio driver has not to wait
|
||||
* remote action, we can return. Behavior should be updated
|
||||
* in future if a remote status is added.
|
||||
*/
|
||||
if (vdev->role == VIRTIO_DEV_DRIVER)
|
||||
return;
|
||||
|
||||
@@ -169,7 +169,7 @@ int handle_trace_rsc(struct remoteproc *rproc, void *rsc)
|
||||
|
||||
if (vdev_rsc->da != FW_RSC_U32_ADDR_ANY && vdev_rsc->len != 0)
|
||||
return 0;
|
||||
/* FIXME: master should allocated a memory used by slave */
|
||||
/* FIXME: The host should allocated a memory used by remote */
|
||||
|
||||
return -RPROC_ERR_RSC_TAB_NS;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ static int _rpmsg_virtio_get_buffer_size(struct rpmsg_virtio_device *rvdev)
|
||||
#ifndef VIRTIO_DEVICE_ONLY
|
||||
if (role == RPMSG_HOST) {
|
||||
/*
|
||||
* If device role is Master then buffers are provided by us,
|
||||
* If device role is host then buffers are provided by us,
|
||||
* so just provide the macro.
|
||||
*/
|
||||
length = rvdev->config.h2r_buf_size - sizeof(struct rpmsg_hdr);
|
||||
@@ -270,7 +270,7 @@ static int _rpmsg_virtio_get_buffer_size(struct rpmsg_virtio_device *rvdev)
|
||||
#ifndef VIRTIO_DRIVER_ONLY
|
||||
if (role == RPMSG_REMOTE) {
|
||||
/*
|
||||
* If other core is Master then buffers are provided by it,
|
||||
* If other core is host then buffers are provided by it,
|
||||
* so get the buffer size from the virtqueue.
|
||||
*/
|
||||
length =
|
||||
@@ -676,7 +676,7 @@ int rpmsg_init_vdev_with_config(struct rpmsg_virtio_device *rvdev,
|
||||
|
||||
#ifndef VIRTIO_DRIVER_ONLY
|
||||
if (role == RPMSG_REMOTE) {
|
||||
/* wait synchro with the master */
|
||||
/* wait synchro with the host */
|
||||
rpmsg_virtio_wait_remote_ready(rvdev);
|
||||
}
|
||||
#endif /*!VIRTIO_DRIVER_ONLY*/
|
||||
|
||||
@@ -99,7 +99,7 @@ int virtqueue_create(struct virtio_device *virt_dev, unsigned short id,
|
||||
|
||||
/*
|
||||
* CACHE: nothing to be done here. Only desc.next is setup at this
|
||||
* stage but that is only written by master, so no need to flush it.
|
||||
* stage but that is only written by driver, so no need to flush it.
|
||||
*/
|
||||
|
||||
return status;
|
||||
@@ -188,7 +188,7 @@ void *virtqueue_get_buffer(struct virtqueue *vq, uint32_t *len, uint16_t *idx)
|
||||
void *cookie;
|
||||
uint16_t used_idx, desc_idx;
|
||||
|
||||
/* Used.idx is updated by slave, so we need to invalidate */
|
||||
/* Used.idx is updated by the virtio device, so we need to invalidate */
|
||||
VRING_INVALIDATE(vq->vq_ring.used->idx);
|
||||
|
||||
if (!vq || vq->vq_used_cons_idx == vq->vq_ring.used->idx)
|
||||
@@ -201,7 +201,7 @@ void *virtqueue_get_buffer(struct virtqueue *vq, uint32_t *len, uint16_t *idx)
|
||||
|
||||
atomic_thread_fence(memory_order_seq_cst);
|
||||
|
||||
/* Used.ring is written by slave, invalidate it */
|
||||
/* Used.ring is written by remote, invalidate it */
|
||||
VRING_INVALIDATE(vq->vq_ring.used->ring[used_idx]);
|
||||
|
||||
desc_idx = (uint16_t)uep->id;
|
||||
@@ -263,7 +263,7 @@ void *virtqueue_get_available_buffer(struct virtqueue *vq, uint16_t *avail_idx,
|
||||
|
||||
atomic_thread_fence(memory_order_seq_cst);
|
||||
|
||||
/* Avail.idx is updated by master, invalidate it */
|
||||
/* Avail.idx is updated by driver, invalidate it */
|
||||
VRING_INVALIDATE(vq->vq_ring.avail->idx);
|
||||
if (vq->vq_available_idx == vq->vq_ring.avail->idx) {
|
||||
return NULL;
|
||||
@@ -273,11 +273,11 @@ void *virtqueue_get_available_buffer(struct virtqueue *vq, uint16_t *avail_idx,
|
||||
|
||||
head_idx = vq->vq_available_idx++ & (vq->vq_nentries - 1);
|
||||
|
||||
/* Avail.ring is updated by master, invalidate it */
|
||||
/* Avail.ring is updated by driver, invalidate it */
|
||||
VRING_INVALIDATE(vq->vq_ring.avail->ring[head_idx]);
|
||||
*avail_idx = vq->vq_ring.avail->ring[head_idx];
|
||||
|
||||
/* Invalidate the desc entry written by master before accessing it */
|
||||
/* Invalidate the desc entry written by driver before accessing it */
|
||||
VRING_INVALIDATE(vq->vq_ring.desc[*avail_idx]);
|
||||
buffer = virtqueue_phys_to_virt(vq, vq->vq_ring.desc[*avail_idx].addr);
|
||||
*len = vq->vq_ring.desc[*avail_idx].len;
|
||||
@@ -308,20 +308,20 @@ int virtqueue_add_consumed_buffer(struct virtqueue *vq, uint16_t head_idx,
|
||||
|
||||
VQUEUE_BUSY(vq);
|
||||
|
||||
/* CACHE: used is never written by master, so it's safe to directly access it */
|
||||
/* CACHE: used is never written by driver, so it's safe to directly access it */
|
||||
used_idx = vq->vq_ring.used->idx & (vq->vq_nentries - 1);
|
||||
used_desc = &vq->vq_ring.used->ring[used_idx];
|
||||
used_desc->id = head_idx;
|
||||
used_desc->len = len;
|
||||
|
||||
/* We still need to flush it because this is read by master */
|
||||
/* We still need to flush it because this is read by driver */
|
||||
VRING_FLUSH(vq->vq_ring.used->ring[used_idx]);
|
||||
|
||||
atomic_thread_fence(memory_order_seq_cst);
|
||||
|
||||
vq->vq_ring.used->idx++;
|
||||
|
||||
/* Used.idx is read by master, so we need to flush it */
|
||||
/* Used.idx is read by driver, so we need to flush it */
|
||||
VRING_FLUSH(vq->vq_ring.used->idx);
|
||||
|
||||
/* Keep pending count until virtqueue_notify(). */
|
||||
@@ -444,7 +444,7 @@ uint32_t virtqueue_get_desc_size(struct virtqueue *vq)
|
||||
uint16_t avail_idx = 0;
|
||||
uint32_t len = 0;
|
||||
|
||||
/* Avail.idx is updated by master, invalidate it */
|
||||
/* Avail.idx is updated by driver, invalidate it */
|
||||
VRING_INVALIDATE(vq->vq_ring.avail->idx);
|
||||
|
||||
if (vq->vq_available_idx == vq->vq_ring.avail->idx) {
|
||||
@@ -455,11 +455,11 @@ uint32_t virtqueue_get_desc_size(struct virtqueue *vq)
|
||||
|
||||
head_idx = vq->vq_available_idx & (vq->vq_nentries - 1);
|
||||
|
||||
/* Avail.ring is updated by master, invalidate it */
|
||||
/* Avail.ring is updated by driver, invalidate it */
|
||||
VRING_INVALIDATE(vq->vq_ring.avail->ring[head_idx]);
|
||||
avail_idx = vq->vq_ring.avail->ring[head_idx];
|
||||
|
||||
/* Invalidate the desc entry written by master before accessing it */
|
||||
/* Invalidate the desc entry written by driver before accessing it */
|
||||
VRING_INVALIDATE(vq->vq_ring.desc[avail_idx].len);
|
||||
|
||||
len = vq->vq_ring.desc[avail_idx].len;
|
||||
@@ -495,7 +495,7 @@ static uint16_t vq_ring_add_buffer(struct virtqueue *vq,
|
||||
VQASSERT(vq, idx != VQ_RING_DESC_CHAIN_END,
|
||||
"premature end of free desc chain");
|
||||
|
||||
/* CACHE: No need to invalidate desc because it is only written by master */
|
||||
/* CACHE: No need to invalidate desc because it is only written by driver */
|
||||
dp = &desc[idx];
|
||||
dp->addr = virtqueue_virt_to_phys(vq, buf_list[i].buf);
|
||||
dp->len = buf_list[i].len;
|
||||
@@ -532,7 +532,7 @@ static void vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)
|
||||
struct vring_desc *dp;
|
||||
struct vq_desc_extra *dxp;
|
||||
|
||||
/* CACHE: desc is never written by slave, no need to invalidate */
|
||||
/* CACHE: desc is never written by remote, no need to invalidate */
|
||||
VQ_RING_ASSERT_VALID_IDX(vq, desc_idx);
|
||||
dp = &vq->vq_ring.desc[desc_idx];
|
||||
dxp = &vq->vq_descx[desc_idx];
|
||||
@@ -560,7 +560,7 @@ static void vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)
|
||||
* newly freed chain. If the virtqueue was completely used, then
|
||||
* head would be VQ_RING_DESC_CHAIN_END (ASSERTed above).
|
||||
*
|
||||
* CACHE: desc.next is never read by slave, no need to flush it.
|
||||
* CACHE: desc.next is never read by remote, no need to flush it.
|
||||
*/
|
||||
dp->next = vq->vq_desc_head_idx;
|
||||
vq->vq_desc_head_idx = desc_idx;
|
||||
@@ -608,7 +608,7 @@ static void vq_ring_update_avail(struct virtqueue *vq, uint16_t desc_idx)
|
||||
* currently running on another CPU, we can keep it processing the new
|
||||
* descriptor.
|
||||
*
|
||||
* CACHE: avail is never written by slave, so it is safe to not invalidate here
|
||||
* CACHE: avail is never written by remote, so it is safe to not invalidate here
|
||||
*/
|
||||
avail_idx = vq->vq_ring.avail->idx & (vq->vq_nentries - 1);
|
||||
vq->vq_ring.avail->ring[avail_idx] = desc_idx;
|
||||
@@ -778,7 +778,7 @@ static int virtqueue_nused(struct virtqueue *vq)
|
||||
{
|
||||
uint16_t used_idx, nused;
|
||||
|
||||
/* Used is written by slave */
|
||||
/* Used is written by remote */
|
||||
VRING_INVALIDATE(vq->vq_ring.used->idx);
|
||||
used_idx = vq->vq_ring.used->idx;
|
||||
|
||||
@@ -799,7 +799,7 @@ static int virtqueue_navail(struct virtqueue *vq)
|
||||
{
|
||||
uint16_t avail_idx, navail;
|
||||
|
||||
/* Avail is written by master */
|
||||
/* Avail is written by driver */
|
||||
VRING_INVALIDATE(vq->vq_ring.avail->idx);
|
||||
|
||||
avail_idx = vq->vq_ring.avail->idx;
|
||||
|
||||
Reference in New Issue
Block a user