qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v7 14/20] hw/arm/virt: Store the PCI host controller


From: Eric Auger
Subject: [Qemu-devel] [PATCH v7 14/20] hw/arm/virt: Store the PCI host controller dt phandle
Date: Fri, 1 Sep 2017 19:21:17 +0200

Let's allocate a phandle for the PCI host controller dt
node and store this latter in the Virt Machine State. This
will simplify fdt operations when we bind smmu and PCI host
controller.

Signed-off-by: Eric Auger <address@hidden>
---
 hw/arm/virt.c         | 5 ++++-
 include/hw/arm/virt.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 6b7a0fe..39886c1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -991,7 +991,7 @@ static void create_pcie_irq_map(const VirtMachineState *vms,
                            0x7           /* PCI irq */);
 }
 
-static void create_pcie(const VirtMachineState *vms, qemu_irq *pic)
+static void create_pcie(VirtMachineState *vms, qemu_irq *pic)
 {
     hwaddr base_mmio = vms->memmap[VIRT_PCIE_MMIO].base;
     hwaddr size_mmio = vms->memmap[VIRT_PCIE_MMIO].size;
@@ -1100,8 +1100,11 @@ static void create_pcie(const VirtMachineState *vms, 
qemu_irq *pic)
                                      2, base_mmio, 2, size_mmio);
     }
 
+    vms->pcihost_phandle = qemu_fdt_alloc_phandle(vms->fdt);
+
     qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 1);
     create_pcie_irq_map(vms, vms->gic_phandle, irq, nodename);
+    qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->pcihost_phandle);
 
     g_free(nodename);
 }
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 33b0ff3..ae2bf2c 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -105,6 +105,7 @@ typedef struct {
     uint32_t clock_phandle;
     uint32_t gic_phandle;
     uint32_t msi_phandle;
+    uint32_t pcihost_phandle;
     int psci_conduit;
 } VirtMachineState;
 
-- 
2.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]