From patchwork Sat Jan 12 21:39:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?xYF1a2FzeiBEYcWCZWs=?= X-Patchwork-Id: 211568 X-Patchwork-Delegate: trini@ti.com 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 EBF422C0101 for ; Sun, 13 Jan 2013 09:11:13 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA78D4A164; Sat, 12 Jan 2013 23:11:01 +0100 (CET) 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 yZQSK4zikS0c; Sat, 12 Jan 2013 23:11:01 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5A76D4A100; Sat, 12 Jan 2013 23:10:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A01ED4A105 for ; Sat, 12 Jan 2013 23:10:00 +0100 (CET) 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 TyyhYde2h6rl for ; Sat, 12 Jan 2013 23:10:00 +0100 (CET) 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-ee0-f42.google.com (mail-ee0-f42.google.com [74.125.83.42]) by theia.denx.de (Postfix) with ESMTPS id AF6FD4A092 for ; Sat, 12 Jan 2013 23:09:42 +0100 (CET) Received: by mail-ee0-f42.google.com with SMTP id b47so984043eek.1 for ; Sat, 12 Jan 2013 14:09:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Vf24OPNhi/h+eHYroheQ3sck29ceH3BtH2Pw3Z3yKug=; b=vE6jCavek4oVKucLFM/lc2eKTxZQfJFx6yOyPAYdpQUxB0QWS3LNB+n4yUtaGSPtqC LS+9tiwyJW/Uu+8TFMDcPYAPR8CgqOtnyBAv93/BV137plKxhlfEO/2JcOtwG10exUHT iZWi4dDQuirsKpEAx6J7L8BM/BCBbLjtg3GXrO9pSzXyrjkqVgXYrhlQfxuVkDT4ND4c /7g40II0ilERozyKINywyzmMQH1RcepU/tkUq4yreGMCph37H7EW7MP+dZvHiZnwrF+1 fvSCCjKYMb7x8OmCsmK8mFCV/bp2IheK9wkKgHERSRhfntdfAJo6iGL4BOKwsu1NfC+F 0haA== X-Received: by 10.14.176.66 with SMTP id a42mr213914512eem.34.1358026801713; Sat, 12 Jan 2013 13:40:01 -0800 (PST) Received: from mover.dalas.net (riviera.nat.student.pw.edu.pl. [194.29.137.1]) by mx.google.com with ESMTPS id b2sm14489530eep.9.2013.01.12.13.40.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jan 2013 13:40:01 -0800 (PST) From: Lukasz Dalek To: u-boot@lists.denx.de Date: Sat, 12 Jan 2013 22:39:27 +0100 Message-Id: <1358026767-28130-3-git-send-email-luk0104@gmail.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1358026767-28130-1-git-send-email-luk0104@gmail.com> References: <1358026767-28130-1-git-send-email-luk0104@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [PATCH 3/3] pxa: Save lr register in relocate_code function 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 When u-boot is compiled for PXA25x processor, pxa/start.S is calling cpu_init_crit by BL instruction. BL is overwriting lr register so relocate_code is going into infinite loop. This patch preservs lr register in r12 before calling cpu_init_crit and after function returns restores it. Signed-off-by: Lukasz Dalek Acked-by: Marek Vasut --- arch/arm/cpu/pxa/start.S | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S index 72af869..e71803e 100644 --- a/arch/arm/cpu/pxa/start.S +++ b/arch/arm/cpu/pxa/start.S @@ -183,7 +183,9 @@ relocate_code: /* Disable the Dcache RAM lock for stack now */ #ifdef CONFIG_CPU_PXA25X + mov r12, lr bl cpu_init_crit + mov lr, r12 #endif adr r0, _start