The function should return void. the reason is that
vdev->func->delete_virtqueues() is optional and return void.
To be generic we should call virtio_delete_virtqueues in all cases.
Then depending on the dispatcher we do nothing or call delete_virtqueues()
Fixes: 7f90610 ("virtio: add create_virtqueues and delete_virtqueues in virtio_dispatch")
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The virtio_describe() function does not seem usable.
Therefore, it should be marked as deprecated to initiate
the removal process.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Add descriptions for following structures:
- virtio_device_id
- virtio_feature_desc
- virtio_dispatch
- virtqueue_buf
- virtqueue
- vring_alloc_info
Move some comments related to the vring structure in its description.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Add WITH_DCACHE operation used for all cache operations:
vrings, buffers and resource table.
The other options will be deprecated - add warning
message for this.
Add info for WITH_DCACHE option in README.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Since all cache operations, for vrings, buffer and
resource table are using metal_cache_flush and
metal_cache_invalidate, define a common function for all.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Do buffers flush and invalidate the same as with vrings
and resource table:
- add defines in header file;
- call BUFFER_FLUSH/BUFFER_INVALIDATE where necessary.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Do a cache invalidation before reading the resource table's info
since this ca be in a cacheable region.
Make this optional, based on VIRTIO_CACHED_RSC_TABLE.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
With the no-copy feature a tx buffer can be get, filled and then
sent to the remote side.
In Some error cases the application can need to release it instead
of sending it to the remote side.
As the virtqueue is updated when the buffer it get, it is not
possible to manage this use case at virtqueue level.
This patchset implements the release based on a buffer recycler.
The principle is to store the released buffer in a 'reclaimer' list.
On next get pmsg_virtio_get_tx_buffer call the buffer is reused.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
As it possible to get the buffer length we need also to retrieve
the address associated to the descriptor index.
This is need by rpmsg virtio to implement the buffer recycler.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Add an API to be able to release unused TX buffer that will not be
sent.
For instance this API can be called in case of error between the
buffer reservation and the send to the remote side.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
In the multi core of lower power device, when one of core enters sleep,
it needs to put its corresponding share memory into retention mode to
save power consumption. Based on the limitations of the chip design,
when the CPU to which share memory belongs goes to sleep, the share
memory enters the retention mode, and other cores will not be able
to access it. When the share memory divides tx shm and rx shm
and the core of tx shm and rx shm are different, so that when one
CPU sleeps, the other CPU can still access its own tx shm.
Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
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>
In line with the terminology changes proposed by the OpenAMP
Technical Steering committe. Change VIRTIO_SLAVE_ONLY to
VIRTIO_DEVICE_ONLY. On linux, the two ends of the virtio communication
path are referred to as the "driver" (Linux), and the "device", in this
case running on the remote processor.
Terminology: Replace VIRTIO_MASTER_ONLY with VIRTIO_DRIVER_ONLY.
Terminology: Replace VIRTIO_DEV_SLAVE with VIRTIO_DEV_DEVICE
Terminology: Replace VIRTIO_DEV_MASTER with VIRTIO_DEV_DRIVER.
Apps: Fix variable names
Per guidance from the Technical Steering Committee, replace "master" and
"slave" with more appropriate terms.
lib: Replace RPMSG_MASTER with RPMSG_HOST
cmake: Change option names from "master", "slave" to "driver", "device".
Apps: Cleanup terminology
README: Update variable names to match the code.
Terminology: Add deprecation warnings to configuration variables.
Warn the user if they use the older, possibly offensively
named configuration variables.
Terminology: Clean up deprecation warnings.
CMake: Default deprecated configuration variables to off.
Make the deprecated WITH_VIRTIO_MASTER and WITH_VIRTIO_SLAVE
configuration variables default to OFF. This means that only deliberate
use of those variables will trigger the deprecation warning.
Terminology: Replace compiler-specific warnings with #warning.
In warning about deprecated constant names, change from
compiler-specific compile time warnings to the standard #warning.
fixup! Terminology: Replace potentially offensive terms in the code.
Fix the compilation error in zephyr by declaring a deprecated function
Deprecated message generated:
zephyr/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c: In function 'rpmsg_mng_task':
zephyr/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c:351:2: warning: 'deprecated_virtio_dev_slave' is deprecated [-Wdeprecated-declarations]
351 | rpdev = platform_create_rpmsg_vdev(0, VIRTIO_DEV_SLAVE, NULL,
| ^~~~~
In file included from modules/lib/open-amp/open-amp/lib/include/openamp/rpmsg_virtio.h:18,
from modules/lib/open-amp/open-amp/lib/include/openamp/open_amp.h:12,
from zephyr/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c:15:
modules/lib/open-amp/open-amp/lib/include/openamp/virtio.h:49:32: note: declared here
49 | __deprecated static inline int deprecated_virtio_dev_slave(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
fixup! Terminology: Replace potentially offensive terms in the code.
miscellaneous update
Signed-off-by: Ed Mooring <ed.mooring@gmail.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Enable user of rpmsg_virtio to set sizes of TX and RX buffers per
created rpmsg_virtio instance. Each instance can use other buffer sizes.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
Add similar API that the libmetal to allow application to get information
about the version of the openamp library.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Since the mapping info is normally managed inside the porting
layer, the new callback could avoid the mapping duplication.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
The rpmsg_init_ept does not seem to be usable by application
but is used internally. This patch mark this API deprecated
and in at least two full release, to remove this API as the
standard API to use is rpmsg_create_ept.
In addition, move the rpmsg_init_ept to rpmsg_internal and rename it.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Although omitting the cast to the target type is idiomatic C, the
omission is actually forbidden in ISO C++. This patch enables the header
to be used in C++ code.
Signed-off-by: Simon Leiner <simon@leiner.me>
Fix errors returned by fix IAR C-STAT tool:
elf_loader.c:
- L374 Variable `phdr' may be uninitialized
- L469 (and some others) Expression may overflow
remoteproc.c:
- L43: Overrun in strncmp with string `mem->name'. Length passed
to strncmp is 32, but string is of length <unknown size>
- L185: Variable `ret' may be uninitialized
- L498 & L696: Value assigned to variable `ret' is never used
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>