Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178159010
D62184.1796149771.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62184.1796149771.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 1, 6:29 PM (2 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42129295
Default Alt Text
D62184.1796149771.diff (1 KB)
Attached To
Mode
D62184: usb: dwc3: derive 32-bit vs 64-bit DMA from DWC3_GHWPARAMS0 AWIDTH
Attached
Detach File
Event Timeline