Commit 0a9e4e772123fe3e2bb499d7d2160c4cfd8a3a8d

Authored by Mike Frysinger
Committed by Wolfgang Denk
1 parent 02c9aa1d41

unify {CONFIG_,}ENV_IS_EMBEDDED

Some boards have fallen out of sync by defining CONFIG_ENV_IS_EMBEDDED
manually.  While it is useful to have this available to the build system,
let's do it automatically rather than forcing people to opt into it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>

Showing 14 changed files with 28 additions and 19 deletions Side-by-side Diff

include/configs/M52277EVB.h
... ... @@ -255,7 +255,6 @@
255 255 # define CONFIG_ENV_IS_IN_FLASH 1
256 256 #endif
257 257 #define CONFIG_ENV_OVERWRITE 1
258   -#undef CONFIG_ENV_IS_EMBEDDED
259 258  
260 259 /*-----------------------------------------------------------------------
261 260 * FLASH organization
include/configs/M5235EVB.h
... ... @@ -222,7 +222,6 @@
222 222 * Environment is embedded in u-boot in the second sector of the flash
223 223 */
224 224 #define CONFIG_ENV_IS_IN_FLASH 1
225   -#define CONFIG_ENV_IS_EMBEDDED 1
226 225 #ifdef NORFLASH_PS32BIT
227 226 # define CONFIG_ENV_OFFSET (0x8000)
228 227 # define CONFIG_ENV_SIZE 0x4000
include/configs/M5272C3.h
... ... @@ -55,7 +55,6 @@
55 55 #define CONFIG_ENV_OFFSET 0x4000
56 56 #define CONFIG_ENV_SECT_SIZE 0x2000
57 57 #define CONFIG_ENV_IS_IN_FLASH 1
58   -#define CONFIG_ENV_IS_EMBEDDED 1
59 58 #else
60 59 #define CONFIG_ENV_ADDR 0xffe04000
61 60 #define CONFIG_ENV_SECT_SIZE 0x2000
include/configs/M5275EVB.h
... ... @@ -55,7 +55,6 @@
55 55 #define CONFIG_ENV_OFFSET 0x4000
56 56 #define CONFIG_ENV_SECT_SIZE 0x2000
57 57 #define CONFIG_ENV_IS_IN_FLASH 1
58   -#define CONFIG_ENV_IS_EMBEDDED 1
59 58 #else
60 59 #define CONFIG_ENV_ADDR 0xffe04000
61 60 #define CONFIG_ENV_SECT_SIZE 0x2000
include/configs/M5329EVB.h
... ... @@ -231,7 +231,6 @@
231 231 #define CONFIG_ENV_OFFSET 0x4000
232 232 #define CONFIG_ENV_SECT_SIZE 0x2000
233 233 #define CONFIG_ENV_IS_IN_FLASH 1
234   -#define CONFIG_ENV_IS_EMBEDDED 1
235 234  
236 235 /*-----------------------------------------------------------------------
237 236 * Cache Configuration
include/configs/M5373EVB.h
... ... @@ -231,7 +231,6 @@
231 231 #define CONFIG_ENV_OFFSET 0x4000
232 232 #define CONFIG_ENV_SECT_SIZE 0x2000
233 233 #define CONFIG_ENV_IS_IN_FLASH 1
234   -#define CONFIG_ENV_IS_EMBEDDED 1
235 234  
236 235 /*-----------------------------------------------------------------------
237 236 * Cache Configuration
include/configs/M54451EVB.h
... ... @@ -277,7 +277,6 @@
277 277 # define CONFIG_ENV_SECT_SIZE 0x8000
278 278 #endif
279 279 #undef CONFIG_ENV_OVERWRITE
280   -#undef CONFIG_ENV_IS_EMBEDDED
281 280  
282 281 /* FLASH organization */
283 282 #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_CS0_BASE
include/configs/M54455EVB.h
... ... @@ -332,7 +332,6 @@
332 332 # define CONFIG_ENV_IS_IN_FLASH 1
333 333 #endif
334 334 #undef CONFIG_ENV_OVERWRITE
335   -#undef CONFIG_ENV_IS_EMBEDDED
336 335  
337 336 /*-----------------------------------------------------------------------
338 337 * FLASH organization
include/configs/M5475EVB.h
... ... @@ -280,7 +280,6 @@
280 280 #define CONFIG_ENV_OFFSET 0x2000
281 281 #define CONFIG_ENV_SECT_SIZE 0x2000
282 282 #define CONFIG_ENV_IS_IN_FLASH 1
283   -#define CONFIG_ENV_IS_EMBEDDED 1
284 283  
285 284 /*-----------------------------------------------------------------------
286 285 * Cache Configuration
include/configs/M5485EVB.h
... ... @@ -266,7 +266,6 @@
266 266 #define CONFIG_ENV_OFFSET 0x2000
267 267 #define CONFIG_ENV_SECT_SIZE 0x2000
268 268 #define CONFIG_ENV_IS_IN_FLASH 1
269   -#define CONFIG_ENV_IS_EMBEDDED 1
270 269  
271 270 /*-----------------------------------------------------------------------
272 271 * Cache Configuration
include/configs/OXC.h
... ... @@ -196,7 +196,6 @@
196 196 #define CONFIG_ENV_IS_IN_FLASH 1
197 197 #define CONFIG_ENV_ADDR 0xFFF30000 /* Offset of Environment Sector */
198 198 #define CONFIG_ENV_SIZE 0x00010000 /* Total Size of Environment Sector */
199   -#define CONFIG_ENV_IS_EMBEDDED 1 /* short-cut compile-time test */
200 199 #define CONFIG_ENV_OVERWRITE 1 /* Allow modifying the environment */
201 200  
202 201 /*
include/configs/cobra5272.h
... ... @@ -127,7 +127,6 @@
127 127 #define CONFIG_ENV_OFFSET 0x4000
128 128 #define CONFIG_ENV_SECT_SIZE 0x2000
129 129 #define CONFIG_ENV_IS_IN_FLASH 1
130   -#define CONFIG_ENV_IS_EMBEDDED 1
131 130 #else
132 131 #define CONFIG_ENV_ADDR 0xffe04000
133 132 #define CONFIG_ENV_SECT_SIZE 0x2000
include/configs/pcu_e.h
... ... @@ -231,7 +231,6 @@
231 231 #define CONFIG_ENV_SIZE 0x2000 /* Total Size of Environment */
232 232 #define CONFIG_ENV_ADDR 0xFFFFE000 /* Address of Environment Sector */
233 233 #define CONFIG_ENV_SECT_SIZE 0x2000 /* use the top-most 8k boot sector */
234   -#define CONFIG_ENV_IS_EMBEDDED 1 /* short-cut compile-time test */
235 234 #else
236 235 /* Final version: environment in EEPROM */
237 236 #define CONFIG_ENV_IS_IN_EEPROM 1
include/environment.h
... ... @@ -67,6 +67,10 @@
67 67 # if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
68 68 # define CONFIG_SYS_REDUNDAND_ENVIRONMENT 1
69 69 # endif
  70 +# ifdef CONFIG_ENV_IS_EMBEDDED
  71 +# error "do not define CONFIG_ENV_IS_EMBEDDED in your board config"
  72 +# error "it is calculated automatically for you"
  73 +# endif
70 74 #endif /* CONFIG_ENV_IS_IN_FLASH */
71 75  
72 76 #if defined(CONFIG_ENV_IS_IN_NAND)
... ... @@ -79,9 +83,6 @@
79 83 # ifdef CONFIG_ENV_OFFSET_REDUND
80 84 # define CONFIG_SYS_REDUNDAND_ENVIRONMENT
81 85 # endif
82   -# ifdef CONFIG_ENV_IS_EMBEDDED
83   -# define ENV_IS_EMBEDDED 1
84   -# endif
85 86 #endif /* CONFIG_ENV_IS_IN_NAND */
86 87  
87 88 #if defined(CONFIG_ENV_IS_IN_MG_DISK)
88 89  
... ... @@ -91,10 +92,31 @@
91 92 # ifndef CONFIG_ENV_SIZE
92 93 # error "Need to define CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_MG_DISK"
93 94 # endif
94   -# ifdef CONFIG_ENV_IS_EMBEDDED
95   -# error "CONFIG_ENV_IS_EMBEDDED not supported when using CONFIG_ENV_IS_IN_MG_DISK"
96   -# endif
97 95 #endif /* CONFIG_ENV_IS_IN_MG_DISK */
  96 +
  97 +/* Embedded env is only supported for some flash types */
  98 +#ifdef CONFIG_ENV_IS_EMBEDDED
  99 +# if !defined(CONFIG_ENV_IS_IN_FLASH) && \
  100 + !defined(CONFIG_ENV_IS_IN_NAND) && \
  101 + !defined(CONFIG_ENV_IS_IN_ONENAND)
  102 +# error "CONFIG_ENV_IS_EMBEDDED not supported for your flash type"
  103 +# endif
  104 +#endif
  105 +
  106 +/*
  107 + * For the flash types where embedded env is supported, but it cannot be
  108 + * calculated automatically (i.e. NAND), take the board opt-in.
  109 + */
  110 +#if defined(CONFIG_ENV_IS_EMBEDDED) && !defined(ENV_IS_EMBEDDED)
  111 +# define ENV_IS_EMBEDDED 1
  112 +#endif
  113 +
  114 +/* The build system likes to know if the env is embedded */
  115 +#ifdef DO_DEPS_ONLY
  116 +# ifdef ENV_IS_EMBEDDED
  117 +# define CONFIG_ENV_IS_EMBEDDED
  118 +# endif
  119 +#endif
98 120  
99 121 #include "compiler.h"
100 122