From 982145e3ae188ba3fcb48bc3d2df7f8dd27136ae Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Mon, 28 Apr 2014 16:19:44 +0800 Subject: ENGR00310794 iMX6 Fix potential plugin bug which wrecks bootROM register The R5 register used plugin code is not saved on stack. If this register is also used in boot ROM, this may cause to destroy the R5 value. Currently, it is a potential problem because the ROM does not use R5 before its calling plug-in. But this is the compiler behavior and not be guaranteed. Signed-off-by: Ye.Li (cherry picked from commit 3a0d342db505bb014e59a275fdddacdc907ea7f9) --- arch/arm/include/asm/arch-mx6/mx6_plugin.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/include/asm/arch-mx6/mx6_plugin.S b/arch/arm/include/asm/arch-mx6/mx6_plugin.S index 79b1bf8..7f37048 100644 --- a/arch/arm/include/asm/arch-mx6/mx6_plugin.S +++ b/arch/arm/include/asm/arch-mx6/mx6_plugin.S @@ -93,6 +93,7 @@ after_calling_rom___pu_irom_hwcnfg_setup: * plugin_download(void **start, size_t *bytes, UINT32 *ivt_offset) */ pop {r0-r4, lr} + push {r5} ldr r5, boot_data2 str r5, [r0] ldr r5, image_len2 @@ -100,6 +101,7 @@ after_calling_rom___pu_irom_hwcnfg_setup: ldr r5, second_ivt_offset str r5, [r2] mov r0, #1 + pop {r5} /* return back to ROM code */ bx lr -- cgit v1.1