linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: linuxppc-embedded@ozlabs.org
Cc: Felix Radensky <felix@embedded-sol.com>
Subject: Re: External interrupt on 460EX
Date: Wed, 15 Oct 2008 17:00:30 +0200	[thread overview]
Message-ID: <200810151700.30741.sr@denx.de> (raw)
In-Reply-To: <48F60192.6050803@embedded-sol.com>

Felix,

On Wednesday 15 October 2008, Felix Radensky wrote:
> I'm running Linux 2.6.26 on custom board based on AMCC 460EX.
> I'm trying to catch interrupt generated by CPLD, but without any luck.
>
> The interrupt is connected to GPIO 45. U-Boot (1.3.4) configures this
> pin as external interrupt 12 (interrupt 20 in UIC 3). I've added the
> following
> entry to board device tree (in opb section)
>
> cpld@2,0 {
>     device_type = "cpld";
>     interrupts = <20 1>;

Is this interrupt active on rising edge? This is what you have configured 
here. When you need level, active low, then you need to write:

     interrupts = <20 8>;

And be careful which dts version you are using. Is this 20 decimal or hex?

>     interrupt-parent = <&UIC3>;
> };
>
> In my driver I do the following:
>
>     /* Find CPLD node in device tree */
>     np = of_find_node_by_type(NULL, "cpld");
>     if (!np) {
>         printk(KERN_INFO "No CPLD found in device tree\n");
>         return -1;
>     }
>
>     /* Get and map irq number from device tree */
>     cpld_irq = irq_of_parse_and_map(np, 0);
>     if (cpld_irq == NO_IRQ) {
>         printk(KERN_ERR "irq_of_parse_and_map failed\n");
>         of_node_put(np);
>         return -ENODEV;
>     }
>
>     /* Register CPLD interrupt handler */
>     rc = request_irq(cpld_irq, cpld_interrupt,
>              IRQF_TRIGGER_LOW, "CPLD", NULL);
>
> And I see this interrupt in /proc/interrups after loading
> the driver. However interrupt handler is never invoked,
> although hardware guys see that GPIO line goes down
> when interrupt is generated.
>
> What am I doing wrong ?

Another idea is that you didn't configure the pin multiplexing correctly. Most 
external IRQ's are shared with other functions and/or GPIO's. You need to 
configure the multiplexing correctly for external IRQ functionality. This is 
usually done in U-Boot with the CFG_4xx_GPIO_TABLE. 

I suggest you check here first.

Best regards,
Stefan

  reply	other threads:[~2008-10-15 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-15 14:43 External interrupt on 460EX Felix Radensky
2008-10-15 15:00 ` Stefan Roese [this message]
2008-10-15 15:18   ` Felix Radensky
2008-10-16  7:44     ` Stefan Roese
2008-10-16  9:22       ` Felix Radensky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810151700.30741.sr@denx.de \
    --to=sr@denx.de \
    --cc=felix@embedded-sol.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).