Commit f1c574d4006d81301792e70fafc31ff39259e793

Authored by Scott Wood
Committed by Wolfgang Denk
1 parent c56f84ca9c

83xx: Fix NAND_SPL link address

Apply the same fix for 83xx as was done for 85xx in commit
96196a1f7546904563994d2d041804a816d7c139.

Without this, NAND SPLs are built with the text base intended for the main
image, resulting in a broken, very large u-boot-nand.bin.

The block of defines for NAND boot is moved closer to where
CONFIG_SYS_TEXT_BASE is defined.  We can't directly use
CONFIG_SYS_NAND_U_BOOT_DST in the definition of CONFIG_SYS_TEXT_BASE because
autoconf.mk will include the literal text "CONFIG_SYS_NAND_U_BOOT_DST",
but at least keep them close and point out that they're supposed to be
the same.

Signed-off-by: Scott Wood <scottwood@freescale.com>

Showing 6 changed files with 55 additions and 30 deletions Side-by-side Diff

include/configs/MPC8313ERDB.h
... ... @@ -35,10 +35,29 @@
35 35 #define CONFIG_MPC8313 1
36 36 #define CONFIG_MPC8313ERDB 1
37 37  
  38 +#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  39 +#define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
  40 +#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
  41 +#define CONFIG_SYS_NAND_U_BOOT_OFFS 16384
  42 +#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
  43 +#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
  44 +
  45 +#ifdef CONFIG_NAND_U_BOOT
  46 +#define CONFIG_SYS_TEXT_BASE 0x00100000 /* CONFIG_SYS_NAND_U_BOOT_DST */
  47 +#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
  48 +#ifdef CONFIG_NAND_SPL
  49 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
  50 +#endif /* CONFIG_NAND_SPL */
  51 +#endif /* CONFIG_NAND_U_BOOT */
  52 +
38 53 #ifndef CONFIG_SYS_TEXT_BASE
39 54 #define CONFIG_SYS_TEXT_BASE 0xFE000000
40 55 #endif
41 56  
  57 +#ifndef CONFIG_SYS_MONITOR_BASE
  58 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  59 +#endif
  60 +
42 61 #define CONFIG_PCI
43 62 #define CONFIG_FSL_ELBC 1
44 63  
... ... @@ -200,8 +219,6 @@
200 219 #define CONFIG_SYS_FLASH_ERASE_TOUT 60000 /* Flash Erase Timeout (ms) */
201 220 #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (ms) */
202 221  
203   -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
204   -
205 222 #if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE) && !defined(CONFIG_NAND_SPL)
206 223 #define CONFIG_SYS_RAMBOOT
207 224 #endif
... ... @@ -248,12 +265,6 @@
248 265 #define CONFIG_NAND_FSL_ELBC 1
249 266 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
250 267  
251   -#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
252   -#define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
253   -#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
254   -#define CONFIG_SYS_NAND_U_BOOT_OFFS 16384
255   -#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
256   -#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
257 268  
258 269 #define CONFIG_SYS_NAND_BR_PRELIM ( CONFIG_SYS_NAND_BASE \
259 270 | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
include/configs/MPC8315ERDB.h
... ... @@ -25,15 +25,28 @@
25 25 #ifndef __CONFIG_H
26 26 #define __CONFIG_H
27 27  
28   -#ifdef CONFIG_NAND
29   -#define CONFIG_NAND_U_BOOT 1
30   -#define CONFIG_SYS_TEXT_BASE 0x00100000
31   -#endif
  28 +#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  29 +#define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
  30 +#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
  31 +#define CONFIG_SYS_NAND_U_BOOT_OFFS 16384
  32 +#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
32 33  
  34 +#ifdef CONFIG_NAND_U_BOOT
  35 +#define CONFIG_SYS_TEXT_BASE 0x00100000 /* CONFIG_SYS_NAND_U_BOOT_DST */
  36 +#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
  37 +#ifdef CONFIG_NAND_SPL
  38 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
  39 +#endif /* CONFIG_NAND_SPL */
  40 +#endif /* CONFIG_NAND_U_BOOT */
  41 +
33 42 #ifndef CONFIG_SYS_TEXT_BASE
34 43 #define CONFIG_SYS_TEXT_BASE 0xFE000000
35 44 #endif
36 45  
  46 +#ifndef CONFIG_SYS_MONITOR_BASE
  47 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
  48 +#endif
  49 +
37 50 /*
38 51 * High Level Configuration Options
39 52 */
... ... @@ -181,8 +194,6 @@
181 194 /*
182 195 * The reserved memory
183 196 */
184   -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
185   -
186 197 #define CONFIG_SYS_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Mon */
187 198 #define CONFIG_SYS_MALLOC_LEN (512 * 1024) /* Reserved for malloc */
188 199  
include/configs/SIMPC8313.h
... ... @@ -36,8 +36,19 @@
36 36 #define CONFIG_MPC831x 1
37 37 #define CONFIG_MPC8313 1
38 38  
39   -#ifndef CONFIG_SYS_TEXT_BASE
40   -#define CONFIG_SYS_TEXT_BASE 0x00100000
  39 +#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
  40 +#define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
  41 +#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
  42 +#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
  43 +#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
  44 +
  45 +#define CONFIG_SYS_TEXT_BASE 0x00100000 /* CONFIG_SYS_NAND_U_BOOT_DST */
  46 +#define CONFIG_SYS_TEXT_BASE_SPL 0xfff00000
  47 +
  48 +#ifdef CONFIG_NAND_SPL
  49 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE_SPL /* start of monitor */
  50 +#else
  51 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
41 52 #endif
42 53  
43 54 #define CONFIG_PCI
... ... @@ -95,8 +106,6 @@
95 106 */
96 107 #define CONFIG_SYS_NO_FLASH
97 108  
98   -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* start of monitor */
99   -
100 109 #if !defined(CONFIG_NAND_SPL)
101 110 #define CONFIG_SYS_RAMBOOT
102 111 #endif
... ... @@ -137,12 +146,6 @@
137 146 #define CONFIG_MTD_NAND_VERIFY_WRITE
138 147 #define CONFIG_CMD_NAND 1
139 148 #define CONFIG_NAND_FSL_ELBC 1
140   -
141   -#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10)
142   -#define CONFIG_SYS_NAND_U_BOOT_DST 0x00100000
143   -#define CONFIG_SYS_NAND_U_BOOT_START 0x00100100
144   -#define CONFIG_SYS_NAND_U_BOOT_RELOC 0x00010000
145   -#define CONFIG_SYS_NAND_U_BOOT_RELOC_SP (CONFIG_SYS_NAND_U_BOOT_RELOC + 0x10000)
146 149  
147 150 #define CONFIG_SYS_NAND_BR_PRELIM ( CONFIG_SYS_NAND_BASE \
148 151 | (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
nand_spl/board/freescale/mpc8313erdb/Makefile
... ... @@ -23,13 +23,13 @@
23 23 #
24 24  
25 25 NAND_SPL := y
26   -CONFIG_SYS_TEXT_BASE := 0xfff00000
27 26 PAD_TO := 0xfff04000
28 27  
29 28 include $(TOPDIR)/config.mk
30 29  
31 30 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
32   -LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
  31 +LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds \
  32 + -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(PLATFORM_LDFLAGS)
33 33 AFLAGS += -DCONFIG_NAND_SPL
34 34 CFLAGS += -DCONFIG_NAND_SPL
35 35  
nand_spl/board/freescale/mpc8315erdb/Makefile
... ... @@ -23,13 +23,13 @@
23 23 #
24 24  
25 25 NAND_SPL := y
26   -CONFIG_SYS_TEXT_BASE := 0xfff00000
27 26 PAD_TO := 0xfff04000
28 27  
29 28 include $(TOPDIR)/config.mk
30 29  
31 30 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
32   -LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
  31 +LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds \
  32 + -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(PLATFORM_LDFLAGS)
33 33 AFLAGS += -DCONFIG_NAND_SPL
34 34 CFLAGS += -DCONFIG_NAND_SPL
35 35  
nand_spl/board/sheldon/simpc8313/Makefile
... ... @@ -24,12 +24,12 @@
24 24 #
25 25  
26 26 NAND_SPL := y
27   -CONFIG_SYS_TEXT_BASE := 0xfff00000
28 27  
29 28 include $(TOPDIR)/config.mk
30 29  
31 30 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
32   -LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
  31 +LDFLAGS = -Bstatic -T $(nandobj)u-boot.lds \
  32 + -Ttext $(CONFIG_SYS_TEXT_BASE_SPL) $(PLATFORM_LDFLAGS)
33 33 AFLAGS += -DCONFIG_NAND_SPL
34 34 CFLAGS += -DCONFIG_NAND_SPL
35 35