[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH 13/15] spapr_pci: provide node start offset via sp
From: |
Michael Roth |
Subject: |
[Qemu-ppc] [RFC PATCH 13/15] spapr_pci: provide node start offset via spapr_populate_pci_dt() |
Date: |
Wed, 29 Apr 2015 14:20:22 -0500 |
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 <address@hidden>
---
hw/ppc/spapr.c | 2 +-
hw/ppc/spapr_pci.c | 6 +++++-
include/hw/pci-host/spapr.h | 3 ++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 042e7a9..ecf40e4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -767,7 +767,7 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr,
}
QLIST_FOREACH(phb, &spapr->phbs, list) {
- ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt);
+ ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt, NULL);
}
if (ret < 0) {
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index e37de28..66fe85f 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1534,7 +1534,8 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr,
int index)
int spapr_populate_pci_dt(sPAPRPHBState *phb,
uint32_t xics_phandle,
- void *fdt)
+ void *fdt,
+ int *node_offset)
{
int bus_off, i, j, ret;
char nodename[256];
@@ -1578,6 +1579,9 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
if (bus_off < 0) {
return bus_off;
}
+ if (node_offset) {
+ *node_offset = bus_off;
+ }
/* Write PHB properties */
_FDT(fdt_setprop_string(fdt, bus_off, "device_type", "pci"));
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 9dca388..32a9213 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -126,7 +126,8 @@ PCIHostState *spapr_create_phb(sPAPREnvironment *spapr, int
index);
int spapr_populate_pci_dt(sPAPRPHBState *phb,
uint32_t xics_phandle,
- void *fdt);
+ void *fdt,
+ int *node_offset);
void spapr_pci_msi_init(sPAPREnvironment *spapr, hwaddr addr);
--
1.9.1
- [Qemu-ppc] [RFC PATCH 00/15] spapr: add support for PHB hotplug, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 09/15] spapr: populate PHB DRC entries for root DT node, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 10/15] spapr_events: add support for phb hotplug events, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 11/15] qdev: add qbus_set_hotplug_handler_generic(), Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 14/15] spapr_pci: add ibm, my-drc-index property for PHB hotplug, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 12/15] spapr: stub implementation of machine-level HotplugHandler interface, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 13/15] spapr_pci: provide node start offset via spapr_populate_pci_dt(),
Michael Roth <=
- [Qemu-ppc] [RFC PATCH 01/15] pci: allow cleanup/unregistration of PCI buses, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 15/15] spapr: add hotplug hooks for PHB hotplug, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 02/15] qdev: store DeviceState's canonical path to use when unparenting, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 05/15] spapr_pci: add PHB unrealize, Michael Roth, 2015/04/29
- [Qemu-ppc] [RFC PATCH 03/15] spapr_drc: pass object ownership to parent/owner, Michael Roth, 2015/04/29