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
,
19 SysBusDevice parent_obj
;
33 MemoryRegion xscom_mmio
;
35 AddressSpace xscom_as
;
38 gchar
*dt_isa_nodename
;
41 #define TYPE_PNV8_CHIP "pnv8-chip"
42 DECLARE_INSTANCE_CHECKER(Pnv8Chip
, PNV8_CHIP
,
50 MemoryRegion icp_mmio
;
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
];
68 #define TYPE_PNV9_CHIP "pnv9-chip"
69 DECLARE_INSTANCE_CHECKER(Pnv9Chip
, PNV9_CHIP
,
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
,
108 PnvLpcController lpc
;
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
{
125 SysBusDeviceClass parent_class
;
128 uint64_t chip_cfam_id
;
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
);