[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/34] hw/riscv/virt.c: create '/soc/pci@...' fdt node earlier
From: |
Alistair Francis |
Subject: |
[PULL 17/34] hw/riscv/virt.c: create '/soc/pci@...' fdt node earlier |
Date: |
Fri, 8 Mar 2024 21:11:35 +1000 |
From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Hotplugged FDT nodes will attempt to write this node that, at this
moment, is being created only in create_fdt_pcie() during
finalize_fdt().
Create it earlier.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240217192607.32565-4-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
hw/riscv/virt.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index fd35c74781..b540f4d3da 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -826,7 +826,6 @@ static void create_fdt_pcie(RISCVVirtState *s, const
MemMapEntry *memmap,
name = g_strdup_printf("/soc/pci@%lx",
(long) memmap[VIRT_PCIE_ECAM].base);
- qemu_fdt_add_subnode(ms->fdt, name);
qemu_fdt_setprop_cell(ms->fdt, name, "#address-cells",
FDT_PCI_ADDR_CELLS);
qemu_fdt_setprop_cell(ms->fdt, name, "#interrupt-cells",
@@ -996,6 +995,7 @@ static void create_fdt(RISCVVirtState *s, const MemMapEntry
*memmap)
{
MachineState *ms = MACHINE(s);
uint8_t rng_seed[32];
+ g_autofree char *name = NULL;
ms->fdt = create_device_tree(&s->fdt_size);
if (!ms->fdt) {
@@ -1014,6 +1014,13 @@ static void create_fdt(RISCVVirtState *s, const
MemMapEntry *memmap)
qemu_fdt_setprop_cell(ms->fdt, "/soc", "#size-cells", 0x2);
qemu_fdt_setprop_cell(ms->fdt, "/soc", "#address-cells", 0x2);
+ /*
+ * The "/soc/pci@..." node is needed for PCIE hotplugs
+ * that might happen before finalize_fdt().
+ */
+ name = g_strdup_printf("/soc/pci@%lx", (long) memmap[VIRT_PCIE_ECAM].base);
+ qemu_fdt_add_subnode(ms->fdt, name);
+
qemu_fdt_add_subnode(ms->fdt, "/chosen");
/* Pass seed to RNG */
--
2.44.0
- [PULL 09/34] target/riscv: add remaining named features, (continued)
- [PULL 10/34] target/riscv: Reset henvcfg to zero, Alistair Francis, 2024/03/08
- [PULL 11/34] target/riscv: Gate hardware A/D PTE bit updating, Alistair Francis, 2024/03/08
- [PULL 12/34] target/riscv: Promote svade to a normal extension, Alistair Francis, 2024/03/08
- [PULL 13/34] target/riscv: FIX xATP_MODE validation, Alistair Francis, 2024/03/08
- [PULL 14/34] target/riscv: UPDATE xATP write CSR, Alistair Francis, 2024/03/08
- [PULL 15/34] target/riscv: Add missing include guard in pmu.h, Alistair Francis, 2024/03/08
- [PULL 17/34] hw/riscv/virt.c: create '/soc/pci@...' fdt node earlier,
Alistair Francis <=
- [PULL 16/34] hw/riscv/virt-acpi-build.c: Add SRAT and SLIT ACPI tables, Alistair Francis, 2024/03/08
- [PULL 18/34] hw/riscv/virt.c: add virtio-iommu-pci hotplug support, Alistair Francis, 2024/03/08
- [PULL 19/34] hw/riscv/virt.c: make aclint compatible with 'qtest' accel, Alistair Francis, 2024/03/08
- [PULL 20/34] tests/libqos: add riscv/virt machine nodes, Alistair Francis, 2024/03/08
[PULL 21/34] RISC-V: Add support for Ztso, Alistair Francis, 2024/03/08