From 07783de5fbfc0c872b2da841ed863bce7a723998 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 12 Jul 2008 12:21:04 +0000 Subject: [PATCH] Use the proper interrupt target ID on Oberon. --- sys/arch/sparc64/dev/pyro.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c index 146164c5abe..dad704e0491 100644 --- a/sys/arch/sparc64/dev/pyro.c +++ b/sys/arch/sparc64/dev/pyro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pyro.c,v 1.12 2008/05/24 14:54:03 kettenis Exp $ */ +/* $OpenBSD: pyro.c,v 1.13 2008/07/12 12:21:04 kettenis Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -56,6 +56,17 @@ int pyro_debug = ~0; #define DPRINTF(l, s) #endif +#define FIRE_INTRMAP_INT_CNTRL_NUM_MASK 0x000003c0 +#define FIRE_INTRMAP_INT_CNTRL_NUM0 0x00000040 +#define FIRE_INTRMAP_INT_CNTRL_NUM1 0x00000080 +#define FIRE_INTRMAP_INT_CNTRL_NUM2 0x00000100 +#define FIRE_INTRMAP_INT_CNTRL_NUM3 0x00000200 +#define FIRE_INTRMAP_T_JPID_SHIFT 26 +#define FIRE_INTRMAP_T_JPID_MASK 0x7c000000 + +#define OBERON_INTRMAP_T_DESTID_SHIFT 21 +#define OBERON_INTRMAP_T_DESTID_MASK 0x7fe00000 + extern struct sparc_pci_chipset _sparc_pci_chipset; int pyro_match(struct device *, void *, void *); @@ -505,7 +516,16 @@ _pyro_intr_establish(bus_space_tag_t t, bus_space_tag_t t0, int ihandle, u_int64_t intrmap; intrmap = *intrmapptr; - intrmap |= (1LL << 6); + intrmap &= ~FIRE_INTRMAP_INT_CNTRL_NUM_MASK; + intrmap |= FIRE_INTRMAP_INT_CNTRL_NUM0; + if (sc->sc_oberon) { + intrmap &= ~OBERON_INTRMAP_T_DESTID_MASK; + intrmap |= CPU_JUPITERID << + OBERON_INTRMAP_T_DESTID_SHIFT; + } else { + intrmap &= ~FIRE_INTRMAP_T_JPID_MASK; + intrmap |= CPU_UPAID << FIRE_INTRMAP_T_JPID_SHIFT; + } intrmap |= INTMAP_V; *intrmapptr = intrmap; intrmap = *intrmapptr; -- 2.20.1