summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/xbow
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-06-13 21:48:04 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-06-13 21:48:04 +0000
commit7e97643755bb45a839c99309ba46c6c5b31c0669 (patch)
tree8aaa44aa51ce9cc3dcaf2b8040ca22675ebb1188 /sys/arch/sgi/xbow
parentc66a555036d7337a47d930b3b23f88dacad8aaef (diff)
Enumerate all available nodes for hardware on IP27/IP35 systems; works to some
extent, but isp(4) on other nodes do not work correctly yet.
Diffstat (limited to 'sys/arch/sgi/xbow')
-rw-r--r--sys/arch/sgi/xbow/xbow.c22
-rw-r--r--sys/arch/sgi/xbow/xbow.h3
-rw-r--r--sys/arch/sgi/xbow/xbridge.c20
3 files changed, 31 insertions, 14 deletions
diff --git a/sys/arch/sgi/xbow/xbow.c b/sys/arch/sgi/xbow/xbow.c
index 5fbeea5c07e..b66ae708d4b 100644
--- a/sys/arch/sgi/xbow/xbow.c
+++ b/sys/arch/sgi/xbow/xbow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbow.c,v 1.8 2009/06/13 16:28:11 miod Exp $ */
+/* $OpenBSD: xbow.c,v 1.9 2009/06/13 21:48:03 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -225,7 +225,7 @@ xbowprint(void *aux, const char *pnp)
printf(" revision %d at %s",
xaa->xaa_revision, pnp);
}
- printf(" widget %d", xaa->xaa_widget);
+ printf(" nasid %d widget %d", xaa->xaa_nasid, xaa->xaa_widget);
if (pnp == NULL) {
if (p != NULL)
printf(": %s", p->productname);
@@ -289,7 +289,8 @@ struct xbow_kl_config {
void
xbowattach(struct device *parent, struct device *self, void *aux)
{
- int16_t nasid = 0; /* XXX for now... */
+ struct confargs *ca = aux;
+ int16_t nasid = ca->ca_nasid;
uint32_t wid, vendor, product;
const struct xbow_product *p;
struct xbow_config cfg;
@@ -319,9 +320,11 @@ xbowattach(struct device *parent, struct device *self, void *aux)
/*
* Default value for the interrupt register.
*/
- xbow_intr_widget_register = (1UL << 47) /* XIO I/O space */ |
- ((paddr_t)IP27_RHUB_ADDR(nasid, HUBPI_IR_CHANGE) -
- IP27_NODE_IO_BASE(0)) /* HUB register offset */;
+ if (xbow_intr_widget_register == 0)
+ xbow_intr_widget_register =
+ (1UL << 47) /* XIO I/O space */ |
+ ((paddr_t)IP27_RHUB_ADDR(nasid, HUBPI_IR_CHANGE) -
+ IP27_NODE_IO_BASE(0)) /* HUB register offset */;
klcfg.cfg = &cfg;
klcfg.probe_order = NULL;
@@ -337,7 +340,8 @@ xbowattach(struct device *parent, struct device *self, void *aux)
* Interrupt widget is hardwired to #a (this is another
* facet of this bridge).
*/
- xbow_intr_widget = 0x0a;
+ if (xbow_intr_widget == 0)
+ xbow_intr_widget = 0x0a;
klcfg.probe_order = xbow_probe_singlebridge;
} else {
/*
@@ -354,7 +358,8 @@ xbowattach(struct device *parent, struct device *self, void *aux)
* crossbow, and is where memory and interrupt logic
* resources are connected to.
*/
- xbow_intr_widget = cfg.master;
+ if (xbow_intr_widget == 0)
+ xbow_intr_widget = cfg.master;
}
break;
#endif
@@ -399,6 +404,7 @@ xbow_attach_widget(struct device *self, int16_t nasid, int widget,
xbow_build_bus_space(bs, nasid, widget, 0);
xbow_build_bus_space(bl, nasid, widget, 1);
+ xaa.xaa_nasid = nasid;
xaa.xaa_widget = widget;
xaa.xaa_vendor = (wid & WIDGET_ID_VENDOR_MASK) >>
WIDGET_ID_VENDOR_SHIFT;
diff --git a/sys/arch/sgi/xbow/xbow.h b/sys/arch/sgi/xbow/xbow.h
index 9209f5d5c2c..d7f0e5337b6 100644
--- a/sys/arch/sgi/xbow/xbow.h
+++ b/sys/arch/sgi/xbow/xbow.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbow.h,v 1.3 2009/04/15 18:45:41 miod Exp $ */
+/* $OpenBSD: xbow.h,v 1.4 2009/06/13 21:48:03 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -108,6 +108,7 @@ extern void (*xbow_intr_widget_intr_disestablish)(int);
struct xbow_attach_args {
+ int16_t xaa_nasid;
int xaa_widget;
uint32_t xaa_vendor;
diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c
index f26c3470276..5d8f5c729c0 100644
--- a/sys/arch/sgi/xbow/xbridge.c
+++ b/sys/arch/sgi/xbow/xbridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbridge.c,v 1.25 2009/06/13 16:28:11 miod Exp $ */
+/* $OpenBSD: xbridge.c,v 1.26 2009/06/13 21:48:03 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -64,6 +64,7 @@ struct xbridge_softc {
struct device sc_dev;
int sc_flags;
#define XBRIDGE_FLAGS_XBRIDGE 0x01 /* is XBridge vs Bridge */
+ int16_t sc_nasid;
int sc_widget;
struct mips_pci_chipset sc_pc;
@@ -209,6 +210,7 @@ xbridge_attach(struct device *parent, struct device *self, void *aux)
struct pcibus_attach_args pba;
struct xbow_attach_args *xaa = aux;
+ sc->sc_nasid = xaa->xaa_nasid;
sc->sc_widget = xaa->xaa_widget;
printf(" revision %d\n", xaa->xaa_revision);
@@ -774,7 +776,6 @@ xbridge_intr_handler(void *v)
{
struct xbridge_intr *xi = v;
struct xbridge_softc *sc = xi->xi_bridge;
- uint16_t nasid = 0; /* XXX */
int rc;
int spurious;
@@ -827,11 +828,19 @@ xbridge_intr_handler(void *v)
} else {
if (bus_space_read_4(sc->sc_iot, sc->sc_regh,
BRIDGE_ISR) & (1 << xi->xi_intrbit)) {
- if (sys_config.system_type == SGI_OCTANE) {
+ switch (sys_config.system_type) {
+#if defined(TGT_OCTANE)
+ case SGI_OCTANE:
/* XXX what to do there? */
- } else {
- IP27_RHUB_PI_S(nasid, 0, HUBPI_IR_CHANGE,
+ break;
+#endif
+#if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000)
+ case SGI_O200:
+ case SGI_O300:
+ IP27_RHUB_PI_S(sc->sc_nasid, 0, HUBPI_IR_CHANGE,
PI_IR_SET | xi->xi_intrsrc);
+ break;
+#endif
}
}
}
@@ -1629,6 +1638,7 @@ xbridge_setup(struct xbridge_softc *sc)
/*
* Configure the direct DMA window to access the low 2GB of memory.
+ * XXX assumes masternasid is 0
*/
if (sys_config.system_type == SGI_OCTANE)