summaryrefslogtreecommitdiffstats
path: root/include/hw/pci-host
diff options
context:
space:
mode:
authorDaniel Henrique Barboza2022-06-24 10:49:14 +0200
committerDaniel Henrique Barboza2022-08-31 19:08:05 +0200
commit210aacb3b92707ecc5de811c743322ca395c0fa6 (patch)
tree646006642e4d40b1ba97caa1660191ecb66bf08f /include/hw/pci-host
parentppc/pnv: add PHB4 bus init helper (diff)
downloadqemu-210aacb3b92707ecc5de811c743322ca395c0fa6.tar.gz
qemu-210aacb3b92707ecc5de811c743322ca395c0fa6.tar.xz
qemu-210aacb3b92707ecc5de811c743322ca395c0fa6.zip
ppc/pnv: turn PnvPHB4 into a PnvPHB backend
Change the parent type of the PnvPHB4 device to TYPE_PARENT since the PCI bus is going to be initialized by the PnvPHB parent. Functions that needs to access the bus via a PnvPHB4 object can do so via the phb4->phb_base pointer. pnv_phb4_pec now creates a PnvPHB object. The powernv9 machine class will create PnvPHB devices with version '4'. powernv10 will create using version '5'. Both are using global machine properties in their class_init() to do that. These changes will benefit us when adding PnvPHB user creatable devices for powernv9 and powernv10. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com> Message-Id: <20220624084921.399219-6-danielhb413@gmail.com>
Diffstat (limited to 'include/hw/pci-host')
-rw-r--r--include/hw/pci-host/pnv_phb4.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 90843ac3a9..f22253358f 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -18,6 +18,7 @@
typedef struct PnvPhb4PecState PnvPhb4PecState;
typedef struct PnvPhb4PecStack PnvPhb4PecStack;
typedef struct PnvPHB4 PnvPHB4;
+typedef struct PnvPHB PnvPHB;
typedef struct PnvChip PnvChip;
/*
@@ -78,7 +79,9 @@ OBJECT_DECLARE_SIMPLE_TYPE(PnvPHB4, PNV_PHB4)
#define PCI_MMIO_TOTAL_SIZE (0x1ull << 60)
struct PnvPHB4 {
- PCIExpressHost parent_obj;
+ DeviceState parent;
+
+ PnvPHB *phb_base;
uint32_t chip_id;
uint32_t phb_id;