[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/12] mac_via: move ADB variables to MOS6522Q800VIA1State
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 05/12] mac_via: move ADB variables to MOS6522Q800VIA1State |
Date: |
Tue, 31 Aug 2021 00:12:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 8/30/21 12:24 PM, Mark Cave-Ayland wrote:
> The ADB is accessed using clock and data pins on q800 VIA1 port B and so can
> be
> moved to MOS6522Q800VIA1State.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/m68k/q800.c | 6 +-
> hw/misc/mac_via.c | 169 +++++++++++++++++++-------------------
> include/hw/misc/mac_via.h | 20 ++---
> 3 files changed, 96 insertions(+), 99 deletions(-)
> @@ -967,17 +962,10 @@ static void mac_via_realize(DeviceState *dev, Error
> **errp)
> MacVIAState *m = MAC_VIA(dev);
> MOS6522Q800VIA1State *v1s = &m->mos6522_via1;
> MOS6522State *ms;
> - ADBBusState *adb_bus = &m->adb_bus;
> + ADBBusState *adb_bus = &v1s->adb_bus;
> struct tm tm;
> int ret;
>
> - /* Init VIAs 1 and 2 */
> - object_initialize_child(OBJECT(dev), "via1", &m->mos6522_via1,
> - TYPE_MOS6522_Q800_VIA1);
> -
> - object_initialize_child(OBJECT(dev), "via2", &m->mos6522_via2,
> - TYPE_MOS6522_Q800_VIA2);
> -
Preferably moving object_initialize_child() from realize()
to init() in a previous patch (so this patch is only about ADB):
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> /* Pass through mos6522 output IRQs */
> ms = MOS6522(&m->mos6522_via1);
> object_property_add_alias(OBJECT(dev), "irq[0]", OBJECT(ms),
> @@ -1006,9 +994,9 @@ static void mac_via_realize(DeviceState *dev, Error
> **errp)
> qemu_get_timedate(&tm, 0);
> v1s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
>
> - adb_register_autopoll_callback(adb_bus, adb_via_poll, m);
> - m->adb_data_ready = qdev_get_gpio_in_named(dev, "via1-irq",
> - VIA1_IRQ_ADB_READY_BIT);
> + adb_register_autopoll_callback(adb_bus, adb_via_poll, v1s);
> + v1s->adb_data_ready = qdev_get_gpio_in_named(dev, "via1-irq",
> + VIA1_IRQ_ADB_READY_BIT);
>
> if (v1s->blk) {
> int64_t len = blk_getlength(v1s->blk);
> @@ -1049,9 +1037,12 @@ static void mac_via_init(Object *obj)
> &m->mos6522_via2, "via2", VIA_SIZE);
> memory_region_add_subregion(&m->mmio, VIA_SIZE, &m->via2mem);
>
> - /* ADB */
> - qbus_create_inplace((BusState *)&m->adb_bus, sizeof(m->adb_bus),
> - TYPE_ADB_BUS, DEVICE(obj), "adb.0");
> + /* Init VIAs 1 and 2 */
> + object_initialize_child(obj, "via1", &m->mos6522_via1,
> + TYPE_MOS6522_Q800_VIA1);
> +
> + object_initialize_child(obj, "via2", &m->mos6522_via2,
> + TYPE_MOS6522_Q800_VIA2);
> }
- [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
- Re: [PATCH 05/12] mac_via: move ADB variables to MOS6522Q800VIA1State,
Philippe Mathieu-Daudé <=
- [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, 2021/08/30
- [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