From patchwork Sun Dec 29 14:20:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22776 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 8648F23FDF for ; Sun, 29 Dec 2013 14:20:38 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id lx4sf51837790iec.10 for ; Sun, 29 Dec 2013 06:20:37 -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:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=69UZQhDpYZ+8IUzMF3VJ6OTfA2yTGKDFzBIeE7jXFWY=; b=L9aPhumRqlaCcvcn2B+tUzgNfutNU/fAYto0hTQTowV0ma44lCT2mS/P/nv0+iBprj FD1l/Bxz2RDp/BPxhE2busn8JDDw5W4iHKygm0Xwga46LI59h8eBR+ic9hsG+JRdVM1p 5afer0ObrsAXzWGYDpvEhq+EKmCMtegmH3sc0HMq2hzxYCONBuAhP1p/p8deeUjNeK6H gnH8XRP1HMttd7mF10PdlQ+tg+ccXD9DMYOAlJI2AET4hW6HLhbZ4njcR6Ixkb91Rh84 V4uk7MIQsAvlPCxjFne7hCZqgSlNNtB69vg0VBMHm3bDdwHJawEVlyvD1e1UNTrRKckO hUig== X-Gm-Message-State: ALoCoQn+UzysV6MMSmEeb30aptSjg395LxbXNAfZnmZtIBaF4/oJtrOfsO511ImLLpZig98tIEYs X-Received: by 10.182.55.102 with SMTP id r6mr24464719obp.7.1388326837384; Sun, 29 Dec 2013 06:20:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.70 with SMTP id v6ls3460796qec.47.gmail; Sun, 29 Dec 2013 06:20:37 -0800 (PST) X-Received: by 10.52.244.49 with SMTP id xd17mr12974440vdc.26.1388326837279; Sun, 29 Dec 2013 06:20:37 -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 l4si15283926vch.129.2013.12.29.06.20.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Dec 2013 06:20:37 -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 ie18so5321839vcb.24 for ; Sun, 29 Dec 2013 06:20:37 -0800 (PST) X-Received: by 10.220.145.75 with SMTP id c11mr13805615vcv.30.1388326837146; Sun, 29 Dec 2013 06:20:37 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp558988ved; Sun, 29 Dec 2013 06:20:36 -0800 (PST) X-Received: by 10.194.5.7 with SMTP id o7mr41260641wjo.17.1388326835509; Sun, 29 Dec 2013 06:20:35 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id e19si15691076wjz.71.2013.12.29.06.20.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 29 Dec 2013 06:20:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VxHEH-0000B3-4P; Sun, 29 Dec 2013 14:20:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting Date: Sun, 29 Dec 2013 14:20:33 +0000 Message-Id: <1388326833-656-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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.