From: Guenter Roeck <linux@roeck-us.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] hw/arm/pxa2xx: Correctly handle external GPIO reset requests
Date: Thu, 27 Oct 2016 12:09:53 -0700 [thread overview]
Message-ID: <20161027190953.GC9699@roeck-us.net> (raw)
In-Reply-To: <CAFEAcA8RJtsPPD-MR2+K8L9wTEL9JLF+AEfKHG=1iV=jvDDxbw@mail.gmail.com>
On Thu, Oct 27, 2016 at 03:34:29PM +0100, Peter Maydell wrote:
> On 25 October 2016 at 19:21, Guenter Roeck <linux@roeck-us.net> wrote:
> > Problem though is that the kernel doesn't really set GPIO01.
> > It sets SPITZ_GPIO_ON_RESET (for spitz), which is 89.
> > This is mapped to the reset function in spitz.c.
> > /* Handle reset */
> > qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_ON_RESET, cpu->reset);
> >
> > This doesn't seem correct; with that override, the reset is supposed
> > to happen unconditionally, not only if bit 4 of PCFR is set (and that
> > bit isn't set for spitz).
>
> Yes, that code looks dodgy (among other things it shouldn't
> be reaching into the PXA2xxState's structure members directly
> like that; par for the course on an unmaintained elderly bit
> of QEMU code like this though).
>
> > How should I correctly handle that situation ? Allocate a second irq
> > for non-GPIO01 reset requests ?
>
> What does the hardware actually do here? It seems unlikely that
> the board really wires up the GPIO 89 pin back into the CPU/SoC to
> ask the CPU to do a full reset, rather than just handling reset itself.
Yes, I am quite sure that is what it does.
> If it's handled at board level then the right thing would be
> for the spitz.c code to have its own GPIO handler that does
> a power-on-reset.
>
Makes sense. I'll fix spitz.c (and tosa.c, which does the same)
along that line.
Thanks,
Guenter
prev parent reply other threads:[~2016-10-27 19:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 2:06 [Qemu-devel] [PATCH] hw/arm/pxa2xx: Correctly handle external GPIO reset requests Guenter Roeck
2016-10-25 5:36 ` no-reply
2016-10-25 11:49 ` Peter Maydell
2016-10-25 13:27 ` Guenter Roeck
2016-10-25 13:40 ` Peter Maydell
2016-10-25 18:21 ` Guenter Roeck
2016-10-27 14:34 ` Peter Maydell
2016-10-27 19:09 ` Guenter Roeck [this message]
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=20161027190953.GC9699@roeck-us.net \
--to=linux@roeck-us.net \
--cc=peter.maydell@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.