4 #include "hw/pci-host/pnv_phb4.h"
5 #include "hw/ppc/pnv_adu.h"
6 #include "hw/ppc/pnv_chiptod.h"
7 #include "hw/ppc/pnv_core.h"
8 #include "hw/ppc/pnv_homer.h"
9 #include "hw/ppc/pnv_n1_chiplet.h"
10 #include "hw/ssi/pnv_spi.h"
11 #include "hw/ppc/pnv_lpc.h"
12 #include "hw/ppc/pnv_occ.h"
13 #include "hw/ppc/pnv_psi.h"
14 #include "hw/ppc/pnv_sbe.h"
15 #include "hw/ppc/pnv_xive.h"
16 #include "hw/ppc/pnv_i2c.h"
17 #include "hw/sysbus.h"
19 OBJECT_DECLARE_TYPE(PnvChip
, PnvChipClass
,
24 SysBusDevice parent_obj
;
40 MemoryRegion xscom_mmio
;
42 AddressSpace xscom_as
;
45 gchar
*dt_isa_nodename
;
48 #define TYPE_PNV8_CHIP "pnv8-chip"
49 DECLARE_INSTANCE_CHECKER(Pnv8Chip
, PNV8_CHIP
,
57 MemoryRegion icp_mmio
;
64 #define PNV8_CHIP_PHB3_MAX 4
66 * The array is used to allow quick access to the phbs by
67 * pnv_ics_get_child() and pnv_ics_resend_child().
69 PnvPHB
*phbs
[PNV8_CHIP_PHB3_MAX
];
75 #define TYPE_PNV9_CHIP "pnv9-chip"
76 DECLARE_INSTANCE_CHECKER(Pnv9Chip
, PNV9_CHIP
,
96 #define PNV9_CHIP_MAX_PEC 3
97 PnvPhb4PecState pecs
[PNV9_CHIP_MAX_PEC
];
99 #define PNV9_CHIP_MAX_I2C 4
100 PnvI2C i2c
[PNV9_CHIP_MAX_I2C
];
104 * A SMT8 fused core is a pair of SMT4 cores.
106 #define PNV9_PIR2FUSEDCORE(pir) (((pir) >> 3) & 0xf)
107 #define PNV9_PIR2CHIP(pir) (((pir) >> 8) & 0x7f)
109 #define TYPE_PNV10_CHIP "pnv10-chip"
110 DECLARE_INSTANCE_CHECKER(Pnv10Chip
, PNV10_CHIP
,
121 PnvLpcController lpc
;
126 PnvN1Chiplet n1_chiplet
;
127 #define PNV10_CHIP_MAX_PIB_SPIC 6
128 PnvSpi pib_spic
[PNV10_CHIP_MAX_PIB_SPIC
];
133 #define PNV10_CHIP_MAX_PEC 2
134 PnvPhb4PecState pecs
[PNV10_CHIP_MAX_PEC
];
136 #define PNV10_CHIP_MAX_I2C 4
137 PnvI2C i2c
[PNV10_CHIP_MAX_I2C
];
140 #define PNV10_PIR2FUSEDCORE(pir) (((pir) >> 3) & 0xf)
141 #define PNV10_PIR2CHIP(pir) (((pir) >> 8) & 0x7f)
142 #define PNV10_PIR2THREAD(pir) (((pir) & 0x7f))
144 struct PnvChipClass
{
146 SysBusDeviceClass parent_class
;
149 uint64_t chip_cfam_id
;
154 uint32_t i2c_num_engines
;
155 const int *i2c_ports_per_engine
;
157 DeviceRealize parent_realize
;
159 /* Get PIR and TIR values for a CPU thread identified by core/thread id */
160 void (*get_pir_tir
)(PnvChip
*chip
, uint32_t core_id
, uint32_t thread_id
,
161 uint32_t *pir
, uint32_t *tir
);
162 void (*intc_create
)(PnvChip
*chip
, PowerPCCPU
*cpu
, Error
**errp
);
163 void (*intc_reset
)(PnvChip
*chip
, PowerPCCPU
*cpu
);
164 void (*intc_destroy
)(PnvChip
*chip
, PowerPCCPU
*cpu
);
165 void (*intc_print_info
)(PnvChip
*chip
, PowerPCCPU
*cpu
, GString
*buf
);
166 ISABus
*(*isa_create
)(PnvChip
*chip
, Error
**errp
);
167 void (*dt_populate
)(PnvChip
*chip
, void *fdt
);
168 void (*pic_print_info
)(PnvChip
*chip
, GString
*buf
);
169 uint64_t (*xscom_core_base
)(PnvChip
*chip
, uint32_t core_id
);
170 uint32_t (*xscom_pcba
)(PnvChip
*chip
, uint64_t addr
);