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