git: f23351e4ff05 - main - dwc: Program the DMA burst length of the QoS core

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Fri, 20 Nov 2026 13:55:53 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=f23351e4ff05b7c112ed0ad6c19bc8fd1689e6e5

commit f23351e4ff05b7c112ed0ad6c19bc8fd1689e6e5
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-10-20 15:15:40 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-20 13:55:30 +0000

    dwc: Program the DMA burst length of the QoS core
    
    dma4_init() set the 8xPBL mode bit but never wrote the programmable burst
    lengths, which stay at the reset value of one beat, so the DMA engines issue
    very short bursts.  The TX and RX burst lengths are already parsed from the
    device tree (snps,pbl, snps,txpbl, snps,rxpbl, default 8) for the older
    core, use them here too.
    
    Reviewed by:    br
    Differential Revision:  https://reviews.freebsd.org/D60920
---
 sys/dev/dwc/dwc4_dma.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/dev/dwc/dwc4_dma.c b/sys/dev/dwc/dwc4_dma.c
index 58e8b009e08e..15a454dcee15 100644
--- a/sys/dev/dwc/dwc4_dma.c
+++ b/sys/dev/dwc/dwc4_dma.c
@@ -635,9 +635,12 @@ dma4_init(struct dwc_softc *sc)
 		reg |= DMACCR_PBLX8;
 	WRITE4(sc, ETH_DMACCR(0), reg);
 
-	WRITE4(sc, ETH_DMACTXCR(0), 0);
+	/* Programmable burst lengths, multiplied by 8 unless snps,no-pbl-x8. */
+	reg = (sc->txpbl << DMACTXCR_TXPBL_S) & DMACTXCR_TXPBL_M;
+	WRITE4(sc, ETH_DMACTXCR(0), reg);
 
 	reg = (MCLBYTES << DMACRXCR_RBSZ_S);
+	reg |= (sc->rxpbl << DMACRXCR_RXPBL_S) & DMACRXCR_RXPBL_M;
 	WRITE4(sc, ETH_DMACRXCR(0), reg);
 
 	reg = DMASBMR_BLEN4;