[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/14] ppc/pnv: Introduce version and device_id class atributes f
From: |
Cédric Le Goater |
Subject: |
[PATCH 08/14] ppc/pnv: Introduce version and device_id class atributes for PHB4 devices |
Date: |
Thu, 2 Dec 2021 15:42:29 +0100 |
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/pci-host/pnv_phb4.h | 2 ++
hw/pci-host/pnv_phb4_pec.c | 2 ++
hw/ppc/pnv.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 27556ae53425..b2864233641e 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 */
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 741ddc90ed8d..9f722729ac50 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 185464a1d443..0c65e1e88cf5 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1408,9 +1408,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);
--
2.31.1
- [PATCH 05/14] ppc/pnv: Reparent user created PHB3 devices to the PnvChip, (continued)
- [PATCH 05/14] ppc/pnv: Reparent user created PHB3 devices to the PnvChip, Cédric Le Goater, 2021/12/02
- [PATCH 09/14] ppc/pnv: Introduce a "chip" property under the PHB4 model, Cédric Le Goater, 2021/12/02
- [PATCH 06/14] ppc/pnv: Complete user created PHB3 devices, Cédric Le Goater, 2021/12/02
- [PATCH 08/14] ppc/pnv: Introduce version and device_id class atributes for PHB4 devices,
Cédric Le Goater <=
- [PATCH 10/14] ppc/pnv: Introduce a num_stack class attribute, Cédric Le Goater, 2021/12/02
- [PATCH 11/14] ppc/pnv: Compute the PHB index from the PHB4 PEC model, Cédric Le Goater, 2021/12/02