To move barebox out of QEMU's NOR flash and into RAM, implement
relocate_to_adr_full(), like we already do for ARM64.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
The series adding support for ARM Qemu Virt -bios will make use of this,
but this is already useful for other boards, so sending it out now.
---
 arch/arm/cpu/setupc_32.S | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/setupc_32.S b/arch/arm/cpu/setupc_32.S
index d3449d9646b9..0134637f6296 100644
--- a/arch/arm/cpu/setupc_32.S
+++ b/arch/arm/cpu/setupc_32.S
@@ -43,12 +43,21 @@ ENDPROC(setup_c)
  * executing at new address.
  */
 .section .text.relocate_to_adr
+#ifdef __PBL__
+ENTRY(relocate_to_adr_full)
+       ldr     r2, =__image_end
+       b       1f
+#endif
+
 ENTRY(relocate_to_adr)
-                                       /* r0: target address */
+       ldr     r2, =__bss_start
+       b       1f
+
+1:
        push    {r3, r4, r5, r6, r7, r8}
        mov     r7, lr
 
-       mov     r6, r0
+       mov     r6, r0                  /* r0: target address */
 
        bl      get_runtime_offset
 
@@ -61,8 +70,6 @@ ENTRY(relocate_to_adr)
        cmp     r1, r6                  /* already at correct address? */
        beq     1f                      /* yes, skip copy to new address */
 
-       ldr     r2, =__bss_start
-
        sub     r2, r2, r8              /* r2: size */
        mov     r0, r6                  /* r0: target */
 
-- 
2.47.3


Reply via email to