diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-12-16 22:27:35 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-12-16 22:27:35 +0000 |
commit | 30f45188c7e533334067f2c8949db8a87a9c4e2d (patch) | |
tree | 86ad20b02b3f3d6c1ecf4fd1a194b33cf948b455 | |
parent | 7893d74eb052e5b3c3dee8214f081ed3553fa557 (diff) |
Make the "machine xir" ddb command work on machines with Tomatillo
schizo(4) variants.
-rw-r--r-- | sys/arch/sparc64/dev/schizo.c | 28 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/schizoreg.h | 5 |
2 files changed, 31 insertions, 2 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 }; diff --git a/sys/arch/sparc64/dev/schizoreg.h b/sys/arch/sparc64/dev/schizoreg.h index af4344e8026..629747d63d9 100644 --- a/sys/arch/sparc64/dev/schizoreg.h +++ b/sys/arch/sparc64/dev/schizoreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: schizoreg.h,v 1.20 2008/07/12 13:08:04 kettenis Exp $ */ +/* $OpenBSD: schizoreg.h,v 1.21 2008/12/16 22:27:34 kettenis Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -95,6 +95,7 @@ struct schizo_regs { #define SCZ_UE_AFAR 0x10038 #define SCZ_CE_AFSR 0x10040 #define SCZ_CE_AFAR 0x10048 +#define TOM_RESET_GEN 0x17010 /* These are relative to the PBM */ #define SCZ_PCI_IOMMU_CTRL 0x00200 @@ -183,6 +184,8 @@ struct schizo_regs { #define SCZ_CEAFAR_PIO_PCIAC 0x0000038000000000UL /* pcib: config / i/o */ #define SCZ_CEAFAR_MEMADDR 0x000007fffffffff0UL /* memory address */ +#define TOM_RESET_GEN_XIR 0x00000000000000002L + #define SCZ_PCICTRL_BUS_UNUS (1UL << 63UL) /* bus unusable */ #define TOM_PCICTRL_DTO_ERR (1UL << 62UL) /* pci discard timeout */ #define TOM_PCICTRL_DTO_INT (1UL << 61UL) /* discard intr en */ |