ppc/pnv: introduce pnv*_is_power9() helpers

These are useful when instantiating device models which are shared
between the POWER8 and the POWER9 processor families.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Cédric Le Goater 2018-01-15 19:04:03 +01:00 committed by David Gibson
parent 09279d7e7b
commit b3b066e9d8
2 changed files with 13 additions and 5 deletions

View file

@ -138,6 +138,16 @@ typedef struct PnvMachineState {
Notifier powerdown_notifier;
} PnvMachineState;
static inline bool pnv_chip_is_power9(const PnvChip *chip)
{
return PNV_CHIP_GET_CLASS(chip)->chip_type == PNV_CHIP_POWER9;
}
static inline bool pnv_is_power9(PnvMachineState *pnv)
{
return pnv_chip_is_power9(pnv->chips[0]);
}
#define PNV_FDT_ADDR 0x01000000
#define PNV_TIMEBASE_FREQ 512000000ULL