From patchwork Thu Sep 11 16:45:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 388330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5430F1400F0 for ; Fri, 12 Sep 2014 02:48:39 +1000 (EST) Received: from localhost ([::1]:40097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS7Xx-0004n4-Ho for incoming@patchwork.ozlabs.org; Thu, 11 Sep 2014 12:48:37 -0400 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZNI3UpRO3Lt8+/EGo7ZMxlsP099nVprge/hSM82cdI4=; b=mfO4hjfsSVoZ3O0Uwh95D1OGK1jo23PaHSsKTX3tzTHL0FLKtKRuGyOAfojg/6ML5T gnrpRBiUf58ozB78fadvE8AjxpTIWhOxVk1Pe/EXP1gcFwLtspbeWwZoWeFloYwrWX7i tfSAAQ50O2lvG7wuvXoG8UXr+HV2LB11jOqodAfA68aZBcs2i71gp00frTVk3YpVvmeP P6Jtcuj6WvaUSYFDTWIrr+rg7bV4xiIj/Vv78Bf5yRkLBC58may5GfyhcR1X7pjzFFCR R1c0H22QkfMbVzuJVMvYPQFCBJtT2mh0uO3U0tVngSFCRvEkoprdfnlLnRBJCRsGS3wj RcdA== X-Gm-Message-State: ALoCoQl7xWb97QUyxFuOGgNrWHJvClAtVLTzLnrRlGRtGzEb95Y+dfv1huv2bIRU3GmDWutTmlBx X-Received: by 10.181.13.116 with SMTP id ex20mr3965130wid.31.1410453921031; Thu, 11 Sep 2014 09:45:21 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id ll20sm2078442wic.14.2014.09.11.09.45.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 09:45:20 -0700 (PDT) From: Ard Biesheuvel To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Thu, 11 Sep 2014 18:45:12 +0200 Message-Id: <1410453915-9344-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1410453915-9344-1-git-send-email-ard.biesheuvel@linaro.org> References: <1410453915-9344-1-git-send-email-ard.biesheuvel@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.173 Cc: christoffer.dall@linaro.org, Ard Biesheuvel Subject: [Qemu-devel] [PATCH v3 1/4] hw/arm/boot: load DTB as a ROM image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);