From patchwork Wed Sep 10 10:59:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 387684 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 86F8614011D for ; Wed, 10 Sep 2014 21:03:35 +1000 (EST) Received: from localhost ([::1]:55157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRfgT-0004l5-MN for incoming@patchwork.ozlabs.org; Wed, 10 Sep 2014 07:03:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRfdB-0006yS-5C for qemu-devel@nongnu.org; Wed, 10 Sep 2014 07:00:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRfd4-00035q-7P for qemu-devel@nongnu.org; Wed, 10 Sep 2014 07:00:09 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:50426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRfd4-00034s-29 for qemu-devel@nongnu.org; Wed, 10 Sep 2014 07:00:02 -0400 Received: by mail-we0-f175.google.com with SMTP id w61so3553963wes.20 for ; Wed, 10 Sep 2014 04:00:01 -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=baXL46DRkcOhPCg+7tYc5hc1+LK0amXOxJkzGsi63rfGoDE1kzKt6OxgRG0s8lY3V7 Z9zV/C7cSkWP90Ky2cX4fq/HVsZ/aDJD3hyHJzNPBlH6AMPVPsYL75LdFk2GehA5Ej+r S37W5Xku8qs16qPmDv5YPApQ7DXN+AJQQlJrl5EO0cZjr+djdmWedPEZ719/1w+SOth6 Iopf4LXGCztR7WAGSl4N9fBTNPONOtHAAWhYkiO12gbtNLp3ikiNXuXhWzqHYel4lCst h8ktVme83Nfc9wwQXvSGH8OM+D77G9YO3b0wpISM9FAa+eKpamiu/mCMnxn1IPO4V5WB z7Jw== X-Gm-Message-State: ALoCoQlJQxa3zAtqWS0KSYUz3kdEpfu/snhEvQ0r1wK0As+SXJzXUQTFmREioOFtmkBJYvo5OrcY X-Received: by 10.194.77.212 with SMTP id u20mr49681221wjw.27.1410346801181; Wed, 10 Sep 2014 04:00:01 -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 wr10sm18127240wjc.10.2014.09.10.03.59.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 04:00:00 -0700 (PDT) From: Ard Biesheuvel To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 10 Sep 2014 12:59:47 +0200 Message-Id: <1410346790-31743-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1410346790-31743-1-git-send-email-ard.biesheuvel@linaro.org> References: <1410346790-31743-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.175 Cc: christoffer.dall@linaro.org, Ard Biesheuvel Subject: [Qemu-devel] [PATCH v2 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);