From patchwork Tue Aug 26 15:31:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 36040 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A6DFF20551 for ; Tue, 26 Aug 2014 15:31:51 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id va2sf71092805obc.7 for ; Tue, 26 Aug 2014 08:31:51 -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: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=Mzpoz1wgUfrkxytj0XppcV+RkEtD3q6nwG+Txxgs2Ks=; b=i4eAd6O1zOpWbbpnO/Uyji9rjNYrc91fuOM+5Bdb4ctoyoKzzGlk7BpEvcqyYUChK9 nmHzYiD89t5eXtPe78SA6dCrZqsKXpQw5VkSXUINb7KkOpxVpEnxI7SdIMlZm1XxZXK/ LYN+gE0vGhlW1Q42cRzL4UB+08GhMJui8VIRAfALSPXqLKctY5ZRLN6LfosBGvTk7tdY r3bt+SWKZlx5YpzCCLik7scFL7yxcODmEIyMWzpLzrjiDb+7a4NCIV92eH3Gsai4kVyV RNF1JM8qwZRrz61FPSmLVB/tJMXDXcEqkf2VADhv3t/6lTqSt00oDuFEBOcQTfPoKJ8n NvyQ== X-Gm-Message-State: ALoCoQlXA19U7Ph2KdTn/OvX/wyID5qFkS1rED8GTu4N1++ZWudNvyKrnsfNQi0hEv4iL3xKF2WO X-Received: by 10.50.85.42 with SMTP id e10mr14502660igz.0.1409067111106; Tue, 26 Aug 2014 08:31:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.117 with SMTP id k108ls2514343qgf.3.gmail; Tue, 26 Aug 2014 08:31:50 -0700 (PDT) X-Received: by 10.236.23.70 with SMTP id u46mr43501086yhu.13.1409067110913; Tue, 26 Aug 2014 08:31:50 -0700 (PDT) Received: from mail-yk0-f171.google.com (mail-yk0-f171.google.com [209.85.160.171]) by mx.google.com with ESMTPS id i3si2688451yhd.166.2014.08.26.08.31.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 08:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.160.171 as permitted sender) client-ip=209.85.160.171; Received: by mail-yk0-f171.google.com with SMTP id 19so11540487ykq.30 for ; Tue, 26 Aug 2014 08:31:50 -0700 (PDT) X-Received: by 10.52.234.228 with SMTP id uh4mr10688802vdc.34.1409067110824; Tue, 26 Aug 2014 08:31:50 -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 uj3csp208710vcb; Tue, 26 Aug 2014 08:31:50 -0700 (PDT) X-Received: by 10.224.130.7 with SMTP id q7mr48658151qas.42.1409067110399; Tue, 26 Aug 2014 08:31:50 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u10si4296530qae.23.2014.08.26.08.31.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 Aug 2014 08:31:50 -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]:54277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMIir-00022l-Fp for patch@linaro.org; Tue, 26 Aug 2014 11:31:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMIiL-0001mD-Lh for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:31:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMIiF-0003dy-Dh for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:31:17 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:45513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMIiF-0003dk-7a for qemu-devel@nongnu.org; Tue, 26 Aug 2014 11:31:11 -0400 Received: by mail-wi0-f174.google.com with SMTP id d1so4409664wiv.13 for ; Tue, 26 Aug 2014 08:31:10 -0700 (PDT) X-Received: by 10.180.93.104 with SMTP id ct8mr22300504wib.30.1409067069849; Tue, 26 Aug 2014 08:31:09 -0700 (PDT) Received: from ards-macbook-pro.local (BSN-143-76-23.dial-up.dsl.siol.net. [89.143.76.23]) by mx.google.com with ESMTPSA id js2sm9172437wjc.9.2014.08.26.08.31.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 08:31:09 -0700 (PDT) From: Ard Biesheuvel To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 26 Aug 2014 17:31:02 +0200 Message-Id: <1409067062-1729-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.174 Cc: Ard Biesheuvel Subject: [Qemu-devel] [PATCH] hw/arm/boot: load device tree to base of DRAM if no -kernel option was passed 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.160.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 If we are running the 'virt' machine, we may have a device tree blob but no kernel to supply it to if no -kernel option was passed. In that case, copy it to the base of DRAM where it can be picked up by a bootloader executing from NOR flash. Signed-off-by: Ard Biesheuvel --- hw/arm/boot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 3d1f4a255b48..ff6a727613aa 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -455,6 +455,14 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) /* Load the kernel. */ if (!info->kernel_filename) { + /* + * If we have a device tree blob, but no kernel to supply it to, copy it + * to the base of DRAM for a bootloader executing from NOR flash to + * pick up. + */ + if (have_dtb(info)) + load_dtb(info->loader_start, info); + /* If no kernel specified, do nothing; we will start from address 0 * (typically a boot ROM image) in the same way as hardware. */