From 1229b6ed6cc13d2c30419b197d73115d5ba5c5cc Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 27 Aug 2006 18:55:58 +0000 Subject: Use the correct IGN for the B side of schizo. Makes interrupts actually work in the PCI slot of the v210. ok jason@ --- sys/arch/sparc64/dev/iommureg.h | 3 ++- sys/arch/sparc64/dev/schizo.c | 22 +++++++++++----------- sys/arch/sparc64/dev/schizovar.h | 3 ++- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'sys') diff --git a/sys/arch/sparc64/dev/iommureg.h b/sys/arch/sparc64/dev/iommureg.h index bdf6fa3c311..219b9e766f4 100644 --- a/sys/arch/sparc64/dev/iommureg.h +++ b/sys/arch/sparc64/dev/iommureg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: iommureg.h,v 1.12 2006/05/28 06:28:08 jason Exp $ */ +/* $OpenBSD: iommureg.h,v 1.13 2006/08/27 18:55:57 kettenis Exp $ */ /* $NetBSD: iommureg.h,v 1.6 2001/07/20 00:07:13 eeh Exp $ */ /* @@ -156,6 +156,7 @@ struct iommu_strbuf { #define INTVEC(x) ((x)&INTMAP_INR) #define INTSLOT(x) (((x)>>3)&0x7) #define INTPRI(x) ((x)&0x7) +#define INTIGN(x) ((x)&INTMAP_IGN) #define INTINO(x) ((x)&INTMAP_INO) #define INTTID_SHIFT 26 #define INTTID(x) (((x) & INTMAP_TID) >> INTTID_SHIFT) diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c index e984775bd0d..66c7ffef322 100644 --- a/sys/arch/sparc64/dev/schizo.c +++ b/sys/arch/sparc64/dev/schizo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schizo.c,v 1.34 2006/07/01 18:19:09 deraadt Exp $ */ +/* $OpenBSD: schizo.c,v 1.35 2006/08/27 18:55:57 kettenis Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -134,6 +134,7 @@ schizo_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmat = ma->ma_dmatag; sc->sc_bust = ma->ma_bustag; sc->sc_ctrl = ma->ma_reg[1].ur_paddr - 0x10000UL; + sc->sc_ign = ma->ma_upaid << 6; if ((ma->ma_reg[0].ur_paddr & 0x00700000) == 0x00600000) busa = 1; @@ -179,8 +180,8 @@ schizo_init(struct schizo_softc *sc, int busa) (void **)&busranges)) panic("schizo: can't get bus-range"); - printf(": \"%s\", bus %c %d to %d\n", - sc->sc_tomatillo ? "Tomatillo" : "Schizo", + printf(": \"%s\", ign %x, bus %c %d to %d\n", + sc->sc_tomatillo ? "Tomatillo" : "Schizo", sc->sc_ign, busa ? 'A' : 'B', busranges[0], busranges[1]); if (bus_space_subregion(pbm->sp_regt, sc->sc_ctrlh, @@ -396,13 +397,9 @@ schizo_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp) struct schizo_pbm *sp = pa->pa_pc->cookie; struct schizo_softc *sc = sp->sp_sc; u_int dev; - u_int64_t agentid; - - agentid = schizo_read(sc, SCZ_CONTROL_STATUS); - agentid = ((agentid >> 20) & 31) << 6; if (*ihp != (pci_intr_handle_t)-1) { - *ihp |= agentid; + *ihp |= sc->sc_ign; return (0); } @@ -424,7 +421,7 @@ schizo_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp) *ihp = (pa->pa_intrpin - 1) & INTMAP_PCIINT; *ihp |= (dev << 2) & INTMAP_PCISLOT; - *ihp |= agentid; + *ihp |= sc->sc_ign; return (0); } @@ -440,7 +437,7 @@ schizo_set_intr(struct schizo_softc *sc, struct schizo_pbm *pbm, int ipl, pbmreg = bus_space_vaddr(pbm->sp_regt, pbm->sp_regh); map = &pbmreg->imap[ino]; clr = &pbmreg->iclr[ino]; - ino |= (*map) & INTMAP_IGN; + ino |= sc->sc_ign; ih = bus_intr_allocate(pbm->sp_regt, handler, arg, ino, ipl, map, clr, what); @@ -654,7 +651,10 @@ _schizo_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, pbmreg = bus_space_vaddr(pbm->sp_regt, pbm->sp_regh); intrmapptr = &pbmreg->imap[ino]; intrclrptr = &pbmreg->iclr[ino]; - ino |= (*intrmapptr) & INTMAP_IGN; + if (INTIGN(vec) == 0) + ino |= (*intrmapptr) & INTMAP_IGN; + else + ino |= vec & INTMAP_IGN; } ih = bus_intr_allocate(t0, handler, arg, ino, level, intrmapptr, diff --git a/sys/arch/sparc64/dev/schizovar.h b/sys/arch/sparc64/dev/schizovar.h index ab72fa347bb..ffa50f83943 100644 --- a/sys/arch/sparc64/dev/schizovar.h +++ b/sys/arch/sparc64/dev/schizovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: schizovar.h,v 1.8 2006/06/28 20:06:32 deraadt Exp $ */ +/* $OpenBSD: schizovar.h,v 1.9 2006/08/27 18:55:57 kettenis Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -54,6 +54,7 @@ struct schizo_pbm { struct schizo_softc { struct device sc_dv; int sc_node; + int sc_ign; bus_dma_tag_t sc_dmat; bus_space_tag_t sc_bust; bus_addr_t sc_ctrl; -- cgit v1.2.3