[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" dev
From: |
Markus Armbruster |
Subject: |
[PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices |
Date: |
Mon, 18 May 2020 07:03:53 +0200 |
cuda_init() creates a "mos6522-cuda" device, but it's never realized.
Affects machines mac99 with via=cuda (default) and g3beige.
pmu_init() creates a "mos6522-pmu" device, but it's never realized.
Affects machine mac99 with via=pmu and via=pmu-adb,
I wonder how this ever worked. If the "device becomes real only on
realize" thing actually works, then we've always been missing these
devices, yet nobody noticed.
Fix by realizing them in cuda_realize() and pmu_realize(),
respectively.
Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341
Cc: Laurent Vivier <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/misc/macio/cuda.c | 8 +++-----
hw/misc/macio/pmu.c | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index e0cc0aac5d..6d4d135f71 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -523,15 +523,13 @@ static void cuda_realize(DeviceState *dev, Error **errp)
{
CUDAState *s = CUDA(dev);
SysBusDevice *sbd;
- MOS6522State *ms;
- DeviceState *d;
struct tm tm;
+ qdev_init_nofail(DEVICE(&s->mos6522_cuda));
+
/* Pass IRQ from 6522 */
- d = DEVICE(&s->mos6522_cuda);
- ms = MOS6522(d);
sbd = SYS_BUS_DEVICE(s);
- sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms));
+ sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->mos6522_cuda));
qemu_get_timedate(&tm, 0);
s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c
index 9a9cd427e1..e29ca5e6cc 100644
--- a/hw/misc/macio/pmu.c
+++ b/hw/misc/macio/pmu.c
@@ -740,15 +740,13 @@ static void pmu_realize(DeviceState *dev, Error **errp)
{
PMUState *s = VIA_PMU(dev);
SysBusDevice *sbd;
- MOS6522State *ms;
- DeviceState *d;
struct tm tm;
+ qdev_init_nofail(DEVICE(&s->mos6522_pmu));
+
/* Pass IRQ from 6522 */
- d = DEVICE(&s->mos6522_pmu);
- ms = MOS6522(d);
sbd = SYS_BUS_DEVICE(s);
- sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms));
+ sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->mos6522_pmu));
qemu_get_timedate(&tm, 0);
s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
--
2.21.1
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, (continued)
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Andrew Jeffery, 2020/05/18
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Markus Armbruster, 2020/05/19
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Philippe Mathieu-Daudé, 2020/05/19
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Cédric Le Goater, 2020/05/19
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Joel Stanley, 2020/05/18
- Re: [PATCH 04/24] aspeed: Don't create unwanted "ftgmac100", "aspeed-mmi" devices, Markus Armbruster, 2020/05/19
[PATCH 08/24] mac_via: Fix to realize "mos6522-q800-via*" devices, Markus Armbruster, 2020/05/18
[PATCH 12/24] MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well, Markus Armbruster, 2020/05/18
[PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices,
Markus Armbruster <=
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Peter Maydell, 2020/05/21
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Markus Armbruster, 2020/05/25
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Markus Armbruster, 2020/05/27
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Peter Maydell, 2020/05/27
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Paolo Bonzini, 2020/05/27
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Markus Armbruster, 2020/05/28
- Re: [PATCH 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices, Markus Armbruster, 2020/05/27
[PATCH 07/24] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave, Markus Armbruster, 2020/05/18
[PATCH 02/24] display/xlnx_dp: Fix to realize "i2c-ddc" and "aux-to-i2c-bridge", Markus Armbruster, 2020/05/18