ppc/xive: Introduce a new XiveRouter end_notify() handler
[qemu/kevin.git] / include / hw / ppc / pnv_chip.h
blob53e1d921d755cb51b2367709e35b8ba727405967
1 #ifndef PPC_PNV_CHIP_H
2 #define PPC_PNV_CHIP_H
4 #include "hw/pci-host/pnv_phb4.h"
5 #include "hw/ppc/pnv_core.h"
6 #include "hw/ppc/pnv_homer.h"
7 #include "hw/ppc/pnv_lpc.h"
8 #include "hw/ppc/pnv_occ.h"
9 #include "hw/ppc/pnv_psi.h"
10 #include "hw/ppc/pnv_sbe.h"
11 #include "hw/ppc/pnv_xive.h"
12 #include "hw/sysbus.h"
14 OBJECT_DECLARE_TYPE(PnvChip, PnvChipClass,
15 PNV_CHIP)
17 struct PnvChip {
18 /*< private >*/
19 SysBusDevice parent_obj;
21 /*< public >*/
22 uint32_t chip_id;
23 uint64_t ram_start;
24 uint64_t ram_size;
26 uint32_t nr_cores;
27 uint32_t nr_threads;
28 uint64_t cores_mask;
29 PnvCore **cores;
31 uint32_t num_pecs;
33 MemoryRegion xscom_mmio;
34 MemoryRegion xscom;
35 AddressSpace xscom_as;
37 MemoryRegion *fw_mr;
38 gchar *dt_isa_nodename;
41 #define TYPE_PNV8_CHIP "pnv8-chip"
42 DECLARE_INSTANCE_CHECKER(Pnv8Chip, PNV8_CHIP,
43 TYPE_PNV8_CHIP)
45 struct Pnv8Chip {
46 /*< private >*/
47 PnvChip parent_obj;
49 /*< public >*/
50 MemoryRegion icp_mmio;
52 PnvLpcController lpc;
53 Pnv8Psi psi;
54 PnvOCC occ;
55 PnvHomer homer;
57 #define PNV8_CHIP_PHB3_MAX 4
59 * The array is used to allow quick access to the phbs by
60 * pnv_ics_get_child() and pnv_ics_resend_child().
62 PnvPHB *phbs[PNV8_CHIP_PHB3_MAX];
63 uint32_t num_phbs;
65 XICSFabric *xics;
68 #define TYPE_PNV9_CHIP "pnv9-chip"
69 DECLARE_INSTANCE_CHECKER(Pnv9Chip, PNV9_CHIP,
70 TYPE_PNV9_CHIP)
72 struct Pnv9Chip {
73 /*< private >*/
74 PnvChip parent_obj;
76 /*< public >*/
77 PnvXive xive;
78 Pnv9Psi psi;
79 PnvLpcController lpc;
80 PnvOCC occ;
81 PnvSBE sbe;
82 PnvHomer homer;
84 uint32_t nr_quads;
85 PnvQuad *quads;
87 #define PNV9_CHIP_MAX_PEC 3
88 PnvPhb4PecState pecs[PNV9_CHIP_MAX_PEC];
92 * A SMT8 fused core is a pair of SMT4 cores.
94 #define PNV9_PIR2FUSEDCORE(pir) (((pir) >> 3) & 0xf)
95 #define PNV9_PIR2CHIP(pir) (((pir) >> 8) & 0x7f)
97 #define TYPE_PNV10_CHIP "pnv10-chip"
98 DECLARE_INSTANCE_CHECKER(Pnv10Chip, PNV10_CHIP,
99 TYPE_PNV10_CHIP)
101 struct Pnv10Chip {
102 /*< private >*/
103 PnvChip parent_obj;
105 /*< public >*/
106 PnvXive2 xive;
107 Pnv9Psi psi;
108 PnvLpcController lpc;
109 PnvOCC occ;
110 PnvSBE sbe;
111 PnvHomer homer;
113 uint32_t nr_quads;
114 PnvQuad *quads;
116 #define PNV10_CHIP_MAX_PEC 2
117 PnvPhb4PecState pecs[PNV10_CHIP_MAX_PEC];
120 #define PNV10_PIR2FUSEDCORE(pir) (((pir) >> 3) & 0xf)
121 #define PNV10_PIR2CHIP(pir) (((pir) >> 8) & 0x7f)
123 struct PnvChipClass {
124 /*< private >*/
125 SysBusDeviceClass parent_class;
127 /*< public >*/
128 uint64_t chip_cfam_id;
129 uint64_t cores_mask;
130 uint32_t num_pecs;
131 uint32_t num_phbs;
133 DeviceRealize parent_realize;
135 uint32_t (*core_pir)(PnvChip *chip, uint32_t core_id);
136 void (*intc_create)(PnvChip *chip, PowerPCCPU *cpu, Error **errp);
137 void (*intc_reset)(PnvChip *chip, PowerPCCPU *cpu);
138 void (*intc_destroy)(PnvChip *chip, PowerPCCPU *cpu);
139 void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon);
140 ISABus *(*isa_create)(PnvChip *chip, Error **errp);
141 void (*dt_populate)(PnvChip *chip, void *fdt);
142 void (*pic_print_info)(PnvChip *chip, Monitor *mon);
143 uint64_t (*xscom_core_base)(PnvChip *chip, uint32_t core_id);
144 uint32_t (*xscom_pcba)(PnvChip *chip, uint64_t addr);
147 #endif