[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/12] mac_via: move VIA1 reset logic from mac_via_reset() to mos
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 07/12] mac_via: move VIA1 reset logic from mac_via_reset() to mos6522_q800_via1_reset() |
Date: |
Mon, 30 Aug 2021 11:24:42 +0100 |
After this change mac_via_reset() is now empty and can be removed.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/misc/mac_via.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c
index 47e221dd88..a2df17d9be 100644
--- a/hw/misc/mac_via.c
+++ b/hw/misc/mac_via.c
@@ -945,18 +945,6 @@ static const MemoryRegionOps mos6522_q800_via2_ops = {
},
};
-static void mac_via_reset(DeviceState *dev)
-{
- MacVIAState *m = MAC_VIA(dev);
- MOS6522Q800VIA1State *v1s = &m->mos6522_via1;
- ADBBusState *adb_bus = &v1s->adb_bus;
-
- adb_set_autopoll_enabled(adb_bus, true);
-
- v1s->cmd = REG_EMPTY;
- v1s->alt = REG_EMPTY;
-}
-
static void mac_via_realize(DeviceState *dev, Error **errp)
{
MacVIAState *m = MAC_VIA(dev);
@@ -1072,7 +1060,6 @@ static void mac_via_class_init(ObjectClass *oc, void
*data)
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = mac_via_realize;
- dc->reset = mac_via_reset;
}
static TypeInfo mac_via_info = {
@@ -1086,8 +1073,10 @@ static TypeInfo mac_via_info = {
/* VIA 1 */
static void mos6522_q800_via1_reset(DeviceState *dev)
{
- MOS6522State *ms = MOS6522(dev);
+ MOS6522Q800VIA1State *v1s = MOS6522_Q800_VIA1(dev);
+ MOS6522State *ms = MOS6522(v1s);
MOS6522DeviceClass *mdc = MOS6522_GET_CLASS(ms);
+ ADBBusState *adb_bus = &v1s->adb_bus;
mdc->parent_reset(dev);
@@ -1095,6 +1084,11 @@ static void mos6522_q800_via1_reset(DeviceState *dev)
ms->timers[1].frequency = VIA_TIMER_FREQ;
ms->b = VIA1B_vADB_StateMask | VIA1B_vADBInt | VIA1B_vRTCEnb;
+
+ /* ADB/RTC */
+ adb_set_autopoll_enabled(adb_bus, true);
+ v1s->cmd = REG_EMPTY;
+ v1s->alt = REG_EMPTY;
}
static void mos6522_q800_via1_init(Object *obj)
--
2.20.1
- [PATCH 00/12] mac_via: remove MAC_VIA device and prepare for Nubus IRQs, Mark Cave-Ayland, 2021/08/30
- [PATCH 03/12] mac_via: move PRAM contents and block backend to MOS6522Q800VIA1State, Mark Cave-Ayland, 2021/08/30
- [PATCH 01/12] mac_via: introduce new VMStateDescription for q800 VIA1 and VIA2, Mark Cave-Ayland, 2021/08/30
- [PATCH 02/12] mac_via: move last_b variable into q800 VIA1 VMStateDescription, Mark Cave-Ayland, 2021/08/30
- [PATCH 05/12] mac_via: move ADB variables to MOS6522Q800VIA1State, Mark Cave-Ayland, 2021/08/30
- [PATCH 06/12] mac_via: move q800 VIA1 timer variables to q800 VIA1 VMStateDescription, Mark Cave-Ayland, 2021/08/30
- [PATCH 07/12] mac_via: move VIA1 reset logic from mac_via_reset() to mos6522_q800_via1_reset(),
Mark Cave-Ayland <=
- [PATCH 08/12] mac_via: move VIA1 realize logic from mac_via_realize() to mos6522_q800_via1_realize(), Mark Cave-Ayland, 2021/08/30
- [PATCH 09/12] mac_via: remove mac_via device, Mark Cave-Ayland, 2021/08/30
- [PATCH 04/12] mac_via: move PRAM/RTC variables to MOS6522Q800VIA1State, Mark Cave-Ayland, 2021/08/30
- [PATCH 10/12] mac_via: remove explicit viaN prefix from VIA IRQ gpios, Mark Cave-Ayland, 2021/08/30
- [PATCH 11/12] mac_via: rename VIA2_IRQ_SLOT_BIT to VIA2_IRQ_NUBUS_BIT, Mark Cave-Ayland, 2021/08/30
- [PATCH 12/12] mac_via: add qdev gpios for nubus slot interrupts to VIA2, Mark Cave-Ayland, 2021/08/30