Fixup register handling in aarch32 reset_handler
The BL handover interface stores the bootloader arguments in
registers r9-r12, so when the reset_handler stores the lr pointer
in r10 it clobers one of the arguments.
Adapt to use r8 and adapt the comment about registers allowed
to clober.
I've checked aarch32 reset_handlers and none seem to use higher
registers as far as I can tell.
Fixes: a6f340fe58
("Introduce the new BL handover interface")
Cc: Soby Mathew <soby.mathew@arm.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
This commit is contained in:
parent
78d58519de
commit
c6c10b02b8
|
@ -22,9 +22,9 @@
|
||||||
*/
|
*/
|
||||||
.globl reset_handler
|
.globl reset_handler
|
||||||
func reset_handler
|
func reset_handler
|
||||||
mov r10, lr
|
mov r8, lr
|
||||||
|
|
||||||
/* The plat_reset_handler can clobber r0 - r9 */
|
/* The plat_reset_handler can clobber r0 - r7 */
|
||||||
bl plat_reset_handler
|
bl plat_reset_handler
|
||||||
|
|
||||||
/* Get the matching cpu_ops pointer (clobbers: r0 - r5) */
|
/* Get the matching cpu_ops pointer (clobbers: r0 - r5) */
|
||||||
|
@ -38,7 +38,7 @@ func reset_handler
|
||||||
/* Get the cpu_ops reset handler */
|
/* Get the cpu_ops reset handler */
|
||||||
ldr r1, [r0, #CPU_RESET_FUNC]
|
ldr r1, [r0, #CPU_RESET_FUNC]
|
||||||
cmp r1, #0
|
cmp r1, #0
|
||||||
mov lr, r10
|
mov lr, r8
|
||||||
bxne r1
|
bxne r1
|
||||||
bx lr
|
bx lr
|
||||||
endfunc reset_handler
|
endfunc reset_handler
|
||||||
|
|
Loading…
Reference in New Issue