macio: move MACIOIDEState type declarations to macio.h
[qemu.git] / include / hw / misc / macio / macio.h
1 /*
2  * PowerMac MacIO device emulation
3  *
4  * Copyright (c) 2005-2007 Fabrice Bellard
5  * Copyright (c) 2007 Jocelyn Mayer
6  *
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:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
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
23  * THE SOFTWARE.
24  */
25
26 #ifndef MACIO_H
27 #define MACIO_H
28
29 #include "hw/char/escc.h"
30 #include "hw/intc/heathrow_pic.h"
31 #include "hw/misc/macio/cuda.h"
32 #include "hw/misc/macio/gpio.h"
33 #include "hw/misc/macio/pmu.h"
34 #include "hw/ppc/mac_dbdma.h"
35 #include "hw/ppc/openpic.h"
36
37 /* MacIO IDE */
38 #define TYPE_MACIO_IDE "macio-ide"
39 #define MACIO_IDE(obj) OBJECT_CHECK(MACIOIDEState, (obj), TYPE_MACIO_IDE)
40
41 typedef struct MACIOIDEState {
42     /*< private >*/
43     SysBusDevice parent_obj;
44     /*< public >*/
45     uint32_t channel;
46     qemu_irq real_ide_irq;
47     qemu_irq real_dma_irq;
48     qemu_irq ide_irq;
49     qemu_irq dma_irq;
50
51     MemoryRegion mem;
52     IDEBus bus;
53     IDEDMA dma;
54     void *dbdma;
55     bool dma_active;
56     uint32_t timing_reg;
57     uint32_t irq_reg;
58 } MACIOIDEState;
59
60 void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table);
61 void macio_ide_register_dma(MACIOIDEState *ide);
62
63 #define TYPE_MACIO "macio"
64 #define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO)
65
66 typedef struct MacIOState {
67     /*< private >*/
68     PCIDevice parent;
69     /*< public >*/
70
71     MemoryRegion bar;
72     CUDAState cuda;
73     PMUState pmu;
74     DBDMAState dbdma;
75     ESCCState escc;
76     uint64_t frequency;
77 } MacIOState;
78
79 #define TYPE_OLDWORLD_MACIO "macio-oldworld"
80 #define OLDWORLD_MACIO(obj) \
81     OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO)
82
83 typedef struct OldWorldMacIOState {
84     /*< private >*/
85     MacIOState parent_obj;
86     /*< public >*/
87
88     HeathrowState *pic;
89
90     MacIONVRAMState nvram;
91     MACIOIDEState ide[2];
92 } OldWorldMacIOState;
93
94 #define TYPE_NEWWORLD_MACIO "macio-newworld"
95 #define NEWWORLD_MACIO(obj) \
96     OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO)
97
98 typedef struct NewWorldMacIOState {
99     /*< private >*/
100     MacIOState parent_obj;
101     /*< public >*/
102
103     bool has_pmu;
104     bool has_adb;
105     OpenPICState *pic;
106     MACIOIDEState ide[2];
107     MacIOGPIOState gpio;
108 } NewWorldMacIOState;
109
110 #endif /* MACIO_H */
This page took 0.033057 seconds and 4 git commands to generate.