[U-Boot] [PATCH 4/6] AVR32: Enable relocation of code for at32uc3

Gunnar Rangoy gunnar at rangoy.com
Thu Nov 13 16:25:10 CET 2008


Since we now have working SRAM, we can relocate the code to SRAM.

Signed-off-by: Gunnar Rangoy <gunnar at rangoy.com>
Signed-off-by: Paul Driveklepp <pauldriveklepp at gmail.com>
Signed-off-by: Olav Morken <olavmrk at gmail.com>
---
 board/atmel/atevk1100/u-boot.lds |    2 --
 cpu/at32uc/start.S               |   15 +--------------
 lib_avr32/board.c                |    5 -----
 3 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/board/atmel/atevk1100/u-boot.lds b/board/atmel/atevk1100/u-boot.lds
index 3c20979..1c09641 100644
--- a/board/atmel/atevk1100/u-boot.lds
+++ b/board/atmel/atevk1100/u-boot.lds
@@ -40,8 +40,6 @@ SECTIONS
 		*(.rodata.*)
 	}
 
-	_end_noreloc = .;
-
 	. = ALIGN(8);
 	_data = .;
 	.data : {
diff --git a/cpu/at32uc/start.S b/cpu/at32uc/start.S
index e1d44cb..a8798af 100644
--- a/cpu/at32uc/start.S
+++ b/cpu/at32uc/start.S
@@ -216,44 +216,31 @@ relocate_code:
 	brgt	1b
 
 	/* jump to RAM */
-	/* we don't want to run from sdram.
 	sub	r0, pc, . - in_ram
 	add	pc, r0, lr
-	*/
 
 	.align	2
 in_ram:
 	/* find the new GOT and relocate it */
 	lddpc	r6, got_init_reloc
 3:	rsub	r6, pc
-	add	r6, lr
 	mov	r8, r6
 	lda.w	r9, _egot
 	lda.w	r10, _got
 	sub	r9, r10
 
-	lda.w	r1, _end_noreloc
-
 1:	ld.w	r0, r8[0]
-	/* Check if the symbol points to the text-section, and
-	 * skip relocation if they do.
-	 */
-	cp.w	r0, r1
-	brlt	2f
-
 	add	r0, lr
 	st.w	r8, r0
-2:
+
 	sub	r8, -4
 	sub	r9, 4
 	brgt	1b
 
 	/* Move the exception handlers */
-	/* We don't want to run from sdram.
 	mfsr	r2, SYSREG_EVBA
 	add	r2, lr
 	mtsr	SYSREG_EVBA, r2
-	*/
 
 	/* Do the rest of the initialization sequence */
 	call	board_init_r
diff --git a/lib_avr32/board.c b/lib_avr32/board.c
index 6afa8bd..216ff74 100644
--- a/lib_avr32/board.c
+++ b/lib_avr32/board.c
@@ -294,13 +294,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	     cmdtp !=  &__u_boot_cmd_end; cmdtp++) {
 		unsigned long addr;
 
-		/* We don't relocate code in the at32uc3a0xxx cpu yet due to
-		 * SDRAM bug. See errata 41.4.6.1.
-		 */
-#ifndef CONFIG_AT32UC
 		addr = (unsigned long)cmdtp->cmd + gd->reloc_off;
 		cmdtp->cmd = (typeof(cmdtp->cmd))addr;
-#endif
 
 		addr = (unsigned long)cmdtp->name + gd->reloc_off;
 		cmdtp->name = (typeof(cmdtp->name))addr;
-- 
1.5.6.3



More information about the U-Boot mailing list