MPC5200B: Can't receive/handle external Interrupts

Schaller Stephan Stephan.Schaller at sensor-technik.de
Thu Jun 11 04:03:56 EST 2009


Hello,
 
I am using a Freescale MPC5200B running Linux 2.6.27.10. Hardware is declared using a flat device tree loaded by uBoot.
 
My Problem is that external Interrupts (I use IRQ3) get not received.
I can use bit 18 of the Main Interrupt Emulation All Register (MBAR+0x540) to trigger IRQ3 manually which calls up my ISR.
However, if I trigger IRQ using Bit 7 of the IRQ Interrupt Emulation All Register (MBAR+0x548), My ISR does not get called. The MPC5200 User Manual says (on p. 7-24): "This register is redundant with IICTL Main Interrupt Emulation All Register for IRQ1-3 but is the only source to emulate IRQ0.". I understand this that there should not be a difference between emulating an external interrupt using one of these registers or the other. But there is. I tried pulling down the IRQ3-Pin as mentioned in the manual, but this does not make a difference.
I checked the Main Interrupt Status All Register (MBAR+0x52C), bit 18 and the bit only gets set when i use the Main Interrupt Emulation All Register to emulate. Also, after setting the appropriate bit in Main Interrupt Emulation All Register, it also is set in IRQ Interrupt Emulation All Register. But it does not work vice versa. This is not what I think "redundant" means...

I Made sure that IRQ3 is enabled and unmasked (MBAR+0x510, Bit 23 = 1, Bit 19 = 1). Forwarding it to SMI instead of INT does not make a difference. If I change IRQ3 to active high (using MBAR+0x510), my ISR gets called instantly, no matter wether the IRQ3-Pin is connected to high or low.
The Bit representing IRQ3 in Main Interrupt Status All Register does not change when i connect the Pin to high or low.

So, basically two Problems:
- ISR seems only to get called by a "Main Interrupt", not by a "IRQ Interrupt". How do I make the connection between these?
- The IRQ3 input Pin level is not shown in the status register and is not regognized by the CPU.

I have noticed several people here using external IRQs, so someone might hopefully know what I forgot to do. I'm running out of ideas on this one.

Here is some additional information:


I declare my test driver in the FTD as follows:

		irqtest at 00 {
		compatible = "irqtest";
		interrupts = < 1 3 3 >;
		interrupt-parent = <&mpc5200_pic>;


and the PIC:

		mpc5200_pic: interrupt-controller at 500 {
			// 5200 interrupts are encoded into two levels;
			interrupt-controller;
			#interrupt-cells = <3>;
			device_type = "interrupt-controller";
			compatible = "fsl,mpc5200b-pic","fsl,mpc5200-pic";
			reg = <0x500 0x80>;
		};

(Of course, the PIC driver is loaded)

My driver requests the IRQ as follows:

   irq = irq_of_parse_and_map(op->node, 0);
   request_irq(irq, irqtest_isr, IRQF_SAMPLE_RANDOM, "irqtest", NULL);


this is my output while loading the module (seems to be OK):

	initializing irqtest module...
	irqtest_of_probe called, mapping irq...
	irqtest: mapped irq 67, calling request_irq...
	request_irq returned 0



Thank you in advance,
Stephan Schaller


More information about the Linuxppc-dev mailing list