]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
unify {CONFIG_,}ENV_IS_EMBEDDED
authorMike Frysinger <vapier@gentoo.org>
Fri, 24 Jul 2009 20:34:32 +0000 (16:34 -0400)
committerWolfgang Denk <wd@denx.de>
Tue, 25 Aug 2009 10:57:54 +0000 (12:57 +0200)
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>
14 files changed:
include/configs/M52277EVB.h
include/configs/M5235EVB.h
include/configs/M5272C3.h
include/configs/M5275EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/M54451EVB.h
include/configs/M54455EVB.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/configs/OXC.h
include/configs/cobra5272.h
include/configs/pcu_e.h
include/environment.h

index e7db0cc108b44f7a0593ffea08460567dceeb141..1801d9d7d588cb3fc0ae0ec0cbdc7979f5975ea2 100644 (file)
 #      define CONFIG_ENV_IS_IN_FLASH   1
 #endif
 #define CONFIG_ENV_OVERWRITE           1
-#undef CONFIG_ENV_IS_EMBEDDED
 
 /*-----------------------------------------------------------------------
  * FLASH organization
index 6b26c0bbc21732b0d63f327289017cbfa058f708..2b816ceae2b94d69b064010026209cd5b167dc48 100644 (file)
  * Environment is embedded in u-boot in the second sector of the flash
  */
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 #ifdef NORFLASH_PS32BIT
 #      define CONFIG_ENV_OFFSET                (0x8000)
 #      define CONFIG_ENV_SIZE          0x4000
index fc73d64091823b2f5945495d55fabbb899ae6c0b..f824158a6975025e23e78182f6619b4d36570b9f 100644 (file)
@@ -55,7 +55,6 @@
 #define CONFIG_ENV_OFFSET              0x4000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 #else
 #define CONFIG_ENV_ADDR                0xffe04000
 #define CONFIG_ENV_SECT_SIZE   0x2000
index 210bb2deff633c9cba7fe6111030163763fe8990..b3801598128a86e37e5b2469367cfa0c0bc75045 100644 (file)
@@ -55,7 +55,6 @@
 #define CONFIG_ENV_OFFSET              0x4000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 #else
 #define CONFIG_ENV_ADDR                0xffe04000
 #define CONFIG_ENV_SECT_SIZE   0x2000
index a2d17c361c5f1aa872e64e02d701fd443f44364c..8180c05e67f90944af683aacd146848d00fb20d8 100644 (file)
 #define CONFIG_ENV_OFFSET              0x4000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
index 98d800f3105675c9d45498c063ec8f188c9ac516..8652a80aa11352dda7afea0ecdc5a0a7a2350a56 100644 (file)
 #define CONFIG_ENV_OFFSET              0x4000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
index fa444c39eeedb3c41af69374019361396847fec1..a5acfd28460f53e8bc438c88a4f157956fa95849 100644 (file)
 #      define CONFIG_ENV_SECT_SIZE     0x8000
 #endif
 #undef CONFIG_ENV_OVERWRITE
-#undef CONFIG_ENV_IS_EMBEDDED
 
 /* FLASH organization */
 #define CONFIG_SYS_FLASH_BASE          CONFIG_SYS_CS0_BASE
index 14d98d69c8a683673eb7aab4a4cd6b7e4ef0b825..7737284aab692b389da6261b0e300274db5142c2 100644 (file)
 #      define CONFIG_ENV_IS_IN_FLASH   1
 #endif
 #undef CONFIG_ENV_OVERWRITE
-#undef CONFIG_ENV_IS_EMBEDDED
 
 /*-----------------------------------------------------------------------
  * FLASH organization
index e48de15f79a48b3fdcc037f64516f5eefb06e740..4534002e473373c1d930c2696a6c8e6b1f979037 100644 (file)
 #define CONFIG_ENV_OFFSET              0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
index 28bf0adcf3f9afd09f900b407284e50a72aef739..971cb67bad1097c7c693f23530af13bea791948d 100644 (file)
 #define CONFIG_ENV_OFFSET              0x2000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
index 104c23f9284f8813912446b7c7b9f71890a644b4..74c51f46b299f3ae6dec927de3dd85702695a187 100644 (file)
 #define CONFIG_ENV_IS_IN_FLASH 1
 #define CONFIG_ENV_ADDR                0xFFF30000      /* Offset of Environment Sector */
 #define CONFIG_ENV_SIZE                0x00010000      /* Total Size of Environment Sector */
-#define        CONFIG_ENV_IS_EMBEDDED  1               /* short-cut compile-time test  */
 #define CONFIG_ENV_OVERWRITE    1              /* Allow modifying the environment */
 
 /*
index fb32f3f3c05aa47e3ed31225b524601d412b8496..1c3ea23c777fa72550d091dd31fb8c7e6379c920 100644 (file)
 #define CONFIG_ENV_OFFSET              0x4000
 #define CONFIG_ENV_SECT_SIZE   0x2000
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_IS_EMBEDDED 1
 #else
 #define CONFIG_ENV_ADDR                0xffe04000
 #define CONFIG_ENV_SECT_SIZE   0x2000
index 7c2bf1b0f4e85f5c7f9c830c0ddbf30031071bf6..651738117067f37844c4330c6aec4fd0fc11618a 100644 (file)
 #define CONFIG_ENV_SIZE                0x2000  /* Total Size of Environment            */
 #define CONFIG_ENV_ADDR            0xFFFFE000  /* Address    of Environment Sector     */
 #define CONFIG_ENV_SECT_SIZE   0x2000  /* use the top-most 8k boot sector      */
-#define        CONFIG_ENV_IS_EMBEDDED  1       /* short-cut compile-time test          */
 #else
 /* Final version: environment in EEPROM */
 #define CONFIG_ENV_IS_IN_EEPROM        1
index 5bed32fd47914b76d9c3b42893b8f060757a5b4f..b9924fd7789cea1e935e22fa836341053eabd883 100644 (file)
 # if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
 #  define CONFIG_SYS_REDUNDAND_ENVIRONMENT     1
 # endif
+# ifdef CONFIG_ENV_IS_EMBEDDED
+#  error "do not define CONFIG_ENV_IS_EMBEDDED in your board config"
+#  error "it is calculated automatically for you"
+# endif
 #endif /* CONFIG_ENV_IS_IN_FLASH */
 
 #if defined(CONFIG_ENV_IS_IN_NAND)
@@ -79,9 +83,6 @@
 # ifdef CONFIG_ENV_OFFSET_REDUND
 #  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 # endif
-# ifdef CONFIG_ENV_IS_EMBEDDED
-#  define ENV_IS_EMBEDDED      1
-# endif
 #endif /* CONFIG_ENV_IS_IN_NAND */
 
 #if defined(CONFIG_ENV_IS_IN_MG_DISK)
 # ifndef CONFIG_ENV_SIZE
 #  error "Need to define CONFIG_ENV_SIZE when using CONFIG_ENV_IS_IN_MG_DISK"
 # endif
-# ifdef CONFIG_ENV_IS_EMBEDDED
-#  error "CONFIG_ENV_IS_EMBEDDED not supported when using CONFIG_ENV_IS_IN_MG_DISK"
-# endif
 #endif /* CONFIG_ENV_IS_IN_MG_DISK */
 
+/* Embedded env is only supported for some flash types */
+#ifdef CONFIG_ENV_IS_EMBEDDED
+# if !defined(CONFIG_ENV_IS_IN_FLASH) && \
+     !defined(CONFIG_ENV_IS_IN_NAND) && \
+     !defined(CONFIG_ENV_IS_IN_ONENAND)
+#  error "CONFIG_ENV_IS_EMBEDDED not supported for your flash type"
+# endif
+#endif
+
+/*
+ * For the flash types where embedded env is supported, but it cannot be
+ * calculated automatically (i.e. NAND), take the board opt-in.
+ */
+#if defined(CONFIG_ENV_IS_EMBEDDED) && !defined(ENV_IS_EMBEDDED)
+# define ENV_IS_EMBEDDED 1
+#endif
+
+/* The build system likes to know if the env is embedded */
+#ifdef DO_DEPS_ONLY
+# ifdef ENV_IS_EMBEDDED
+#  define CONFIG_ENV_IS_EMBEDDED
+# endif
+#endif
+
 #include "compiler.h"
 
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT