Merge branch 'master' of git://git.denx.de/u-boot-mips
[pandora-u-boot.git] / include / environment.h
index 3c145af..e8ab703 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #ifndef _ENVIRONMENT_H_
-#define _ENVIRONMENT_H_        1
+#define _ENVIRONMENT_H_
 
 /**************************************************************************
  *
 # if   (CONFIG_ENV_ADDR >= CONFIG_SYS_MONITOR_BASE) &&         \
        (CONFIG_ENV_ADDR + CONFIG_ENV_SIZE) <=                  \
        (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
-#  define ENV_IS_EMBEDDED      1
+#  define ENV_IS_EMBEDDED
 # endif
 # if defined(CONFIG_ENV_ADDR_REDUND) || defined(CONFIG_ENV_OFFSET_REDUND)
-#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT     1
+#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 # endif
 # ifdef CONFIG_ENV_IS_EMBEDDED
 #  error "do not define CONFIG_ENV_IS_EMBEDDED in your board config"
@@ -96,15 +96,6 @@ extern unsigned long nand_env_oob_offset;
 # endif
 #endif /* CONFIG_ENV_IS_IN_NAND */
 
-#if defined(CONFIG_ENV_IS_IN_MG_DISK)
-# ifndef CONFIG_ENV_ADDR
-#  error "Need to define CONFIG_ENV_ADDR when using CONFIG_ENV_IS_IN_MG_DISK"
-# endif
-# ifndef CONFIG_ENV_SIZE
-#  error "Need to define CONFIG_ENV_SIZE 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)        && \
@@ -120,7 +111,7 @@ extern unsigned long nand_env_oob_offset;
  * 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
+# define ENV_IS_EMBEDDED
 #endif
 
 /* The build system likes to know if the env is embedded */
@@ -190,9 +181,21 @@ void env_crc_update(void);
 /* [re]set to the default environment */
 void set_default_env(const char *s);
 
+/* [re]set individual variables to their value in the default environment */
+int set_default_vars(int nvars, char * const vars[]);
+
 /* Import from binary representation into hash table */
 int env_import(const char *buf, int check);
 
+/*
+ * Check if variable "name" can be changed from oldval to newval,
+ * and if so, apply the changes (e.g. baudrate).
+ * When (flag & H_FORCE) is set, it does not print out any error
+ * message and forces overwriting of write-once variables.
+ */
+int env_check_apply(const char *name, const char *oldval,
+                       const char *newval, int flag);
+
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */