Commit 447c418d authored by Bjoern A. Zeeb's avatar Bjoern A. Zeeb
Browse files

USB: add quirks to XHCI

While XHCI is very generic some revisions of chipsets have problems.
On dwc3 <= 3.00a Port Disable does not seem to work so we need to not
enable it.
For that introduce quirks to xhci so that controllers can steer
certain features.  I would hope that this is and remains the only one.

Obtained from:	an old patch mainly debugging other problems
MFC after:	2 weeks
Reviewed by:	hselasky
Differential Revision:
parent 799051e2
......@@ -3392,7 +3392,8 @@ xhci_roothub_exec(struct usb_device *udev,
XWRITE4(sc, oper, port, v | XHCI_PS_PRC);
XWRITE4(sc, oper, port, v | XHCI_PS_PED);
if ((sc->sc_quirks & XHCI_QUIRK_DISABLE_PORT_PED) == 0)
XWRITE4(sc, oper, port, v | XHCI_PS_PED);
XWRITE4(sc, oper, port, v & ~XHCI_PS_PP);
......@@ -487,6 +487,10 @@ union xhci_hub_desc {
typedef int (xhci_port_route_t)(device_t, uint32_t, uint32_t);
enum xhci_quirks {
struct xhci_softc {
struct xhci_hw_softc sc_hw;
/* base device */
......@@ -563,6 +567,9 @@ struct xhci_softc {
/* vendor string for root HUB */
char sc_vendor[16];
/* XHCI quirks. */
uint32_t sc_quirks;
#define XHCI_CMD_LOCK(sc) sx_xlock(&(sc)->sc_cmd_sx)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment