Message ID | 20240426110023.733309-6-adityag@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | Power11 support for QEMU | expand |
On 4/26/24 13:00, Aditya Gupta wrote: > Power11 core is same as Power10 core, declare PNV11_LPC as a child > class of PNV10_LPC, so it goes through same class init > > Cc: Cédric Le Goater <clg@kaod.org> > Cc: Frédéric Barrat <fbarrat@linux.ibm.com> > Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com> > Cc: Madhavan Srinivasan <maddy@linux.ibm.com> > Cc: Nicholas Piggin <npiggin@gmail.com> > Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > hw/ppc/pnv_lpc.c | 14 ++++++++++++++ > include/hw/ppc/pnv_lpc.h | 4 ++++ > 2 files changed, 18 insertions(+) > > diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c > index d692858bee78..54b366221bc7 100644 > --- a/hw/ppc/pnv_lpc.c > +++ b/hw/ppc/pnv_lpc.c > @@ -698,6 +698,19 @@ static const TypeInfo pnv_lpc_power10_info = { > .class_init = pnv_lpc_power10_class_init, > }; > > +static void pnv_lpc_power11_class_init(ObjectClass *klass, void *data) > +{ > + DeviceClass *dc = DEVICE_CLASS(klass); > + > + dc->desc = "PowerNV LPC Controller POWER11"; > +} > + > +static const TypeInfo pnv_lpc_power11_info = { > + .name = TYPE_PNV11_LPC, > + .parent = TYPE_PNV10_LPC, > + .class_init = pnv_lpc_power11_class_init, > +}; > + > static void pnv_lpc_realize(DeviceState *dev, Error **errp) > { > PnvLpcController *lpc = PNV_LPC(dev); > @@ -771,6 +784,7 @@ static void pnv_lpc_register_types(void) > type_register_static(&pnv_lpc_power8_info); > type_register_static(&pnv_lpc_power9_info); > type_register_static(&pnv_lpc_power10_info); > + type_register_static(&pnv_lpc_power11_info); > } > > type_init(pnv_lpc_register_types) > diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h > index 5d22c4557041..1069bca38dfd 100644 > --- a/include/hw/ppc/pnv_lpc.h > +++ b/include/hw/ppc/pnv_lpc.h > @@ -41,6 +41,10 @@ DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC, > DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC, > TYPE_PNV10_LPC) > > +#define TYPE_PNV11_LPC TYPE_PNV_LPC "-POWER11" > +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV11_LPC, > + TYPE_PNV11_LPC) > + > struct PnvLpcController { > DeviceState parent; >
On Fri, Apr 26, 2024 at 04:32:52PM +0200, Cédric Le Goater wrote: > On 4/26/24 13:00, Aditya Gupta wrote: > > Power11 core is same as Power10 core, declare PNV11_LPC as a child > > class of PNV10_LPC, so it goes through same class init > > > > Cc: Cédric Le Goater <clg@kaod.org> > > Cc: Frédéric Barrat <fbarrat@linux.ibm.com> > > Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com> > > Cc: Madhavan Srinivasan <maddy@linux.ibm.com> > > Cc: Nicholas Piggin <npiggin@gmail.com> > > Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> > > > Reviewed-by: Cédric Le Goater <clg@kaod.org> Thank you Cédric. - Aditya Gupta > > Thanks, > > C. > > > > --- > > hw/ppc/pnv_lpc.c | 14 ++++++++++++++ > > include/hw/ppc/pnv_lpc.h | 4 ++++ > > 2 files changed, 18 insertions(+) > > > > diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c > > index d692858bee78..54b366221bc7 100644 > > --- a/hw/ppc/pnv_lpc.c > > +++ b/hw/ppc/pnv_lpc.c > > @@ -698,6 +698,19 @@ static const TypeInfo pnv_lpc_power10_info = { > > .class_init = pnv_lpc_power10_class_init, > > }; > > +static void pnv_lpc_power11_class_init(ObjectClass *klass, void *data) > > +{ > > + DeviceClass *dc = DEVICE_CLASS(klass); > > + > > + dc->desc = "PowerNV LPC Controller POWER11"; > > +} > > + > > +static const TypeInfo pnv_lpc_power11_info = { > > + .name = TYPE_PNV11_LPC, > > + .parent = TYPE_PNV10_LPC, > > + .class_init = pnv_lpc_power11_class_init, > > +}; > > + > > static void pnv_lpc_realize(DeviceState *dev, Error **errp) > > { > > PnvLpcController *lpc = PNV_LPC(dev); > > @@ -771,6 +784,7 @@ static void pnv_lpc_register_types(void) > > type_register_static(&pnv_lpc_power8_info); > > type_register_static(&pnv_lpc_power9_info); > > type_register_static(&pnv_lpc_power10_info); > > + type_register_static(&pnv_lpc_power11_info); > > } > > type_init(pnv_lpc_register_types) > > diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h > > index 5d22c4557041..1069bca38dfd 100644 > > --- a/include/hw/ppc/pnv_lpc.h > > +++ b/include/hw/ppc/pnv_lpc.h > > @@ -41,6 +41,10 @@ DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC, > > DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC, > > TYPE_PNV10_LPC) > > +#define TYPE_PNV11_LPC TYPE_PNV_LPC "-POWER11" > > +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV11_LPC, > > + TYPE_PNV11_LPC) > > + > > struct PnvLpcController { > > DeviceState parent; >
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index d692858bee78..54b366221bc7 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -698,6 +698,19 @@ static const TypeInfo pnv_lpc_power10_info = { .class_init = pnv_lpc_power10_class_init, }; +static void pnv_lpc_power11_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->desc = "PowerNV LPC Controller POWER11"; +} + +static const TypeInfo pnv_lpc_power11_info = { + .name = TYPE_PNV11_LPC, + .parent = TYPE_PNV10_LPC, + .class_init = pnv_lpc_power11_class_init, +}; + static void pnv_lpc_realize(DeviceState *dev, Error **errp) { PnvLpcController *lpc = PNV_LPC(dev); @@ -771,6 +784,7 @@ static void pnv_lpc_register_types(void) type_register_static(&pnv_lpc_power8_info); type_register_static(&pnv_lpc_power9_info); type_register_static(&pnv_lpc_power10_info); + type_register_static(&pnv_lpc_power11_info); } type_init(pnv_lpc_register_types) diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h index 5d22c4557041..1069bca38dfd 100644 --- a/include/hw/ppc/pnv_lpc.h +++ b/include/hw/ppc/pnv_lpc.h @@ -41,6 +41,10 @@ DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV9_LPC, DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV10_LPC, TYPE_PNV10_LPC) +#define TYPE_PNV11_LPC TYPE_PNV_LPC "-POWER11" +DECLARE_INSTANCE_CHECKER(PnvLpcController, PNV11_LPC, + TYPE_PNV11_LPC) + struct PnvLpcController { DeviceState parent;
Power11 core is same as Power10 core, declare PNV11_LPC as a child class of PNV10_LPC, so it goes through same class init Cc: Cédric Le Goater <clg@kaod.org> Cc: Frédéric Barrat <fbarrat@linux.ibm.com> Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com> Cc: Madhavan Srinivasan <maddy@linux.ibm.com> Cc: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com> --- hw/ppc/pnv_lpc.c | 14 ++++++++++++++ include/hw/ppc/pnv_lpc.h | 4 ++++ 2 files changed, 18 insertions(+)