From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRPlk-0001RD-MX for qemu-devel@nongnu.org; Tue, 09 Sep 2014 14:04:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRPle-0002FH-QM for qemu-devel@nongnu.org; Tue, 09 Sep 2014 14:03:56 -0400 Received: from mail-la0-f45.google.com ([209.85.215.45]:61713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRPle-0002F5-KB for qemu-devel@nongnu.org; Tue, 09 Sep 2014 14:03:50 -0400 Received: by mail-la0-f45.google.com with SMTP id pn19so19980402lab.4 for ; Tue, 09 Sep 2014 11:03:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1409930126-28449-6-git-send-email-ard.biesheuvel@linaro.org> References: <1409930126-28449-1-git-send-email-ard.biesheuvel@linaro.org> <1409930126-28449-6-git-send-email-ard.biesheuvel@linaro.org> From: Peter Maydell Date: Tue, 9 Sep 2014 19:03:28 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 5/6] hw/arm/boot: load DTB as a ROM image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ard Biesheuvel Cc: Fu Wei , QEMU Developers , Christoffer Dall On 5 September 2014 16:15, Ard Biesheuvel wrote: > 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. > > 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 0cfc11d42962..8d8653978dfe 100644 > --- a/hw/arm/boot.c > +++ b/hw/arm/boot.c > @@ -400,7 +400,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); Reviewed-by: Peter Maydell -- PMM