Add VQ_RX_EMPTY_NOTIFY config to define the behavior. If
VQ_RX_EMPTY_NOTIFY is disabled, notify the other side each
time a buffer is released. If VQ_RX_EMPTY_NOTIFY is enabled,
only send one notification when the RX queue is empty to
improve performance.
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Remove openamp support for Zynq-7000 SoC, following changes are done
1) remove folder apps/machine/zynq7
2) remove folder apps/system/generic/machine/zynq7
3) remove file cmake/platforms/zynq7_generic.cmake
4) remove file cmake/platforms/zynq7_linux.cmake
5) Modify README.md files
Reasons to remove:
1) Support for Zynq-7000 has ended
2) Removing redundant or unmaintained code
3) Reduce technical debt carried by OpenAMP team
4) very few customer using openamp on Zynq-7000 SoC
For using Zynq-7000 SoC support
last working and tested version is (v2023.10)
https://github.com/OpenAMP/open-amp/tree/v2023.10
Signed-off-by: Rajiv Mohan <rajiv.mohan@amd.com>
Fix Doxygen warnings on markdown files.
The reported warning is "warning: Unsupported xml/html tag <....>"
This also corrects the display of markdown file in GitHub.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Make the metal_io_region for cfg_io and shm_io into full member structs
instead of just pointers. This means they will be allocated along with
the parent virtio_mmio_device struct and not need dynamically allocated
later.
Signed-off-by: Andrew Davis <afd@ti.com>
A virtual metal_device is created, then the needed IO regions are created
and added to this device. Immediately we extract these same regions back
out and make use of them. There is no reason to do this, instead simply
use the created IO regions.
This also removes the need to have struct metal_device defined to have
more than one IO region (METAL_MAX_DEVICE_REGIONS), which is not the
default and can change per-platform. If the libmetal library was built
with the default value for METAL_MAX_DEVICE_REGIONS, then this would
have led to runtime failures.
Signed-off-by: Andrew Davis <afd@ti.com>
This patch fixes the rpmsg_create_ept function passing the endpoint's private
data that can be set by the application before the call of
rpmsg_create_ept.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The virtio.h header can be included by applications. In such cases,
VIRTIO_DRIVER_SUPPORT and VIRTIO_DEVICE_SUPPORT, which are used to
optimize the library, may not be defined in the application.
Define default VIRTIO_ROLE_IS_DEVICE and VIRTIO_ROLE_IS_DRIVER macros
that do not check for VIRTIO_DEVICE_SUPPORT or VIRTIO_DRIVER_SUPPORT if
they are not defined.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Building the samples/subsys/ipc/openamp_rsc_table/ sample generates the
following warning:
[24/182] Building C object zephyr/CMakeFiles/zephyr.dir/lib/open-amp/resource_table.c.obj
In file included from /zephyrproject/zephyr/lib/open-amp/./resource_table.h:11,
from /zephyrproject/zephyr/lib/open-amp/resource_table.c:30:
/zephyrproject/modules/lib/open-amp/open-amp/lib/include/openamp/virtio.h:83:2:
warning: #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined" [-Wcpp]
83 | #warning "VIRTIO_DRIVER_SUPPORT and/or VIRTIO_DEVICE_SUPPORT should be defined"
| ^~~~~~~
The issue occurs because the project includes the virtio API while
VIRTIO_DRIVER_SUPPORT and VIRTIO_DEVICE_SUPPORT is only defined for
the open-amp library build.
Fix the warning by testing deprecated usage of VIRTIO_DRIVER_ONLY and
VIRTIO_DEVICE_ONLY but not under
#if !defined(VIRTIO_DRIVER_SUPPORT) && !defined(VIRTIO_DEVICE_SUPPORT)
condition.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
As part of the deprecation process for VIRTIO_DEVICE_ONLY and
VIRTIO_DRIVER_ONLY, we should still support builds without errors when
possible.
For legacy support, define VIRTIO_DRIVER_SUPPORT and VIRTIO_DEVICE_SUPPORT
default values based on VIRTIO_DEVICE_ONLY and VIRTIO_DRIVER_ONLY.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Now that we match role to VIRTIO_DEV_{DRIVER,DEVICE} we can replace
all these double check if statements with the role checking macro
already used in all other files.
Signed-off-by: Andrew Davis <afd@ti.com>
For all cases when the role is checked in rpmsg_virtio, what is being
checked is the role of the underlying virtio layer. As such, we should
be matching against the role definitions for the virtio layer
(VIRTIO_DEV_DEVICE and VIRTIO_DEV_DRIVER). Fix this here.
While the underlying virtio layer may be asymmetric, the RPMSG layer
generally is symmetrical. There is no need to define a HOST or REMOTE
role specific to the RPMSG layer. And as there are now no more internal
users of these definitions, deprecate them here.
Signed-off-by: Andrew Davis <afd@ti.com>
The `role` member of `struct virtio_device` stores either the value
VIRTIO_DEV_DRIVER or VIRTIO_DEV_DEVICE. This means the function
rpmsg_virtio_get_role() will also return one of these values.
The values RPMSG_HOST and RPMSG_REMOTE are defined to be the same,
but there is no need for this redefinition. Update the return
values in the comment docs.
While here, remove the same from rpmsg_virtio_set_wait_cb() which
does not return anything, this looks to be a copy/paste error.
Signed-off-by: Andrew Davis <afd@ti.com>
This is handled by default, remove instances from apps. In cases
where there is nothing left in the init() callback remove it as
it is now optional.
Signed-off-by: Andrew Davis <afd@ti.com>
These need to be set in the rproc specific init() callback currently,
instead set them before calling the callback to make doing that in the
callback optional.
They can still be overwritten if needed in the init() callback but
if this is not needed as in some simple cases, then the callback is
not needed. Like other functions here, make this optional if no
additional modifications to the rproc struct are needed.
Signed-off-by: Andrew Davis <afd@ti.com>
This allows us to only need to call rpmsg_virtio_get_rx_buffer() once
at the start of the loop and is easier to comprehend.
Signed-off-by: Andrew Davis <afd@ti.com>
After returning a buffer we kick the other side. This is done after both
call sites of the function that returns the buffer. Move this kick call
into that function to reduce code duplication and prevent it from not
being done after returning the buffer.
Signed-off-by: Andrew Davis <afd@ti.com>
The doxygen build report issue for function descriptions that provide
reference to some function parameters using @:
...
lib/include/openamp/rpmsg.h:160: warning: Found unknown command '\data'
lib/include/openamp/rpmsg.h:160: warning: Found unknown command '\len'
...
Fix the warning by replacing with back-ticks that will be interpreted as
code by Markdown(Markdown support is enabled in the Doxygen configuration).
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The comments states this was kept for "future use", that was a decade
ago.. Remove this never used function and associated data.
Signed-off-by: Andrew Davis <afd@ti.com>
Update CI to work with 24.04.
* Lock to 24.04 so we control when to change
* Update locale and timezone to work for 24.04 or 22.04
* 24.04 creates these files if not already there but 22.04 does not
* Keep existing work around for 22.04 but make it work if already there
* use venv
* Breate a virtual environment isolated from the packages in the base
environment
* Inspired from zephyr build environment
* Use pip3 everywhere removing global and --user installation
* Add section to README about desktop testing
* Also fix usage formatting in README
Co-developed-by: Bill Mills <bill.mills@linaro.org>
Signed-off-by: Bill Mills <bill.mills@linaro.org>
Co-developed-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Fix following warning by updating bad rpc_id parameter type in
the rpmsg_rpc_client_send() API.
Align the rpc_id type to the one used in rpmsg_rpc_server_send().
/github/workspace/lib/service/rpmsg/rpc/rpmsg_rpc_client.c:60:9:
error: ‘memcpy’ reading 8 bytes from a region of size 4
[-Werror=stringop-overread]
1286
60 | memcpy(tmpbuf, &rpc_id, MAX_FUNC_ID_LEN);
1287
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1288
/github/workspace/lib/service/rpmsg/rpc/rpmsg_rpc_client.c:51:40:
note: source object ‘rpc_id’ of size 4
1289
51 | unsigned int rpc_id, void *request_param,
1290
| ~~~~~~~~~~~~~^~~~~~
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
The use of the master and slave terminologies in configs and API are now
deprecated since 2 years, we can remove the associated code.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
There is a common pattern of checking the virtio role while also checking
that this role is supported in this build, which can help optimize away
unusable code. Add a couple macros for this. This has two main benefits,
first being shorter and easier to read if statements, and also makes it
easier to not forget to always do both checks.
Use these everywhere except rpmsg_virtio.c which needs one more refactor
before we can switch it over.
Signed-off-by: Andrew Davis <afd@ti.com>
Checks if this symbol is defined and set to equal 1. Used to make it
more clear that a preprocessor level check is intended.
Signed-off-by: Andrew Davis <afd@ti.com>
Currently compiler defines are defined when support for driver or device
is the only support being built. This is a negative define, it surrounds
the code to not be built and we use ifndef. This is confusing. It also
leaves ifndefs all throughout the code-base. Instead, define a macro that
is set to 1 if support is enabled. Use this inline in if statements where
possible. Any sane compiler will optimize away the code in the branch
when support is not enabled just the same as when using the preprocessor
so we keep the same binary size.
Signed-off-by: Andrew Davis <afd@ti.com>
Several platform_*() functions are common across the example machines.
They actually have to be as they are consumed by example apps that build
across these machines. Move these common declarations to common a header.
Signed-off-by: Andrew Davis <afd@ti.com>
The rvdev->notify_wait_cb is not initialized to NULL if
not set by the user.
Initialize it to NULL and provide an API for the application to set it.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This should hold a pointer to a metal_io_region, make that the type.
Also fix the comment above this variable. This region holds the address
of the message buffers, not the vring descriptor table nor available/used
ring data. It is only used for virt-to-phys/phys-to-vert translation on
the buffers pointed to by these descriptors.
Signed-off-by: Andrew Davis <afd@ti.com>
The metal_io_region in the virtqueue struct is for translating
the buffer address stored in the virtqueue descriptor table, not
the address of the descriptor table itself.
This may have worked previously if the vring descriptors where part
of the same IO space as the buffers they point to, but this is not
guaranteed to always be the case. Fix that here.
Signed-off-by: Andrew Davis <afd@ti.com>
The contents of this struct are internal to the RPMsg layer. Access
should only happen using accessor functions.
Signed-off-by: Andrew Davis <afd@ti.com>
Having these functions as inline header functions forces the contents of
struct remoteproc_mem to remain externally exposed. It also does not save
space in most cases as every call-site gets the full contents of the
function instead of just a call instruction. Make these normal functions
like all others in remoteproc.h.
Signed-off-by: Andrew Davis <afd@ti.com>
There are functions that handle invalidating and reading from vq_ring
members. Use those here to reduce code duplication.
Signed-off-by: Andrew Davis <afd@ti.com>
The callback allows us to add private data. Use that to store our
rpmsg_device instance instead of extracting it from the endpoint
struct. The contents of that struct are internal to the RPMsg layer.
Signed-off-by: Andrew Davis <afd@ti.com>
There is a private data member in the endpoint struct that is passed into
the callback, but there is no way to populate it. Add this to the
endpoint register function.
Signed-off-by: Andrew Davis <afd@ti.com>
In rpmsg_virtio_ns_callback() we directly case from rpmsg_device* to
rpmsg_virtio_device*. This only works if rdev is the first member.
Use metal_container_of() to remove this assumption on struct order.
Signed-off-by: Andrew Davis <afd@ti.com>
The contents of app() in these examples is given a rpmsg_device. We should
not have to know about the backing transport layer. We assume it is virtio
and call into the virtio layer to get the buffer size. This information is
now available from the rpmsg layer. Use those functions to make the app()
agnostic to the backing layer.
Signed-off-by: Andrew Davis <afd@ti.com>
RPMsg provides functions to get a transport's backing buffer sizes.
Connect this up for the virtio transport here.
Signed-off-by: Andrew Davis <afd@ti.com>
Add an RPMsg API to get the buffer sizes supported by the backing
transport layer. Add hooks so that transport layers can register
functions to provide this data.
Signed-off-by: Andrew Davis <afd@ti.com>