-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zephyr: include: rtos: Use native Zephyr cache management functions o… #7458
zephyr: include: rtos: Use native Zephyr cache management functions o… #7458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
d3fda32
to
192616e
Compare
@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. |
95d78f8
to
c80343d
Compare
Fixed CI errors for sparse Zephyr and included a little macro cleanup. |
c80343d
to
d6213b9
Compare
Updates:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @LaurentiuM1234 , looks great now!
d6213b9
to
9cefd95
Compare
Fixed typo in commit message leading to checkpatch error. |
zephyr/include/rtos/cache.h
Outdated
* | ||
* TODO: in time, switch to simply using CONFIG_DCACHE_LINE_SIZE | ||
*/ | ||
#define DCACHE_LINE_SIZE CONFIG_SOF_DCACHE_LINE_SIZE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
9cefd95
to
925e67a
Compare
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. |
925e67a
to
817465b
Compare
817465b
to
0beb03f
Compare
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.