aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-12-17 17:57:19 +0100
committerCédric Le Goater <clg@kaod.org>2021-12-17 17:57:19 +0100
commit12060cbd3fd42e2a263c473829f5872c89dc71d7 (patch)
tree3684f214d163a4e7299c6b38ffe7337e1cb22628
parent422fd92e613ab6b5239538bf2dc1202eb9d3f0f5 (diff)
ppc/pnv: Introduce version and device_id class atributes for PHB4 devices
It prepares ground for PHB5 which has different values. Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20211213132830.108372-9-clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
-rw-r--r--hw/pci-host/pnv_phb4_pec.c2
-rw-r--r--hw/ppc/pnv.c4
-rw-r--r--include/hw/pci-host/pnv_phb4.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 741ddc90ed..9f722729ac 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -499,6 +499,8 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
pecc->compat_size = sizeof(compat);
pecc->stk_compat = stk_compat;
pecc->stk_compat_size = sizeof(stk_compat);
+ pecc->version = PNV_PHB4_VERSION;
+ pecc->device_id = PNV_PHB4_DEVICE_ID;
}
static const TypeInfo pnv_pec_type_info = {
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 2fc2b0dff7..78436a30ac 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1421,9 +1421,9 @@ static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
object_property_set_int(obj, "index", phb_id, &error_fatal);
object_property_set_int(obj, "chip-id", chip->chip_id,
&error_fatal);
- object_property_set_int(obj, "version", PNV_PHB4_VERSION,
+ object_property_set_int(obj, "version", pecc->version,
&error_fatal);
- object_property_set_int(obj, "device-id", PNV_PHB4_DEVICE_ID,
+ object_property_set_int(obj, "device-id", pecc->device_id,
&error_fatal);
object_property_set_link(obj, "stack", OBJECT(stack),
&error_abort);
diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 27556ae534..b286423364 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -219,6 +219,8 @@ struct PnvPhb4PecClass {
int compat_size;
const char *stk_compat;
int stk_compat_size;
+ uint64_t version;
+ uint64_t device_id;
};
#endif /* PCI_HOST_PNV_PHB4_H */