diff options
author | mjacob <mjacob@FreeBSD.org> | 2000-05-09 02:20:44 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2000-05-09 02:20:44 +0000 |
commit | 0c19638e64ba63a6af6dbbb6b5178f2beccdf568 (patch) | |
tree | 50e7b6a898e0010e7bcbfc4feb37db4078700f4c /sys | |
parent | a96a0e9328c99cc23195aee18ed9752e9462dd60 (diff) | |
download | FreeBSD-src-0c19638e64ba63a6af6dbbb6b5178f2beccdf568.zip FreeBSD-src-0c19638e64ba63a6af6dbbb6b5178f2beccdf568.tar.gz |
Change references/comments about 'secondary' to reflect that while we'd
like to see the true SRM bus number be passed to us, instead, we get FreeBSD's
PCI bus instance number (Brzzt! Wrong Answer!).
Also, once we've seen the MCPCIA that has the EISA bus on it, call
dec_kn300_cons_init just before configuring devices on this bus.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/mcbus/mcpcia.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/sys/alpha/mcbus/mcpcia.c b/sys/alpha/mcbus/mcpcia.c index e6f1dfe..10de6a8 100644 --- a/sys/alpha/mcbus/mcpcia.c +++ b/sys/alpha/mcbus/mcpcia.c @@ -69,6 +69,8 @@ struct mcpcia_softc { int mcpcia_inst; /* our mcpcia instance # */ }; static struct mcpcia_softc *mcpcia_eisa = NULL; +extern void dec_kn300_cons_init(void); + static int mcpcia_probe(device_t dev); static int mcpcia_attach(device_t dev); @@ -326,7 +328,6 @@ mcpcia_cfgread(u_int bh, u_int bus, u_int slot, u_int func, u_int off, int sz) struct mcpcia_softc *sc; u_int32_t *dp, data, rvp; u_int64_t paddr; - int secondary = 0; rvp = data = ~0; if (bh > 3) @@ -338,14 +339,18 @@ mcpcia_cfgread(u_int bh, u_int bus, u_int slot, u_int func, u_int off, int sz) sc = MCPCIA_SOFTC(dev); /* + * The bus number being passed is the pci instance number- not + * the actual pci bus number. FreeBSD farts bad on this one. + */ + bus = 0; /* No secondaries for the moment */ + + /* * There's nothing in slot 0 on a primary bus. - * - * XXX: How do we generate knowledge of secondary bus accesses? */ - if (secondary == 0 && (slot < 1 || slot >= MCPCIA_MAXDEV)) + if (bus == 0 && (slot < 1 || slot >= MCPCIA_MAXDEV)) return (data); - paddr = secondary << 21; + paddr = bus << 21; paddr |= slot << 16; paddr |= func << 13; paddr |= ((sz - 1) << 3); @@ -356,13 +361,11 @@ mcpcia_cfgread(u_int bh, u_int bus, u_int slot, u_int func, u_int off, int sz) #if 0 printf("CFGREAD MID %d %d.%d.%d sz %d off %d -> paddr 0x%x", -mcbus_get_mid(dev), secondary, slot, func, sz, off, paddr); +mcbus_get_mid(dev), bus , slot, func, sz, off, paddr); #endif if (badaddr(dp, sizeof (*dp)) == 0) { data = *dp; } - if (secondary) { - } if (data != ~0) { if (sz == 1) { rvp = SPARSE_BYTE_EXTRACT(off, data); @@ -389,7 +392,6 @@ mcpcia_cfgwrite(u_int bh, u_int bus, u_int slot, u_int func, u_int off, struct mcpcia_softc *sc; u_int32_t *dp; u_int64_t paddr; - int secondary = 0; if (bh > 3) return; @@ -398,16 +400,15 @@ mcpcia_cfgwrite(u_int bh, u_int bus, u_int slot, u_int func, u_int off, return; } sc = MCPCIA_SOFTC(dev); + bus = 0; /* No secondaries for the moment */ /* * There's nothing in slot 0 on a primary bus. - * - * XXX: How do we generate knowledge of secondary bus accesses? */ - if (secondary == 0 && (slot < 1 || slot >= MCPCIA_MAXDEV)) + if (bus != 0 && (slot < 1 || slot >= MCPCIA_MAXDEV)) return; - paddr = secondary << 21; + paddr = bus << 21; paddr |= slot << 16; paddr |= func << 13; paddr |= ((sz - 1) << 3); @@ -428,13 +429,11 @@ mcpcia_cfgwrite(u_int bh, u_int bus, u_int slot, u_int func, u_int off, #if 0 printf("CFGWRITE MID%d %d.%d.%d sz %d off %d paddr %lx, data %x new_data %x\n", -mcbus_get_mid(dev), secondary, slot, func, sz, off, paddr, data, new_data); +mcbus_get_mid(dev), bus , slot, func, sz, off, paddr, data, new_data); #endif *dp = new_data; } - if (secondary) { - } } static u_int8_t @@ -564,6 +563,10 @@ mcpcia_attach(device_t dev) rval = BUS_SETUP_INTR(p, dev, NULL, INTR_TYPE_MISC, mcpcia_intr, 0, &intr); if (rval == 0) { + if (sc == mcpcia_eisa) { + printf("Attaching Real Console\n"); + dec_kn300_cons_init(); + } bus_generic_attach(dev); } return (rval); @@ -638,7 +641,7 @@ mcpcia_setup_intr(device_t dev, device_t child, struct resource *ir, int flags, if (error) return error; mcpcia_enable_intr(sc, irq); - device_printf(child, "interrupting at IRQ 0x%x INT%c (vec 0x%x)\n", + device_printf(child, "interrupting at IRQ 0x%x int%c (vec 0x%x)\n", irq, intpin - 1 + 'A' , h); return (0); } |