]> Git Repo - qemu.git/commitdiff
spapr_pci: provide node start offset via spapr_populate_pci_dt()
authorMichael Roth <[email protected]>
Tue, 19 Feb 2019 17:18:39 +0000 (18:18 +0100)
committerDavid Gibson <[email protected]>
Mon, 25 Feb 2019 22:21:25 +0000 (09:21 +1100)
PHB hotplug re-uses PHB device tree generation code and passes
it to a guest via RTAS. Doing this requires knowledge of where
exactly in the device tree the node describing the PHB begins.

Provide this via a new optional pointer that can be used to
store the PHB node's start offset.

Signed-off-by: Michael Roth <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
Message-Id: <155059671912.1466090.10891589403973703473[email protected]>
Signed-off-by: David Gibson <[email protected]>
hw/ppc/spapr.c
hw/ppc/spapr_pci.c
include/hw/pci-host/spapr.h

index fcda17709066e12db85ac1d84b261cb47468cb92..76b3c15d5952826602e94cbc8c62fd8eebda654c 100644 (file)
@@ -1312,7 +1312,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr)
 
     QLIST_FOREACH(phb, &spapr->phbs, list) {
         ret = spapr_populate_pci_dt(phb, PHANDLE_INTC, fdt,
-                                    spapr->irq->nr_msis);
+                                    spapr->irq->nr_msis, NULL);
         if (ret < 0) {
             error_report("couldn't setup PCI devices in fdt");
             exit(1);
index ede928b0bff3ea6820bcfb14f5891ec1eeba3fe2..a0e17694396a4030108eaf377e73e68ef8c0a9eb 100644 (file)
@@ -2153,7 +2153,7 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *phb)
 }
 
 int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t intc_phandle, void *fdt,
-                          uint32_t nr_msis)
+                          uint32_t nr_msis, int *node_offset)
 {
     int bus_off, i, j, ret;
     gchar *nodename;
@@ -2208,6 +2208,9 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t intc_phandle, void *fdt,
     nodename = g_strdup_printf("pci@%" PRIx64, phb->buid);
     _FDT(bus_off = fdt_add_subnode(fdt, 0, nodename));
     g_free(nodename);
+    if (node_offset) {
+        *node_offset = bus_off;
+    }
 
     /* Write PHB properties */
     _FDT(fdt_setprop_string(fdt, bus_off, "device_type", "pci"));
index 4b0443f4cfe442ccc1d84a46dce2d257b51c984a..ab0e3a0a6f729e58dd4126cea43328e619263ac0 100644 (file)
@@ -113,7 +113,7 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRPHBState *phb, int pin)
 }
 
 int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t intc_phandle, void *fdt,
-                          uint32_t nr_msis);
+                          uint32_t nr_msis, int *node_offset);
 
 void spapr_pci_rtas_init(void);
 
This page took 0.033239 seconds and 4 git commands to generate.