[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU de
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices |
Date: |
Tue, 13 Feb 2024 14:03:41 +0100 |
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>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/sparc64/sparc64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c
index 72f0849f50..3091cde586 100644
--- a/hw/sparc64/sparc64.c
+++ b/hw/sparc64/sparc64.c
@@ -24,6 +24,7 @@
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "cpu.h"
#include "hw/boards.h"
#include "hw/sparc/sparc64.h"
@@ -271,9 +272,10 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_type,
uint64_t prom_addr)
uint32_t stick_frequency = 100 * 1000000;
uint32_t hstick_frequency = 100 * 1000000;
- cpu = SPARC_CPU(cpu_create(cpu_type));
+ cpu = SPARC_CPU(object_new(cpu_type));
qdev_init_gpio_in_named(DEVICE(cpu), sparc64_cpu_set_ivec_irq,
"ivec-irq", IVEC_MAX);
+ qdev_realize(DEVICE(cpu), NULL, &error_fatal);
env = &cpu->env;
env->tick = cpu_timer_create("tick", cpu, tick_irq,
--
2.41.0
- [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it, (continued)
- [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 05/12] hw/ppc/prep: Realize ISA bridge before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 07/12] hw/sh4/r2d: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 08/12] hw/sparc/sun4m: Realize DMA controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 11/12] hw/sparc/leon3: Initialize GPIO before realizing CPU devices, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices,
Philippe Mathieu-Daudé <=
- [PATCH v4 09/12] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it, Philippe Mathieu-Daudé, 2024/02/13
- [PATCH v4 10/12] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in(), Philippe Mathieu-Daudé, 2024/02/13
- Re: [PATCH v4 00/12] hw: Strengthen SysBus & QBus API, Philippe Mathieu-Daudé, 2024/02/15