diff options
author | Cédric Le Goater <clg@kaod.org> | 2022-01-12 11:28:27 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2022-01-12 11:28:27 +0100 |
commit | a71cd51e2aae333dde272ff83661f9ef0fe62a30 (patch) | |
tree | 5acbb41e5c45ade73ca8ff04419525ed127f80d2 /hw/ppc/pnv.c | |
parent | 5ff21d94e2ce0a89ca1a490a31929171cf28e92f (diff) |
ppc/pnv: Attach PHB3 root port device when defaults are enabled
This cleanups the PHB3 model a bit more since the root port is an
independent device and it will ease our task when adding user created
PHB3s.
pnv_phb_attach_root_port() is made public in pnv.c so it can be reused
with the pnv_phb4 root port later.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220105212338.49899-4-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/ppc/pnv.c')
-rw-r--r-- | hw/ppc/pnv.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 9de8b83530..3a263f631a 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1156,6 +1156,14 @@ static void pnv_chip_icp_realize(Pnv8Chip *chip8, Error **errp) } } +/* Attach a root port device */ +void pnv_phb_attach_root_port(PCIHostState *pci, const char *name) +{ + PCIDevice *root = pci_new(PCI_DEVFN(0, 0), name); + + pci_realize_and_unref(root, pci->bus, &error_fatal); +} + static void pnv_chip_power8_realize(DeviceState *dev, Error **errp) { PnvChipClass *pcc = PNV_CHIP_GET_CLASS(dev); |