From: Alexander Graf <agraf@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, afaerber@suse.de, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 14/14] sysbus: Use TYPE_DEVICE GPIO functionality
Date: Thu, 28 Aug 2014 13:32:38 +0200 [thread overview]
Message-ID: <53FF1356.7020707@suse.de> (raw)
In-Reply-To: <058158ee2df477e4f0e4e5e434c9becb8e1f9317.1408080397.git.peter.crosthwaite@xilinx.com>
On 15.08.14 07:37, Peter Crosthwaite wrote:
> Re-implement the Sysbus GPIOs to use the existing TYPE_DEVICE
> GPIO named framework. A constant string name is chosen to avoid
> conflicts with existing unnamed GPIOs.
>
> This unifies GPIOs are IRQs for sysbus devices and allows removal
> of all Sysbus state for GPIOs.
>
> Any existing and future-added functionality for GPIOs is now
> also available for sysbus IRQs.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
> Changed since v1:
> Named each IRQ individually.
>
> hw/core/sysbus.c | 20 +++-----------------
> include/hw/sysbus.h | 6 +++---
> 2 files changed, 6 insertions(+), 20 deletions(-)
>
> diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c
> index f4e760d..192a729 100644
> --- a/hw/core/sysbus.c
> +++ b/hw/core/sysbus.c
> @@ -41,11 +41,7 @@ static const TypeInfo system_bus_info = {
>
> void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq)
> {
> - assert(n >= 0 && n < dev->num_irq);
> - dev->irqs[n] = NULL;
> - if (dev->irqp[n]) {
> - *dev->irqp[n] = irq;
> - }
> + qdev_connect_gpio_out_named(DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ, n, irq);
> }
>
> static void sysbus_mmio_map_common(SysBusDevice *dev, int n, hwaddr addr,
> @@ -89,22 +85,13 @@ void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr,
> /* Request an IRQ source. The actual IRQ object may be populated later. */
> void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p)
> {
> - int n;
> -
> - assert(dev->num_irq < QDEV_MAX_IRQ);
> - n = dev->num_irq++;
This renders dev->num_irq to always stay 0. Better remove it from the
header.
Alex
next prev parent reply other threads:[~2014-08-28 11:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-15 5:29 [Qemu-devel] [PATCH v2 00/14] GPIO/IRQ QOMification: Phase 2 - Getting rid of SYSBUS IRQs Peter Crosthwaite
2014-08-15 5:29 ` [Qemu-devel] [PATCH v2 01/14] qdev: gpio: Don't allow name share between I and O Peter Crosthwaite
2014-08-15 5:30 ` [Qemu-devel] [PATCH v2 02/14] qdev: gpio: Register GPIO inputs as child objects Peter Crosthwaite
2014-08-15 5:30 ` [Qemu-devel] [PATCH v2 03/14] qdev: gpio: Register GPIO outputs as QOM links Peter Crosthwaite
2014-08-15 5:31 ` [Qemu-devel] [PATCH v2 04/14] qmp: qstring: Handle NULL strings Peter Crosthwaite
2014-08-15 5:32 ` [Qemu-devel] [PATCH v2 05/14] qom: Allow clearing of a Link property Peter Crosthwaite
2014-08-15 5:32 ` [Qemu-devel] [PATCH v2 06/14] qom: Demote already-has-a-parent to a regular error Peter Crosthwaite
2014-08-15 5:33 ` [Qemu-devel] [PATCH v2 07/14] qdev: gpio: Re-impement qdev_connect_gpio QOM style Peter Crosthwaite
2014-08-15 5:33 ` [Qemu-devel] [PATCH v2 08/14] qdev: gpio: Add API for intercepting a GPIO Peter Crosthwaite
2014-08-15 5:34 ` [Qemu-devel] [PATCH v2 09/14] qtest/irq: Rework IRQ interception Peter Crosthwaite
2014-08-15 5:34 ` [Qemu-devel] [PATCH v2 10/14] irq: Remove qemu_irq_intercept_out Peter Crosthwaite
2014-08-15 5:35 ` [Qemu-devel] [PATCH v2 11/14] qdev: gpio: delete NamedGPIOList::out Peter Crosthwaite
2014-08-15 5:35 ` [Qemu-devel] [PATCH v2 12/14] qdev: gpio: Remove qdev_init_gpio_out x1 restriction Peter Crosthwaite
2014-08-15 5:36 ` [Qemu-devel] [PATCH v2 13/14] qdev: gpio: Define qdev_pass_gpios() Peter Crosthwaite
2014-08-15 5:37 ` [Qemu-devel] [PATCH v2 14/14] sysbus: Use TYPE_DEVICE GPIO functionality Peter Crosthwaite
2014-08-28 11:32 ` Alexander Graf [this message]
2014-08-21 9:23 ` [Qemu-devel] [PATCH v2 00/14] GPIO/IRQ QOMification: Phase 2 - Getting rid of SYSBUS IRQs Alexander Graf
2014-08-25 7:09 ` Peter Crosthwaite
2014-08-28 11:59 ` Alexander Graf
2014-08-28 12:23 ` Alexander Graf
2014-09-23 21:49 ` Alexander Graf
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=53FF1356.7020707@suse.de \
--to=agraf@suse.de \
--cc=afaerber@suse.de \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--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.