linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, linuxppc-embedded@ozlabs.org, sl@bplan-gmbh.de
Subject: Re: [PATCH/RFC] powerpc: Add MPC5200 Interrupt Controller support.
Date: Sun, 05 Nov 2006 15:32:04 +0100	[thread overview]
Message-ID: <454DF5E4.8050704@246tNt.com> (raw)
In-Reply-To: <1162731733.28571.241.camel@localhost.localdomain>


>> As said, no option here. I think there is different way to see how works the PIC. However, from a register point of view. There is just critical, main, peripherals, SDMA.
>>
>> Loot at "ICTL Perstat, MainStat, MainStat, CritStat Encoded Register--MBAR + 0x0524"
>>     
>
> You should have your device-tree match your internal numbering. As you
> noticed, the CRIT interrupt and the EXT interrupts are just the same.
> And you properly folded them under the same level 1... now just make
> the device-tree expose the same informations.
>
> I don't care if you have firmwares in production or whatever... As a
> matter of fact, you guys have been working on this board for long enough
> you could have dealt with that issue long ago :-)
>
> So right now, what you should do is figure out a proper encoding for the
> firmware, and then either fix your device-tree, or do a hack in
> prom_init.c that fixes it up.
>   
I think Nicolas's choice makes sense.
The HW provides 4 registers which each contain the "number" of the IRQ that
happenned. And IRQ0 is encoded separatly from IRQ[1-3].

So when IRQ0 happens,  you really have a flag saying that a critical
interrupt
happenned, and when you look at the encoded critical interrupt number,
you get
"00" which is IRQ0.

If IRQ2 happend, the flag say a main interrupt happenned and when looking in
the encoded main interrupt number, we get "000001" which is IRQ2 ...

So the Hardware maps the hw IRQ number like this, so it makes sense to
use that mapping. Sure we could just not use that mapping and put IRQ0 hwirq
number just before IRQ1 but then the hack is just moved in get_irq and
we have
a numbering scheme which is not really what's in hw.


        Sylvain

  parent reply	other threads:[~2006-11-05 14:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01 20:27 [PATCH/RFC] powerpc: Add MPC5200 Interrupt Controller support Nicolas DET
2006-11-01 22:05 ` Dale Farnsworth
2006-11-01 22:07   ` Sven Luther
2006-11-01 22:21     ` Dale Farnsworth
2006-11-01 22:12 ` Benjamin Herrenschmidt
2006-11-02 16:27   ` Nicolas DET
2006-11-02 20:47     ` Nicolas DET
2006-11-04 23:35       ` Benjamin Herrenschmidt
2006-11-05  0:27         ` Sylvain Munaut
2006-11-05  1:13           ` Benjamin Herrenschmidt
2006-11-06  6:28             ` Grant Likely
2006-11-06  8:39               ` Sylvain Munaut
2006-11-05 10:17         ` Nicolas DET
2006-11-05 10:37           ` Benjamin Herrenschmidt
2006-11-05 11:30             ` Nicolas DET
2006-11-05 13:02               ` Benjamin Herrenschmidt
2006-11-05 13:16                 ` Nicolas DET
2006-11-05 14:32                 ` Sylvain Munaut [this message]
2006-11-06  6:55       ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2006-11-06 10:26 Nicolas DET
2006-11-06 11:03 Nicolas DET
2006-11-06 23:35 ` Sylvain Munaut
2006-11-07  9:22   ` Nicolas DET
2006-11-07 10:40 Nicolas DET
2006-11-07 10:45 ` Sylvain Munaut
2006-11-07 16:30   ` Grant Likely
2006-11-07 20:52     ` Sylvain Munaut

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=454DF5E4.8050704@246tNt.com \
    --to=tnt@246tnt.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=sl@bplan-gmbh.de \
    /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).