summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-08-27 01:00:27 +0000
committerimp <imp@FreeBSD.org>2001-08-27 01:00:27 +0000
commitb5d9fcd82cbba8da67cba3f7f67fcbacde2a966a (patch)
tree5d96722ea3193efe7e590e9ebcc46c391262bac3 /sys/pccard
parent2c0e81585db7ef98958dab88acd60685771f7291 (diff)
downloadFreeBSD-src-b5d9fcd82cbba8da67cba3f7f67fcbacde2a966a.zip
FreeBSD-src-b5d9fcd82cbba8da67cba3f7f67fcbacde2a966a.tar.gz
A number of fixes for the TI-1130 and ISA interrupt routing cases:
o For TI PCI-1130, you need to set bit 5 of register 91 if you want ANY pci interrupts. Then set bits 3 and/or 4 as appropriate. This will fix those people with 1030, 1130 and 1131 in their machines trying to do PCI interrupts. o Fix case where we were trying to automatically fail back to ISA interrupt routing. We were dereferencing a NULL pointer. This was true of ANY chipset. o The bus_setup_intr method needs to be pcic_setup_intr so that "FAST" interrupts fail on PCI case (modems act flakey if we don't force them to fall back to normal interrupts). Also needed so that the proper ISA IRQ can be set in the ExCA register. This fixes the people whose ISA routing was failing[*]. o When we find a generic yenta/pccard bridge, go ahead and print its vendor ID in boot verbose. Machine with theses symptoms and a serial console by: jedgar [*] Looks like my pc98 machine has some interrupt source on IRQ 15 that gave about 30 interrupts per second, which masked this problem on my PC-9821Nr15.
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pcic_pci.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/sys/pccard/pcic_pci.c b/sys/pccard/pcic_pci.c
index 31dede2..2938d61 100644
--- a/sys/pccard/pcic_pci.c
+++ b/sys/pccard/pcic_pci.c
@@ -354,18 +354,23 @@ pcic_pci_ti_init(device_t dev)
/*
* The TI-1130 (and 1030 and 1131) have a different
- * interrupt routing control than the newer cards. The
- * newer cards also use offset 0x3e (the Bridge Control
- * register).
+ * interrupt routing control than the newer cards.
+ * assume we're not routing PCI, but enable as necessary
+ * when we find someone uses PCI interrupts. In order to
+ * get any pci interrupts, PCI_IRQ_ENA (bit 5) must
+ * be set. If either PCI_IREQ (bit 4) or PCI_CSC (bit 3)
+ * are set, then set bit 5 at the same time, since setting
+ * them enables the PCI interrupt routing.
*/
- if (sc->func_route == pcic_iw_pci) {
- cardcntl |= TI113X_CARDCNTL_PCI_IRQ_ENA;
+ cardcntl &= ~TI113X_CARDCNTL_PCI_IRQ_ENA;
+ if (sc->func_route == pcic_iw_pci)
+ cardcntl |= TI113X_CARDCNTL_PCI_IRQ_ENA |
+ TI113X_CARDCNTL_PCI_IREQ;
+ else
cardcntl &= ~TI113X_CARDCNTL_PCI_IREQ;
- } else {
- cardcntl |= TI113X_CARDCNTL_PCI_IREQ;
- }
if (sc->csc_route == pcic_iw_pci)
- cardcntl |= TI113X_CARDCNTL_PCI_CSC;
+ cardcntl |= TI113X_CARDCNTL_PCI_IRQ_ENA |
+ TI113X_CARDCNTL_PCI_CSC;
else
cardcntl &= ~TI113X_CARDCNTL_PCI_CSC;
pci_write_config(dev, TI113X_PCI_CARD_CONTROL, cardcntl, 1);
@@ -617,13 +622,17 @@ pcic_pci_probe(device_t dev)
desc = "Generic PCI-PCMCIA Bridge";
if (subclass == PCIS_BRIDGE_CARDBUS && progif == 0)
desc = "YENTA PCI-CARDBUS Bridge";
+ if (bootverbose && desc)
+ printf("Found unknown %s devid 0x%x\n", desc, device_id);
}
if (desc == NULL)
return (ENXIO);
device_set_desc(dev, desc);
/*
- * Take us out of power down mode.
+ * Take us out of power down mode, if necessary. It also
+ * appears that even reading the power register is enough on
+ * some systems to cause correct behavior.
*/
if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
/* Reset the power state. */
@@ -770,9 +779,10 @@ pcic_pci_attach(device_t dev)
sc->func_route = pcic_iw_isa;
device_printf(dev,
"No PCI interrupt routed, trying ISA.\n");
+ } else {
+ intr = pcic_pci_intr;
+ irq = rman_get_start(r);
}
- intr = pcic_pci_intr;
- irq = rman_get_start(r);
}
if (sc->csc_route == pcic_iw_isa) {
rid = 0;
@@ -878,7 +888,7 @@ static device_method_t pcic_pci_methods[] = {
DEVMETHOD(bus_release_resource, bus_generic_release_resource),
DEVMETHOD(bus_activate_resource, pcic_activate_resource),
DEVMETHOD(bus_deactivate_resource, pcic_deactivate_resource),
- DEVMETHOD(bus_setup_intr, bus_generic_setup_intr),
+ DEVMETHOD(bus_setup_intr, pcic_setup_intr),
DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr),
/* Card interface */
OpenPOWER on IntegriCloud