diff options
-rw-r--r-- | sys/dev/usb/uhci_pci.c | 25 | ||||
-rw-r--r-- | sys/pci/uhci_pci.c | 25 |
2 files changed, 34 insertions, 16 deletions
diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index 80e170a..8b8d9bb 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/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", 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", |