[U-Boot] [RFC][PATCH 05/36] x86 - Paramatize link locations
Graeme Russ
graeme.russ at gmail.com
Mon Jan 3 20:46:25 CET 2011
---
arch/i386/cpu/config.mk | 6 ++++++
arch/i386/cpu/u-boot.lds | 22 +++++++---------------
board/eNET/config.mk | 1 +
3 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/arch/i386/cpu/config.mk b/arch/i386/cpu/config.mk
index 99edacf..83ce73c 100644
--- a/arch/i386/cpu/config.mk
+++ b/arch/i386/cpu/config.mk
@@ -25,3 +25,9 @@ CROSS_COMPILE ?= i386-linux-
PLATFORM_CPPFLAGS += -DCONFIG_I386 -D__I386__
PLATFORM_CPPFLAGS += -march=i386 -Werror
+
+# DO NOT MODIFY THE FOLLOWING UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!
+LDPPFLAGS += -DRESET_SEG_START=0xffff0000
+LDPPFLAGS += -DRESET_SEG_SIZE=0x10000
+LDPPFLAGS += -DRESET_VEC_LOC=0xfff0
+LDPPFLAGS += -DSTART_16=0xf800
diff --git a/arch/i386/cpu/u-boot.lds b/arch/i386/cpu/u-boot.lds
index 3eeb2a2..e712d26 100644
--- a/arch/i386/cpu/u-boot.lds
+++ b/arch/i386/cpu/u-boot.lds
@@ -84,21 +84,13 @@ SECTIONS
__bios_start = LOADADDR(.bios);
__bios_size = SIZEOF(.bios);
- /* The load addresses below assumes that the flash
- * will be mapped so that 0x387f0000 == 0xffff0000
- * at reset time
- *
- * The fe00 and ff00 offsets of the start32 and start16
- * segments are arbitrary, the just have to be mapped
- * at reset and the code have to fit.
- * The fff0 offset of resetvec is important, however.
+ /*
+ * The following expressions place the 16-bit Real-Mode code and
+ * Reset Vector at the end of the Flash ROM
*/
- . = 0xfffffe00;
- .start32 : AT (CONFIG_SYS_TEXT_BASE + 0x3fe00) { KEEP(*(.start32)); }
+ . = START_16;
+ .start16 : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + START_16)) { KEEP(*(.start16)); }
- . = 0xf800;
- .start16 : AT (CONFIG_SYS_TEXT_BASE + 0x3f800) { KEEP(*(.start16)); }
-
- . = 0xfff0;
- .resetvec : AT (CONFIG_SYS_TEXT_BASE + 0x3fff0) { KEEP(*(.resetvec)); }
+ . = RESET_VEC_LOC;
+ .resetvec : AT (CONFIG_SYS_TEXT_BASE + (FLASH_SIZE - RESET_SEG_SIZE + RESET_VEC_LOC)) { KEEP(*(.resetvec)); }
}
diff --git a/board/eNET/config.mk b/board/eNET/config.mk
index 02e4147..4e066b4 100644
--- a/board/eNET/config.mk
+++ b/board/eNET/config.mk
@@ -23,3 +23,4 @@
CONFIG_SYS_TEXT_BASE = 0x06000000
CFLAGS_common/dlmalloc.o += -Wa,--no-warn -fno-strict-aliasing
+LDPPFLAGS += -DFLASH_SIZE=0x40000
--
1.7.1.422.g049e9
More information about the U-Boot
mailing list