xref: /openbmc/qemu/include/hw/pci-host/uninorth.h (revision ba2a9a9e6318bfd93a2306dec40137e198205b86)
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"
29db1015e9SEduardo Habkost #include "qom/object.h"
30e7755cc1SMark Cave-Ayland 
3145fefe7cSMark Cave-Ayland /* UniNorth version */
3245fefe7cSMark Cave-Ayland #define UNINORTH_VERSION_10A    0x7
3345fefe7cSMark Cave-Ayland 
345d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost"
355d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost"
365d2eaa02SMark Cave-Ayland #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pcihost"
375d2eaa02SMark Cave-Ayland #define TYPE_U3_AGP_HOST_BRIDGE "u3-agp-pcihost"
385d2eaa02SMark Cave-Ayland 
39db1015e9SEduardo Habkost typedef struct UNINHostState UNINHostState;
408110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_PCI_HOST_BRIDGE,
418110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_PCI_HOST_BRIDGE)
428110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_AGP_HOST_BRIDGE,
438110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_AGP_HOST_BRIDGE)
448110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE,
458110fa1dSEduardo Habkost                          TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE)
468110fa1dSEduardo Habkost DECLARE_INSTANCE_CHECKER(UNINHostState, U3_AGP_HOST_BRIDGE,
478110fa1dSEduardo Habkost                          TYPE_U3_AGP_HOST_BRIDGE)
485d2eaa02SMark Cave-Ayland 
49db1015e9SEduardo Habkost struct UNINHostState {
505d2eaa02SMark Cave-Ayland     PCIHostState parent_obj;
515d2eaa02SMark Cave-Ayland 
5203756c84SMark Cave-Ayland     uint32_t ofw_addr;
53e7755cc1SMark Cave-Ayland     qemu_irq irqs[4];
545d2eaa02SMark Cave-Ayland     MemoryRegion pci_mmio;
555d2eaa02SMark Cave-Ayland     MemoryRegion pci_hole;
56e226efbbSMark Cave-Ayland     MemoryRegion pci_io;
57db1015e9SEduardo Habkost };
585d2eaa02SMark Cave-Ayland 
59db1015e9SEduardo Habkost struct UNINState {
600662946aSMark Cave-Ayland     SysBusDevice parent_obj;
610662946aSMark Cave-Ayland 
620662946aSMark Cave-Ayland     MemoryRegion mem;
63db1015e9SEduardo Habkost };
640662946aSMark Cave-Ayland 
650662946aSMark Cave-Ayland #define TYPE_UNI_NORTH "uni-north"
66*8063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(UNINState, UNI_NORTH)
670662946aSMark Cave-Ayland 
685d2eaa02SMark Cave-Ayland #endif /* UNINORTH_H */
69