2 * PowerMac MacIO device emulation
4 * Copyright (c) 2005-2007 Fabrice Bellard
5 * Copyright (c) 2007 Jocelyn Mayer
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 #include "hw/char/escc.h"
30 #include "hw/pci/pci.h"
31 #include "hw/ide/internal.h"
32 #include "hw/intc/heathrow_pic.h"
33 #include "hw/misc/macio/cuda.h"
34 #include "hw/misc/macio/gpio.h"
35 #include "hw/misc/macio/pmu.h"
36 #include "hw/ppc/mac.h"
37 #include "hw/ppc/mac_dbdma.h"
38 #include "hw/ppc/openpic.h"
39 #include "qom/object.h"
41 /* MacIO virtual bus */
42 #define TYPE_MACIO_BUS "macio-bus"
43 typedef struct MacIOBusState MacIOBusState
;
44 DECLARE_INSTANCE_CHECKER(MacIOBusState
, MACIO_BUS
,
47 struct MacIOBusState
{
53 #define TYPE_MACIO_IDE "macio-ide"
54 typedef struct MACIOIDEState MACIOIDEState
;
55 DECLARE_INSTANCE_CHECKER(MACIOIDEState
, MACIO_IDE
,
58 struct MACIOIDEState
{
60 SysBusDevice parent_obj
;
64 qemu_irq real_ide_irq
;
65 qemu_irq real_dma_irq
;
78 void macio_ide_init_drives(MACIOIDEState
*ide
, DriveInfo
**hd_table
);
79 void macio_ide_register_dma(MACIOIDEState
*ide
);
81 #define TYPE_MACIO "macio"
82 typedef struct MacIOState MacIOState
;
83 DECLARE_INSTANCE_CHECKER(MacIOState
, MACIO
,
91 MacIOBusState macio_bus
;
100 #define TYPE_OLDWORLD_MACIO "macio-oldworld"
101 typedef struct OldWorldMacIOState OldWorldMacIOState
;
102 DECLARE_INSTANCE_CHECKER(OldWorldMacIOState
, OLDWORLD_MACIO
,
105 struct OldWorldMacIOState
{
107 MacIOState parent_obj
;
112 MacIONVRAMState nvram
;
113 MACIOIDEState ide
[2];
116 #define TYPE_NEWWORLD_MACIO "macio-newworld"
117 typedef struct NewWorldMacIOState NewWorldMacIOState
;
118 DECLARE_INSTANCE_CHECKER(NewWorldMacIOState
, NEWWORLD_MACIO
,
121 struct NewWorldMacIOState
{
123 MacIOState parent_obj
;
129 MACIOIDEState ide
[2];