openamp: fix CMake dcache option#18858
Merged
simbit18 merged 1 commit intoapache:masterfrom May 10, 2026
Merged
Conversation
xiaoxiang781216
approved these changes
May 9, 2026
CV-Bowen
approved these changes
May 9, 2026
simbit18
approved these changes
May 9, 2026
Member
|
Hi: Could you Rebase your PR with the Master Branch? We fixed the Config Error for esp32p4-function-ev-board. Thanks :-) |
OpenAMP 2025.10.0 removed the deprecated WITH_DCACHE_VRINGS, WITH_DCACHE_BUFFERS and WITH_DCACHE_RSC_TABLE CMake options. The replacement is WITH_DCACHE, which enables VIRTIO_USE_DCACHE for vrings, buffers and resource table cache operations. Use WITH_DCACHE for CONFIG_OPENAMP_CACHE in the CMake integration so the CMake build matches the Makefile path, which already defines VIRTIO_USE_DCACHE directly. Signed-off-by: yaojiaqi <yaojiaqi@lixiang.com>
ff8c6eb to
c4453c3
Compare
Contributor
Author
Thanks for the heads-up and the fix! I've rebased my PR with the master branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenAMP 2025.10.0 removed the deprecated WITH_DCACHE_VRINGS, WITH_DCACHE_BUFFERS and WITH_DCACHE_RSC_TABLE CMake options. The replacement is WITH_DCACHE, which enables VIRTIO_USE_DCACHE for vrings, buffers and resource table cache operations.
Use WITH_DCACHE for CONFIG_OPENAMP_CACHE in the CMake integration so the CMake build matches the Makefile path, which already defines VIRTIO_USE_DCACHE directly.
Note: Please adhere to Contributing Guidelines.
Summary
Fix the OpenAMP CMake integration to use the cache option supported by the
current OpenAMP version.
NuttX selects OpenAMP 2025.10.0 in both build integrations:
set(OPENAMP_VERSION 2025.10.0)OPENAMP_VERSION ?= 2025.10.0For this OpenAMP version,
WITH_DCACHE_VRINGSis no longer consumed byOpenAMP CMake. The supported option is
WITH_DCACHE, which definesVIRTIO_USE_DCACHE:The OpenAMP cache maintenance helpers are guarded by
VIRTIO_USE_DCACHE.For example:
The Makefile integration already uses the correct macro directly:
This change updates the CMake integration to set
WITH_DCACHEwhenCONFIG_OPENAMP_CACHEis enabled, matching the Makefile behavior.Impact
This affects CMake builds with
CONFIG_OPENAMP_CACHE=y.Before this change, the CMake build set
WITH_DCACHE_VRINGS, a deprecatedOpenAMP option that is no longer consumed by OpenAMP 2025.10.0. As a result,
VIRTIO_USE_DCACHEwas not enabled through OpenAMP CMake.After this change, CMake builds enable the intended OpenAMP cache maintenance
path for vrings, RPMsg buffers, and resource table.
Makefile builds are not affected, since they already define
VIRTIO_USE_DCACHEdirectly.Testing
Host:
The validation was done by building the OpenAMP CMake target directly with the
same OpenAMP source selected by NuttX. This isolates the CMake option mapping
and proves whether
VIRTIO_USE_DCACHEis passed to OpenAMP compilation.Before: old option does not enable OpenAMP cache code
Configured OpenAMP with the old option used by NuttX CMake before this change:
cmake -S nuttx/openamp/open-amp \ -B /tmp/openamp-cmake-before \ -DWITH_LIBMETAL_FIND=OFF \ -DWITH_PROXY=OFF \ -DWITH_SHARED_LIB=OFF \ -DWITH_STATIC_LIB=ON \ -DWITH_DCACHE_VRINGS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_C_FLAGS=-I/home/yjq/nuttx/includeCMake reported that the old option is not used:
Built OpenAMP:
Output:
Checked whether
VIRTIO_USE_DCACHEwas added to compile commands:grep -n "WITH_DCACHE_VRINGS\|VIRTIO_USE_DCACHE" \ /tmp/openamp-cmake-before/CMakeCache.txt \ /tmp/openamp-cmake-before/compile_commands.jsonOutput:
VIRTIO_USE_DCACHEwas absent fromcompile_commands.json.Checked the OpenAMP objects:
Output:
This confirms that the old CMake option does not enable OpenAMP cache
maintenance code.
After: new option enables OpenAMP cache code
Configured OpenAMP with the option used by this change:
cmake -S nuttx/openamp/open-amp \ -B /tmp/openamp-cmake-after \ -DWITH_LIBMETAL_FIND=OFF \ -DWITH_PROXY=OFF \ -DWITH_SHARED_LIB=OFF \ -DWITH_STATIC_LIB=ON \ -DWITH_DCACHE=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_C_FLAGS=-I/home/lixiang/yjq/nuttx/includeBuilt OpenAMP:
Output:
Checked that
VIRTIO_USE_DCACHEis present in compile commands:grep -n "WITH_DCACHE:BOOL\|VIRTIO_USE_DCACHE" \ /tmp/openamp-cmake-after/CMakeCache.txt \ /tmp/openamp-cmake-after/compile_commands.jsonOutput excerpt:
Checked the OpenAMP objects:
Output:
This confirms that
WITH_DCACHEenablesVIRTIO_USE_DCACHEand compiles inthe OpenAMP cache maintenance helpers.