Subject: Re: Patch for ISA interrupt mapping for USB on Miata
To: None <thorpej@zembu.com>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: port-alpha
Date: 03/16/2000 19:55:52
Interesting. I'll see about trying this tomorrow.
For comparison, here's what I did:
Index: pci_550.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/pci/pci_550.c,v
retrieving revision 1.13
diff -c -r1.13 pci_550.c
*** pci_550.c 1999/02/12 06:25:13 1.13
--- pci_550.c 2000/03/16 18:39:01
***************
*** 114,119 ****
--- 114,127 ----
#define DEC_550_PCI_IRQ_BEGIN 8
#define DEC_550_MAX_IRQ 48
+ #define DEC_550_ISA_LINE_BEGIN 0xe0
+ #define DEC_550_ISA_LINE_END 0xef
+ #define DEC_550_ISA_LINE_MASK 0x0f
+
+ #define DEC_550_IS_ISA_LINE(line) ((line) >= DEC_550_ISA_LINE_BEGIN && \
+ (line) <= DEC_550_ISA_LINE_END)
+ #define DEC_550_ISA_LINE_IRQ(line) ((line) & DEC_550_ISA_LINE_MASK)
+
/*
* The Miata has a Pyxis, which seems to have problems with stray
* interrupts. Work around this by just ignoring strays.
***************
*** 203,208 ****
--- 211,218 ----
* There will be no interrupt mapping for these devices, so just
* bail out now.
*/
+ printf("dec_550_intr_map: about to map bus %d dev %d func %d pin %d line %d\n",
+ bus,device,function,buspin,line);
if (bus == 0) {
if ((hwrpb->rpb_variation & SV_ST_MASK) < SV_ST_MIATA_1_5) {
/* Miata 1 */
***************
*** 215,221 ****
if (device == 7) {
if (function == 0)
panic("dec_550_intr_map: SIO device");
! return (1);
}
}
}
--- 225,232 ----
if (device == 7) {
if (function == 0)
panic("dec_550_intr_map: SIO device");
! if ((function == 1) || (function == 2))
! return (1);
}
}
}
***************
*** 230,241 ****
return (1);
}
! /* Account for the PCI interrupt offset. */
! line += DEC_550_PCI_IRQ_BEGIN;
!
! if (line >= DEC_550_MAX_IRQ)
! panic("dec_550_intr_map: dec 550 irq too large (%d)\n",
! line);
*ihp = line;
return (0);
--- 241,265 ----
return (1);
}
! if (DEC_550_IS_ISA_LINE(line)) {
! /* This is not actually a PCI interrupt, but a PCI device
! * whose interrupt is wired to an ISA interrupt line. Pass the
! * value through unmolested so we can handle it in
! * dec_550_intr_[dis]establish.
! */
! printf("Ah ha! ISA intr %d\n", DEC_550_ISA_LINE_IRQ(line));
! #if !NSIO
! panic("dec_550_intr_map: attempt to map ISA interrupt %d without "
! "ISA ICU\n", DEC_550_IS_ISA_LINE(line));
! #endif
! } else {
! /* Account for the PCI interrupt offset. */
! line += DEC_550_PCI_IRQ_BEGIN;
!
! if (line >= DEC_550_MAX_IRQ)
! panic("dec_550_intr_map: dec 550 irq too large (%d)\n",
! line);
! }
*ihp = line;
return (0);
***************
*** 251,256 ****
--- 275,285 ----
#endif
static char irqstr[16]; /* 12 + 2 + NULL + sanity */
+ #if NSIO
+ if (DEC_550_IS_ISA_LINE(ih))
+ return sio_intr_string(NULL, DEC_550_ISA_LINE_IRQ(ih));
+ #endif
+
if (ih >= DEC_550_MAX_IRQ)
panic("dec_550_intr_string: bogus 550 IRQ 0x%lx\n", ih);
sprintf(irqstr, "dec 550 irq %ld", ih);
***************
*** 269,274 ****
--- 298,309 ----
#endif
void *cookie;
+ #if NSIO
+ if (DEC_550_IS_ISA_LINE(ih))
+ return sio_intr_establish(NULL, DEC_550_ISA_LINE_IRQ(ih),
+ IST_EDGE, level, func, arg);
+ #endif
+
if (ih >= DEC_550_MAX_IRQ)
panic("dec_550_intr_establish: bogus dec 550 IRQ 0x%lx\n", ih);
***************
*** 292,297 ****
--- 327,340 ----
int s;
s = splhigh();
+
+ #if 0 /* Need to figure out how to determine sio vs. 550 intr type from
+ * the cookie */
+ if (DEC_550_IS_ISA_LINE(ih)) {
+ sio_intr_disestablish(NULL, cookie);
+ return;
+ }
+ #endif
alpha_shared_intr_disestablish(dec_550_pci_intr, cookie,
"dec 550 irq");