linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: Alemao <xcarandiru@gmail.com>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: MPC85xx External/Internal Interrupts
Date: Sun, 6 Sep 2009 13:06:41 +0200	[thread overview]
Message-ID: <20090906110641.GA11350@Chamillionaire.breakpoint.cc> (raw)
In-Reply-To: <d970ff420909041229hb3aa96dya329e06ea56dd1ac@mail.gmail.com>

* Alemao | 2009-09-04 16:29:15 [-0300]:

>On Fri, Sep 4, 2009 at 4:28 PM, Alemao<xcarandiru@gmail.com> wrote:
>> I've read some posts in the list, and about:
>>
>> irq_of_parse_and_map()
>> irq_create_map()
>>
>> But Im still trying to understand MPC85xx TSEC1 dts.
>>
>> Gianfar driver is using request_irq(), and request_irq() uses virtual
>> irq, right?
Yes. request_irq() expects a linux-irq-number. irq_of_parse_and_map()
provides such a number.

>>
>> Thats why in dts all irqs for TSEC1 are "offseted" of 16?
>>
>> Manual ?| ?DTS
>> ----------------------
>> 13 ? ? ? ? 29
>> 14 ? ? ? ? 30
>> 18 ? ? ? ? 34
>>
>
>This makes no sense.
>
>CPM2-PIC, in MPC8555ERM, its on 30. In DTS is on 46. Offset of 16.
>But my platform code use irq_of_parse_and_map()!
>
>So why this offset?!?!
irq_of_parse_and_map() creates a mapping between the hardware irq number
as specified in the device tree and the linux number (virq) which is
used within the linux api in request_irq() for instance.
irq_of_parse_and_map() is essential to create a mapping between those
two. The interrupt controller on the MPC8555 (mpic) specifies the first
few interrupt numbers as external sources followed by internal sources. 
Now, during the init sequenze of the mpic every interrupt source
(internal and external) becomes its uniqe vector number which identifies
the source by a number. This number is the hardware interrupt number
i.e. that thing in the device tree. The init sequence is a for loop
which starts at 0 for the first interrupt source which happens to be
external interrupt 0, 1 for external interrupt 1 and so on. At the time
it reaches the first internal interrupt source the vector number is 16.
That's why you always have an offset of 16 between every internal
interupt source number in the MPC855ERM document and those weired
numbers in the device tree :)

>Alemao
Sebastian

  parent reply	other threads:[~2009-09-06 11:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d970ff420909040604h1bb3874eg5c79f79f85e713a3@mail.gmail.com>
2009-09-04 13:13 ` Fwd: MPC85xx External/Internal Interrupts Alemao
2009-09-04 19:01 ` Alemao
2009-09-04 19:14   ` Alemao
2009-09-04 19:24     ` Alemao
     [not found] ` <d970ff420909041228h3638e840r34c0c0e79f178e55@mail.gmail.com>
     [not found]   ` <d970ff420909041229hb3aa96dya329e06ea56dd1ac@mail.gmail.com>
2009-09-06 11:06     ` Sebastian Andrzej Siewior [this message]
2009-09-09 18:28       ` Scott Wood
2009-09-10 13:15         ` Sebastian Andrzej Siewior
2009-09-10 22:24           ` Sebastian Andrzej Siewior
2009-09-10 22:27             ` Scott Wood
2009-12-06 11:32               ` [RFC] doc/powerpc: try to explain why the interrupt numbers are off by 16 Sebastian Andrzej Siewior
2009-12-09 20:51                 ` Kumar Gala

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=20090906110641.GA11350@Chamillionaire.breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=xcarandiru@gmail.com \
    /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).