-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Description
Is your feature request related to a problem? Please describe.
RISC-V architecture in Zephyr does not provide implementations for cache management functions (arch_dcache_, arch_icache_), causing build failures when boards declare cache support via CONFIG_CPU_HAS_ICACHE/CONFIG_CPU_HAS_DCACHE and tests attempt to use cache management APIs.
Describe the solution you'd like
Implement RISC-V cache management functions. RISC-V has standardized cache management through the Zicbom (Cache Block Management Operations) extension, which provides instructions like:
cbo.clean - Clean cache line
cbo.flush - Flush cache line
cbo.inval - Invalidate cache line
The implementation would need to:
Create arch/riscv/core/cache.c (or add inline implementations to headers)
Implement all required arch_cache_ functions
Use Zicbom instructions where available, with appropriate feature detection
Handle cases where Zicbom is not available
Describe alternatives you've considered
No response