From patchwork Wed Sep 3 21:32:33 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: 385670 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 7920D1401EF for ; Thu, 4 Sep 2014 07:41:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C02ABA76D9; Wed, 3 Sep 2014 23:41:07 +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 cp6ZlR-FyIG9; Wed, 3 Sep 2014 23:41:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8F88A76A7; Wed, 3 Sep 2014 23:41:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4CE64A76A7 for ; Wed, 3 Sep 2014 23:41:00 +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 eROorgIiE-Jx for ; Wed, 3 Sep 2014 23:40:57 +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-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by theia.denx.de (Postfix) with ESMTPS id 4325EA7493 for ; Wed, 3 Sep 2014 23:40:52 +0200 (CEST) Received: by mail-wg0-f46.google.com with SMTP id x13so9149544wgg.29 for ; Wed, 03 Sep 2014 14:40:52 -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:mime-version:content-type :content-transfer-encoding; bh=gmDAG2pTdLSR1fS4wGD6JIvHc7FY+Czhg4X8DxLf0E4=; b=l1tZCT/TsluCIarqQZGfA4OhPPMVsGTXS6PrXGtdHVf5mZNUGhkc6lUHo7GXWM6FVz Kt17OYHaAKGfMXR8DaqcnXQfNOYYzI2Zr0F3N1hKSxWlxVmSBxCCMDvcuAcGHnBn4Gq+ WsbV9MOdH/RmxDeC0bAgUSNxfGPZk+LVWnrzqBvrPAD3/Jkq4C5nfFP4t5xC88cLQ3NJ Hc9HcJm2HnF//syiQ2hM049eGHV+4q2sSg9vd6Q6mo7TOlbxc3WcXBLTPenTh+Wk7c8n uKekH8uEplQjd3jj2kovRIN/XJp1ZqLWtGPfE/A0BKGRv4lnPhGDShN0WplW9KDHKsQn rXTg== X-Received: by 10.180.102.130 with SMTP id fo2mr153447wib.29.1409779980675; Wed, 03 Sep 2014 14:33:00 -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.32.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Sep 2014 14:33:00 -0700 (PDT) From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= To: U-Boot Date: Wed, 3 Sep 2014 23:32:33 +0200 Message-Id: <1409779954-14542-1-git-send-email-benoit.thebaudeau.dev@gmail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Cc: Tom Rini , Magnus Lilja , John Rigby Subject: [U-Boot] [PATCH 1/2] arm: Make reset position-independent 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 Some boards, like mx31pdk and tx25, require the beginning of the SPL code to be position-independent. For these two boards, this is because they use the i.MX external NAND boot, which starts by executing the first NAND Flash page from the NFC page buffer. The SPL then needs to copy itself to its actual link address in order to free the NFC page buffer and use it to load the non-SPL image from Flash before running it. This means that the SPL runtime address differs from its link address between the reset and the initial copy performed by board_init_f(), so this part of the SPL binary must be position-independent. This requirement was broken by commit 41623c9 'arm: move exception handling out of start.S files', which used an absolute address to branch to the reset routine. This new commit restores the original behavior, which just performed a relative branch. This fixes the boot of mx31pdk and tx25. Signed-off-by: Benoît Thébaudeau Reported-by: Helmut Raiger Cc: Albert Aribaud Cc: Magnus Lilja Cc: John Rigby Tested-by: Magnus Lilja --- arch/arm/lib/vectors.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S index 493f337..843b18f 100644 --- a/arch/arm/lib/vectors.S +++ b/arch/arm/lib/vectors.S @@ -50,7 +50,7 @@ #endif _start: - ldr pc, _reset + b reset ldr pc, _undefined_instruction ldr pc, _software_interrupt ldr pc, _prefetch_abort @@ -77,7 +77,6 @@ _start: .globl _irq .globl _fiq -_reset: .word reset _undefined_instruction: .word undefined_instruction _software_interrupt: .word software_interrupt _prefetch_abort: .word prefetch_abort