diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-04-09 20:39:04 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-04-09 20:39:04 +0000 |
commit | e35676f1c470b7e077dfd93de1d883b5a5e79fdd (patch) | |
tree | a62eaff4a6fd0b315858447eed09d2b95e1dcc72 /sys/dev/fdt/xhci_fdt.c | |
parent | da3965a4df1392a024334520db51d277e907d1f1 (diff) |
Add two more dwc3 quirks.
ok visa@, patrick@
Diffstat (limited to 'sys/dev/fdt/xhci_fdt.c')
-rw-r--r-- | sys/dev/fdt/xhci_fdt.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/fdt/xhci_fdt.c b/sys/dev/fdt/xhci_fdt.c index c98dbf8368a..9976b81445c 100644 --- a/sys/dev/fdt/xhci_fdt.c +++ b/sys/dev/fdt/xhci_fdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci_fdt.c,v 1.7 2018/03/29 11:41:15 kettenis Exp $ */ +/* $OpenBSD: xhci_fdt.c,v 1.8 2018/04/09 20:39:03 kettenis Exp $ */ /* * Copyright (c) 2017 Mark kettenis <kettenis@openbsd.org> * @@ -134,9 +134,12 @@ unmap: #define USB3_GCTL_PRTCAPDIR_MASK (0x3 << 12) #define USB3_GCTL_PRTCAPDIR_HOST (0x1 << 12) #define USB3_GCTL_PRTCAPDIR_DEVICE (0x2 << 12) +#define USB3_GUCTL1 0xc11c +#define USB3_GUCTL1_TX_IPGAP_LINECHECK_DIS (1 << 28) #define USB3_GUSB2PHYCFG0 0xc200 #define USB3_GUSB2PHYCFG0_U2_FREECLK_EXISTS (1 << 30) #define USB3_GUSB2PHYCFG0_USBTRDTIM(n) ((n) << 10) +#define USB3_GUSB2PHYCFG0_ENBLSLPM (1 << 8) #define USB3_GUSB2PHYCFG0_SUSPENDUSB20 (1 << 6) #define USB3_GUSB2PHYCFG0_PHYIF (1 << 3) @@ -147,7 +150,7 @@ xhci_dwc3_init(struct xhci_fdt_softc *sc) int node = sc->sc_node; uint32_t reg; - /* We don't support device mode, so alway force host mode. */ + /* We don't support device mode, so always force host mode. */ reg = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USB3_GCTL); reg &= ~USB3_GCTL_PRTCAPDIR_MASK; reg |= USB3_GCTL_PRTCAPDIR_HOST; @@ -166,9 +169,17 @@ xhci_dwc3_init(struct xhci_fdt_softc *sc) } if (OF_getproplen(node, "snps,dis-u2-freeclk-exists-quirk") == 0) reg &= ~USB3_GUSB2PHYCFG0_U2_FREECLK_EXISTS; + if (OF_getproplen(node, "snps,dis_enblslpm_quirk") == 0) + reg &= ~USB3_GUSB2PHYCFG0_ENBLSLPM; if (OF_getproplen(node, "snps,dis_u2_susphy_quirk") == 0) reg &= ~USB3_GUSB2PHYCFG0_SUSPENDUSB20; bus_space_write_4(sc->sc.iot, sc->sc.ioh, USB3_GUSB2PHYCFG0, reg); + + /* Configure USB3 quirks. */ + reg = bus_space_read_4(sc->sc.iot, sc->sc.ioh, USB3_GUCTL1); + if (OF_getproplen(node, "snps,dis-tx-ipgap-linecheck-quirk") == 0) + reg |= USB3_GUCTL1_TX_IPGAP_LINECHECK_DIS; + bus_space_write_4(sc->sc.iot, sc->sc.ioh, USB3_GUCTL1, reg); } /* |