From 7a90c6a1b650e3cd6391543cdf6587c5bc9f28c1 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Fri, 13 Dec 2019 12:59:56 +0100 Subject: ppc/pnv: Introduce PnvMachineClass::dt_power_mgt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We add an extra node to advertise power management on some machines, namely powernv9 and powernv10. This is achieved by using the pnv_is_power9() and pnv_is_power10() helpers. This can be achieved with QOM. Add a method to the base class for powernv machines and have it implemented by machine types that support power management instead. Signed-off-by: Greg Kurz Message-Id: <157623839642.360005.9243510140436689941.stgit@bahia.lan> Reviewed-by: Cédric Le Goater Signed-off-by: David Gibson --- include/hw/ppc/pnv.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/hw/ppc') diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index d534746bd4..8a42c199b6 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -190,6 +190,8 @@ PowerPCCPU *pnv_chip_find_cpu(PnvChip *chip, uint32_t pir); #define PNV_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(PnvMachineClass, klass, TYPE_PNV_MACHINE) +typedef struct PnvMachineState PnvMachineState; + typedef struct PnvMachineClass { /*< private >*/ MachineClass parent_class; @@ -197,9 +199,11 @@ typedef struct PnvMachineClass { /*< public >*/ const char *compat; int compat_size; + + void (*dt_power_mgt)(PnvMachineState *pnv, void *fdt); } PnvMachineClass; -typedef struct PnvMachineState { +struct PnvMachineState { /*< private >*/ MachineState parent_obj; @@ -216,7 +220,7 @@ typedef struct PnvMachineState { Notifier powerdown_notifier; PnvPnor *pnor; -} PnvMachineState; +}; static inline bool pnv_chip_is_power9(const PnvChip *chip) { -- cgit v1.2.3