-
Notifications
You must be signed in to change notification settings - Fork 170
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
Setting dma-coherent on devices created through /dev/u-dma-buf-mgr #69
Comments
Thank you for the issue. At the moment, u-dma-buf is configured by u-dma-buf-mgr only by device name and buffer capacity. Originally u-dma-buf was designed with the device tree in mind. Settings by other methods are still incomplete. Thank you for your feedback. |
By the way, you said that your design uses HPC0. Do you use "Broadcasting Inner Shareable"? "Zynq UltraScale MPSoC Cache Coherency" has the following description. https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842098/Zynq+UltraScale+MPSoC+Cache+Coherency
For Linux, cache coherency cannot be guaranteed unless ZynqMP is configured as described in "Broadcasting Inner Shareable". The dma-coherent property is just for the Linux kernel to check if DMA guarantees cache coherence in hardware. It does not configure DMA in hardware to guarantee cache coherency. |
Yes, I did enable broadcasting inner shareable. BTW, I'm using exclusive access (atomic memory updates - AxLOCK = 1'b1) and trying to make them coherent. The behavior I see is quite different from the described in the AXI specs. Since the main problem is when PS atomically updates cached memory and PL can't see the updates, I also tried to enable the Enable_snoops bit from CCI's Snoop_Control_Register_S3 as in here: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842098/Zynq+UltraScale+MPSoC+Cache+Coherency#ZynqUltraScaleMPSoCCacheCoherency-6Snooping The other way around works fine: when PL updates cached memory, PS can see the updates (coherent). I've posted more details in Xilinx forum here: https://bit.ly/3tng81y Thanks for the help. |
I accessed the URL provided, but it was "Message Not Found". |
Hi.
I'm using u-dma-buf on a Zynq MPSoC Ultrascale+ board (ZCU102). I'm trying to make the allocated DMA buffer to be cache coherent while using Exclusive access (atomic operations).
My design connects using the HPC0 port, and I'm driving AxCACHE/AxUSER/AxPROT/AxLOCK signals. My application allocates DMA buffer on demand, at startup, using the /dev/u-dma-buf-mgr. When buffer is created, I see
dma_coherent
is0
(using/sys/...
file).Is there a way to set
dma_coherent
to1
upon buffer allocation ? I'm not using device tree because looks like it already creates buffers of a pre-defined size.For now, I was able to enable write coherency: when the PL writes to memory (using AWCACHE[3:0] = 4'b1100), PS access data immediately. When PS writes data, PL reads the previous value written by the PL, not by the PS.
thanks.
The text was updated successfully, but these errors were encountered: