From adad9ac78e8ab4fd3b329a4753c97503bea836ea Mon Sep 17 00:00:00 2001 From: n_hibma Date: Sun, 6 Feb 2000 14:52:27 +0000 Subject: [PATCH] Disable the generation of SMIs (System Management Interrupts). Always set the PIRQD bit. This fixes the problem of uhub0 hanging forever during boot when USB keyboard support is switched on in the BIOS on motherboards with Intel chipsets (UHCI). Approved by: The Sheep --- sys/dev/usb/uhci_pci.c | 20 ++++++++++---------- sys/pci/uhci_pci.c | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/dev/usb/uhci_pci.c b/sys/dev/usb/uhci_pci.c index 0fbade090d2f..0a3959b947b0 100644 --- a/sys/dev/usb/uhci_pci.c +++ b/sys/dev/usb/uhci_pci.c @@ -158,7 +158,6 @@ uhci_pci_attach(device_t self) void *ih; struct resource *io_res, *irq_res; int intr; - int legsup; int err; rid = PCI_UHCI_BASE_REG; @@ -239,16 +238,17 @@ uhci_pci_attach(device_t self) goto bad3; } - /* Verify that the PIRQD enable bit is set, some BIOS's don't do that */ - legsup = pci_read_config(self, PCI_LEGSUP, 4); - if ( !(legsup & PCI_LEGSUP_USBPIRQDEN) ) { -#ifndef USB_DEBUG - if (bootverbose) + /* Set the PIRQD enable bit and switch off all the others. We don't + * want legacy support to interfere with us + * XXX Does this also mean that the BIOS won't touch the keyboard + * anymore if it is connected to the ports of the root hub? + */ +#ifdef UHCI_DEBUG + if (pci_read_config(self, PCI_LEGSUP, 4) != PCI_LEGSUP_USBPIRQDEN) + device_printf(self, "LegSup = 0x%08x\n", + pci_read_config(self, PCI_LEGSUP, 4)); #endif - device_printf(self, "PIRQD enable not set\n"); - legsup |= PCI_LEGSUP_USBPIRQDEN; - pci_write_config(self, PCI_LEGSUP, legsup, 4); - } + pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 4); err = uhci_init(sc); if (!err) diff --git a/sys/pci/uhci_pci.c b/sys/pci/uhci_pci.c index 0fbade090d2f..0a3959b947b0 100644 --- a/sys/pci/uhci_pci.c +++ b/sys/pci/uhci_pci.c @@ -158,7 +158,6 @@ uhci_pci_attach(device_t self) void *ih; struct resource *io_res, *irq_res; int intr; - int legsup; int err; rid = PCI_UHCI_BASE_REG; @@ -239,16 +238,17 @@ uhci_pci_attach(device_t self) goto bad3; } - /* Verify that the PIRQD enable bit is set, some BIOS's don't do that */ - legsup = pci_read_config(self, PCI_LEGSUP, 4); - if ( !(legsup & PCI_LEGSUP_USBPIRQDEN) ) { -#ifndef USB_DEBUG - if (bootverbose) + /* Set the PIRQD enable bit and switch off all the others. We don't + * want legacy support to interfere with us + * XXX Does this also mean that the BIOS won't touch the keyboard + * anymore if it is connected to the ports of the root hub? + */ +#ifdef UHCI_DEBUG + if (pci_read_config(self, PCI_LEGSUP, 4) != PCI_LEGSUP_USBPIRQDEN) + device_printf(self, "LegSup = 0x%08x\n", + pci_read_config(self, PCI_LEGSUP, 4)); #endif - device_printf(self, "PIRQD enable not set\n"); - legsup |= PCI_LEGSUP_USBPIRQDEN; - pci_write_config(self, PCI_LEGSUP, legsup, 4); - } + pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 4); err = uhci_init(sc); if (!err)