From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Maydell <peter.maydell@linaro.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH] hw/arm/virt: Fix PL061 node name and properties
Date: Fri, 22 May 2020 11:46:52 +0200 [thread overview]
Message-ID: <2b14cde5-4e91-2f1a-95cd-13f051b10afa@amsat.org> (raw)
In-Reply-To: <CAFEAcA9TzPcWWiJNTQ=EZzsSVy5qTPz5DXTePGmXWBTxZg7i7w@mail.gmail.com>
On 5/22/20 11:30 AM, Peter Maydell wrote:
> On Fri, 22 May 2020 at 09:29, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> On Thu, May 21, 2020 at 6:59 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>> On Tue, 19 May 2020 at 09:49, Geert Uytterhoeven
>>> <geert+renesas@glider.be> wrote:
>>>> Make the created node comply with the PL061 Device Tree bindings:
>>>> - Use generic node name "gpio" instead of "pl061",
>>>> - Add missing "#interrupt-cells" and "interrupt-controller"
>>>> properties.
>>>
[...]
>>> Since the devicetree spec says that the interrupt-controller
>>> property "defines a node as an interrupt controller node"
>>> and a GPIO chip isn't an interrupt controller, this seems
>>> like some kind of error in the dtb binding. Maybe I'm
>>> missing something...
>>
>> PL061 is an interrupt controller, as it can assert its interrupt output
>> based on activity on GPIO input lines.
>
> By that logic the PL011 UART is an interrupt controller, because
> it can assert its interrupt output based on activity on the serial
> port input lines.
Yes :)
> A GPIO controller is not an interrupt controller inherently.
> Maybe you can use it in a system design as an interrupt
> controller if you want to, and in that system's dtb perhaps
> it would make sense to label it as one, but the virt board's
> PL061 is in no way an interrupt controller -- it's just a GPIO
> controller.
>
>>> What actually goes wrong if QEMU doesn't specify these
>>> properties?
>>
>> It means that other devices that have their interrupt output connected
>> to a PL061 GPIO input won't work, as their driver in the guest OS cannot
>> find the interrupt. Note that arm/virt.c currently doesn't instantiate
>> such devices.
>
> OK. But why would we want to run an interrupt line through the GPIO
> controller when we have a perfectly good interrupt controller in
> the system already?
This is sometimes done on embedded devices when all the INTC lines are
already wired. You'd use extra lines on free peripherals. Usually the
peripheral offer a limited GPIO mode as passthru interrupt, else you use
nasty hacks...
>
> It might be reasonable to add the properties now to avoid setting
> a bear trap for ourselves in future; on the other hand if running
> interrupt lines through the GPIO controller doesn't work then it
> acts as a nudge to stop people adding devices that are wired
> up in a weird way.
[...]
next prev parent reply other threads:[~2020-05-22 9:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 8:49 [PATCH] hw/arm/virt: Fix PL061 node name and properties Geert Uytterhoeven
2020-05-21 16:59 ` Peter Maydell
2020-05-22 8:29 ` Geert Uytterhoeven
2020-05-22 9:30 ` Peter Maydell
2020-05-22 9:46 ` Philippe Mathieu-Daudé [this message]
2020-05-29 8:01 ` Geert Uytterhoeven
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=2b14cde5-4e91-2f1a-95cd-13f051b10afa@amsat.org \
--to=f4bug@amsat.org \
--cc=geert@linux-m68k.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).