AnsweredAssumed Answered

External IRQ with mpc8xxx in linux

Question asked by ranshalit on Aug 10, 2015
Latest reply on Aug 17, 2015 by ranshalit

Hello,

 

I have some difficulties and using interrupt handler with powerpc, mpc8349, on linux.

In datasheet is shows that there are 8 external interrupts, named irq0-7. We need to use IRQ4.

I don't see the interrupt listed in /proc/interrupts

 

# cat /proc/interrupts

           CPU0

16:         93      IPIC   9 Level     serial

18:          0      IPIC  14 Level     i2c-mpc

19:          0      IPIC  15 Level     i2c-mpc

21:          0      IPIC  18 Level     phy_interrupt

32:          0      IPIC  32 Level     eth0_g0_tx

33:         14      IPIC  33 Level     eth0_g0_rx

34:          0      IPIC  34 Level     eth0_g0_er

35:          0      IPIC  35 Level     eth1_g0_tx

36:          0      IPIC  36 Level     eth1_g0_rx

37:          0      IPIC  37 Level     eth1_g0_er

LOC:      60756   Local timer interrupts for timer event device

LOC:          1   Local timer interrupts for others

SPU:          0   Spurious interrupts

PMI:          0   Performance monitoring interrupts

MCE:          0   Machine check exceptions

 

I have tried to add it in dts (Is that required?), but I still don't see any change in /proc/interrupts:

  intc@0{

compatible = "intc";

#address-cells = <1>;

#size-cells = <0>;

reg = <0 0x1000>;

interrupts = <4 0x8>; <- is this the way to define IRQ4 ?

  };

 

I've then added the following in the driver, but I also fails:

np = of_find_node_by_name(NULL,"hello");
  if (np == NULL)
    {
    printk("Error node not found\n");
    }
  printk("Node np = 0x%0x\n",np); <-- Node np = 0xdfffe2f0
  virq = irq_of_parse_and_map(np,0);
//
  printk(" VIRQ: %d \n" , virq); <-- virq = 0 !!??
  if (0 > (error=request_irq(virq, &hello_IRQHandler, IRQF_SHARED, "hello", &value))) {
      printk(KERN_WARNING"hello_IRQHandler: Init: Unable to allocate IRQ error = %d\n\n", error);
    return -1; <-- request_irq return -22 ....
  }

 

 

Thank you for any idea,

Ran

Outcomes