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 From: Peter Maydell Date: Wed, 29 Jan 2014 13:39:38 +0000 Message-Id: <1391002805-26596-12-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> References: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 11/38] hw/arm/boot: Don't set up ATAGS for autogenerated dtb booting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno 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. -- 1.8.5