[U-Boot] [PATCH 3/6] Env and lds file clean up for ColdFire M5445x and M547x/8x boards.

Jason Jin Jason.jin at freescale.com
Tue Apr 12 10:40:07 CEST 2011


Move the environment outside the u-boot image, leave more
 space for the text to avoid the possible PC truncate issue.

 The lds file for ColdFire need to clean up since commit
 6d8962e814c15807dd6ac5757904be2a02d187b8 'Switch from archive
 libraries to partial linking'.

Signed-off-by: Jason Jin <Jason.jin at freescale.com>
---
 board/freescale/m54451evb/u-boot.spa |   10 ----------
 board/freescale/m54451evb/u-boot.stm |   13 -------------
 board/freescale/m54455evb/u-boot.atm |    7 -------
 board/freescale/m54455evb/u-boot.int |    4 ----
 board/freescale/m547xevb/u-boot.lds  |    6 ------
 board/freescale/m548xevb/u-boot.lds  |    6 ------
 include/configs/M54451EVB.h          |    9 +++++----
 include/configs/M54455EVB.h          |   10 ++++++----
 include/configs/M5475EVB.h           |    9 +++++----
 include/configs/M5485EVB.h           |    9 +++++----
 10 files changed, 21 insertions(+), 62 deletions(-)

diff --git a/board/freescale/m54451evb/u-boot.spa b/board/freescale/m54451evb/u-boot.spa
index e1bacd3..03d8e52 100644
--- a/board/freescale/m54451evb/u-boot.spa
+++ b/board/freescale/m54451evb/u-boot.spa
@@ -56,16 +56,6 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf5445x/start.o		(.text)
-    arch/m68k/cpu/mcf5445x/libmcf5445x.o	(.text)
-    arch/m68k/lib/libm68k.o		(.text)
-    common/cmd_flash.o		(.text)
-    common/dlmalloc.o		(.text)
-    common/main.o		(.text)
-    common/image.o		(.text)
-    lib/libgeneric.o	(.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o	(.text)
 
     *(.text)
     *(.fixup)
diff --git a/board/freescale/m54451evb/u-boot.stm b/board/freescale/m54451evb/u-boot.stm
index 1c6979f..46773d0 100644
--- a/board/freescale/m54451evb/u-boot.stm
+++ b/board/freescale/m54451evb/u-boot.stm
@@ -56,20 +56,7 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf5445x/start.o		(.text)
-/*    arch/m68k/cpu/mcf5445x/cpu_init.o		(.text)
-    arch/m68k/cpu/mcf5445x/cpu.o			(.text)
-    arch/m68k/cpu/mcf5445x/dspi.o			(.text)
-    arch/m68k/cpu/mcf5445x/interrupt.o		(.text)
-    arch/m68k/cpu/mcf5445x/speed.o		(.text)
-    arch/m68k/lib/board.o			(.text)
-    common/serial.o			(.text)
-    common/console.o			(.text)
-    lib/display_options.o	(.text)
-    board/freescale/m54455evb/m54455evb.o	(.text)
 
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o	(.text)
-*/
     *(.text)
     *(.fixup)
     *(.got1)
diff --git a/board/freescale/m54455evb/u-boot.atm b/board/freescale/m54455evb/u-boot.atm
index cf4650e..03d8e52 100644
--- a/board/freescale/m54455evb/u-boot.atm
+++ b/board/freescale/m54455evb/u-boot.atm
@@ -56,13 +56,6 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf5445x/start.o		(.text)
-    arch/m68k/lib/traps.o		(.text)
-    arch/m68k/lib/interrupts.o	(.text)
-    common/dlmalloc.o		(.text)
-    lib/zlib.o		(.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o	(.text)
 
     *(.text)
     *(.fixup)
diff --git a/board/freescale/m54455evb/u-boot.int b/board/freescale/m54455evb/u-boot.int
index 79e64a2..03d8e52 100644
--- a/board/freescale/m54455evb/u-boot.int
+++ b/board/freescale/m54455evb/u-boot.int
@@ -56,10 +56,6 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf5445x/start.o		(.text)
-    arch/m68k/lib/traps.o		(.text)
-    arch/m68k/lib/interrupts.o	(.text)
-    common/dlmalloc.o		(.text)
-    lib/zlib.o		(.text)
 
     *(.text)
     *(.fixup)
diff --git a/board/freescale/m547xevb/u-boot.lds b/board/freescale/m547xevb/u-boot.lds
index a4e4d5a..a5b1c1a 100644
--- a/board/freescale/m547xevb/u-boot.lds
+++ b/board/freescale/m547xevb/u-boot.lds
@@ -56,12 +56,6 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf547x_8x/start.o		(.text)
-    arch/m68k/lib/traps.o		(.text)
-    arch/m68k/lib/interrupts.o	(.text)
-    common/dlmalloc.o		(.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o	(.text)
 
     *(.text)
     *(.fixup)
diff --git a/board/freescale/m548xevb/u-boot.lds b/board/freescale/m548xevb/u-boot.lds
index a4e4d5a..a5b1c1a 100644
--- a/board/freescale/m548xevb/u-boot.lds
+++ b/board/freescale/m548xevb/u-boot.lds
@@ -56,12 +56,6 @@ SECTIONS
     /* the sector layout of our flash chips!	XXX FIXME XXX	*/
 
     arch/m68k/cpu/mcf547x_8x/start.o		(.text)
-    arch/m68k/lib/traps.o		(.text)
-    arch/m68k/lib/interrupts.o	(.text)
-    common/dlmalloc.o		(.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/env_embedded.o	(.text)
 
     *(.text)
     *(.fixup)
diff --git a/include/configs/M54451EVB.h b/include/configs/M54451EVB.h
index 37715c5..12405d3 100644
--- a/include/configs/M54451EVB.h
+++ b/include/configs/M54451EVB.h
@@ -250,7 +250,7 @@
 #endif
 #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
+#define CONFIG_SYS_MALLOC_LEN		(256 << 10)	/* Reserve 256 kB for malloc() */
 
 /*
  * For booting Linux, the board info and command line data
@@ -261,7 +261,8 @@
 #define CONFIG_SYS_BOOTMAPSZ		(CONFIG_SYS_SDRAM_BASE + (CONFIG_SYS_SDRAM_SIZE << 20))
 
 /* Configuration for environment
- * Environment is embedded in u-boot in the second sector of the flash
+ * Environment is not embedded in u-boot. First time runing may have env crc error warnig
+ * if there are no correct environment on the flash.
  */
 #if defined(CONFIG_SYS_STMICRO_BOOT)
 #	define CONFIG_ENV_IS_IN_SPI_FLASH	1
@@ -271,9 +272,9 @@
 #	define CONFIG_ENV_SECT_SIZE	0x10000
 #else
 #	define CONFIG_ENV_IS_IN_FLASH	1
-#	define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0x8000)
+#	define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0x40000)
 #	define CONFIG_ENV_SIZE		0x2000
-#	define CONFIG_ENV_SECT_SIZE	0x8000
+#	define CONFIG_ENV_SECT_SIZE	0x20000
 #endif
 #undef CONFIG_ENV_OVERWRITE
 
diff --git a/include/configs/M54455EVB.h b/include/configs/M54455EVB.h
index 86faa3d..46d99a8 100644
--- a/include/configs/M54455EVB.h
+++ b/include/configs/M54455EVB.h
@@ -310,7 +310,7 @@
 #endif
 #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
-#define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
+#define CONFIG_SYS_MALLOC_LEN		(256 << 10)	/* Reserve 256 kB for malloc() */
 
 /*
  * For booting Linux, the board info and command line data
@@ -322,7 +322,8 @@
 
 /*
  * Configuration for environment
- * Environment is embedded in u-boot in the second sector of the flash
+ * Environment is not embedded in u-boot. First time runing may have env crc error warnig
+ * if there are no correct environment on the flash.
  */
 #ifdef CONFIG_CF_SBF
 #	define CONFIG_ENV_IS_IN_SPI_FLASH
@@ -346,8 +347,9 @@
 #	define CONFIG_SYS_FLASH_BASE		CONFIG_SYS_CS0_BASE
 #	define CONFIG_SYS_FLASH0_BASE		CONFIG_SYS_CS0_BASE
 #	define CONFIG_SYS_FLASH1_BASE		CONFIG_SYS_CS1_BASE
-#	define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0x4000)
-#	define CONFIG_ENV_SECT_SIZE	0x2000
+#	define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0x40000)
+#	define CONFIG_ENV_SIZE		0x2000
+#	define CONFIG_ENV_SECT_SIZE	0x10000
 #endif
 #ifdef CONFIG_SYS_INTEL_BOOT
 #	define CONFIG_SYS_FLASH_BASE		CONFIG_SYS_CS0_BASE
diff --git a/include/configs/M5475EVB.h b/include/configs/M5475EVB.h
index 5f6eb55..57134e6 100644
--- a/include/configs/M5475EVB.h
+++ b/include/configs/M5475EVB.h
@@ -243,7 +243,7 @@
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
 
 #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
-#define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
+#define CONFIG_SYS_MALLOC_LEN		(256 << 10)	/* Reserve 256 kB for malloc() */
 
 /*
  * For booting Linux, the board info and command line data
@@ -274,10 +274,11 @@
 #endif
 
 /* Configuration for environment
- * Environment is embedded in u-boot in the second sector of the flash
+ * Environment is not embedded in u-boot but at offset 0x40000 on the flash.
+ * First time runing may have env crc error warnig if there are no correct environment on the flash.
  */
-#define CONFIG_ENV_OFFSET		0x2000
-#define CONFIG_ENV_SECT_SIZE	0x2000
+#define CONFIG_ENV_OFFSET		0x40000
+#define CONFIG_ENV_SECT_SIZE	0x10000
 #define CONFIG_ENV_IS_IN_FLASH	1
 
 /*-----------------------------------------------------------------------
diff --git a/include/configs/M5485EVB.h b/include/configs/M5485EVB.h
index e178e35..ea4c129 100644
--- a/include/configs/M5485EVB.h
+++ b/include/configs/M5485EVB.h
@@ -229,7 +229,7 @@
 #define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor */
 
 #define CONFIG_SYS_BOOTPARAMS_LEN	64*1024
-#define CONFIG_SYS_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc() */
+#define CONFIG_SYS_MALLOC_LEN		(256 << 10)	/* Reserve 256 kB for malloc() */
 
 /*
  * For booting Linux, the board info and command line data
@@ -260,10 +260,11 @@
 #endif
 
 /* Configuration for environment
- * Environment is embedded in u-boot in the second sector of the flash
+ * Environment is not embedded in u-boot. First time runing may have env crc error warnig
+ * if there are no correct environment on the flash.
  */
-#define CONFIG_ENV_OFFSET		0x2000
-#define CONFIG_ENV_SECT_SIZE	0x2000
+#define CONFIG_ENV_OFFSET		0x40000
+#define CONFIG_ENV_SECT_SIZE	0x10000
 #define CONFIG_ENV_IS_IN_FLASH	1
 
 /*-----------------------------------------------------------------------
-- 
1.6.4




More information about the U-Boot mailing list