[U-Boot] [PATCH 3/3] pxa: Save lr register in relocate_code function

Lukasz Dalek luk0104 at gmail.com
Sat Jan 12 22:39:27 CET 2013


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 <luk0104 at gmail.com>
---
 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
-- 
1.7.8.6



More information about the U-Boot mailing list