-/* $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)
#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 *);
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;