From patchwork Wed Sep 3 21:32:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= X-Patchwork-Id: 385667 X-Patchwork-Delegate: albert.aribaud@free.fr 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 94A901401EC for ; Thu, 4 Sep 2014 07:33:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7B3DEA7493; Wed, 3 Sep 2014 23:33:17 +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 uzRukgJON4rk; Wed, 3 Sep 2014 23:33:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A17BA76A7; Wed, 3 Sep 2014 23:33:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D6EF4A76A7 for ; Wed, 3 Sep 2014 23:33:09 +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 l2f+1OnAnKoz for ; Wed, 3 Sep 2014 23:33:06 +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 mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by theia.denx.de (Postfix) with ESMTPS id 6B754A7493 for ; Wed, 3 Sep 2014 23:33:02 +0200 (CEST) Received: by mail-we0-f177.google.com with SMTP id u56so9128536wes.8 for ; Wed, 03 Sep 2014 14:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=a0U50s5APLlbPsPZ4PBixWdEGnE4ylK+NLVtsSLG0B8=; b=lwGbEYIaMvdr2G/4fFrMy9ifvQahYW/Ru1bSpXVCL6etNis/1e0cPw3xf7s+DI3HfV mXvcUnnn8KGY9AzUoRcmEbiz5LBVPjO55QeBh27IxrPoBMUL9oDJPO8+0mxOMvcJh9H9 escGg76924fZG8V0Y8vZHJFSPID+xTsrUTiClN6WTXksVTFoHD8rNmrVyf2ZWsFdbMYr 2YG+WyR6YYcYscHddhDe56HeSJzILezJK1Jf3+t+XiqtwbmbFH+a4zLoXWURV3NrsnT3 ltiaNyLsZq/bcsazSlwppO0ufQlQ7VwC/4ACgPFk8lSK7V5H6VI17wDUDfkVqc4Abjry XDxg== X-Received: by 10.180.104.42 with SMTP id gb10mr76343wib.65.1409779982394; Wed, 03 Sep 2014 14:33:02 -0700 (PDT) Received: from localhost.localdomain (vno44-1-88-172-188-148.fbx.proxad.net. [88.172.188.148]) by mx.google.com with ESMTPSA id r8sm17347347wjy.20.2014.09.03.14.33.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:33:01 -0700 (PDT) From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= To: U-Boot Date: Wed, 3 Sep 2014 23:32:34 +0200 Message-Id: <1409779954-14542-2-git-send-email-benoit.thebaudeau.dev@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409779954-14542-1-git-send-email-benoit.thebaudeau.dev@gmail.com> References: <1409779954-14542-1-git-send-email-benoit.thebaudeau.dev@gmail.com> MIME-Version: 1.0 Cc: Sudhakar Rajashekhara , Tom Rini , Christian Riesch Subject: [U-Boot] [PATCH 2/2] arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The boards using CONFIG_SYS_DV_NOR_BOOT_CFG (i.e. calimain, da850evm_direct_nor and enbw_cmc) had the _start symbol defined after the CONFIG_SYS_DV_NOR_BOOT_CFG word rather than before it in arch/arm/lib/vectors.S. Because of that, if by lack of luck 'gd->mon_len = (ulong)&__bss_end - (ulong)_start' (see setup_mon_len()) was a multiple of 4 kiB (see reserve_uboot()), then the last BSS word overlapped the first word of the following reserved RAM area (or went beyond the top of RAM without such an area) after relocation because __image_copy_start did not match _start (see relocate_code()). This was broken by commit 41623c9 'arm: move exception handling out of start.S files', which defined _start twice (before and after the CONFIG_SYS_DV_NOR_BOOT_CFG word), then by commit 0a26e1d 'arm: fix a double-definition error of _start symbol', which kept the definition of the _start symbol after the CONFIG_SYS_DV_NOR_BOOT_CFG word. This new commit fixes this issue by restoring the original behavior, i.e. by defining the _start symbol before the CONFIG_SYS_DV_NOR_BOOT_CFG word. Signed-off-by: Benoît Thébaudeau Cc: Albert Aribaud Cc: Manfred Rudigier Cc: Christian Riesch Cc: Sudhakar Rajashekhara Cc: Heiko Schocher --- arch/arm/lib/vectors.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S index 843b18f..0cb87ce 100644 --- a/arch/arm/lib/vectors.S +++ b/arch/arm/lib/vectors.S @@ -45,11 +45,12 @@ ************************************************************************* */ +_start: + #ifdef CONFIG_SYS_DV_NOR_BOOT_CFG .word CONFIG_SYS_DV_NOR_BOOT_CFG #endif -_start: b reset ldr pc, _undefined_instruction ldr pc, _software_interrupt