From patchwork Fri Sep 5 15:15:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 36858 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0FC0720D9F for ; Fri, 5 Sep 2014 15:19:23 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id a3sf5064399oib.3 for ; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=dzVnRup56QP2TebojDzzePl4c/LkFNoZnQrV+k3IhW4=; b=WEi7Iv5sjCCzoHjcmJKJpiTEKpVpDtBZZVuMPfGjCGKN/YMm6Cn5pq9jgcY1XAJqIg iN+Vk6uinDaCXY8lqspFQs5allUFQSRgMhoKZySF5QSZhXLtuaTFMYQwjyPcLUZsyPzp D4faGZSBJmZxO0ikskSccHTJ7UeQ0jCBZjIZSg321rqhhLTE3Y21yx1p8JjvcauJXyIr xzh/XO0w2iKcPBIHC9bDGkVv/IKkCuuZgl2TRPEk8h1Hlq5dYjBOALa+6RBqwFLz0XZI 2+CUIkIZy6359d6Neect+kdF22ZZjpMpuAFeKrKu96JEqpw7Ig0FwgE2YQBJnh+uCBa2 nJqQ== X-Gm-Message-State: ALoCoQkGTin2DoRJ6UimD4hJmlbPzPO2XJMKY8P7UFw0aW0ivi9YEVuz3xE604K8JSRDs2W9Zxao X-Received: by 10.42.94.69 with SMTP id a5mr7351833icn.29.1409930362681; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.11 with SMTP id y11ls796828qgy.23.gmail; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) X-Received: by 10.220.69.18 with SMTP id x18mr1711250vci.58.1409930362511; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id gm7si1496752vdc.87.2014.09.05.08.19.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 08:19:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so12596302vcb.11 for ; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr1618993vcb.71.1409930362414; Fri, 05 Sep 2014 08:19:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp97948vcb; Fri, 5 Sep 2014 08:19:22 -0700 (PDT) X-Received: by 10.224.47.6 with SMTP id l6mr19921700qaf.32.1409930361464; Fri, 05 Sep 2014 08:19:21 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id g7si2016561qcu.34.2014.09.05.08.19.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 05 Sep 2014 08:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:58432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvIH-0000lW-0U for patch@linaro.org; Fri, 05 Sep 2014 11:19:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvEl-0003mx-4Q for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPvEf-0002l2-5u for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:15:43 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:54912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPvEe-0002ki-K2 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 11:15:36 -0400 Received: by mail-we0-f171.google.com with SMTP id u56so11991736wes.30 for ; Fri, 05 Sep 2014 08:15:33 -0700 (PDT) X-Received: by 10.180.212.50 with SMTP id nh18mr4298905wic.81.1409930131614; Fri, 05 Sep 2014 08:15:31 -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 wx3sm1734308wjc.19.2014.09.05.08.15.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 08:15:30 -0700 (PDT) From: Ard Biesheuvel To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Fri, 5 Sep 2014 17:15:25 +0200 Message-Id: <1409930126-28449-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1409930126-28449-1-git-send-email-ard.biesheuvel@linaro.org> References: <1409930126-28449-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: 74.125.82.171 Cc: fu.wei@linaro.org, christoffer.dall@linaro.org, Ard Biesheuvel Subject: [Qemu-devel] [PATCH 5/6] 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Peter Maydell --- 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);