ARM: arm926ejs: fix lowlevel_init call
authorMans Rullgard <mans@mansr.com>
Sat, 21 Apr 2018 15:11:07 +0000 (16:11 +0100)
committerStefano Babic <sbabic@denx.de>
Fri, 27 Apr 2018 07:32:54 +0000 (09:32 +0200)
The code attempts to preserve the value of LR by storing it in R12/IP
across the lowevel_init() call.  However, this register is not saved
by the callee.  Use a register that guaranteed to be preserved instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
arch/arm/cpu/arm926ejs/start.S

index 959d1ed86d8af82c62a1f497aa90c50d3f109318..a6f0bdb70345b503f6698aa3738ee779237e981d 100644 (file)
@@ -105,9 +105,9 @@ flush_dcache:
        /*
         * Go setup Memory and board specific bits prior to relocation.
         */
-       mov     ip, lr          /* perserve link reg across call */
+       mov     r4, lr          /* perserve link reg across call */
        bl      lowlevel_init   /* go setup pll,mux,memory */
-       mov     lr, ip          /* restore link */
+       mov     lr, r4          /* restore link */
 #endif
        mov     pc, lr          /* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */