Commit dec96689 authored by Albert ARIBAUD's avatar Albert ARIBAUD Committed by Tom Rini
Browse files

arm: armv7: omap3: Fix restore sequence in lowlevel_init

The restore sequence in lowlevel_init was in the wrong order,
causing lr to lose its original value and be set equal to ip
instead. Also, its use of the stack clashes with that of
s_init, so move the s_init call after the restore and turn
it  into a tail-optimized branch.
Signed-off-by: default avatarAlbert ARIBAUD <>
Tested-by: default avatarJeroen Hofstee <>
parent 8cc64baf
......@@ -214,7 +214,7 @@ pll_div_val5:
ldr sp, SRAM_STACK
str ip, [sp] /* stash old link register */
str ip, [sp] /* stash ip register */
mov ip, lr /* save link reg across call */
......@@ -224,12 +224,11 @@ ENTRY(lowlevel_init)
ldr r1, =SRAM_CLK_CODE
bl cpy_clk_code
#endif /* NAND Boot */
bl s_init /* go setup pll, mux, memory */
ldr ip, [sp] /* restore save ip */
mov lr, ip /* restore link reg */
ldr ip, [sp] /* restore save ip */
/* tail-call s_init to setup pll, mux, memory */
b s_init
/* back to arch calling code */
mov pc, lr
/* the literal pools origin */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment