ppc/pnv: Introduce PnvMachineClass and PnvMachineClass::compat
commitd76f2da7a5b6330fba70f2c14f209de92e26abab
authorGreg Kurz <groug@kaod.org>
Fri, 13 Dec 2019 11:59:50 +0000 (13 12:59 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 16 Dec 2019 23:58:49 +0000 (17 10:58 +1100)
treebb3b48f8fb4040c991a277aa5a019ae20c530513
parent248e4e924e873ffb36e9af725281f20614c58062
ppc/pnv: Introduce PnvMachineClass and PnvMachineClass::compat

The pnv_dt_create() function generates different contents for the
"compatible" property of the root node in the DT, depending on the
CPU type. This is open coded with multiple ifs using pnv_is_powerXX()
helpers.

It seems cleaner to achieve with QOM. Introduce a base class for the
powernv machine and a compat attribute that each child class can use
to provide the value for the "compatible" property.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <157623839085.360005.4046508784077843216.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
[dwg: Folded in small fix Greg spotted after posting]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/pnv.c
include/hw/ppc/pnv.h