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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>