git: a1a067b7131e - main - axidma(4): add local data cache flushes.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 22 Apr 2025 09:37:02 UTC
The branch main has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=a1a067b7131ef9122800f16dbc154dd390dc74a6 commit a1a067b7131ef9122800f16dbc154dd390dc74a6 Author: Ruslan Bukin <br@FreeBSD.org> AuthorDate: 2025-04-22 09:28:55 +0000 Commit: Ruslan Bukin <br@FreeBSD.org> CommitDate: 2025-04-22 09:28:55 +0000 axidma(4): add local data cache flushes. As axidma(4) does not support busdma(9) then add local cache flushes, and map descriptors using default memory attribute (cacheable type). This fixes operation on Codasip X730. Sponsored by: UKRI --- sys/dev/xilinx/axidma.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/xilinx/axidma.c b/sys/dev/xilinx/axidma.c index 5b92f90df683..77a46c712980 100644 --- a/sys/dev/xilinx/axidma.c +++ b/sys/dev/xilinx/axidma.c @@ -169,6 +169,9 @@ axidma_intr(struct axidma_softc *sc, while (chan->idx_tail != chan->idx_head) { desc = chan->descs[chan->idx_tail]; + cpu_dcache_wbinv_range((vm_offset_t)desc, + sizeof(struct axidma_desc)); + if ((desc->status & BD_STATUS_CMPLT) == 0) break; @@ -357,7 +360,8 @@ axidma_desc_alloc(struct axidma_softc *sc, struct xdma_channel *xchan, return (-1); } chan->mem_vaddr = kva_alloc(chan->mem_size); - pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr); + pmap_kenter(chan->mem_vaddr, chan->mem_size, chan->mem_paddr, + VM_MEMATTR_DEFAULT); device_printf(sc->dev, "Allocated chunk %lx %lu\n", chan->mem_paddr, chan->mem_size); @@ -493,6 +497,9 @@ axidma_channel_submit_sg(device_t dev, struct xdma_channel *xchan, if (sg[i].last == 1) desc->control |= BD_CONTROL_TXEOF; + cpu_dcache_wbinv_range((vm_offset_t)desc, + sizeof(struct axidma_desc)); + tmp = chan->idx_head; atomic_add_int(&chan->descs_used_count, 1);