The branch main has been updated by manu:

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

commit b69c49d106325a9ceb06ca0d5b827d1dbcc8a54c
Author:     Emmanuel Vadot <[email protected]>
AuthorDate: 2023-09-23 16:56:26 +0000
Commit:     Emmanuel Vadot <[email protected]>
CommitDate: 2023-10-05 15:34:38 +0000

    dwc: Add support for aal
    
    snps,aal is used to indicate that the DMA engine should
    use Address-Aligned Beats.
---
 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 7acb70457a24..7b9cd936681d 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -1610,6 +1610,7 @@ dwc_attach(device_t dev)
        bool nopblx8 = false;
        bool fixed_burst = false;
        bool mixed_burst = false;
+       bool aal = false;
 
        sc = device_get_softc(dev);
        sc->dev = dev;
@@ -1650,6 +1651,8 @@ dwc_attach(device_t dev)
                fixed_burst = true;
        if (OF_hasprop(sc->node, "snps,mixed-burst") == 1)
                mixed_burst = true;
+       if (OF_hasprop(sc->node, "snps,aal") == 1)
+               aal = true;
 
        if (IF_DWC_INIT(dev) != 0)
                return (ENXIO);
@@ -1697,6 +1700,8 @@ dwc_attach(device_t dev)
                reg |= BUS_MODE_FIXEDBURST;
        if (mixed_burst)
                reg |= BUS_MODE_MIXEDBURST;
+       if (aal)
+               reg |= BUS_MODE_AAL;
 
        WRITE4(sc, BUS_MODE, reg);
 
diff --git a/sys/dev/dwc/if_dwc.h b/sys/dev/dwc/if_dwc.h
index 113477818e4b..be27b189e4e8 100644
--- a/sys/dev/dwc/if_dwc.h
+++ b/sys/dev/dwc/if_dwc.h
@@ -220,6 +220,7 @@
 /* DMA */
 #define        BUS_MODE                0x1000
 #define         BUS_MODE_MIXEDBURST    (1 << 26)
+#define         BUS_MODE_AAL           (1 << 25)
 #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 */

Reply via email to