[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/35] next-cube: move reset of next-rtc fields from next-pc to ne
From: |
Thomas Huth |
Subject: |
[PULL 28/35] next-cube: move reset of next-rtc fields from next-pc to next-rtc |
Date: |
Sun, 29 Dec 2024 08:25:19 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Message-ID: <20241222130012.1013374-27-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
---
hw/m68k/next-cube.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index 883891ce6b..bd7c76c35e 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -1018,6 +1018,16 @@ static const MemoryRegionOps next_dummy_en_ops = {
.endianness = DEVICE_BIG_ENDIAN,
};
+static void next_rtc_reset_hold(Object *obj, ResetType type)
+{
+ NeXTRTC *rtc = NEXT_RTC(obj);
+
+ rtc->status = 0x90;
+
+ /* Load RTC RAM - TODO: provide possibility to load contents from file */
+ memcpy(rtc->ram, rtc_ram2, 32);
+}
+
static const VMStateDescription next_rtc_vmstate = {
.name = "next-rtc",
.version_id = 3,
@@ -1037,9 +1047,11 @@ static const VMStateDescription next_rtc_vmstate = {
static void next_rtc_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
dc->desc = "NeXT RTC";
dc->vmsd = &next_rtc_vmstate;
+ rc->phases.hold = next_rtc_reset_hold;
}
static const TypeInfo next_rtc_info = {
@@ -1072,11 +1084,6 @@ static void next_pc_reset_hold(Object *obj, ResetType
type)
s->scr1 = 0x00011102;
s->scr2 = 0x00ff0c80;
s->old_scr2 = s->scr2;
-
- s->rtc.status = 0x90;
-
- /* Load RTC RAM - TODO: provide possibility to load contents from file */
- memcpy(s->rtc.ram, rtc_ram2, 32);
}
static void next_pc_realize(DeviceState *dev, Error **errp)
--
2.47.1
- [PULL 30/35] next-cube: use named gpio output for next-rtc data, (continued)
- [PULL 30/35] next-cube: use named gpio output for next-rtc data, Thomas Huth, 2024/12/29
- [PULL 26/35] next-cube: don't use rtc phase value of -1, Thomas Huth, 2024/12/29
- [PULL 27/35] next-cube: QOMify NeXTRTC, Thomas Huth, 2024/12/29
- [PULL 29/35] next-cube: move rtc-data-in gpio from next-pc to next-rtc device, Thomas Huth, 2024/12/29
- [PULL 31/35] next-cube: add rtc-cmd-reset named gpio to reset the rtc state machine, Thomas Huth, 2024/12/29
- [PULL 32/35] next-cube: add rtc-power-out named gpio to trigger the NEXT_PWR_I interrupt, Thomas Huth, 2024/12/29
- [PULL 33/35] next-cube: move next_rtc_cmd_is_write() and next_rtc_data_in_irq() functions, Thomas Huth, 2024/12/29
- [PULL 22/35] next-cube: separate rtc read and write shift logic, Thomas Huth, 2024/12/29
- [PULL 35/35] next-cube: add my copyright to the top of the file, Thomas Huth, 2024/12/29
- [PULL 34/35] next-cube: rename old_scr2 and scr2_2 in next_scr2_rtc_update(), Thomas Huth, 2024/12/29
- [PULL 28/35] next-cube: move reset of next-rtc fields from next-pc to next-rtc,
Thomas Huth <=