xref: /qemu/hw/pci-host/pnv_phb.h (revision 29b62a10)
1 /*
2  * QEMU PowerPC PowerNV Proxy PHB model
3  *
4  * Copyright (c) 2022, IBM Corporation.
5  *
6  * This code is licensed under the GPL version 2 or later. See the
7  * COPYING file in the top-level directory.
8  */
9 
10 #ifndef PCI_HOST_PNV_PHB_H
11 #define PCI_HOST_PNV_PHB_H
12 
13 #include "hw/pci/pcie_host.h"
14 #include "hw/pci/pcie_port.h"
15 #include "hw/ppc/pnv.h"
16 #include "qom/object.h"
17 
18 typedef struct PnvPhb4PecState PnvPhb4PecState;
19 
20 struct PnvPHB {
21     PCIExpressHost parent_obj;
22 
23     uint32_t chip_id;
24     uint32_t phb_id;
25     uint32_t version;
26     char bus_path[8];
27 
28     PnvChip *chip;
29 
30     PnvPhb4PecState *pec;
31 
32     /* The PHB backend (PnvPHB3, PnvPHB4 ...) being used */
33     Object *backend;
34 };
35 
36 #define TYPE_PNV_PHB "pnv-phb"
37 OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB, PNV_PHB)
38 
39 /*
40  * PHB PCIe Root port
41  */
42 #define PNV_PHB3_DEVICE_ID         0x03dc
43 #define PNV_PHB4_DEVICE_ID         0x04c1
44 #define PNV_PHB5_DEVICE_ID         0x0652
45 
46 typedef struct PnvPHBRootPort {
47     PCIESlot parent_obj;
48 
49     uint32_t version;
50 } PnvPHBRootPort;
51 
52 #define TYPE_PNV_PHB_ROOT_PORT "pnv-phb-root-port"
53 OBJECT_DECLARE_SIMPLE_TYPE(PnvPHBRootPort, PNV_PHB_ROOT_PORT)
54 
55 #endif /* PCI_HOST_PNV_PHB_H */
56