summaryrefslogtreecommitdiff
path: root/hw/arm/boot.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-09-12 14:06:50 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-09-12 14:06:50 +0100
commit4c4bf654746eae5a042bde6c150d534d8849b762 (patch)
treeaa0a0c2c5114074d684d2b5b412a1effa0ae78c1 /hw/arm/boot.c
parent0be969a2d974971628fc4ed95834d22ecf0fd497 (diff)
downloadqemu-4c4bf654746eae5a042bde6c150d534d8849b762.tar.gz
hw/arm/boot: load DTB as a ROM image
In order to make the device tree blob (DTB) available in memory not only at first boot, but also after system reset, use rom_blob_add_fixed() to install it into memory. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Message-id: 1410453915-9344-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/boot.c')
-rw-r--r--hw/arm/boot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index e32f2f4158..50eca931e1 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -396,7 +396,10 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo)
qemu_fdt_dumpdtb(fdt, size);
- cpu_physical_memory_write(addr, fdt, size);
+ /* Put the DTB into the memory map as a ROM image: this will ensure
+ * the DTB is copied again upon reset, even if addr points into RAM.
+ */
+ rom_add_blob_fixed("dtb", fdt, size, addr);
g_free(fdt);