From patchwork Fri Sep 12 13:23:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 37321 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 043AF203EE for ; Fri, 12 Sep 2014 13:37:45 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id x12sf472478wgg.10 for ; Fri, 12 Sep 2014 06:37:40 -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: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=a3tYgAUgLLouy5p/W5FK6L+TKBWUKhmy2Sdya4M1kus=; b=GETbbg6Iw7B9HyfQGG4YaySjXmfbTvPxaGR4P8HnpGn8n0kD+1pc/MqCmYp43hPNNB 47a7eoix5TJXiLZO+DpJlRd4tXNkXTSyT1Bc+lNL+NygGiSO0cLsgB8KYBoQu3n+4sVm aY4ukC5r8W8I9uG0N2IHF5Wv0kmrqApxXRYaqYPhNYI2kEOE4ANzR2KhLdcqzzyfPL7x aiPYuha/WJlc6vQg73ZV93lvbu6+p0X4D3/33N9HkmFQ+0djiE2a5kmWJYmzCV1KIKFm OGJLpdm2VyscgfbhoQ2yPxGn8rT4CSRkLp867QAIpFgwEongNBJwl6yuSj7IgR3AZmLT khwA== X-Gm-Message-State: ALoCoQk1JBIJKElxTu9+QbTLzTDtq0oo4YwuEqd6BYJFoFrSNj30O1E7kTdSTiAn8IDN0XNFoOJC X-Received: by 10.112.141.104 with SMTP id rn8mr2301338lbb.2.1410529060729; Fri, 12 Sep 2014 06:37:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.73 with SMTP id j9ls187288lag.29.gmail; Fri, 12 Sep 2014 06:37:40 -0700 (PDT) X-Received: by 10.152.6.40 with SMTP id x8mr9069173lax.18.1410529060592; Fri, 12 Sep 2014 06:37:40 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id k1si6541854lam.96.2014.09.12.06.37.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 06:37:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id 10so925181lbg.30 for ; Fri, 12 Sep 2014 06:37:40 -0700 (PDT) X-Received: by 10.152.204.231 with SMTP id lb7mr7347230lac.44.1410529060473; Fri, 12 Sep 2014 06:37:40 -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.112.141.42 with SMTP id rl10csp733099lbb; Fri, 12 Sep 2014 06:37:39 -0700 (PDT) X-Received: by 10.224.88.3 with SMTP id y3mr12001199qal.65.1410529059054; Fri, 12 Sep 2014 06:37:39 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s9si5628796qan.84.2014.09.12.06.37.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Sep 2014 06:37:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:45058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSR2f-0006fa-N9 for patch@linaro.org; Fri, 12 Sep 2014 09:37:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSQpa-0006q3-Dw for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:24:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSQpQ-0003y7-LN for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:24:06 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:46960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSQpQ-0003xI-Fd for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:23:56 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XSQpP-0003YX-Ju for qemu-devel@nongnu.org; Fri, 12 Sep 2014 14:23:55 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 12 Sep 2014 14:23:51 +0100 Message-Id: <1410528234-13545-21-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1410528234-13545-1-git-send-email-peter.maydell@linaro.org> References: <1410528234-13545-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.2.115.146 Subject: [Qemu-devel] [PULL 20/23] 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: peter.maydell@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.217.171 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 From: 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 Message-id: 1410453915-9344-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-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 e32f2f4..50eca93 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);