linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 5/5] irqchip: s3c24xx: add devicetree support
Date: Fri, 22 Mar 2013 22:42:05 +0000	[thread overview]
Message-ID: <201303222242.05269.arnd@arndb.de> (raw)
In-Reply-To: <201303222315.44882.heiko@sntech.de>

On Friday 22 March 2013, Heiko St?bner wrote:
> Not all main interrupts are parent interrupts, so it would be difficult to 
> distinguish between main interrupts that are a parent and the ones that are 
> not - is a "-1" a valid cell-value for interrupts?

I'm actually not sure if negative numbers are valid syntax in dtc, but
you could certainly define some value to mean "none", or you add another
flag in the trigger type cell.

>         <main_irq -1 trigger_type> /* directly used main interrupt */
>         <main_irq child_irq trigger_type> /* sub-interrupt */
> 
> Or are you thinking of something like:
>         <main_irq is_a_parent child_irq trigger_type>

The first one would work, the second one with four cells seems a bit
strange if the second cell is just a bit. My first idea was to use 
a bit mask for the child irq, in which only one bit is set, so
it would be <3 0x40000 4> instead of <3 18 4>, and a zero bitmask
would indicate no sub-interrupt. This is probably harder to read
though and not a good representation.

> I looked a bit more thru the other irqchips and it seems the bcm2835 is doing 
> something similar but without having a parent relationship:
>         <controller-num irq-num>
> 
> so this could be adapted to:
>         <controller-num irq-num parent-num trigger_type>
> 
> controller-num being 0 for intc, 1 for subintc, 2 intc2 . The controller 
> itself knows if it's a sub- or main controller - when it should handle the 
> parent-number or simply ignore it.

Yes, that looks more logical.

You could in theory also compact collapse multiple cells into one, so
instead of using <1 3 18 4> it could be <0x10031204> or <0x10030012 4>
to save a little space while making it a little less readable.
 
> > The alternative would be to have three completely separate nodes,
> > and then you can describe the parent-child relationship like
> > 
> > intc: interrupt-controller at 4a000000 {
> >       compatible = "samsung,s3c2416-intc";
> >       reg = <0x4a000000 0x18>;
> >       interrupt-controller;
> >       #interrupt-cells = <2>;
> > };
> > 
> > subintc: interrupt-controller at 4a000018 {
> >       compatible = "samsung,s3c2416-subintc";
> >       reg = <0x4a000018 0x28>;
> >       interrupt-controller;
> >       #interrupt-cells = <3>;
> >       interrupt-parent = <&intc>;
> >       interrupts  = <28 0>, <23 0>, <15 0>, <31 0>, <16 0>, <17 0>, <18 0>, <9
> > 0>; };
> 
> 
> The first two iterations had separate nodes, but the interrupt controller 
> posseses more interesting registers that are shared between all of the 
> controllers, so it did sound better to have them together.

Yes, makes sense.

> Also the interrupts property is most likely not able to accurately describe 
> the parent relationship, as the interrupts are very much different in all 
> s3c24xx SoCs - I would need to tell every sub-interrupt where it cascasdes 
> from, because most of them do different things on different s3c24xx SoCs.
>
> I did start with this approach, using the interrupt index as mapping for the 
> hwirq - interrupts[0] for hwirq 0 and so on. But it looked ugly. Using only 
> one interrupts element per sub-group would require per-SoC mapping data to be 
> present in the driver, indicating that interrupts[0] is responsible for bits 
> 0,1,2 and so on.
> 
> Therefore the idea of handling the parent relationship in the device-nodes 
> interrupt property sounds much nicer :-)

Ok.

	Arnd

  reply	other threads:[~2013-03-22 22:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 17:43 [PATCH v4 0/5] move s3c24xx-irq to drivers/irqchip and add dt support Heiko Stübner
2013-03-22 17:44 ` [PATCH v4 1/5] ARM: S3C24XX: move irq driver to drivers/irqchip Heiko Stübner
2013-03-22 17:44 ` [PATCH v4 2/5] irqchip: s3c24xx: fix comments on some camera interrupts Heiko Stübner
2013-03-22 17:45 ` [PATCH v4 3/5] irqchip: s3c24xx: fix irqlist of second s3c2416 controller Heiko Stübner
2013-03-22 17:46 ` [PATCH v4 4/5] irqchip: s3c24xx: add irq_set_type callback for basic interrupt types Heiko Stübner
2013-03-22 17:46 ` [PATCH v4 5/5] irqchip: s3c24xx: add devicetree support Heiko Stübner
2013-03-22 20:55   ` Arnd Bergmann
2013-03-22 22:15     ` Heiko Stübner
2013-03-22 22:42       ` Arnd Bergmann [this message]
2013-03-22 21:04 ` [PATCH v4 0/5] move s3c24xx-irq to drivers/irqchip and add dt support Arnd Bergmann
2013-03-22 21:21   ` Heiko Stübner

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=201303222242.05269.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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).