linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* GPIO IRQ on P1022
@ 2011-07-31 10:38 Felix Radensky
  2011-07-31 13:59 ` Tabi Timur-B04825
  2011-07-31 15:19 ` Wolfgang Grandegger
  0 siblings, 2 replies; 8+ messages in thread
From: Felix Radensky @ 2011-07-31 10:38 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org, jacmet, Tabi Timur-B04825

Hi,

I'm running kernel 3.0 on a custom board based on Freescale P1022.
The interrupt line of on-board FPGA is connected to GPIO2_9. FPGA
IRQ is level, active low. The GPIOs are mapped like this:

GPIOs 160-191, /soc@ffe00000/gpio-controller@f200:

GPIOs 192-223, /soc@ffe00000/gpio-controller@f100:

GPIOs 224-255, /soc@ffe00000/gpio-controller@f000:

I've verified that pin mixing is done correctly, and the
FPGA IRQ line is indeed configured as GPIO.

I have the following code in my driver:

     #define FPGA_IRQ_GPIO 169

     err = gpio_request(FPGA_IRQ_GPIO, "FPGA IRQ");
     if (err) {
         printk(KERN_ERR "Failed to request FPGA IRQ GPIO, err=%d\n", 
err);
         goto out;
     }

     gpio_direction_input(FPGA_IRQ_GPIO);

     irq = gpio_to_irq(FPGA_IRQ_GPIO);
     if (irq < 0) {
         printk(KERN_ERR "Failed to map FPGA GPIO to IRQ\n");
         goto out;
     }

     err = request_irq(irq, gsat_interrupt,
               IRQF_TRIGGER_FALLING, DRVNAME, priv);

     Interrupt handler reads FPGA interrupt status register to clear 
interrupt
     and exits.

     What happens when I load my driver is single execution of 
interrupt handler
     followed by system freeze. Even if I call disable_irq() in 
interrupt handler the
     system still freezes.

     I've added some prints to mpc8xxx_gpio.c driver, here's what I get:

     mpc8xxx_gpio_to_irq: offset 9
     mpc8xxx_gpio_irq_map: virq 31
     irq: irq 9 on host /soc@ffe00000/gpio-controller@f200 mapped to 
virtual irq 31
     mpc8xxx_irq_set_type: virq 9 flow_type 2
     mpc8xxx_irq_unmask: irq 9
     mpc8xxx_gpio_irq_cascade: irq 47
     mpc8xxx_irq_mask: irq 9
     mpc8xxx_irq_ack: irq 9


What am I doing wrong ?

Thanks a lot.

Felix.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-02 10:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-31 10:38 GPIO IRQ on P1022 Felix Radensky
2011-07-31 13:59 ` Tabi Timur-B04825
2011-07-31 14:56   ` Felix Radensky
2011-08-02 10:47   ` Felix Radensky
2011-07-31 15:19 ` Wolfgang Grandegger
2011-07-31 15:51   ` Felix Radensky
2011-07-31 17:49     ` Wolfgang Grandegger
2011-07-31 19:28       ` Felix Radensky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).