summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-03-23 21:37:45 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-03-23 21:37:45 +0000
commit7e54723f10912dbfafbbba2fb64cdaa442f87f40 (patch)
treed671612a2471b37ee192a981c7536561f275be2f /sys/pci
parent19a0bccc49b8e77cfdc7ff4d5f6ec9c3c58c29b2 (diff)
downloadFreeBSD-src-7e54723f10912dbfafbbba2fb64cdaa442f87f40.zip
FreeBSD-src-7e54723f10912dbfafbbba2fb64cdaa442f87f40.tar.gz
Check whether the PIRQD enable bit is set in LegSup and if not, set it.
On my PIIX4 chip rev 1 this is required. Have not had any complaints from other people so it might be a problem with this stepping.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/uhci_pci.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c
index 80e170a..8b8d9bb 100644
--- a/sys/pci/uhci_pci.c
+++ b/sys/pci/uhci_pci.c
@@ -1,4 +1,4 @@
-/* FreeBSD $Id: uhci_pci.c,v 1.9 1999/01/22 00:36:46 n_hibma Exp $ */
+/* FreeBSD $Id: uhci_pci.c,v 1.1 1999/02/18 21:42:19 n_hibma Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -128,7 +128,7 @@ uhci_pci_probe(pcici_t config_id, pcidi_t device_id)
static void
uhci_pci_attach(pcici_t config_id, int unit)
{
- int id;
+ int id, legsup;
char *typestr;
usbd_status r;
uhci_softc_t *sc = NULL;
@@ -165,9 +165,8 @@ uhci_pci_attach(pcici_t config_id, int unit)
typestr = "unknown";
break;
}
- printf("usb%d: USB version %s, interrupting at %d\n", unit,
- typestr,
- (int)pci_conf_read(config_id,PCI_INTERRUPT_REG) & 0xff);
+ printf("usb%d: USB version %s, chip rev. %d\n", unit, typestr,
+ (int) pci_conf_read(config_id, PCIR_REVID) & 0xff);
}
/* Figure out vendor for root hub descriptor. */
@@ -193,9 +192,7 @@ uhci_pci_attach(pcici_t config_id, int unit)
*/
sc->sc_bus.bdev = device_add_child(root_bus, "usb", unit, sc);
if (!sc->sc_bus.bdev) {
- printf("%s%d: could not add USB device to root bus\n",
- device_get_name(sc->sc_bus.bdev),
- device_get_unit(sc->sc_bus.bdev));
+ printf("usb%d: could not add USB device to root bus\n", unit);
return;
}
@@ -214,6 +211,18 @@ uhci_pci_attach(pcici_t config_id, int unit)
device_set_desc(sc->sc_bus.bdev, uhci_device_generic);
}
+ legsup = pci_conf_read(config_id, PCI_LEGSUP);
+ if ( ! (legsup & PCI_LEGSUP_USBPIRQDEN) ) {
+#if ! (defined(USBVERBOSE) || defined(USB_DEBUG))
+ if (bootverbose)
+#endif
+ printf("%s%d: PIRQD enable not set\n",
+ device_get_name(sc->sc_bus.bdev),
+ device_get_unit(sc->sc_bus.bdev));
+ legsup |= PCI_LEGSUP_USBPIRQDEN;
+ pci_conf_write(config_id, PCI_LEGSUP, legsup);
+ }
+
r = uhci_init(sc);
if (r != USBD_NORMAL_COMPLETION) {
printf("%s%d: init failed, error=%d\n",
OpenPOWER on IntegriCloud