diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-03-02 20:42:06 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-03-02 20:42:06 +0000 |
commit | 8dc95f1ef3391ce2b99f9ee21f9c726ed536598a (patch) | |
tree | 216e63791abe20a5e053871cf392f8635c2c5226 /sys/dev/usb | |
parent | 845accea495a907b47559a2ef8467933061b2ef9 (diff) | |
download | FreeBSD-src-8dc95f1ef3391ce2b99f9ee21f9c726ed536598a.zip FreeBSD-src-8dc95f1ef3391ce2b99f9ee21f9c726ed536598a.tar.gz |
Add quirk to disable 64-bit XHCI DMA after r276717.
Requested by: Gary Jennejohn <gljennjohn@gmail.com>
MFC after: 3 days
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/controller/xhci.c | 13 | ||||
-rw-r--r-- | sys/dev/usb/controller/xhci.h | 2 | ||||
-rw-r--r-- | sys/dev/usb/controller/xhci_pci.c | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index b248399..412c27a 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -97,15 +97,19 @@ SYSCTL_INT(_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RWTUN, static int xhcidebug; static int xhciroute; static int xhcipolling; +static int xhcidma32; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RWTUN, &xhcidebug, 0, "Debug level"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RWTUN, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); + &xhciroute, 0, "Routing bitmap for switching EHCI ports to the XHCI controller"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, use_polling, CTLFLAG_RWTUN, - &xhcipolling, 0, "Set to enable software interrupt polling for XHCI controller"); + &xhcipolling, 0, "Set to enable software interrupt polling for the XHCI controller"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dma32, CTLFLAG_RWTUN, + &xhcidma32, 0, "Set to only use 32-bit DMA for the XHCI controller"); #else #define xhciroute 0 +#define xhcidma32 0 #endif #define XHCI_INTR_ENDPT 1 @@ -576,7 +580,7 @@ xhci_halt_controller(struct xhci_softc *sc) } usb_error_t -xhci_init(struct xhci_softc *sc, device_t self) +xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -623,7 +627,8 @@ xhci_init(struct xhci_softc *sc, device_t self) } /* get DMA bits */ - sc->sc_bus.dma_bits = XHCI_HCS0_AC64(temp) ? 64 : 32; + sc->sc_bus.dma_bits = (XHCI_HCS0_AC64(temp) && + xhcidma32 == 0 && dma32 == 0) ? 64 : 32; device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index c7610bb..ac21c0f 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -522,7 +522,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); -usb_error_t xhci_init(struct xhci_softc *, device_t); +usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index b39782a..9821814 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -192,7 +192,7 @@ xhci_pci_attach(device_t self) sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); sc->sc_io_size = rman_get_size(sc->sc_io_res); - if (xhci_init(sc, self)) { + if (xhci_init(sc, self, 0)) { device_printf(self, "Could not initialize softc\n"); bus_release_resource(self, SYS_RES_MEMORY, PCI_XHCI_CBMEM, sc->sc_io_res); |