From patchwork Wed Jan 29 13:39:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23842 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED4F2202FA for ; Wed, 29 Jan 2014 13:43:35 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id x13sf5972562ief.10 for ; Wed, 29 Jan 2014 05:43:35 -0800 (PST) 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=nUGU6ZBhbJii+53mWI4M3+kg28qsuwE1kUgjXfQNFBY=; b=ZoY7YuyHh8tC0Y2y70YZoGH3ldqZUJYaWcuZytqAbEVK3w6BmFliFVBE055FIMLZce SbttAewU4odhCUrROLSfCFqSr8Uotw51M7bpg3KVG2VWKzEfpbrtknGTZjN1aoXIklkU JF95lsMfaC9FBfI8tAGkBbcnrXRdNdbU/vvno5qxXVj5oHKHlqvpCPLqCj/MkG2Iay1x RRnlkX8SVdM6qUg4c3GNV+hKDbY1LComj9A2eFOR/mdDj/kAll+1QSjv5RV1K972fDG3 JM2q73AzUdVi7rOTI/9QG+MRE3Mh6vNM4NbIJhNKDRDGZagB7Nb/syMP72NLjhX30J+G eysw== X-Gm-Message-State: ALoCoQk8qzsoj+BHyNawg/MiUzsSqC7cOGHzyYme4acm5+Jkfzw22rgdujcbY7QNGxeSCCfUrzVI X-Received: by 10.42.107.67 with SMTP id c3mr2688046icp.0.1391003015241; Wed, 29 Jan 2014 05:43:35 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.129 with SMTP id g1ls103641qge.69.gmail; Wed, 29 Jan 2014 05:43:35 -0800 (PST) X-Received: by 10.52.106.107 with SMTP id gt11mr5723406vdb.7.1391003014998; Wed, 29 Jan 2014 05:43:34 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id yb7si807817vec.39.2014.01.29.05.43.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:43:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id lh14so1138793vcb.38 for ; Wed, 29 Jan 2014 05:43:34 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr6786661vco.18.1391003014901; Wed, 29 Jan 2014 05:43:34 -0800 (PST) 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.220.174.196 with SMTP id u4csp113718vcz; Wed, 29 Jan 2014 05:43:34 -0800 (PST) X-Received: by 10.224.119.74 with SMTP id y10mr12081016qaq.28.1391003014234; Wed, 29 Jan 2014 05:43:34 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x4si1761485qad.124.2014.01.29.05.43.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:43:34 -0800 (PST) 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]:42320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VQT-000580-SX for patch@linaro.org; Wed, 29 Jan 2014 08:43:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNS-00019s-5W for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8VNF-0000rA-K1 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:26 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:45234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNF-0000p0-Al for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:13 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W8VN7-0006w8-MK; Wed, 29 Jan 2014 13:40:05 +0000 From: Peter Maydell To: Anthony Liguori Date: Wed, 29 Jan 2014 13:39:38 +0000 Message-Id: <1391002805-26596-12-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> References: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 11/38] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting 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=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 The code which decides whether to set up the ATAGS data structure on reset was using the wrong conditional, which meant we were creating an ATAGS structure when doing a device-tree boot if the dtb was autogenerated by the board. This is harmless, but unnecessary, so bring it in to line with user-provided-dtb boots. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite Message-id: 1388326833-656-1-git-send-email-peter.maydell@linaro.org --- hw/arm/boot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 1c1b0e5..4036262 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -173,6 +173,11 @@ static void default_reset_secondary(ARMCPU *cpu, env->regs[15] = info->smp_loader_start; } +static inline bool have_dtb(const struct arm_boot_info *info) +{ + return info->dtb_filename || info->get_dtb; +} + #define WRITE_WORD(p, value) do { \ stl_phys_notdirty(p, value); \ p += 4; \ @@ -421,7 +426,7 @@ static void do_cpu_reset(void *opaque) env->regs[15] = info->loader_start; } - if (!info->dtb_filename) { + if (!have_dtb(info)) { if (old_param) { set_kernel_args_old(info); } else { @@ -542,7 +547,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) /* for device tree boot, we pass the DTB directly in r2. Otherwise * we point to the kernel args. */ - if (info->dtb_filename || info->get_dtb) { + if (have_dtb(info)) { /* Place the DTB after the initrd in memory. Note that some * kernels will trash anything in the 4K page the initrd * ends in, so make sure the DTB isn't caught up in that.