[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/34] pnv_phb4.c: add unique chassis and slot for pnv_phb4_root_p
From: |
Cédric Le Goater |
Subject: |
[PULL 17/34] pnv_phb4.c: add unique chassis and slot for pnv_phb4_root_port |
Date: |
Wed, 12 Jan 2022 12:55:34 +0100 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
A similar situation as described previously with pnv_phb3_root_port
devices also happens with pnv_phb4_root_ports.
The solution is the same: assign an unique chassis/slot combo for them.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220105212338.49899-3-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/pci-host/pnv_phb4.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 5ba26e250a1f..836b0c156cc8 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -1338,8 +1338,23 @@ static void pnv_phb4_root_port_reset(DeviceState *dev)
static void pnv_phb4_root_port_realize(DeviceState *dev, Error **errp)
{
PCIERootPortClass *rpc = PCIE_ROOT_PORT_GET_CLASS(dev);
+ PCIDevice *pci = PCI_DEVICE(dev);
+ PCIBus *bus = pci_get_bus(pci);
+ PnvPHB4 *phb = NULL;
Error *local_err = NULL;
+ phb = (PnvPHB4 *) object_dynamic_cast(OBJECT(bus->qbus.parent),
+ TYPE_PNV_PHB4);
+
+ if (!phb) {
+ error_setg(errp, "%s must be connected to pnv-phb4 buses", dev->id);
+ return;
+ }
+
+ /* Set unique chassis/slot values for the root port */
+ qdev_prop_set_uint8(&pci->qdev, "chassis", phb->chip_id);
+ qdev_prop_set_uint16(&pci->qdev, "slot", phb->phb_id);
+
rpc->parent_realize(dev, &local_err);
if (local_err) {
error_propagate(errp, local_err);
--
2.31.1
- [PULL 00/34] ppc queue, Cédric Le Goater, 2022/01/12
- [PULL 05/34] docs/system/ppc: Merge the PEF information into the pseries page, Cédric Le Goater, 2022/01/12
- [PULL 09/34] target/ppc: powerpc_excp: Keep 60x/7x5 soft MMU logs active, Cédric Le Goater, 2022/01/12
- [PULL 03/34] spapr: Fix support of POWER5+ processors, Cédric Le Goater, 2022/01/12
- [PULL 02/34] target/ppc: Add popcntb instruction to POWER5+ processors, Cédric Le Goater, 2022/01/12
- [PULL 01/34] pseries: Update SLOF firmware image, Cédric Le Goater, 2022/01/12
- [PULL 14/34] target/ppc: Introduce a wrapper for powerpc_excp, Cédric Le Goater, 2022/01/12
- [PULL 04/34] target/ppc: Add extra float instructions to POWER5P processors, Cédric Le Goater, 2022/01/12
- [PULL 24/34] ppc/pnv: Move num_phbs under Pnv8Chip, Cédric Le Goater, 2022/01/12
- [PULL 17/34] pnv_phb4.c: add unique chassis and slot for pnv_phb4_root_port,
Cédric Le Goater <=
- [PULL 10/34] target/ppc: powerpc_excp: Group unimplemented exceptions, Cédric Le Goater, 2022/01/12
- [PULL 25/34] pnv_phb3.h: change TYPE_PNV_PHB3_ROOT_BUS name, Cédric Le Goater, 2022/01/12
- [PULL 16/34] pnv_phb3.c: add unique chassis and slot for pnv_phb3_root_port, Cédric Le Goater, 2022/01/12
- [PULL 20/34] pnv_phb4.c: check if root port exists in rc_config functions, Cédric Le Goater, 2022/01/12
- [PULL 18/34] ppc/pnv: Attach PHB3 root port device when defaults are enabled, Cédric Le Goater, 2022/01/12
- [PULL 15/34] target/ppc: Set the correct endianness for powernv memory dumps, Cédric Le Goater, 2022/01/12
- [PULL 07/34] docs: Clarifications and formatting changes in ppc docs., Cédric Le Goater, 2022/01/12
- [PULL 13/34] target/ppc: Use ppc_interrupts_little_endian in powerpc_excp, Cédric Le Goater, 2022/01/12
- [PULL 30/34] ppc/pnv: move PHB4 XSCOM init to phb4_realize(), Cédric Le Goater, 2022/01/12
- [PULL 23/34] ppc/pnv: Complete user created PHB3 devices, Cédric Le Goater, 2022/01/12