-/* $OpenBSD: ohci.c,v 1.10 2000/03/30 16:19:32 aaron Exp $ */
-/* $NetBSD: ohci.c,v 1.84 2000/03/29 18:24:53 augustss Exp $ */
+/* $OpenBSD: ohci.c,v 1.11 2000/04/01 19:11:35 aaron Exp $ */
+/* $NetBSD: ohci.c,v 1.85 2000/04/01 09:27:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
/*
desca = OREAD4(sc, OHCI_RH_DESCRIPTOR_A);
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca | OHCI_NOCP);
OWRITE4(sc, OHCI_RH_STATUS, OHCI_LPSC); /* Enable port power */
- usb_delay_ms(&sc->sc_bus, 5);
+ usb_delay_ms(&sc->sc_bus, OHCI_ENABLE_POWER_DELAY);
OWRITE4(sc, OHCI_RH_DESCRIPTOR_A, desca);
+ /*
+ * The AMD756 requires a delay before re-reading the register,
+ * otherwise it will occasionally report 0 ports.
+ */
+ usb_delay_ms(&sc->sc_bus, OHCI_READ_DESC_DELAY);
sc->sc_noport = OHCI_GET_NDP(OREAD4(sc, OHCI_RH_DESCRIPTOR_A));
#ifdef OHCI_DEBUG
-/* $OpenBSD: ohcireg.h,v 1.6 2000/03/30 16:19:32 aaron Exp $ */
-/* $NetBSD: ohcireg.h,v 1.16 2000/03/29 01:46:27 augustss Exp $ */
+/* $OpenBSD: ohcireg.h,v 1.7 2000/04/01 19:11:36 aaron Exp $ */
+/* $NetBSD: ohcireg.h,v 1.17 2000/04/01 09:27:35 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohcireg.h,v 1.8 1999/11/17 22:33:40 n_hibma Exp $ */
#define OHCI_CC_BUFFER_UNDERRUN 13
#define OHCI_CC_NOT_ACCESSED 15
+/* Some delay needed when changing certain registers. */
+#define OHCI_ENABLE_POWER_DELAY 5
+#define OHCI_READ_DESC_DELAY 5
+
#endif /* _DEV_PCI_OHCIREG_H_ */