diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/schizo.c | 30 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/schizoreg.h | 40 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/schizovar.h | 6 |
3 files changed, 51 insertions, 25 deletions
diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c index 11f7482c546..d88a7f17409 100644 --- a/sys/arch/sparc64/dev/schizo.c +++ b/sys/arch/sparc64/dev/schizo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schizo.c,v 1.22 2006/06/01 07:54:10 jason Exp $ */ +/* $OpenBSD: schizo.c,v 1.23 2006/06/01 19:12:45 jason Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -218,15 +218,19 @@ schizo_init(struct schizo_softc *sc, int busa) if (busa) schizo_set_intr(sc, pbm, PIL_HIGH, schizo_pci_error, - pbm, 0x32, "pci_a"); + pbm, SCZ_PCIERR_A_INO, "pci_a"); else schizo_set_intr(sc, pbm, PIL_HIGH, schizo_pci_error, - pbm, 0x32, "pci_ib"); + pbm, SCZ_PCIERR_B_INO, "pci_b"); - schizo_set_intr(sc, pbm, PIL_HIGH, schizo_ue, sc, 0x30, "ue"); - schizo_set_intr(sc, pbm, PIL_HIGH, schizo_ce, sc, 0x31, "ce"); + schizo_pbm_write(pbm, SCZ_PCI_CTRL, schizo_pbm_read(pbm, SCZ_PCI_CTRL) | + SCZ_PCICTRL_EEN | SCZ_PCICTRL_SBH_INT | SCZ_PCICTRL_DTO_INT); + + /* double mapped */ + schizo_set_intr(sc, pbm, PIL_HIGH, schizo_ue, sc, SCZ_UE_INO, "ue"); + schizo_set_intr(sc, pbm, PIL_HIGH, schizo_ce, sc, SCZ_CE_INO, "ce"); schizo_set_intr(sc, pbm, PIL_HIGH, schizo_safari_error, sc, - 0x34, "safari"); + SCZ_SERR_INO, "safari"); config_found(&sc->sc_dv, &pba, schizo_print); } @@ -255,7 +259,19 @@ schizo_pci_error(void *vpbm) struct schizo_pbm *sp = vpbm; struct schizo_softc *sc = sp->sp_sc; - panic("%s: pci error", sc->sc_dv.dv_xname); + printf("%s: pci bus %c error\n", sc->sc_dv.dv_xname, + sp->sp_bus_a ? 'A' : 'B'); + + printf("PCICTRL=%lb\n", + schizo_pbm_read(sp, SCZ_PCI_CTRL), SCZ_PCICTRL_BITS); + + printf("PCIAFSR=%lb\n", + schizo_pbm_read(sp, SCZ_PCI_AFSR), SCZ_PCIAFSR_BITS); + + printf("PCIAFAR=%lx\n", schizo_pbm_read(sp, SCZ_PCI_AFAR)); + + panic("%s: fatal", sc->sc_dv.dv_xname); + return (1); } diff --git a/sys/arch/sparc64/dev/schizoreg.h b/sys/arch/sparc64/dev/schizoreg.h index c8346e3aab9..294d04ba0ea 100644 --- a/sys/arch/sparc64/dev/schizoreg.h +++ b/sys/arch/sparc64/dev/schizoreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: schizoreg.h,v 1.11 2006/06/01 09:07:09 jason Exp $ */ +/* $OpenBSD: schizoreg.h,v 1.12 2006/06/01 19:12:45 jason Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -87,6 +87,7 @@ struct schizo_regs { #define SCZ_PCIB_IO_MATCH 0x00070 #define SCZ_PCIB_IO_MASK 0x00078 #define SCZ_CONTROL_STATUS 0x10000 +#define SCZ_SAFARI_INTCTRL 0x10010 #define SCZ_SAFARI_ERRLOG 0x10018 #define SCZ_ECCCTRL 0x10020 #define SCZ_UE_AFSR 0x10030 @@ -104,6 +105,8 @@ struct schizo_regs { #define SCZ_PCI_CTRL 0x02000 #define SCZ_PCI_AFSR 0x02010 #define SCZ_PCI_AFAR 0x02018 +#define SCZ_PCI_DIAG 0x02020 +#define SCZ_PCI_ESTAR 0x02028 #define SCZ_PCI_STRBUF_CTRL 0x02800 #define SCZ_PCI_STRBUF_FLUSH 0x02808 #define SCZ_PCI_STRBUF_FSYNC 0x02810 @@ -176,22 +179,23 @@ struct schizo_regs { #define SCZ_CEAFAR_PIO_PCIAC 0x0000038000000000UL /* pcib: config / i/o */ #define SCZ_CEAFAR_MEMADDR 0x000007fffffffff0UL /* memory address */ -#define SCZ_PCICTRL_BUS_UNUS (1UL << 63UL) -#define SCZ_PCICTRL_ESLCK (1UL << 51UL) -#define SCZ_PCICTRL_ERRSLOT (7UL << 48UL) -#define SCZ_PCICTRL_TTO_ERR (1UL << 38UL) -#define SCZ_PCICTRL_RTRY_ERR (1UL << 37UL) -#define SCZ_PCICTRL_DTO_ERR (1UL << 36UL) -#define SCZ_PCICTRL_SBH_ERR (1UL << 35UL) -#define SCZ_PCICTRL_SERR (1UL << 34UL) -#define SCZ_PCICTRL_PCISPD (1UL << 33UL) -#define SCZ_PCICTRL_PTO (3UL << 24UL) -#define SCZ_PCICTRL_DTO_INT (1UL << 19UL) -#define SCZ_PCICTRL_SBH_INT (1UL << 18UL) -#define SCZ_PCICTRL_EEN (1UL << 17UL) -#define SCZ_PCICTRL_PARK (1UL << 16UL) -#define SCZ_PCICTRL_PCIRST (1UL << 8UL) -#define SCZ_PCICTRL_ARB (0x3fUL << 0UL) +#define SCZ_PCICTRL_BUS_UNUS (1UL << 63UL) /* bus unusable */ +#define SCZ_PCICTRL_ESLCK (1UL << 51UL) /* error slot locked */ +#define SCZ_PCICTRL_ERRSLOT (7UL << 48UL) /* error slot */ +#define SCZ_PCICTRL_TTO_ERR (1UL << 38UL) /* pci trdy# timeout */ +#define SCZ_PCICTRL_RTRY_ERR (1UL << 37UL) /* pci rtry# timeout */ +#define SCZ_PCICTRL_DTO_ERR (1UL << 36UL) /* pci discard timeout */ +#define SCZ_PCICTRL_SBH_ERR (1UL << 35UL) /* pci strm hole */ +#define SCZ_PCICTRL_SERR (1UL << 34UL) /* pci serr# sampled */ +#define SCZ_PCICTRL_PCISPD (1UL << 33UL) /* speed (0=clk/2,1=clk) */ +#define SCZ_PCICTRL_PTO (3UL << 24UL) /* pci timeout interval */ +#define SCZ_PCICTRL_DTO_INT (1UL << 19UL) /* discard intr en */ +#define SCZ_PCICTRL_SBH_INT (1UL << 18UL) /* strm byte hole intr en */ +#define SCZ_PCICTRL_EEN (1UL << 17UL) /* error intr en */ +#define SCZ_PCICTRL_PARK (1UL << 16UL) /* bus parked */ +#define SCZ_PCICTRL_PCIRST (1UL << 8UL) /* pci reset */ +#define SCZ_PCICTRL_ARB (0x3fUL << 0UL) /* dma arb enables */ +#define SCZ_PCICTRL_BITS "\20\277UNUS\263ESLCK\246TTO\245RTRY\244DTO\243SBH\242SERR\241SPD\223DTO_INT\222SBH_INT\221EEN\220PARK\210PCIRST" #define SCZ_PCIAFSR_PMA 0x8000000000000000UL #define SCZ_PCIAFSR_PTA 0x4000000000000000UL @@ -211,6 +215,8 @@ struct schizo_regs { #define SCZ_PCIAFSR_MEM 0x0000000020000000UL #define SCZ_PCIAFSR_IO 0x0000000010000000UL +#define SCZ_PCIAFSR_BITS "\20\277PMA\276PTA\275PRTRY\274PPERR\273PTTO\272PUNUS\271SMA\270STA\267SRTRY\266SPERR\265STTO\264SUNUS" + #define SCZ_PBM_A_REGS (0x600000UL - 0x400000UL) #define SCZ_PBM_B_REGS (0x700000UL - 0x400000UL) diff --git a/sys/arch/sparc64/dev/schizovar.h b/sys/arch/sparc64/dev/schizovar.h index 595d8445976..6bad2bf6af5 100644 --- a/sys/arch/sparc64/dev/schizovar.h +++ b/sys/arch/sparc64/dev/schizovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: schizovar.h,v 1.6 2006/06/01 07:54:10 jason Exp $ */ +/* $OpenBSD: schizovar.h,v 1.7 2006/06/01 19:12:45 jason Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -64,3 +64,7 @@ struct schizo_softc { bus_space_read_8((sc)->sc_bust, (sc)->sc_ctrlh, (r)) #define schizo_write(sc,r,v) \ bus_space_write_8((sc)->sc_bust, (sc)->sc_ctrlh, (r), (v)) +#define schizo_pbm_read(pbm,r) \ + bus_space_read_8((pbm)->sp_regt, (pbm)->sp_regh, (r)) +#define schizo_pbm_write(pbm,r,v) \ + bus_space_write_8((pbm)->sp_regt, (pbm)->sp_regh, (r), (v)) |