From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS7V4-00088L-Eo for qemu-devel@nongnu.org; Thu, 11 Sep 2014 12:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS7Ux-0004Ck-MC for qemu-devel@nongnu.org; Thu, 11 Sep 2014 12:45:38 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:61393) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS7Ux-0004CY-B3 for qemu-devel@nongnu.org; Thu, 11 Sep 2014 12:45:31 -0400 Received: by mail-wi0-f173.google.com with SMTP id em10so1309668wid.0 for ; Thu, 11 Sep 2014 09:45:23 -0700 (PDT) From: Ard Biesheuvel Date: Thu, 11 Sep 2014 18:45:12 +0200 Message-Id: <1410453915-9344-2-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: <1410453915-9344-1-git-send-email-ard.biesheuvel@linaro.org> References: <1410453915-9344-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [Qemu-devel] [PATCH v3 1/4] hw/arm/boot: load DTB as a ROM image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, qemu-devel@nongnu.org Cc: christoffer.dall@linaro.org, Ard Biesheuvel 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 Signed-off-by: Ard Biesheuvel --- hw/arm/boot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index e32f2f415885..50eca931e1a4 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); -- 1.8.3.2