summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev/schizo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sparc64/dev/schizo.c')
-rw-r--r--sys/arch/sparc64/dev/schizo.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c
index 0f4d772a9d9..a7e02226d15 100644
--- a/sys/arch/sparc64/dev/schizo.c
+++ b/sys/arch/sparc64/dev/schizo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schizo.c,v 1.55 2008/08/18 20:29:37 brad Exp $ */
+/* $OpenBSD: schizo.c,v 1.56 2008/12/16 22:27:34 kettenis Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -41,6 +41,10 @@
#include <machine/autoconf.h>
#include <machine/psl.h>
+#ifdef DDB
+#include <machine/db_machdep.h>
+#endif
+
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
@@ -101,6 +105,8 @@ void *schizo_intr_establish(bus_space_tag_t, bus_space_tag_t, int, int, int,
int schizo_dmamap_create(bus_dma_tag_t, bus_dma_tag_t, bus_size_t, int,
bus_size_t, bus_size_t, int, bus_dmamap_t *);
+void schizo_xir(void *, int);
+
int
schizo_match(struct device *parent, void *match, void *aux)
{
@@ -270,6 +276,16 @@ schizo_init(struct schizo_softc *sc, int busa)
schizo_set_intr(sc, pbm, PIL_HIGH, schizo_safari_error, sc,
SCZ_SERR_INO, "safari");
+#ifdef DDB
+ /*
+ * Only a master Tomatillo (the one with JPID[0:2] = 6)
+ * can/should generate XIR.
+ */
+ if (sc->sc_tomatillo &&
+ ((schizo_read(sc, SCZ_CONTROL_STATUS) >> 20) & 0x7) == 6)
+ db_register_xir(schizo_xir, sc);
+#endif
+
config_found(&sc->sc_dv, &pba, schizo_print);
}
@@ -780,6 +796,16 @@ schizo_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle,
return (ih);
}
+#ifdef DDB
+void
+schizo_xir(void *arg, int cpu)
+{
+ struct schizo_softc *sc = arg;
+
+ schizo_write(sc, TOM_RESET_GEN, TOM_RESET_GEN_XIR);
+}
+#endif
+
const struct cfattach schizo_ca = {
sizeof(struct schizo_softc), schizo_match, schizo_attach
};