[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 02/10] ppc/pnv: Introduce 'PnvChipClass::chip_type'
|
From: |
Aditya Gupta |
|
Subject: |
Re: [PATCH v2 02/10] ppc/pnv: Introduce 'PnvChipClass::chip_type' |
|
Date: |
Fri, 26 Apr 2024 22:48:47 +0530 |
Hello Cédric,
> >
> > <...snip...>
> >
> > diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h
> > index 8589f3291ed3..ebfe82b89537 100644
> > --- a/include/hw/ppc/pnv_chip.h
> > +++ b/include/hw/ppc/pnv_chip.h
> > @@ -17,12 +17,21 @@
> > OBJECT_DECLARE_TYPE(PnvChip, PnvChipClass,
> > PNV_CHIP)
> > +typedef enum PnvChipType {
> > + PNV_TYPE_POWER8E, /* AKA Murano (default) */
> > + PNV_TYPE_POWER8, /* AKA Venice */
> > + PNV_TYPE_POWER8NVL, /* AKA Naples */
> > + PNV_TYPE_POWER9, /* AKA Nimbus */
> > + PNV_TYPE_POWER10,
> > +} PnvChipType;
>
> Nope.
>
> > +
> > struct PnvChip {
> > /*< private >*/
> > SysBusDevice parent_obj;
> > /*< public >*/
> > uint32_t chip_id;
> > +
> > uint64_t ram_start;
> > uint64_t ram_size;
> > @@ -137,6 +146,7 @@ struct PnvChipClass {
> > SysBusDeviceClass parent_class;
> > /*< public >*/
> > + PnvChipType chip_type;
> > uint64_t chip_cfam_id;
> > uint64_t cores_mask;
> > uint32_t num_pecs;
>
> Adding an enum type under PnvChipClass which is a type already
> looks wrong. Please find another way. It is possible I am sure.
True. You suggested one possible way in patch #3, to replicate the
*_dt_populate and quad_realize functions for Power11 also.
Another way to do this was depending on the type string in qemu
object's class type name, or object_cast_cache, but I decided not to go
with string comparison or depending on internal strings.
Will use your suggestion in patch #3.
Thanks,
Aditya Gupta
>
> Thanks,
>
> C.
>
>
- Re: [PATCH v2 06/10] ppc/pnv: Add OCC for Power11, (continued)
- [PATCH v2 05/10] ppc/pnv: Add a LPC controller for POWER11, Aditya Gupta, 2024/04/26
- [PATCH v2 08/10] ppc/pnv: Add SBE model for Power11, Aditya Gupta, 2024/04/26
- [PATCH v2 02/10] ppc/pnv: Introduce 'PnvChipClass::chip_type', Aditya Gupta, 2024/04/26
- [PATCH v2 07/10] ppc/pnv: Add a PSI bridge model for Power11, Aditya Gupta, 2024/04/26
- [PATCH v2 03/10] ppc/pnv: Add a Power11 Pnv11Chip, and a Power11 Machine, Aditya Gupta, 2024/04/26
- [PATCH v2 01/10] ppc/pseries: Add Power11 cpu type, Aditya Gupta, 2024/04/26