xref: /qemu/include/hw/pci-host/uninorth.h (revision 8110fa1d94f2997badc2af39231a1d279c5bb1ee)
15d2eaa02SMark Cave-Ayland /*
25d2eaa02SMark Cave-Ayland  * QEMU Uninorth PCI host (for all Mac99 and newer machines)
35d2eaa02SMark Cave-Ayland  *
45d2eaa02SMark Cave-Ayland  * Copyright (c) 2006 Fabrice Bellard
55d2eaa02SMark Cave-Ayland  *
65d2eaa02SMark Cave-Ayland  * Permission is hereby granted, free of charge, to any person obtaining a copy
75d2eaa02SMark Cave-Ayland  * of this software and associated documentation files (the "Software"), to deal
85d2eaa02SMark Cave-Ayland  * in the Software without restriction, including without limitation the rights
95d2eaa02SMark Cave-Ayland  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
105d2eaa02SMark Cave-Ayland  * copies of the Software, and to permit persons to whom the Software is
115d2eaa02SMark Cave-Ayland  * furnished to do so, subject to the following conditions:
125d2eaa02SMark Cave-Ayland  *
135d2eaa02SMark Cave-Ayland  * The above copyright notice and this permission notice shall be included in
145d2eaa02SMark Cave-Ayland  * all copies or substantial portions of the Software.
155d2eaa02SMark Cave-Ayland  *
165d2eaa02SMark Cave-Ayland  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175d2eaa02SMark Cave-Ayland  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
185d2eaa02SMark Cave-Ayland  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
195d2eaa02SMark Cave-Ayland  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
205d2eaa02SMark Cave-Ayland  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
215d2eaa02SMark Cave-Ayland  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
225d2eaa02SMark Cave-Ayland  * THE SOFTWARE.
235d2eaa02SMark Cave-Ayland  */
245d2eaa02SMark Cave-Ayland 
255d2eaa02SMark Cave-Ayland #ifndef UNINORTH_H
265d2eaa02SMark Cave-Ayland #define UNINORTH_H
275d2eaa02SMark Cave-Ayland 
28ec150c7eSMarkus Armbruster #include "hw/pci/pci_host.h"
29e7755cc1SMark Cave-Ayland #include "hw/ppc/openpic.h"
30db1015e9SEduardo Habkost #include "qom/object.h"
31e7755cc1SMark Cave-Ayland 
3245fefe7cSMark Cave-Ayland /* UniNorth version */
3345fefe7cSMark Cave-Ayland #define UNINORTH_VERSION_10A    0x7
3445fefe7cSMark Cave-Ayland 
355d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
365d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
375d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
385d2eaa02SMark Cave-Ayland #define TYPE_U3_AGP_HOST_BRIDGE "u3-agp-pcihost"
395d2eaa02SMark Cave-Ayland 
40db1015e9SEduardo Habkost typedef struct UNINHostState UNINHostState;
41*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_PCI_HOST_BRIDGE,
42*8110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_PCI_HOST_BRIDGE)
43*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_AGP_HOST_BRIDGE,
44*8110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_AGP_HOST_BRIDGE)
45*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE,
46*8110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE)
47*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, U3_AGP_HOST_BRIDGE,
48*8110fa1dSEduardo Habkost                          TYPE_U3_AGP_HOST_BRIDGE)
495d2eaa02SMark Cave-Ayland 
50db1015e9SEduardo Habkost struct UNINHostState {
515d2eaa02SMark Cave-Ayland     PCIHostState parent_obj;
525d2eaa02SMark Cave-Ayland 
5303756c84SMark Cave-Ayland     uint32_t ofw_addr;
54e7755cc1SMark Cave-Ayland     OpenPICState *pic;
55e7755cc1SMark Cave-Ayland     qemu_irq irqs[4];
565d2eaa02SMark Cave-Ayland     MemoryRegion pci_mmio;
575d2eaa02SMark Cave-Ayland     MemoryRegion pci_hole;
58e226efbbSMark Cave-Ayland     MemoryRegion pci_io;
59db1015e9SEduardo Habkost };
605d2eaa02SMark Cave-Ayland 
61db1015e9SEduardo Habkost struct UNINState {
620662946aSMark Cave-Ayland     SysBusDevice parent_obj;
630662946aSMark Cave-Ayland 
640662946aSMark Cave-Ayland     MemoryRegion mem;
65db1015e9SEduardo Habkost };
66db1015e9SEduardo Habkost typedef struct UNINState UNINState;
670662946aSMark Cave-Ayland 
680662946aSMark Cave-Ayland #define TYPE_UNI_NORTH "uni-north"
69*8110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINState, UNI_NORTH,
70*8110fa1dSEduardo Habkost                          TYPE_UNI_NORTH)
710662946aSMark Cave-Ayland 
725d2eaa02SMark Cave-Ayland #endif /* UNINORTH_H */
73