[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to sp
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt |
Date: |
Tue, 25 Sep 2018 17:01:48 +1000 |
From: Cédric Le Goater <address@hidden>
So that we don't have to call qdev_get_machine() to get the machine
class and the sPAPRIrq backend holding the number of MSIs.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 2 +-
hw/ppc/spapr_pci.c | 9 +++------
include/hw/pci-host/spapr.h | 5 ++---
3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index eba7d60a30..98868d893a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1267,7 +1267,7 @@ static void *spapr_build_fdt(sPAPRMachineState *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, smc->irq->nr_msis);
if (ret < 0) {
error_report("couldn't setup PCI devices in fdt");
exit(1);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index bb736177e7..c2271e6ed4 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -2069,9 +2069,8 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *phb)
}
-int spapr_populate_pci_dt(sPAPRPHBState *phb,
- uint32_t xics_phandle,
- void *fdt)
+int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt,
+ uint32_t nr_msis)
{
int bus_off, i, j, ret;
gchar *nodename;
@@ -2121,7 +2120,6 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
sPAPRTCETable *tcet;
PCIBus *bus = PCI_HOST_BRIDGE(phb)->bus;
sPAPRFDT s_fdt;
- sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine());
/* Start populating the FDT */
nodename = g_strdup_printf("address@hidden" PRIx64, phb->buid);
@@ -2139,8 +2137,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,
_FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges));
_FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg)));
_FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1));
- _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi",
- smc->irq->nr_msis));
+ _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", nr_msis));
/* Dynamic DMA window */
if (phb->ddw_enabled) {
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 0fae4fc6a4..7c66c3872f 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -113,9 +113,8 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct
sPAPRPHBState *phb, int pin)
PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index);
-int spapr_populate_pci_dt(sPAPRPHBState *phb,
- uint32_t xics_phandle,
- void *fdt);
+int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void *fdt,
+ uint32_t nr_msis);
void spapr_pci_rtas_init(void);
--
2.17.1
- [Qemu-ppc] [PULL 00/14] ppc-for-3.1 queue 20180925, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 03/14] hw/ppc: on 40p machine, change default firmware to OpenBIOS, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 06/14] spapr: introduce a spapr_irq class 'nr_msis' attribute, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 02/14] target/ppc/cpu-models: Re-group the 970 CPUs together again, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 05/14] 40p: use OR gate to wire up raven PCI interrupts, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 07/14] spapr: increase the size of the IRQ number space, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 04/14] raven: some minor IRQ-related tidy-ups, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 01/14] Record history of ppcemb target in common.json, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 12/14] scsi: remove unused lsi53c895a_create() and lsi53c810_create() functions, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt,
David Gibson <=
- [Qemu-ppc] [PULL 09/14] sm501: Adjust endianness of pixel value in rectangle fill, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 14/14] 40p: add fixed IRQ routing for LSI SCSI device, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 11/14] scsi: move lsi53c8xx_create() callers to lsi53c8xx_handle_legacy_cmdline(), David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 10/14] scsi: add lsi53c8xx_handle_legacy_cmdline() function, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 13/14] lsi53c895a: add optional external IRQ via qdev, David Gibson, 2018/09/25
- Re: [Qemu-ppc] [PULL 00/14] ppc-for-3.1 queue 20180925, Peter Maydell, 2018/09/25