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.
This commit is contained in:
Doug Rabson 2002-03-26 19:46:40 +00:00
parent 106d501706
commit 71d645d0a2
5 changed files with 69 additions and 4 deletions

View File

@ -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

View File

@ -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;
@ -105,6 +106,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

View File

@ -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);

View File

@ -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.
*/

View File

@ -61,3 +61,5 @@
*/
#define MCPCIA_I2C_CVEC 0xA90
#define MCPCIA_I2C_BVEC 0xAA0
extern void mcpcia_init(int, int);