]> git.sur5r.net Git - u-boot/blobdiff - common/env_flash.c
env_flash: Move conditional compilation to Makefile
[u-boot] / common / env_flash.c
index 7a37e550deb8f90bff6518bebbf3666e079dcf4f..84166afea856a32b65896369b47fddd818eaecef 100644 (file)
@@ -27,9 +27,6 @@
 /* #define DEBUG */
 
 #include <common.h>
-
-#if defined(CFG_ENV_IS_IN_FLASH) /* Environment is in Flash */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
@@ -107,13 +104,6 @@ int  env_init(void)
        ulong addr1 = (ulong)&(flash_addr->data);
        ulong addr2 = (ulong)&(flash_addr_new->data);
 
-#ifdef CONFIG_OMAP2420H4
-       int flash_probe(void);
-
-       if(flash_probe() == 0)
-               goto bad_flash;
-#endif
-
        crc1_ok = (crc32(0, flash_addr->data, ENV_SIZE) == flash_addr->crc);
        crc2_ok = (crc32(0, flash_addr_new->data, ENV_SIZE) == flash_addr_new->crc);
 
@@ -143,9 +133,6 @@ int  env_init(void)
                gd->env_valid = 2;
        }
 
-#ifdef CONFIG_OMAP2420H4
-bad_flash:
-#endif
        return (0);
 }
 
@@ -259,20 +246,12 @@ Done:
 
 int  env_init(void)
 {
-#ifdef CONFIG_OMAP2420H4
-       int flash_probe(void);
-
-       if(flash_probe() == 0)
-               goto bad_flash;
-#endif
        if (crc32(0, env_ptr->data, ENV_SIZE) == env_ptr->crc) {
                gd->env_addr  = (ulong)&(env_ptr->data);
                gd->env_valid = 1;
                return(0);
        }
-#ifdef CONFIG_OMAP2420H4
-bad_flash:
-#endif
+
        gd->env_addr  = (ulong)&default_environment[0];
        gd->env_valid = 0;
        return (0);
@@ -396,8 +375,8 @@ void env_relocate_spec (void)
                puts ("*** Warning - some problems detected "
                      "reading environment; recovered successfully\n\n");
 #endif /* CFG_ENV_ADDR_REDUND */
+#ifdef CMD_SAVEENV
        memcpy (env_ptr, (void*)flash_addr, CFG_ENV_SIZE);
+#endif
 #endif /* ! ENV_IS_EMBEDDED || CFG_ENV_ADDR_REDUND */
 }
-
-#endif /* CFG_ENV_IS_IN_FLASH */