PHB5 will introduce its own root port model. Prepare ground for it.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/pci-host/pnv_phb4.h | 1 +
hw/pci-host/pnv_phb4_pec.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 74fdec2b478b..0c7635dec591 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -203,6 +203,7 @@ struct PnvPhb4PecClass {
int stk_compat_size;
uint64_t version;
const uint32_t *num_phbs;
+ const char *rp_model;
};
#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 b19e89236a63..a3c4b4ef850c 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -134,7 +134,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
}
/* Add a single Root port if running with defaults */
- pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
+ pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
+ PNV_PHB4_PEC_GET_CLASS(pec)->rp_model);
+
}
static void pnv_pec_realize(DeviceState *dev, Error **errp)
@@ -267,6 +269,7 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
pecc->stk_compat_size = sizeof(stk_compat);
pecc->version = PNV_PHB4_VERSION;
pecc->num_phbs = pnv_pec_num_phbs;
+ pecc->rp_model = TYPE_PNV_PHB4_ROOT_PORT;
}
static const TypeInfo pnv_pec_type_info = {
--
2.31.1
On 1/17/22 09:27, Cédric Le Goater wrote:
> PHB5 will introduce its own root port model. Prepare ground for it.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> include/hw/pci-host/pnv_phb4.h | 1 +
> hw/pci-host/pnv_phb4_pec.c | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
> index 74fdec2b478b..0c7635dec591 100644
> --- a/include/hw/pci-host/pnv_phb4.h
> +++ b/include/hw/pci-host/pnv_phb4.h
> @@ -203,6 +203,7 @@ struct PnvPhb4PecClass {
> int stk_compat_size;
> uint64_t version;
> const uint32_t *num_phbs;
> + const char *rp_model;
> };
>
> #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 b19e89236a63..a3c4b4ef850c 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -134,7 +134,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
> }
>
> /* Add a single Root port if running with defaults */
> - pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
> + pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
> + PNV_PHB4_PEC_GET_CLASS(pec)->rp_model);
> +
> }
>
> static void pnv_pec_realize(DeviceState *dev, Error **errp)
> @@ -267,6 +269,7 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
> pecc->stk_compat_size = sizeof(stk_compat);
> pecc->version = PNV_PHB4_VERSION;
> pecc->num_phbs = pnv_pec_num_phbs;
> + pecc->rp_model = TYPE_PNV_PHB4_ROOT_PORT;
> }
>
> static const TypeInfo pnv_pec_type_info = {
© 2016 - 2026 Red Hat, Inc.