From fa081a357e3e6f778d19b5c01ee896bdec2aa068 Mon Sep 17 00:00:00 2001 From: Nick Sayer Date: Fri, 24 Aug 2001 02:14:26 +0000 Subject: In order for the MA301 to pass interrupts from the PCCard, you must go into the PLX 9052's interrupt control register and turn on the magic interrupt enable bit. Partial thanks are due to OpenBSD for pointing out that the chip is a PLX 9052 and pointing me to the datasheet PDF. --- sys/dev/wi/if_wi.c | 14 ++++++++++++++ sys/dev/wi/if_wireg.h | 11 +++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 4c10c10c2129..f741a8b628e2 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -381,6 +381,20 @@ wi_pci_attach(device_t dev) CSR_WRITE_2(sc, WI_INT_EN, 0); CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); + /* We have to do a magic PLX poke to enable interrupts */ + sc->local_rid = WI_PCI_LOCALRES; + sc->local = bus_alloc_resource(dev, SYS_RES_IOPORT, + &sc->local_rid, 0, ~0, 1, RF_ACTIVE); + sc->wi_localtag = rman_get_bustag(sc->local); + sc->wi_localhandle = rman_get_bushandle(sc->local); + command = bus_space_read_4(sc->wi_localtag, sc->wi_localhandle, + WI_LOCAL_INTCSR); + command |= WI_LOCAL_INTEN; + bus_space_write_4(sc->wi_localtag, sc->wi_localhandle, + WI_LOCAL_INTCSR, command); + bus_release_resource(dev, SYS_RES_IOPORT, sc->local_rid, sc->local); + sc->local = NULL; + sc->mem_rid = WI_PCI_MEMRES; sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mem_rid, 0, ~0, 1, RF_ACTIVE); diff --git a/sys/dev/wi/if_wireg.h b/sys/dev/wi/if_wireg.h index 0fa1c0c9d110..7602f69e89d2 100644 --- a/sys/dev/wi/if_wireg.h +++ b/sys/dev/wi/if_wireg.h @@ -89,12 +89,16 @@ struct wi_softc { struct ifmedia ifmedia; device_t dev; int wi_unit; + struct resource * local; + int local_rid; struct resource * iobase; int iobase_rid; struct resource * irq; int irq_rid; struct resource * mem; int mem_rid; + bus_space_handle_t wi_localhandle; + bus_space_tag_t wi_localtag; bus_space_handle_t wi_bhandle; bus_space_tag_t wi_btag; bus_space_handle_t wi_bmemhandle; @@ -146,9 +150,12 @@ struct wi_softc { #define WI_PORT4 4 #define WI_PORT5 5 -#define WI_PCI_MEMRES 0x18 -#define WI_PCI_IORES 0x1C +#define WI_PCI_LOCALRES 0x14 /* The PLX chip's local registers */ +#define WI_PCI_MEMRES 0x18 /* The PCCard's attribute memory */ +#define WI_PCI_IORES 0x1C /* The PCCard's I/O space */ +#define WI_LOCAL_INTCSR 0x4c +#define WI_LOCAL_INTEN 0x40 #define WI_HFA384X_SWSUPPORT0_OFF 0x28 #define WI_PRISM2STA_MAGIC 0x4A2D -- cgit v1.3