From patchwork Mon Jun 25 12:40:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuyuki Kobayashi X-Patchwork-Id: 167090 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 EB904101673 for ; Mon, 25 Jun 2012 22:41:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 045942808A; Mon, 25 Jun 2012 14:41: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 FCmU083JR9X6; Mon, 25 Jun 2012 14:41:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E316228080; Mon, 25 Jun 2012 14:41:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D32A028080 for ; Mon, 25 Jun 2012 14:41:10 +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 sefIhBlPKj11 for ; Mon, 25 Jun 2012 14:41:09 +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 vrgw5.firstserver.ne.jp (vrgw5.firstserver.ne.jp [164.46.1.48]) by theia.denx.de (Postfix) with ESMTPS id 939BE2807F for ; Mon, 25 Jun 2012 14:41:06 +0200 (CEST) Received: from fvrsp33.firstserver.ne.jp (fvrsp33.firstserver.ne.jp [203.183.68.3]) by vrgw5.firstserver.ne.jp (8.13.8/8.13.8/FirstServer) with ESMTP id q5PCet6S012285; Mon, 25 Jun 2012 21:40:55 +0900 (envelope-from koba@kmckk.co.jp) Received: from 203.137.25.97 (203.137.25.97) by fvrsp33.firstserver.ne.jp (F-Secure/virusgw_smtp/407/fvrsp33.firstserver.ne.jp); Mon, 25 Jun 2012 21:40:55 +0900 (JST) X-Virus-Status: clean(F-Secure/virusgw_smtp/407/fvrsp33.firstserver.ne.jp) Received: from [192.168.1.110] (58-188-103-12f2.kns1.eonet.ne.jp [58.188.103.12]) (authenticated (0 bits)) by mail.kmckk.co.jp (8.14.3/8.11.3) with ESMTP id q5PCesYk016448; Mon, 25 Jun 2012 21:40:54 +0900 Message-ID: <4FE85C59.1010400@kmckk.co.jp> Date: Mon, 25 Jun 2012 21:40:57 +0900 From: Tetsuyuki Kobayashi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] arm: bugfix: Move vector table before jumping relocated code 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 Interrupts and exceptions doesn't work in relocated code. It badly use IRQ_STACK_START_IN in rom area as interrupt stack. It is because the vecotr table is not moved to ram area. This patch moves vector table before jumping relocated code. Signed-off-by: Tetsuyuki Kobayashi Tested-by: Tom Rini --- arch/arm/cpu/armv7/start.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 52f7f6e..5098f7b 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -277,6 +277,18 @@ jump_2_ram: mcr p15, 0, r0, c7, c10, 4 @ DSB mcr p15, 0, r0, c7, c5, 4 @ ISB #endif +/* + * Move vector table + */ +#if !defined(CONFIG_TEGRA2) +#if !(defined(CONFIG_OMAP44XX) && defined(CONFIG_SPL_BUILD)) + /* Set vector address in CP15 VBAR register */ + ldr r0, =_start + add r0, r0, r9 + mcr p15, 0, r0, c12, c0, 0 @Set VBAR +#endif +#endif /* !Tegra2 */ + ldr r0, _board_init_r_ofs adr r1, _start add lr, r0, r1