-/* $OpenBSD: xhci_pci.c,v 1.13 2024/05/24 06:02:58 jsg Exp $ */
+/* $OpenBSD: xhci_pci.c,v 1.14 2024/08/17 01:55:03 jsg Exp $ */
/*
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_FRESCO_FL1400)
pa->pa_flags &= ~PCI_FLAGS_MSI_ENABLED;
break;
+ case PCI_VENDOR_AMD:
+ if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_17_1X_XHCI_1 ||
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_17_1X_XHCI_2)
+ psc->sc.sc_flags |= XHCI_NOCSS;
+ break;
}
/* Map and establish the interrupt. */
-/* $OpenBSD: xhci.c,v 1.133 2024/08/15 17:17:05 kettenis Exp $ */
+/* $OpenBSD: xhci.c,v 1.134 2024/08/17 01:55:03 jsg Exp $ */
/*
* Copyright (c) 2014-2015 Martin Pieuchot
* will prevent the SoC from reaching its lowest idle state.
* So save the state here.
*/
+ if ((sc->sc_flags & XHCI_NOCSS) == 0) {
+ XOWRITE4(sc, XHCI_USBCMD, XHCI_CMD_CSS); /* Save state */
+ hcr = XOREAD4(sc, XHCI_USBSTS);
+ for (i = 0; i < 100; i++) {
+ usb_delay_ms(&sc->sc_bus, 1);
+ hcr = XOREAD4(sc, XHCI_USBSTS) & XHCI_STS_SSS;
+ if (!hcr)
+ break;
+ }
- XOWRITE4(sc, XHCI_USBCMD, XHCI_CMD_CSS); /* Save state */
- hcr = XOREAD4(sc, XHCI_USBSTS);
- for (i = 0; i < 100; i++) {
- usb_delay_ms(&sc->sc_bus, 1);
- hcr = XOREAD4(sc, XHCI_USBSTS) & XHCI_STS_SSS;
- if (!hcr)
- break;
- }
+ if (hcr) {
+ printf("%s: save state timeout\n", DEVNAME(sc));
+ xhci_reset(sc);
+ return;
+ }
- if (hcr) {
- printf("%s: save state timeout\n", DEVNAME(sc));
- xhci_reset(sc);
- return;
+ sc->sc_saved_state = 1;
}
- sc->sc_saved_state = 1;
-
/* Disable interrupts. */
XRWRITE4(sc, XHCI_IMOD(0), 0);
XRWRITE4(sc, XHCI_IMAN(0), 0);
-/* $OpenBSD: xhcivar.h,v 1.15 2024/08/15 17:17:05 kettenis Exp $ */
+/* $OpenBSD: xhcivar.h,v 1.16 2024/08/17 01:55:03 jsg Exp $ */
/*
* Copyright (c) 2014 Martin Pieuchot
char sc_vendor[16]; /* Vendor string for root hub */
int sc_id_vendor; /* Vendor ID for root hub */
+
+ int sc_flags;
+#define XHCI_NOCSS 0x01
};
int xhci_init(struct xhci_softc *);