[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 27/37] leon3: use qdev gpio facilities for the PIL
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 27/37] leon3: use qdev gpio facilities for the PIL |
Date: |
Thu, 21 Nov 2019 13:51:15 +0000 |
On Wed, 20 Nov 2019 at 15:30, Marc-André Lureau
<address@hidden> wrote:
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> hw/sparc/leon3.c | 6 ++++--
> target/sparc/cpu.h | 1 -
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index cac987373e..1a89d44e57 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -230,8 +230,10 @@ static void leon3_generic_hw_init(MachineState *machine)
>
> /* Allocate IRQ manager */
> dev = qdev_create(NULL, TYPE_GRLIB_IRQMP);
> - env->pil_irq = qemu_allocate_irq(leon3_set_pil_in, env, 0);
> - qdev_connect_gpio_out_named(dev, "grlib-irq", 0, env->pil_irq);
> + qdev_init_gpio_in_named_with_opaque(DEVICE(env), leon3_set_pil_in,
> + env, "pil", 1);
> + qdev_connect_gpio_out_named(dev, "grlib-irq", 0,
> + qdev_get_gpio_in_named(DEVICE(env), "pil",
> 0));
> qdev_init_nofail(dev);
> sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_IRQMP_OFFSET);
> env->irq_manager = dev;
Reviewed-by: Peter Maydell <address@hidden>
Creating a gpio pin on some object that isn't yourself
looks a bit odd, but all this leon3 code is modifying
the CPU object from the outside anyway. Someday we might
tidy it up, but not today.
thanks
-- PMM
- [PATCH v4 21/37] sm501: make SerialMM a child, export chardev property, (continued)
- [PATCH v4 21/37] sm501: make SerialMM a child, export chardev property, Marc-André Lureau, 2019/11/20
- [PATCH v4 22/37] vmmouse: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/11/20
- [PATCH v4 23/37] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/11/20
- [PATCH v4 24/37] etraxfs: remove PROP_PTR usage, Marc-André Lureau, 2019/11/20
- [PATCH v4 25/37] dp8393x: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/11/20
- [PATCH v4 26/37] leon3: use qemu_irq framework instead of callback as property, Marc-André Lureau, 2019/11/20
- [PATCH v4 27/37] leon3: use qdev gpio facilities for the PIL, Marc-André Lureau, 2019/11/20
- Re: [PATCH v4 27/37] leon3: use qdev gpio facilities for the PIL,
Peter Maydell <=
- [PATCH v4 28/37] qdev: use g_strcmp0() instead of open-coding it, Marc-André Lureau, 2019/11/20
- [PATCH v4 29/37] RFC: mips/cps: fix setting saar property, Marc-André Lureau, 2019/11/20
- [PATCH v4 30/37] cris: improve passing PIC interrupt vector to the CPU, Marc-André Lureau, 2019/11/20
- [PATCH v4 31/37] smbus-eeprom: remove PROP_PTR, Marc-André Lureau, 2019/11/20