diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-09-10 11:09:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-09-10 11:09:30 +0100 |
commit | 6d1272d3ef81aa33e97ca5c69707cbcad953cbdb (patch) | |
tree | 827eab7033f23a01834c521897f84b93d9848f86 /include | |
parent | 500f1f3e81ad112e28b7c979136847e32dad83b6 (diff) | |
parent | dde602ae539910c3579952834b713e2f360ec34a (diff) |
Merge remote-tracking branch 'remotes/vivier/tags/q800-pull-request' into staging
q800 pull request 20210908
mac_via: remove MAC_VIA device and prepare for Nubus IRQs
# gpg: Signature made Wed 08 Sep 2021 16:35:03 BST
# gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg: issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier/tags/q800-pull-request:
mac_via: add qdev gpios for nubus slot interrupts to VIA2
mac_via: rename VIA2_IRQ_SLOT_BIT to VIA2_IRQ_NUBUS_BIT
mac_via: remove explicit viaN prefix from VIA IRQ gpios
mac_via: remove mac_via device
mac_via: move VIA1 realize logic from mac_via_realize() to mos6522_q800_via1_realize()
mac_via: move VIA1 reset logic from mac_via_reset() to mos6522_q800_via1_reset()
mac_via: move q800 VIA1 timer variables to q800 VIA1 VMStateDescription
mac_via: move ADB variables to MOS6522Q800VIA1State
mac_via: move PRAM/RTC variables to MOS6522Q800VIA1State
mac_via: move PRAM contents and block backend to MOS6522Q800VIA1State
mac_via: move last_b variable into q800 VIA1 VMStateDescription
mac_via: introduce new VMStateDescription for q800 VIA1 and VIA2
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/misc/mac_via.h | 101 |
1 files changed, 50 insertions, 51 deletions
diff --git a/include/hw/misc/mac_via.h b/include/hw/misc/mac_via.h index 3058b30685..4506abe5d0 100644 --- a/include/hw/misc/mac_via.h +++ b/include/hw/misc/mac_via.h @@ -15,6 +15,8 @@ #include "qom/object.h" +#define VIA_SIZE 0x2000 + /* VIA 1 */ #define VIA1_IRQ_ONE_SECOND_BIT 0 #define VIA1_IRQ_60HZ_BIT 1 @@ -24,11 +26,11 @@ #define VIA1_IRQ_NB 8 -#define VIA1_IRQ_ONE_SECOND (1 << VIA1_IRQ_ONE_SECOND_BIT) -#define VIA1_IRQ_60HZ (1 << VIA1_IRQ_60HZ_BIT) -#define VIA1_IRQ_ADB_READY (1 << VIA1_IRQ_ADB_READY_BIT) -#define VIA1_IRQ_ADB_DATA (1 << VIA1_IRQ_ADB_DATA_BIT) -#define VIA1_IRQ_ADB_CLOCK (1 << VIA1_IRQ_ADB_CLOCK_BIT) +#define VIA1_IRQ_ONE_SECOND (1 << VIA1_IRQ_ONE_SECOND_BIT) +#define VIA1_IRQ_60HZ (1 << VIA1_IRQ_60HZ_BIT) +#define VIA1_IRQ_ADB_READY (1 << VIA1_IRQ_ADB_READY_BIT) +#define VIA1_IRQ_ADB_DATA (1 << VIA1_IRQ_ADB_DATA_BIT) +#define VIA1_IRQ_ADB_CLOCK (1 << VIA1_IRQ_ADB_CLOCK_BIT) #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1" @@ -38,9 +40,35 @@ struct MOS6522Q800VIA1State { /*< private >*/ MOS6522State parent_obj; + MemoryRegion via_mem; + qemu_irq irqs[VIA1_IRQ_NB]; uint8_t last_b; + + /* RTC */ uint8_t PRAM[256]; + BlockBackend *blk; + VMChangeStateEntry *vmstate; + + uint32_t tick_offset; + + uint8_t data_out; + int data_out_cnt; + uint8_t data_in; + uint8_t data_in_cnt; + uint8_t cmd; + int wprotect; + int alt; + + /* ADB */ + ADBBusState adb_bus; + qemu_irq adb_data_ready; + int adb_data_in_size; + int adb_data_in_index; + int adb_data_out_index; + uint8_t adb_data_in[128]; + uint8_t adb_data_out[16]; + uint8_t adb_autopoll_cmd; /* external timers */ QEMUTimer *one_second_timer; @@ -52,18 +80,28 @@ struct MOS6522Q800VIA1State { /* VIA 2 */ #define VIA2_IRQ_SCSI_DATA_BIT 0 -#define VIA2_IRQ_SLOT_BIT 1 +#define VIA2_IRQ_NUBUS_BIT 1 #define VIA2_IRQ_UNUSED_BIT 2 #define VIA2_IRQ_SCSI_BIT 3 #define VIA2_IRQ_ASC_BIT 4 #define VIA2_IRQ_NB 8 -#define VIA2_IRQ_SCSI_DATA (1 << VIA2_IRQ_SCSI_DATA_BIT) -#define VIA2_IRQ_SLOT (1 << VIA2_IRQ_SLOT_BIT) -#define VIA2_IRQ_UNUSED (1 << VIA2_IRQ_SCSI_BIT) -#define VIA2_IRQ_SCSI (1 << VIA2_IRQ_UNUSED_BIT) -#define VIA2_IRQ_ASC (1 << VIA2_IRQ_ASC_BIT) +#define VIA2_IRQ_SCSI_DATA (1 << VIA2_IRQ_SCSI_DATA_BIT) +#define VIA2_IRQ_NUBUS (1 << VIA2_IRQ_NUBUS_BIT) +#define VIA2_IRQ_UNUSED (1 << VIA2_IRQ_SCSI_BIT) +#define VIA2_IRQ_SCSI (1 << VIA2_IRQ_UNUSED_BIT) +#define VIA2_IRQ_ASC (1 << VIA2_IRQ_ASC_BIT) + +#define VIA2_NUBUS_IRQ_NB 7 + +#define VIA2_NUBUS_IRQ_9 0 +#define VIA2_NUBUS_IRQ_A 1 +#define VIA2_NUBUS_IRQ_B 2 +#define VIA2_NUBUS_IRQ_C 3 +#define VIA2_NUBUS_IRQ_D 4 +#define VIA2_NUBUS_IRQ_E 5 +#define VIA2_NUBUS_IRQ_INTVIDEO 6 #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2" OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA2State, MOS6522_Q800_VIA2) @@ -71,47 +109,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(MOS6522Q800VIA2State, MOS6522_Q800_VIA2) struct MOS6522Q800VIA2State { /*< private >*/ MOS6522State parent_obj; -}; - -#define TYPE_MAC_VIA "mac_via" -OBJECT_DECLARE_SIMPLE_TYPE(MacVIAState, MAC_VIA) - -struct MacVIAState { - SysBusDevice busdev; - - VMChangeStateEntry *vmstate; - - /* MMIO */ - MemoryRegion mmio; - MemoryRegion via1mem; - MemoryRegion via2mem; - - /* VIAs */ - MOS6522Q800VIA1State mos6522_via1; - MOS6522Q800VIA2State mos6522_via2; - - /* RTC */ - uint32_t tick_offset; - - uint8_t data_out; - int data_out_cnt; - uint8_t data_in; - uint8_t data_in_cnt; - uint8_t cmd; - int wprotect; - int alt; - BlockBackend *blk; - - /* ADB */ - ADBBusState adb_bus; - qemu_irq adb_data_ready; - int adb_data_in_size; - int adb_data_in_index; - int adb_data_out_index; - uint8_t adb_data_in[128]; - uint8_t adb_data_out[16]; - uint8_t adb_autopoll_cmd; + MemoryRegion via_mem; }; #endif |