-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
drivers: uart_stm32: add DCache support in async DMA mode by using nocache memory regions #70503
drivers: uart_stm32: add DCache support in async DMA mode by using nocache memory regions #70503
Conversation
57f2a21
to
85f7ad8
Compare
85f7ad8
to
d76d130
Compare
|
||
if DCACHE | ||
|
||
config DT_DEFINED_NOCACHE |
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.
Perhaps it's time to generalize the DT NOCACHE? Considering its usage here, in the SPI tests, and potentially by applications.
For example, by introducing related configs in
Line 385 in 414b3b7
config NOCACHE_MEMORY |
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.
Yes, I already thought about it, it will simplify things. Thanks!
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.
Perhaps it's time to generalize the DT NOCACHE? Considering its usage here, in the SPI tests, and potentially by applications.
@GeorgeCGV Will do it in another PR for all drivers as soon as this one is merged.
393ade6
to
f8d5a71
Compare
#if defined(CONFIG_DCACHE) && defined(CONFIG_NOCACHE_MEMORY) | ||
#define __NOCACHE __attribute__ ((__section__(".nocache"))) | ||
#define NOCACHE_MEM 1 | ||
#elif defined(CONFIG_DCACHE) && defined(CONFIG_DT_DEFINED_NOCACHE) | ||
#define __NOCACHE __attribute__ ((__section__(CONFIG_DT_DEFINED_NOCACHE_NAME))) | ||
#define NOCACHE_MEM 1 | ||
#else | ||
#define NOCACHE_MEM 0 | ||
#endif /* CONFIG_NOCACHE_MEMORY */ |
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.
Open point, instead of modifiying the code, what about using the code relocation feature which will do the same operation behind the scene. For instance see: https://github.com/zephyrproject-rtos/zephyr/pull/65234/files.
Though, this solution doesn't seem to be compatible with use of ".nocache", so it could be a blocker
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.
interesting, will investigate.
harness: ztest | ||
harness_config: | ||
fixture: gpio_loopback | ||
depends_on: gpio |
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.
@dcpleung I'm surprise about this depends_on: gpio
but I can see it all over this file. Is that expected ?
f8d5a71
to
76d168b
Compare
76d168b
to
2086422
Compare
Adapt the driver to verify if DMA buffers are located in noncacheable memory when DCache is activated, in order to avoid cache coherency issues. This is required until manual cache coherency management is implemented. Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Add support for running tests with DCache enabled & put DMA buffers in a nocache memory region to avoid coherency issues. Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Add test cases/configs for async DMA uart with DCache on STM32F7/H7 boards Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Add the possibility to flash nucleo-f746zg board using west STM32CubeProgrammer runner. Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2086422
to
39ac02b
Compare
@dcpleung I'd like your opinion, specially on the test part, as this part is generic. |
Adapt the stm32 uart driver to verify if DMA buffers, used in async mode, are located in noncacheable memory when DCache is activated, in order to avoid cache coherency issues.
Modify
tests/drivers/uart_async_api
test to run with DCache enabled by putting DMA buffers in a nocache memory region.