Page MenuHomeFreeBSD

D62184.1796149795.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62184.1796149795.diff

Index: sys/dev/usb/controller/dwc3/dwc3.h
===================================================================
--- sys/dev/usb/controller/dwc3/dwc3.h
+++ sys/dev/usb/controller/dwc3/dwc3.h
@@ -67,6 +67,7 @@
#define DWC3_GBUSERRADDRHI 0xc134
#define DWC3_GPRTBIMAPLO 0xc138
#define DWC3_GHWPARAMS0 0xc140
+#define DWC3_GHWPARAMS0_AWIDTH(x) (((x) >> 24) & 0xff)
#define DWC3_GHWPARAMS0_MODE_DUALROLEDEVICE 0x2
#define DWC3_GHWPARAMS0_MODE_MASK 0x3
#define DWC3_GHWPARAMS1 0xc144
Index: sys/dev/usb/controller/dwc3/dwc3.c
===================================================================
--- sys/dev/usb/controller/dwc3/dwc3.c
+++ sys/dev/usb/controller/dwc3/dwc3.c
@@ -96,8 +96,6 @@
#define DWC3_READ(_sc, _off) \
bus_space_read_4(_sc->bst, _sc->bsh, _off)
-#define IS_DMA_32B 1
-
static void
xhci_interrupt_poll(void *_sc)
{
@@ -114,6 +112,8 @@
{
struct snps_dwc3_softc *snps_sc = device_get_softc(dev);
struct xhci_softc *sc = &snps_sc->sc;
+ uint32_t ghwp0;
+ uint8_t dma32;
int err = 0, rid = 0;
sc->sc_io_res = snps_sc->mem_res;
@@ -149,7 +149,11 @@
}
}
- err = xhci_init(sc, dev, IS_DMA_32B);
+ ghwp0 = DWC3_READ(snps_sc, DWC3_GHWPARAMS0);
+ dma32 = (DWC3_GHWPARAMS0_AWIDTH(ghwp0) == 64 &&
+ sizeof(long) == 8) ? 0 : 1;
+
+ err = xhci_init(sc, dev, dma32);
if (err != 0) {
device_printf(dev, "Failed to init XHCI, with error %d\n", err);
return (ENXIO);

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 1, 6:29 PM (2 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42129295
Default Alt Text
D62184.1796149795.diff (1 KB)

Event Timeline