diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2019-05-29 01:52:01 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2019-06-23 23:44:42 -0700 |
commit | 5b7ae1cec9af5bf96fdc963a52a4595c51b128f9 (patch) | |
tree | d03891ed7fc787233d9736cbb613b8907e2117ad /hw | |
parent | db21e6f72721996ddf1948c35a8ee35238089da4 (diff) | |
download | qemu-5b7ae1cec9af5bf96fdc963a52a4595c51b128f9.zip qemu-5b7ae1cec9af5bf96fdc963a52a4595c51b128f9.tar.gz qemu-5b7ae1cec9af5bf96fdc963a52a4595c51b128f9.tar.bz2 |
riscv: virt: Correct pci "bus-range" encoding
The largest pci bus number should be calculated from ECAM size,
instead of its base address.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/riscv/virt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 84d94d0..487f614 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -298,7 +298,7 @@ static void *create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap, qemu_fdt_setprop_string(fdt, nodename, "device_type", "pci"); qemu_fdt_setprop_cell(fdt, nodename, "linux,pci-domain", 0); qemu_fdt_setprop_cells(fdt, nodename, "bus-range", 0, - memmap[VIRT_PCIE_ECAM].base / + memmap[VIRT_PCIE_ECAM].size / PCIE_MMCFG_SIZE_MIN - 1); qemu_fdt_setprop(fdt, nodename, "dma-coherent", NULL, 0); qemu_fdt_setprop_cells(fdt, nodename, "reg", 0, memmap[VIRT_PCIE_ECAM].base, |