xref: /qemu/include/hw/misc/macio/macio.h (revision e1218e48128164d0971322f4577eb3ad5f2a17f5)
1*e1218e48SMark Cave-Ayland /*
2*e1218e48SMark Cave-Ayland  * PowerMac MacIO device emulation
3*e1218e48SMark Cave-Ayland  *
4*e1218e48SMark Cave-Ayland  * Copyright (c) 2005-2007 Fabrice Bellard
5*e1218e48SMark Cave-Ayland  * Copyright (c) 2007 Jocelyn Mayer
6*e1218e48SMark Cave-Ayland  *
7*e1218e48SMark Cave-Ayland  * Permission is hereby granted, free of charge, to any person obtaining a copy
8*e1218e48SMark Cave-Ayland  * of this software and associated documentation files (the "Software"), to deal
9*e1218e48SMark Cave-Ayland  * in the Software without restriction, including without limitation the rights
10*e1218e48SMark Cave-Ayland  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11*e1218e48SMark Cave-Ayland  * copies of the Software, and to permit persons to whom the Software is
12*e1218e48SMark Cave-Ayland  * furnished to do so, subject to the following conditions:
13*e1218e48SMark Cave-Ayland  *
14*e1218e48SMark Cave-Ayland  * The above copyright notice and this permission notice shall be included in
15*e1218e48SMark Cave-Ayland  * all copies or substantial portions of the Software.
16*e1218e48SMark Cave-Ayland  *
17*e1218e48SMark Cave-Ayland  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18*e1218e48SMark Cave-Ayland  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19*e1218e48SMark Cave-Ayland  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20*e1218e48SMark Cave-Ayland  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21*e1218e48SMark Cave-Ayland  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22*e1218e48SMark Cave-Ayland  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23*e1218e48SMark Cave-Ayland  * THE SOFTWARE.
24*e1218e48SMark Cave-Ayland  */
25*e1218e48SMark Cave-Ayland 
26*e1218e48SMark Cave-Ayland #ifndef MACIO_H
27*e1218e48SMark Cave-Ayland #define MACIO_H
28*e1218e48SMark Cave-Ayland 
29*e1218e48SMark Cave-Ayland #include "hw/misc/macio/cuda.h"
30*e1218e48SMark Cave-Ayland #include "hw/ppc/mac_dbdma.h"
31*e1218e48SMark Cave-Ayland 
32*e1218e48SMark Cave-Ayland #define TYPE_MACIO "macio"
33*e1218e48SMark Cave-Ayland #define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO)
34*e1218e48SMark Cave-Ayland 
35*e1218e48SMark Cave-Ayland typedef struct MacIOState {
36*e1218e48SMark Cave-Ayland     /*< private >*/
37*e1218e48SMark Cave-Ayland     PCIDevice parent;
38*e1218e48SMark Cave-Ayland     /*< public >*/
39*e1218e48SMark Cave-Ayland 
40*e1218e48SMark Cave-Ayland     MemoryRegion bar;
41*e1218e48SMark Cave-Ayland     CUDAState cuda;
42*e1218e48SMark Cave-Ayland     DBDMAState dbdma;
43*e1218e48SMark Cave-Ayland     ESCCState escc;
44*e1218e48SMark Cave-Ayland     MemoryRegion *pic_mem;
45*e1218e48SMark Cave-Ayland     uint64_t frequency;
46*e1218e48SMark Cave-Ayland } MacIOState;
47*e1218e48SMark Cave-Ayland 
48*e1218e48SMark Cave-Ayland #define TYPE_OLDWORLD_MACIO "macio-oldworld"
49*e1218e48SMark Cave-Ayland #define OLDWORLD_MACIO(obj) \
50*e1218e48SMark Cave-Ayland     OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO)
51*e1218e48SMark Cave-Ayland 
52*e1218e48SMark Cave-Ayland typedef struct OldWorldMacIOState {
53*e1218e48SMark Cave-Ayland     /*< private >*/
54*e1218e48SMark Cave-Ayland     MacIOState parent_obj;
55*e1218e48SMark Cave-Ayland     /*< public >*/
56*e1218e48SMark Cave-Ayland 
57*e1218e48SMark Cave-Ayland     qemu_irq irqs[7];
58*e1218e48SMark Cave-Ayland 
59*e1218e48SMark Cave-Ayland     MacIONVRAMState nvram;
60*e1218e48SMark Cave-Ayland     MACIOIDEState ide[2];
61*e1218e48SMark Cave-Ayland } OldWorldMacIOState;
62*e1218e48SMark Cave-Ayland 
63*e1218e48SMark Cave-Ayland #define TYPE_NEWWORLD_MACIO "macio-newworld"
64*e1218e48SMark Cave-Ayland #define NEWWORLD_MACIO(obj) \
65*e1218e48SMark Cave-Ayland     OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO)
66*e1218e48SMark Cave-Ayland 
67*e1218e48SMark Cave-Ayland typedef struct NewWorldMacIOState {
68*e1218e48SMark Cave-Ayland     /*< private >*/
69*e1218e48SMark Cave-Ayland     MacIOState parent_obj;
70*e1218e48SMark Cave-Ayland     /*< public >*/
71*e1218e48SMark Cave-Ayland     qemu_irq irqs[7];
72*e1218e48SMark Cave-Ayland     MACIOIDEState ide[2];
73*e1218e48SMark Cave-Ayland } NewWorldMacIOState;
74*e1218e48SMark Cave-Ayland 
75*e1218e48SMark Cave-Ayland #endif /* MACIO_H */
76