Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1716096
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC] interrupts DT property for irqdomain hierarchy |
| Date | Mon, 21 Aug 2017 07:40:02 +0200 |
| Message-ID | <ugNBo-by-11@gated-at.bofh.it> (permalink) |
| References | <u0mYy-2Sz-25@gated-at.bofh.it> <ucZrs-bI-23@gated-at.bofh.it> |
| X-Original-To | Rob Herring <robh+dt@kernel.org> |
| Dkim-Filter | OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com v7L5a6lI017046 |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1503293767; bh=qU6LEAm/8cqgjD0j6AXCC4caAxJBgdqKiq7FS9LH8T0=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=jRnMiqKxSzRn/ReEGgsR129Ssg9w18RYQSbF6ZbwiNLdvP5yjA+YaZnM1VBpyDIyk L3kpxrQ+N1T8meAi9bEyRdNrhhS+kmoPlLX5L6Y9+xq6PuDIvUU4+hPk2jS4dkduct 63qU2AGCNN2OYiEsH3WkubJW+AedHesoY+O1Zs0nTzgOcR0F2k4ikO39Wi86zB0ZHL HlzhhHF2WW4SCY8tA/VBdI8P3R/HLmk6f/R5+IjM6vZo1/ccXLZdbv18HBrcKVW6Oj 9zufyBhCfFtVqARygx/wQTDnMYAV0zwuhoNWsosIAITJBzx13+jQxk+lsiz4s8S8ox R5vHKmvXP6mGA== |
| X-Nifty-Srcip | [209.85.161.177] |
| X-Gm-Message-State | AHYfb5g/Y+Fu55NlP9Cp3kis3g41RwflDNkHyltwvaguhupdokgtTnP0 qc5bXpuZhH/lzD/cbO7VXVkmD5QkUA== |
| X-Received | by 10.129.129.198 with SMTP id r189mr2886377ywf.48.1503293765646; Sun, 20 Aug 2017 22:36:05 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Gmail-Original-Message-ID | <CAK7LNASENLBy9vCi8tPLJ00v8yzkGiV+0w8LoiuCxiVJnxQCzA@mail.gmail.com> |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 105 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Thomas Gleixner <tglx@linutronix.de>, Jason Cooper <jason@lakedaemon.net>, Marc Zyngier <marc.zyngier@arm.com>, Jiang Liu <jiang.liu@linux.intel.com>, Mark Rutland <mark.rutland@arm.com>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, Arnd Bergmann <arnd@arndb.de>, Linus Walleij <linus.walleij@linaro.org> |
| X-Original-Date | Mon, 21 Aug 2017 14:35:25 +0900 |
| X-Original-Message-ID | <CAK7LNASENLBy9vCi8tPLJ00v8yzkGiV+0w8LoiuCxiVJnxQCzA@mail.gmail.com> |
| X-Original-References | <CAK7LNATme8P1uHx5hZr6Eez4KGweUi=jQ6zJ=bdBf1XmxZVoLg@mail.gmail.com> <CAL_JsqLC2kUvhHHJdKd_UinvgRHpSv+vsPgRh0xGowfDX5BXYQ@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1716096 |
Show key headers only | View raw
Hi Rob,
2017-08-11 2:23 GMT+09:00 Rob Herring <robh+dt@kernel.org>:
> On Thu, Jul 6, 2017 at 4:58 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> Hi IRQ experts, DT exports,
>>
>>
>> I have a question about CONFIG_IRQ_DOMAIN_HIERARCHY.
>>
>> When IRQ domains are hierarchy,
>> how can we specify IRQ number re-mapping between the
>> parent irqchip and the child irqchip?
>>
>> The following figure shows a simplified example.
>>
>> |----------| |----------| |----------|
>> | parent | | child | | IRQ |
>> | IRQ chip | <----- | IRQ chip |<----- | consumer |
>> | | | | | Device |
>> |----------| |----------| |----------|
>>
>> Perhaps, we may describe DT like follows
>>
>> gic: interrupt-controller {
>> ...
>> interrupt-controller;
>> #interrupt-cells = <3>;
>> };
>>
>> child_intc: child-interrupt-controller {
>> ...
>> interrupt-parent = <&gic>;
>> interrupts = <0 50 0>, <0 51 0>, <0 52 0>, <0 53 0>;
>> interrupt-controller;
>> #interrupt-cells = <2>;
>> };
>>
>> i2c: i2c {
>> ...
>> interrupt-parent = <&child_intc>;
>> interrupts = <0 4>;
>> };
>>
>>
>> In this example, the I2C controller takes HWIRQ=0 of the child_intc device.
>> This goes through the child IRQ chip,
>> then connected to HWIRQ=50 of the parent intc.
>>
>> The DT above describes the hardware connection well,
>> but it actually does not work.
>>
>> The root irqchip is usually declared with IRQCHIP_DECLARE().
>> So, IRQ resources are allocated when platform devices are populated from DT.
>> This means IRQ allocation happens before drivers are probed.
>>
>> of_pupulate_default_populate() does not know the fact about irqdomain hierarchy.
>
> This has not been true for some time now. The irqs are resolved at
> probe time rather than statically created resources and deferred probe
> is supported if one of the interrupt controllers is not yet
> initialized.
Yes, it is true if the irqchip is a platform driver instead of
IRQCHIP_DECLARE(),
but irqdomain hierarchy always wants to disable the static resource allocation.
>> interrupt-ranges = <0 0 0 50 0 4>;
>>
>> This means <0 0>, <0 1>, <0 2>, <0 3> in the child
>> should be mapped to <0 50 0>, <0 51 0>, <0 52 0>, <0 53 0> in the parent,
>> respectively.
>
> interrupt-map property does this. See here[1].
>
> Rob
>
> [1] http://elinux.org/Device_Tree_Usage#Advanced_Interrupt_Mapping
Thanks for the pointer.
I read it and of_irq_parse_raw() implementation as well.
The interrupt-map would not work for the irqdomain hierarchy
because the interrupt-map transforms irq-spec based on "reg" property.
In this case, no relation between the irqchip and its irq-consumers
(between "child_intc" and "i2c") in therms of the physical address view.
Some irq-consumers have address cell size 1,
and other irq-consumers have address cells size 2.
--
Best Regards
Masahiro Yamada
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [RFC] interrupts DT property for irqdomain hierarchy Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-08-21 07:40 +0200
csiph-web