[U-Boot] [RFC PATCH 6/7] reboard: arm: Move over to generic relocation

Simon Glass sjg at chromium.org
Tue Nov 22 00:57:59 CET 2011


Switch ARM over to generic relocation - unfortunately a few boards need
to be modified to make this work. We rename the relocate_code() function
here so that the existing start.S implementations are still used for now.
The next commit does the actual switch.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/arm/config.mk                          |    3 ---
 board/reloc.c                               |    2 +-
 nand_spl/board/freescale/mx31pdk/Makefile   |    8 +++++++-
 nand_spl/board/freescale/mx31pdk/u-boot.lds |    1 +
 nand_spl/board/karo/tx25/Makefile           |    8 +++++++-
 nand_spl/board/karo/tx25/u-boot.lds         |    1 +
 6 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 31e9ef9..45f9dca 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -33,9 +33,6 @@ endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
-
 # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
 PF_CPPFLAGS_ARM := $(call cc-option,-marm,)
 
diff --git a/board/reloc.c b/board/reloc.c
index abd9c0b..edbeabb 100644
--- a/board/reloc.c
+++ b/board/reloc.c
@@ -87,7 +87,7 @@ static int reloc_elf(void)
 	return 0;
 }
 
-void relocate_code(ulong dest_addr_sp, gd_t *new_gd, ulong dest_addr)
+void new_relocate_code(ulong dest_addr_sp, gd_t *new_gd, ulong dest_addr)
 {
 	reloc_make_copy();
 	reloc_elf();
diff --git a/nand_spl/board/freescale/mx31pdk/Makefile b/nand_spl/board/freescale/mx31pdk/Makefile
index 87784d2..3e858b8 100644
--- a/nand_spl/board/freescale/mx31pdk/Makefile
+++ b/nand_spl/board/freescale/mx31pdk/Makefile
@@ -11,7 +11,7 @@ LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
-SOBJS	= start.o lowlevel_init.o
+SOBJS	= start.o lowlevel_init.o proc.o reloc.o
 COBJS	= nand_boot_fsl_nfc.o
 
 SRCS	:= $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
@@ -50,6 +50,12 @@ $(obj)%.o:	$(SRCTREE)/board/freescale/mx31pdk/%.S
 $(obj)%.o:	$(SRCTREE)/nand_spl/%.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+$(obj)%.o:	$(SRCTREE)/board/%.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(SRCTREE)/arch/arm/lib/%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
diff --git a/nand_spl/board/freescale/mx31pdk/u-boot.lds b/nand_spl/board/freescale/mx31pdk/u-boot.lds
index d2b08f6..2273e9b 100644
--- a/nand_spl/board/freescale/mx31pdk/u-boot.lds
+++ b/nand_spl/board/freescale/mx31pdk/u-boot.lds
@@ -51,6 +51,7 @@ SECTIONS
 	__u_boot_cmd_end = .;
 
 	. = ALIGN(4);
+	__image_copy_end = .;
 
 	.rel.dyn : {
 		__rel_dyn_start = .;
diff --git a/nand_spl/board/karo/tx25/Makefile b/nand_spl/board/karo/tx25/Makefile
index 0336346..5063c06 100644
--- a/nand_spl/board/karo/tx25/Makefile
+++ b/nand_spl/board/karo/tx25/Makefile
@@ -32,7 +32,7 @@ LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
-SOBJS	= start.o lowlevel_init.o
+SOBJS	= start.o lowlevel_init.o proc.o reloc.o
 COBJS	= nand_boot_fsl_nfc.o
 
 SRCS	:= $(SRCTREE)/nand_spl/nand_boot_fsl_nfc.c
@@ -71,6 +71,12 @@ $(obj)%.o:	$(SRCTREE)/board/karo/tx25/%.S
 $(obj)%.o:	$(SRCTREE)/nand_spl/%.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+$(obj)%.o:	$(SRCTREE)/board/%.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(SRCTREE)/arch/arm/lib/%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
diff --git a/nand_spl/board/karo/tx25/u-boot.lds b/nand_spl/board/karo/tx25/u-boot.lds
index d2b08f6..2273e9b 100644
--- a/nand_spl/board/karo/tx25/u-boot.lds
+++ b/nand_spl/board/karo/tx25/u-boot.lds
@@ -51,6 +51,7 @@ SECTIONS
 	__u_boot_cmd_end = .;
 
 	. = ALIGN(4);
+	__image_copy_end = .;
 
 	.rel.dyn : {
 		__rel_dyn_start = .;
-- 
1.7.3.1



More information about the U-Boot mailing list