From patchwork Thu Apr 19 21:34:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 153875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id F196DB7029 for ; Fri, 20 Apr 2012 07:34:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DAAB82817C; Thu, 19 Apr 2012 23:34:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0lqN2ikVz2e4; Thu, 19 Apr 2012 23:34:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 696C12817F; Thu, 19 Apr 2012 23:34:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 687702817E for ; Thu, 19 Apr 2012 23:34:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oxz58bXvMjhk for ; Thu, 19 Apr 2012 23:34:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id CBFD12817C for ; Thu, 19 Apr 2012 23:34:09 +0200 (CEST) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 795A46356; Thu, 19 Apr 2012 15:34:46 -0600 (MDT) Received: from localhost.localdomain (searspoint.nvidia.com [216.228.112.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 8FD7CE4794; Thu, 19 Apr 2012 15:34:05 -0600 (MDT) From: Stephen Warren To: Wolfgang Denk , Tom Rini , Albert ARIBAUD Date: Thu, 19 Apr 2012 15:34:00 -0600 Message-Id: <1334871241-11932-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.0.4 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, twarren@nvidia.com, Simon Schwarz Subject: [U-Boot] [PATCH V2 1/2] arm: fix bootm with device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stephen Warren Commit 0a672d4 "arm: Add Prep subcommand support to bootm" re-organized do_bootm_linux() for ARM. During the re-organization, the code to pass the device tree to the kernel was removed. Add it back. This restores the ability to boot a kernel using device tree. Signed-off-by: Stephen Warren Acked-by: Tom Rini Acked-by: Allen Martin Tested-by: Allen Martin --- v2: Fix a build warning --- arch/arm/lib/bootm.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 1c1bee6..cba457f 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -317,6 +317,7 @@ static void boot_jump_linux(bootm_headers_t *images) unsigned long machid = gd->bd->bi_arch_number; char *s; void (*kernel_entry)(int zero, int arch, uint params); + unsigned long r2; kernel_entry = (void (*)(int, int, uint))images->ep; @@ -330,7 +331,15 @@ static void boot_jump_linux(bootm_headers_t *images) "...\n", (ulong) kernel_entry); bootstage_mark(BOOTSTAGE_ID_RUN_OS); announce_and_cleanup(); - kernel_entry(0, machid, gd->bd->bi_boot_params); + +#ifdef CONFIG_OF_LIBFDT + if (images->ft_len) + r2 = (unsigned long)images->ft_addr; + else +#endif + r2 = gd->bd->bi_boot_params; + + kernel_entry(0, machid, r2); } /* Main Entry point for arm bootm implementation