Repository navigation
zephyr: include: rtos: Use native Zephyr cache management functions o… - #7458
Conversation
kv2019i
left a comment
There was a problem hiding this comment.
In principle ok, but some questions, please see inline
|
@LaurentiuM1234 any update, I think the Zephyr cache changes are now merged ? |
Checked zephyrproject-rtos/zephyr#50136 and it has been tagged with DNM for now. Seems like it will be merged later on. Might be worth keeping the wrappers over the Zephyr cache-management API at least on ARM64 where it seems like there's an option to |
|
@LaurentiuM1234 wrote:
This was now merged and pulled into SOF main.
I think we must keep the wrappers as long as we have any non-Zephyr targets in SOF main (although at some point we can turn these into reverse wrappers, i.e. change app code to call Zephyr interface, and provide wrappers for XTOS builds). But for Zephyr builds, we should map to native Zephyr calls for all targets and not include arch/lib/cache.h (this should be reserved for XTOS). Can you update the PR so that the mapping to native Zephyr calls is done for all targets and then you can have some additional defines for ARM64 on top? |
|
@kv2019i Sorry for taking such a long time to update this. It should be good to go RN. Tested on NXP's side and seems to work fine. |
|
Fixed CI errors for sparse Zephyr and included a little macro cleanup. |
|
Updates:
|
kv2019i
left a comment
There was a problem hiding this comment.
Thanks @LaurentiuM1234 , looks great now!
|
Fixed typo in commit message leading to checkpatch error. |
There was a problem hiding this comment.
I'm wondering how much more work would it be to go with CONFIG_DCACHE_LINE_SIZE directly?
There was a problem hiding this comment.
Hmm, shouldn't be much trouble. Will give it a shot and submit a Zephyr PR if I can get something working.
There was a problem hiding this comment.
@lyakh so should we merge this? and make the change in a separate PR?
|
Marking this as a draft until I can figure out if we can easily get rid of CONFIG_SOF_DCACHE_LINE_SIZE by using CONFIG_DCACHE_LINE_SIZE from Zephyr. Might as well do this now so we won't have to change it later. |
|
Zephyr PR in which CONFIG_DCACHE_LINE_SIZE is set for all SOF-supported boards is ready: zephyrproject-rtos/zephyr#57926. Will update this PR once the Zephyr one is merged. |
|
zephyrproject-rtos/zephyr#57926 has been merged. Now waiting on #7642 and this can be merged IMO. EDIT: CI fails are normal for now because CONFIG_DCACHE_LINE_SIZE is not currently set without #7642. |
Thanks to PR [1], Zephyr cache management API can now be used on xtensa-based SoCs. As a consequence to this, there's no longer a need to use SOF's arch/ layer for cache management. This commit forces all SoCs which support Zephyr to use its native cache management API. [1]: zephyrproject-rtos/zephyr#50136 Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit removes CACHE_INVALIDATE and CACHE_WRITEBACK_INV macros which are not used. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
|
Updates:
|
|
Known error https://sof-ci.01.org/sofpr/PR7458/build8506/devicetest/index.html , fuzz check failure unrelated to this PR. Proceeding with merge. |
Since Zephyr offers cache-management operations for the arm64 architecture we can make use of them on all ARM64-based platforms. In time, if the architecture supports it, more platforms could end up using them instead of using the ones in arch/lib/cache.h.
Please see #7192 for PR dependency graph.