diff options
author | dfr <dfr@FreeBSD.org> | 2002-03-26 19:46:40 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2002-03-26 19:46:40 +0000 |
commit | 3bf8ca061406455b3a57b3c60781a2a94cca5727 (patch) | |
tree | 45bc3c11741dfed14c3fc5cdfe77e68671060425 /sys/alpha | |
parent | 5785423ddfbc734cbeb7a6c82965c7895469aeac (diff) | |
download | FreeBSD-src-3bf8ca061406455b3a57b3c60781a2a94cca5727.zip FreeBSD-src-3bf8ca061406455b3a57b3c60781a2a94cca5727.tar.gz |
Initialise the AS4100 console at the same time as most of the other
platform types instead of deferring it until the mcpcia devices are
probed. This allows the use of e.g. kgdb before the busses are probed.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/dec_kn300.c | 2 | ||||
-rw-r--r-- | sys/alpha/mcbus/mcbus.c | 29 | ||||
-rw-r--r-- | sys/alpha/mcbus/mcbusvar.h | 2 | ||||
-rw-r--r-- | sys/alpha/mcbus/mcpcia.c | 38 | ||||
-rw-r--r-- | sys/alpha/mcbus/mcpciavar.h | 2 |
5 files changed, 69 insertions, 4 deletions
diff --git a/sys/alpha/alpha/dec_kn300.c b/sys/alpha/alpha/dec_kn300.c index dc697e4..a7df9f5 100644 --- a/sys/alpha/alpha/dec_kn300.c +++ b/sys/alpha/alpha/dec_kn300.c @@ -92,6 +92,7 @@ dec_kn300_init() } platform.iobus = "mcbus"; + platform.cons_init = dec_kn300_cons_init; } extern int comconsole; @@ -101,6 +102,7 @@ dec_kn300_cons_init() { struct ctb *ctb; + mcbus_init(); #ifdef DDB siogdbattach(0x2f8, 57600); #endif diff --git a/sys/alpha/mcbus/mcbus.c b/sys/alpha/mcbus/mcbus.c index a0bf2d6..e70424b 100644 --- a/sys/alpha/mcbus/mcbus.c +++ b/sys/alpha/mcbus/mcbus.c @@ -43,6 +43,7 @@ #include <alpha/mcbus/mcbusreg.h> #include <alpha/mcbus/mcbusvar.h> +#include <alpha/mcbus/mcpciavar.h> struct mcbus_device *mcbus_primary_cpu = NULL; @@ -106,6 +107,34 @@ static driver_t mcbus_driver = { static const int mcbus_mcpcia_probe_order[] = { 5, 4, 7, 6 }; /* + * Early console support requires us to partially probe the bus to + * find the ISA bus resources. + */ +void +mcbus_init(void) +{ + static int initted = 0; + int i, mid, gid; + + if (initted) return; + initted = 1; + + /* + * We only look at the first two mids because at this point, + * badaddr() doesn't work so we can't call NO_MCPCIA_AT(). + */ + gid = MCBUS_GID_FROM_INSTANCE(0); + for (i = 0; i < 2; ++i) { + mid = mcbus_mcpcia_probe_order[i]; + + if (NO_MCPCIA_AT(mid, gid)) { + continue; + } + mcpcia_init(gid, mid); + } +} + +/* * At 'probe' time, we add all the devices which we know about to the * bus. The generic attach routine will probe and attach them if they * are alive. diff --git a/sys/alpha/mcbus/mcbusvar.h b/sys/alpha/mcbus/mcbusvar.h index 09245bb..50d9da9 100644 --- a/sys/alpha/mcbus/mcbusvar.h +++ b/sys/alpha/mcbus/mcbusvar.h @@ -71,3 +71,5 @@ struct mcbus_device { #define MCBUS_TYPE_PCI 4 #define DEVTOMCBUS(dev) ((struct mcbus_device *) device_get_ivars(dev)) + +extern void mcbus_init(void); diff --git a/sys/alpha/mcbus/mcpcia.c b/sys/alpha/mcbus/mcpcia.c index 70be7f1..615b32f 100644 --- a/sys/alpha/mcbus/mcpcia.c +++ b/sys/alpha/mcbus/mcpcia.c @@ -120,6 +120,40 @@ static void mcpcia_sgmap_map(void *, bus_addr_t, vm_offset_t); static struct mcpcia_softc *mcpcia_root; +/* + * Early console support requires us to partially probe the bus to + * find the ISA bus resources. + */ +void +mcpcia_init(int gid, int mid) +{ + static struct swiz_space io_space; + static struct swiz_space mem_space; + u_int64_t sysbase; + vm_offset_t regs, io_base, smem_base; + + sysbase = MCBUS_IOSPACE | + (((u_int64_t) gid) << MCBUS_GID_SHIFT) | + (((u_int64_t) mid) << MCBUS_MID_SHIFT); + + if (EISA_PRESENT(REGVAL(sysbase + | MCPCIA_PCI_BRIDGE + | _MCPCIA_PCI_REV))) { + /* + * Define temporary spaces for bootstrap i/o. + */ + regs = (vm_offset_t) KV(sysbase); + io_base = regs + MCPCIA_PCI_IOSPACE; + smem_base = regs + MCPCIA_PCI_SPARSE; + + swiz_init_space(&io_space, io_base); + swiz_init_space(&mem_space, smem_base); + + busspace_isa_io = (struct alpha_busspace *) &io_space; + busspace_isa_mem = (struct alpha_busspace *) &mem_space; + } +} + static int mcpcia_probe(device_t dev) { @@ -233,10 +267,6 @@ mcpcia_attach(device_t dev) &sc->io_space; busspace_isa_mem = (struct alpha_busspace *) &sc->mem_space; - printf("Attaching Real Console\n"); - mcpcia_enable_intr(sc, 16); - dec_kn300_cons_init(); - promcndetach(); /* * Enable EISA interrupts. */ diff --git a/sys/alpha/mcbus/mcpciavar.h b/sys/alpha/mcbus/mcpciavar.h index 67b9f4d..7bbae1b 100644 --- a/sys/alpha/mcbus/mcpciavar.h +++ b/sys/alpha/mcbus/mcpciavar.h @@ -61,3 +61,5 @@ */ #define MCPCIA_I2C_CVEC 0xA90 #define MCPCIA_I2C_BVEC 0xAA0 + +extern void mcpcia_init(int, int); |