[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CP
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices |
Date: |
Fri, 9 Feb 2024 11:35:07 +0000 |
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Inline cpu_create() in order to call
> qdev_init_gpio_in_named_with_opaque()
> before the CPU is realized.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/sparc/leon3.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
> index 0df5fc949d..0e1d749306 100644
> --- a/hw/sparc/leon3.c
> +++ b/hw/sparc/leon3.c
> @@ -234,8 +234,11 @@ static void leon3_generic_hw_init(MachineState *machine)
> APBPnp *apb_pnp;
>
> /* Init CPU */
> - cpu = SPARC_CPU(cpu_create(machine->cpu_type));
> + cpu = SPARC_CPU(object_new(machine->cpu_type));
> env = &cpu->env;
> + qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_set_pil_in,
> + env, "pil", 1);
> + qdev_realize(DEVICE(cpu), NULL, &error_fatal);
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
with a similar caveat as with the sparc64.c patch.
thanks
-- PMM
- Re: [PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it, (continued)
- [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/08
- [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/08
- Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices, Mark Cave-Ayland, 2024/02/09