Hello!
I've got some problems with IRQ allocation on my noname alpha system.
First I should say that I'm not an alpha expert. 2 months ago I bought a
cheap AXPpci33 board and then build a complete (sort of...) Linux system
from source on it. Initial compiler and libraries were bootstrapped by
crosscompiling from my i486 system.
Ok, the layout 'before running into problems' was:
pci (J27) ATI Xpert@Play VGA
pci (J26) empty
pci (J25) empty
isa (J24) 8-port serial card ['fourport'-type] (using irq 5 for all ports)
isa (J23) multi-io 4s/3p (io-adresses _not_ conflicting with onbord ports,
irq 15 for serial ports, irq 7 preserved for parallel)
isa (J22) empty
isa (J21) 3c509 irq 9
isa (J20) soundblaster 16 irq 10
Problems arose when I plugged an ISDN card (AVM Fritz!pci) into J26. When
booting the system immediately locks up when setserial'ing the first serial
port on J23 (irq 15). There is no Kernel message etc.
I understand that PCI has 4 IRQ-lines that are somewhat magically mapped to
the usual 'ISA'-irqs. As there's no PCI-BIOS-SETUP on (this?) alpha I
further assumed that this mapping is someway 'hardwired' into the linux-kernel.
So the conflict should have gone away when I swapped th VGA and ISDN card.
(The VGA doesn't use an irq). I was proven wrong:
pci (J27) AVM Fritz!pci ISDN
pci (J26) ATI Xpert@Play VGA
The problem persisted - and surprisingly _WENT AWAY_ when I pulled the VGA
out of J26 ! (I have a serial terminal at ttyS0 so booting is no problem
without VGA)
Time to look at the kernel .......
I lernt a lot about pci :-) and think finally found the reason:
1. linux has indeed a hardwired idea of the pci interrupts:
see sys_sio.c: noname_map_irq() and noname_pci_fixup()
2. linux has an automated workaround for buggy pci hardware:
bios32.c: common_pci_fixup() :
/* Cope with 0 and illegal. */
if (pin == 0 || pin > 4)
pin = 1;
---> this errorneously allocates irq-pin 1 to my VGA although it
doesn't have/use any irq
irq-pin 1 apparently maps to irq 15 then.
3. noname_pci_fixup() then calls sio_fixup_irq_levels() and thus makes
irq 15 level-sensitive
4. The 4s/3p bord uses a homemade diode-matrix to tie the ports' irq-lines
together with a 10kOhm resistor to achieve ground (aka 'inactive' or 'idle'
level) on the ISA-irq-line.
So when setserial requests configuration on (one of) that port(s) the irq-line
gets enabled and traps the kernel in an endless irq servicing loop. right?
I then made the following modification that actually solved my particular
problem by assuring that the relevant irq-line doesn't get switched to
level-sensitive:
-------------snip---------------
--- linux/arch/alpha/kernel/sys_sio.c.orig Fri Apr 30 23:29:27 1999
+++ linux/arch/alpha/kernel/sys_sio.c Fri Apr 30 18:31:00 1999
@@ -232,7 +232,11 @@
* selected... :-(
*/
layout_all_busses(DEFAULT_IO_BASE, APECS_AND_LCA_DEFAULT_MEM_BASE);
+#if 0
sio_pci_fixup(noname_map_irq, 0x0b0a0f0d);
+#else
+ sio_pci_fixup(noname_map_irq, 0x0b00000e);
+#endif
sio_fixup_irq_levels(sio_collect_irq_levels());
enable_ide(0x26e);
}
-------------snip---------------
NOTE1: kernel is 2.2.7
NOTE2: THIS IS A HACK! I don't ask anybody to include this somewhere.....
NOTE3: irq 14 is ok for me - it's a scsi-only system :-)
What I want is to create a (or extend the 'pci=') boot option to let the
user select an appropriate irq-mapping. Probably a MILO environment variable
is even better suited so MILO and Linux could use the same settings?
Since I have no clue about other architectures (even other alphas) or
multi-pci-buses:
What do you think is the right way to do it?
I'd like that one would to be able to adapt it to other architectures that
might need (or don't really need but could implement) it.
Related Questions:
1) the INTERRUPT_LINE value one can read/set with the setpci command is meant
to be an informal message from pci-bios to driver-software and doesn't
configure anything, right?
2) the INTERRUPT_PIN value appears to be read-only on my two cards (VGA reports
00, AVM reports 01 - regardless of what I try to set it). Is this true
for every PCI-card?
3) My AXPpci is the variant with the 5-pin DIN keyboard connector. Is the
PS/2 interface electrically present on this board (i.e. could I use some
wire to attach a PS/2-style mouse port)?
I do ask because I remember that irq 12 didn't work with the 4s/3p board
while irq 15 did. I didn't doublecheck this though.
4) Any chance to alter the internal interfaces irq(and io?)-settings?
[ttyS0, ttyS1, par0, ide0, ps/2]
5) What about irq 13 (unuseable on intel, but ...)? when I look at my patch
above, the original value suggests that a mapping to irq 13 _should_ be
possible, but it didn't work. At least the AVM-Card was missing generating
interrupts. The status messages listes irq 13 as expected, but no
interrupts detected. with irq 14 it works (ok, the card obviously gets
initialized but I'm still waiting for the telephone company (Dt. Telecom)
to install the ISDN-Line so I can start doing something useful....)
In case it does matter: I use the HiSax driver isdn-9904191100.tar.gz
found on ftp.suse.de. As of 2.2.7 the main kernel lacks support of the
pci-variant of this ISDN card.
Thanks for reading this lengthy post, any comments appreciated!
--
| Thorsten Kranzkowski Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Mobile: ++49 161 7210230 Inet: [EMAIL PROTECTED] |
| Ampr: dl8bcu@db0nei.#nrw.deu.eu, [EMAIL PROTECTED] [44.130.8.19] |