summaryrefslogtreecommitdiffstats
path: root/sys/alpha/mcbus
diff options
context:
space:
mode:
Diffstat (limited to 'sys/alpha/mcbus')
-rw-r--r--sys/alpha/mcbus/mcbus.c29
-rw-r--r--sys/alpha/mcbus/mcbusvar.h2
-rw-r--r--sys/alpha/mcbus/mcpcia.c38
-rw-r--r--sys/alpha/mcbus/mcpciavar.h2
4 files changed, 67 insertions, 4 deletions
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);
OpenPOWER on IntegriCloud