Re: ppc-linux EPIC (OpenPIC) and Interrupts on MPC8240
From: James F Dougherty <hidden>
Date: 2001-07-09 21:57:24
Thanks Dan, Thanks Andrew, I am using MVista spdemo-linux-2.3.16-2000.02.10 from ftp://ftp.mvista.com/pub/Area51/Sandpoint-8240 and made a change to boot/ns16550.h for COM1 and defined sandpoint_progress() to get output from the kernel. Also, I removed the 8259 cascade intterupt and that got me far enough to see that interrupts are not happening. It is not a mapping issue though, since the registers can be dumped and they show the right value. Dan, is there a more recent version of the kernel source which I should use? Andrew, I am using the EPIC in direct (discrete mode) as you are with EPIC IRQ4=SIO INTR, EPIC IRQ1=Enet Intr, and EPIC IRQ3=PCI slot. Are you simply defining the InitSenses[] array with 24 entries and the 0 sense for UART, 1 for PCI (makes sense since PCI is active high). If so, what kernel source are you using? Finally, attached is the MPC8240 EPIC driver I am using under VxWorks. It simply hooksup the PPC interrupt handler to use the EPIC interrupt handler and initializes the controller to run in discrete mode. This seems trivial to port to Linux, the only question is how to make the PPC irq handler call the epic IRQ handler. Many thanks in advance. -James
quoted
I am sure someone out there has had to deal with this issue before, so any pointers in the right direction would be greatly appreciated.I have HHL2.0 (Linux-2.4.2) running on an MVME2100 board (MPC8240) which only uses the interrupts on the built-in EPIC device, no 8259. I don't pretend to fully understand PCI interrupts, but I did discover that the OpenPIC_InitSenses[] array is critical to getting interrupts to work, and I also had to edit openpic.c to remove the 8259 stuff from openpic_get_irq() in my configuration. You're working with an earlier version though, so YMMV. The openpic driver gets the default number of IRQs from the register on the EPIC chip to be 24, but these are not contiguous nor in their canonical places, so you need to provide the InitSenses array to let it know the real configuration. I start with 16 zero entries as the first EPIC IRQ is offset by 16, then provide up to 16 entries for the real serial IRQ inputs to the EPIC. The value you give to each entry determines the polarity / edge-sensitivity; my setup needs 1 for PCI devices, but 0 for the 16550 UART. I'm not sure how you cope with the large gap before the I2C and DMA IRQ numbers; it looks like openpic.c needs modifying to properly cope with holes in the IRQ space, but it may be that you can do this with a cannonicalize_irq() routine (I don't have one, but I don't need the high IRQs and they're not essential for Linux to run). I discovered that even without serial interrupts working it was possible to type commands to my init shell (mount /proc;cat /proc/interrupts was very useful); you just have to wait up to 10 seconds for them to arrive, and don't type more than will fill the FIFO; be prepared to wait a while for the output to appear too! - Andrew -- The world is such a cheerful place when viewed from upside-down It makes a rise of every fall, a smile of every frown