]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Revert "ARM: use r9 for gd"
authorMichal Simek <michal.simek@xilinx.com>
Tue, 19 Nov 2013 09:07:03 +0000 (10:07 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 21 Nov 2013 15:26:13 +0000 (16:26 +0100)
This reverts commit fe1378a961e508b31b1f29a2bb08ba1dac063155.

The reason for reverting this patch is that it is breaking
example applications where stub is still using r8
instead of r9. This change wasn't the part of origin patch
and also there is any problem with FreeBSD which our
u-boot also supports.
It is safer to revert this patch for now.

For more information look at:
http://lists.denx.de/pipermail/u-boot/2013-November/167389.html

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/config.mk
arch/arm/cpu/armv7/lowlevel_init.S
arch/arm/include/asm/global_data.h
arch/arm/lib/crt0.S

index bdabcf407e2c7cf783e4e73b05acec2031d2189c..2a1e64d2296d8372614367eb1e8025d33a535a54 100644 (file)
@@ -17,7 +17,7 @@ endif
 
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
-                    -fno-common -ffixed-r9 -msoft-float
+                    -fno-common -ffixed-r8 -msoft-float
 
 # Support generic board on ARM
 __HAVE_ARCH_GENERIC_BOARD := y
index 69e3053a4262e7894c165b417c79aeb4e665845d..82b2b86520eb2b2d63c2478145b625a49f931542 100644 (file)
@@ -22,11 +22,11 @@ ENTRY(lowlevel_init)
        ldr     sp, =CONFIG_SYS_INIT_SP_ADDR
        bic     sp, sp, #7 /* 8-byte alignment for ABI compliance */
 #ifdef CONFIG_SPL_BUILD
-       ldr     r9, =gdata
+       ldr     r8, =gdata
 #else
        sub     sp, #GD_SIZE
        bic     sp, sp, #7
-       mov     r9, sp
+       mov     r8, sp
 #endif
        /*
         * Save the old lr(passed in ip) and the current lr to stack
index e126436093d43ed408af43bf9d0dd54ffb103840..79a959741945968eca7a21018187b97eb65d70f3 100644 (file)
@@ -47,6 +47,6 @@ struct arch_global_data {
 
 #include <asm-generic/global_data.h>
 
-#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r9")
+#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")
 
 #endif /* __ASM_GBL_DATA_H */
index ac54b9359aea3b4954004e1b7805445ff0508b41..960d12e7327cf9d8924496ea6c7b2271bd3f68ad 100644 (file)
@@ -69,7 +69,7 @@ ENTRY(_main)
        bic     sp, sp, #7      /* 8-byte alignment for ABI compliance */
        sub     sp, #GD_SIZE    /* allocate one GD above SP */
        bic     sp, sp, #7      /* 8-byte alignment for ABI compliance */
-       mov     r9, sp          /* GD is above SP */
+       mov     r8, sp          /* GD is above SP */
        mov     r0, #0
        bl      board_init_f
 
@@ -81,15 +81,15 @@ ENTRY(_main)
  * 'here' but relocated.
  */
 
-       ldr     sp, [r9, #GD_START_ADDR_SP]     /* sp = gd->start_addr_sp */
+       ldr     sp, [r8, #GD_START_ADDR_SP]     /* sp = gd->start_addr_sp */
        bic     sp, sp, #7      /* 8-byte alignment for ABI compliance */
-       ldr     r9, [r9, #GD_BD]                /* r9 = gd->bd */
-       sub     r9, r9, #GD_SIZE                /* new GD is below bd */
+       ldr     r8, [r8, #GD_BD]                /* r8 = gd->bd */
+       sub     r8, r8, #GD_SIZE                /* new GD is below bd */
 
        adr     lr, here
-       ldr     r0, [r9, #GD_RELOC_OFF]         /* r0 = gd->reloc_off */
+       ldr     r0, [r8, #GD_RELOC_OFF]         /* r0 = gd->reloc_off */
        add     lr, lr, r0
-       ldr     r0, [r9, #GD_RELOCADDR]         /* r0 = gd->relocaddr */
+       ldr     r0, [r8, #GD_RELOCADDR]         /* r0 = gd->relocaddr */
        b       relocate_code
 here:
 
@@ -111,8 +111,8 @@ clbss_l:cmp r0, r1                  /* while not at end of BSS */
        bl red_led_on
 
        /* call board_init_r(gd_t *id, ulong dest_addr) */
-       mov     r0, r9                  /* gd_t */
-       ldr     r1, [r9, #GD_RELOCADDR] /* dest_addr */
+       mov     r0, r8                  /* gd_t */
+       ldr     r1, [r8, #GD_RELOCADDR] /* dest_addr */
        /* call board_init_r */
        ldr     pc, =board_init_r       /* this is auto-relocated! */