Commit Graph
921 Commits
Author SHA1 Message Date
Manikanta Sreeram 2e9f3a31cc Update LICENSE.md to cover CI test scripts
Add Apache and GPL licensing to cover CI test scripts in case they
are converted to SPDX:
  Apache-2.0
	scripts/ci/check_compliance.py
	scripts/do_checkpatch.sh
	scripts/gitlint/commit_rules.py
  GPL-2.0
	scripts/checkpatch.pl
	scripts/spelling.txt

Note: Neither Apache nor GPL are used by the libmetal library itself.

Signed-off-by: Manikanta Sreeram <manikanta.sreeram@xilinx.com>
2022-10-18 10:03:47 +02:00
Manikanta Sreeram 29fbf24ef9 apps: update linker scripts to SPDX license
Update linker scripts to SPDX based licensing.

Signed-off-by: Manikanta Sreeram <manikanta.sreeram@xilinx.com>
2022-10-18 10:03:47 +02:00
Ben Levinsky bb6d16837b apps: examples: load_fw: fix up for -werror
with werror flag compilation fails. update to build

Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
2022-10-18 10:03:47 +02:00
Sergei Korneichuk 17b2594ab6 app: rpc_demod: fix buffer overflow in handle_read
Fix the following error:
	Remote>Opened file 'remote.file' with fd = 8
	*** buffer overflow detected ***: rpc_demod-shared
1. Change RPC_BUFF_SIZE to accomodate the remote
2. Set size to the minimum of the request or the buffer size

Signed-off-by: Sergei Korneichuk <sergei.korneichuk@amd.com>
2022-10-18 10:03:47 +02:00
Guiding Li 2b6a38a9c6 openamp: should kick remote when use release_rx_buffer
There is missing virtqueue_kick when use hold_rx/release_rx

Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
2022-10-14 10:44:36 +02:00
Jiuzhu Dong e62c824489 openamp: divide shram to TX shram & RX shram by config:split_shpool
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>
2022-10-14 10:26:35 +02:00
Tammy Leino 88f38c9020 Potential overflow of notifyid on 64-bit architectures
handle_vdev_rsc sets end to RSC_NOTIFY_ID_ANY in case of wildcard notifyid
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-10-14 09:54:03 +02:00
Tammy Leino 03c80a1341 handle_vdev_rsc must return error if notifyid cannot be assigned
Updated handle_vdev_rsc to return error if a unique id cannot be assigned
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-10-04 10:17:54 +02:00
Tammy Leino e40eea8ff1 Vring descriptor count must be limited to 65k per device
Code must ensure we don't overflow the 16-bit count in vring_alloc_info
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-10-04 10:08:36 +02:00
Sergei Korneichuk 54595de006 linux_rpc_demo: do not include rsc_table.h
No symbols from rsc_table.h are used in linux_rpc_demo.c and
the demo fails to build for Zynq, ZynqMP, and Versal systems.
Remove include rsc_table.h.

Signed-off-by: Sergei Korneichuk <sergei.korneichuk@amd.com>
2022-10-03 17:48:49 +02:00
Tammy Leino 2016ff1e49 Additional input parameter checks for APIs
Added additional input parameter checks to APIs
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-10-03 17:30:14 +02:00
Arnaud Pouliquen a1c64fbc77 CI: Fix Zephyr build by updating Zephyr SDK version to 0.15.0
Update zephyr SDK to 0.15.0 to fix CI build issue.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-09-09 18:21:27 +02:00
Guiding Li 1460543153 openamp: add available_idx to dump
Just update debug logs

Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
2022-08-17 15:09:26 +02:00
Tammy Leino 8590171dc1 virtqueue_add_consumed_buffer input parameter fix
head_idx must be restricted to 0 ... vq_nentries - 1
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-08-17 15:07:25 +02:00
Tammy Leino 6d9df8fbac Add missing macros for driver/device-only compilation
Added macros to omit code when compiling for device-only.
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-08-17 15:05:14 +02:00
Arnaud Pouliquen afed3bd117 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>
2022-05-31 10:15:47 +02:00
Arnaud Pouliquen ef7a9d014d app: fix comment style and trailing whitespace
Fix some checkpatch complains

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-05-31 10:15:47 +02:00
Arnaud Pouliquen 923e060045 README: fix broken link
The link to meta-openamp is not valid, fix it.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-05-24 17:36:57 -07:00
Arnaud Pouliquen 1671b6f80c README: Fix links with renamed branches
Some "master" branches have be renamed "main".

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-05-24 17:36:57 -07:00
Arnaud Pouliquen 9e30ada7e9 doc: clean-up data structures
Realign data structure description with the code.
The Description of the libmetal API is removed.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-05-24 09:57:15 +02:00
Arnaud Pouliquen 4687a0ca53 apps: machines: clean-up the virtio device features definition
Provide a more explicit name and value for the virtio device
features.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-05-24 09:56:25 +02:00
Ed Mooring 0107a28539 lib: Remove warnings from -Wcast-align
There were several places in the library where a char* was used to point
to a wider type (uint32_t or a struct). Casting the char* to the wider
type resulted in a compiler warning.

This commit changes some simple casts to (void *) to silence compiler
warnings. In rsc_table_parser.c, replace casts and pointer arithmetic
with explicit uses of fw_rsc_hdr.

Signed-off-by: Ed Mooring <ed.mooring@gmail.com>
2022-05-24 09:53:51 +02:00
Ed Mooring e5988ab1c0 CMake: Drop deprecated CMAKE_FORCE_*_COMPILER directives.
Building OpenAMP for standalone ARM R5, the following warning occurs:

CMake Deprecation Warning at
/usr/share/cmake-3.16/Modules/CMakeForceCompiler.cmake:75 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  cmake/platforms/cross_generic_gcc.cmake:5 (CMAKE_FORCE_C_COMPILER)
  /home/mooring/build-oa/toolchain.r5-oa.sa:18 (include)
  /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:93 (include)
  CMakeLists.txt:19 (project)

Follow the suggestions in the above error message, and add
CMAKE_TRY_COMPILE_TARGET_TYPE = STATIC LIBRARY, which makes try_compile()
not try to link the cross-compiled binary. This is necessary because the
arm-none-eabi toolchain libgcc doesn't have an implementation of _exit(),
leaving that to the BSP. This results in a CMake error because it can't
build the test executable.

Signed-off-by: Ed Mooring <ed.mooring@gmail.com>
2022-05-16 09:55:19 +02:00
Guiding Li 9fdadd0a4a openamp: add ns_unbind_cb to rpmsg_device
it's useful to notify the port layer and
also symmetry with ns_bind_cb callback

Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
2022-05-16 09:51:12 +02:00
Ed Mooring 8c93bffd9f apps: Remove leading space in CMake linker directive variables.
While building the Xilinx R5 demo apps, the following error message
occurs:

CMake Error at apps/examples/echo/CMakeLists.txt:38 (add_executable):
Target "rpmsg-echo.out" links to item " -Wl,--defsym,_rsc_table=0x3ed20000
-T"/OpenAMP-Project/gh3/open-amp/apps/system/generic/machine/zynqmp_r5/
linker_remote.ld""
which has leading or trailing whitespace.  This is now an error according
to policy CMP0004.

Remove the leading space.

Signed-off-by: Ed Mooring <ed.mooring@gmail.com>
2022-05-06 11:14:51 +02:00
Xiang Xiao 3ff669b993 rpmsg: remove rpmsg_init_ept
since it is deprecated for while

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-04 15:01:29 -07:00
Arnaud Pouliquen 10dcceca63 release: open-amp 2022.04.0
Set library version to 1.2.0

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
v2022.04.0
2022-04-29 10:14:15 +02:00
Ed Mooring 71c85d6b66 Terminology: Replace potentially offensive terms in the code.
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>
2022-04-29 10:12:09 +02:00
Tammy Leino dbb178198c rpmsg_virtio_get_buffer_size should return error on failure
Updated API to return RPMSG_ERR_NO_BUFF if no descriptor available
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-28 09:40:32 +02:00
Xiang Xiao 923641d28c doc: add const for remoteproc_ops and image_store_ops
follow up the change in lib

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-28 09:40:05 +02:00
Xiang Xiao 45bf79aeab apps: add const for remoteproc_ops and image_store_ops
follow up the change in lib

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-28 09:40:05 +02:00
Xiang Xiao 6f03c1e952 lib: add const for remoteproc_ops, image_store_ops and laoder_ops
to avoid load the constant data to ram in XIP mode

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-28 09:40:05 +02:00
Arnaud Pouliquen 79749b1a86 checkpatch: Increase the default limit to 100 characters
The 80 character limit is a warning which sometime affect the readability.
let's relax this limit to 100 as done in some other projects

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-04-21 13:04:00 -07:00
Tammy Leino 0d75fa7d34 remoteproc_get_mem could wrongly match on name
Bound name comparison by RPROC_MAX_NAME_LEN instead of length of search string
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-20 09:08:36 +02:00
Tammy Leino e4307e142e Document buf argument in get_mem for remoteproc_ops structure
Added a description of the buf parameter to get_mem.
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-15 09:20:36 +02:00
Tammy Leino e89dbeb528 remoteproc_virtio_notify could use null notify operation
remoteproc_virtio_notify updated to check notify operation before invoking.
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-15 09:19:19 +02:00
Tammy Leino 2dcdc61587 virtqueue_add_buffer must check that there is room for multiple buffers
Ensure there is enough room for all the buffers being added to the vring.
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-14 09:16:40 +02:00
Ben Levinsky 9b96accd88 apps: zynqmp_r5: enable resource table base address to be configurable
Currently the resource table location in the firmware is hard-coded.

Preserve the current functionality by adding a default value.

Allow user to overwrite the default resource table location by adding the
CMake property:

set(RSC_TABLE <address> CACHE STRING "")

Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
2022-04-14 09:15:38 +02:00
Ben Levinsky a6fe0b7764 apps: zynqmp: wrap app config symbols in ifndef
Allow symbols for IPI and shared memory to be set in CMake configuration

Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
2022-04-14 09:15:38 +02:00
Ben Levinsky b28fb3879b apps: zynqmp_r5: wrap app config symbols in ifndef
Allow symbols for IPI and shared memory to be set in CMake configuration

Signed-off-by: Ben Levinsky <ben.levinsky@xilinx.com>
2022-04-14 09:15:38 +02:00
Arnaud Pouliquen 4728d56c85 Fix various typo with codespell
Found via `codespell -q 3 -S ./scripts/spelling.txt`

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-04-14 09:13:39 +02:00
Arnaud Pouliquen b90535e319 CI: add codespell support to check typos
Enable the use of codespell tool in checkpatch.pl
For this the checkpatch.pl as been partially rebased on the Linux one.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-04-11 09:27:06 +02:00
Arnaud Pouliquen f27850d74d CI: clean-up check on check compliance test
- Rebase check_compliance.py and compliance.yml from zephyr project
- Fix checkpatch subprocess command.
- rebase

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-04-11 09:27:06 +02:00
Tammy Leino eecda52787 Removed unused code from rpmsg_get_endpoint
Case for src and dest address is unused since the first case matches src only.

Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
2022-04-06 10:24:57 +02:00
chao an 0307c3f0ed remoteproc: fix memory issue if load resource table failed
The old code pass the error code to metal_free_memory in failure
which is obviously wrong:

1. Generate the memory leak
2. May corrupt the heap manager

Signed-off-by: chao an <anchao@xiaomi.com>
2022-03-30 10:46:51 +02:00
Joshua Lin b139a1ff11 virtqueue: fix invalidate wrong cache region
The current code fetches the vring index before invalidating the cache.
This can lead to using an invalid index.
Fetch the index before invalidation to ensure a correct index.
Signed-off-by: Joshua Lin <jlin@petaio.com>
2022-02-24 16:59:41 +01:00
Joshua Lin 837f0784ee remoteproc: fix remoteproc get wrong memory
When memory region are continuous, it may get wrong memory region.
If pa is equal to the end address of the memory and size equal zero.
It will get wrong memory region.
So need to add check pa is smaller then end address.
Signed-off-by: Joshua Lin <jlin@petaio.com>
2022-02-24 16:59:41 +01:00
Xiang Xiao b8cd61b519 rpmsg: merge rpmsg_initialize_ept into rpmsg_register_endpoint
so the service with preserved address could call rpmsg_register_endpoint only

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-25 10:21:10 +01:00
Xiang Xiao 353122136d rpmsg_virtio: move RPMSG_VIRTIO_DEFAULT_CONFIG to private location
and define it to NULL when VIRTIO_SLAVE_ONLY is defined to save space

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-24 09:37:31 +01:00
Hubert Miś a12d03ccc1 rpmsg_virtio: docs fixes for the rpmsg_init_vdev function
Replacing potentially objectionable terms from the function description.
Language fixes.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-01-04 10:20:47 +01:00