git: f4bb6ea5212b - main - dwc: Add support for mixed-burst

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Thu, 05 Oct 2023 15:34:57 UTC
The branch main has been updated by manu:

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

commit f4bb6ea5212b05445e1e7f01d9023714c83344cb
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2023-09-23 16:52:29 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-10-05 15:34:38 +0000

    dwc: Add support for mixed-burst
    
    snps,mixed-burst is used to indicate that the DMA engine should
    use mixed-burst mode.
---
 sys/dev/dwc/if_dwc.c | 5 +++++
 sys/dev/dwc/if_dwc.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 6ef9fb8513af..7acb70457a24 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -1609,6 +1609,7 @@ dwc_attach(device_t dev)
 	uint32_t txpbl, rxpbl, pbl;
 	bool nopblx8 = false;
 	bool fixed_burst = false;
+	bool mixed_burst = false;
 
 	sc = device_get_softc(dev);
 	sc->dev = dev;
@@ -1647,6 +1648,8 @@ dwc_attach(device_t dev)
 		nopblx8 = true;
 	if (OF_hasprop(sc->node, "snps,fixed-burst") == 1)
 		fixed_burst = true;
+	if (OF_hasprop(sc->node, "snps,mixed-burst") == 1)
+		mixed_burst = true;
 
 	if (IF_DWC_INIT(dev) != 0)
 		return (ENXIO);
@@ -1692,6 +1695,8 @@ dwc_attach(device_t dev)
 	reg |= (rxpbl << BUS_MODE_RPBL_SHIFT);
 	if (fixed_burst)
 		reg |= BUS_MODE_FIXEDBURST;
+	if (mixed_burst)
+		reg |= BUS_MODE_MIXEDBURST;
 
 	WRITE4(sc, BUS_MODE, reg);
 
diff --git a/sys/dev/dwc/if_dwc.h b/sys/dev/dwc/if_dwc.h
index 5397b5801596..113477818e4b 100644
--- a/sys/dev/dwc/if_dwc.h
+++ b/sys/dev/dwc/if_dwc.h
@@ -219,6 +219,7 @@
 
 /* DMA */
 #define	BUS_MODE		0x1000
+#define	 BUS_MODE_MIXEDBURST	(1 << 26)
 #define	 BUS_MODE_EIGHTXPBL	(1 << 24) /* Multiplies PBL by 8 */
 #define	 BUS_MODE_USP		(1 << 23)
 #define	 BUS_MODE_RPBL_SHIFT	17 /* Single block transfer size */