aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-07-24 17:51:27 -0400
committerWolfgang Denk <wd@denx.de>2009-08-09 22:41:42 +0200
commit18304f7675e84252965b4e24cba279071f1da472 (patch)
tree9ddc4f54c1da582300862a6bfbb0e47f1267f28b
parentbedd8403f77f790e9876578885eab1200ba2f8d8 (diff)
downloadu-boot-linaro-natty-18304f7675e84252965b4e24cba279071f1da472.tar.gz
env: kill off default_environment_size
The only environment type that uses this variable is spi flash, and that is only because it is reimplementing the common set_default_env() function. So fix the spi flash code and kill off the default_environment_size in the process. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--common/env_common.c5
-rw-r--r--common/env_dataflash.c1
-rw-r--r--common/env_flash.c1
-rw-r--r--common/env_mgdisk.c1
-rw-r--r--common/env_nand.c1
-rw-r--r--common/env_nowhere.c1
-rw-r--r--common/env_nvram.c1
-rw-r--r--common/env_sf.c12
8 files changed, 1 insertions, 22 deletions
diff --git a/common/env_common.c b/common/env_common.c
index 6be3bb04a..be64d1307 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -139,11 +139,6 @@ uchar default_environment[] = {
"\0"
};
-#if defined(CONFIG_ENV_IS_IN_NAND) /* Environment is in Nand Flash */ \
- || defined(CONFIG_ENV_IS_IN_SPI_FLASH)
-int default_environment_size = sizeof(default_environment);
-#endif
-
void env_crc_update (void)
{
env_ptr->crc = crc32(0, env_ptr->data, ENV_SIZE);
diff --git a/common/env_dataflash.c b/common/env_dataflash.c
index fed919e67..27a3bbcca 100644
--- a/common/env_dataflash.c
+++ b/common/env_dataflash.c
@@ -35,7 +35,6 @@ extern int write_dataflash (unsigned long addr_dest, unsigned long addr_src,
unsigned long size);
extern int AT91F_DataflashInit (void);
extern uchar default_environment[];
-/* extern int default_environment_size; */
uchar env_get_char_spec (int index)
diff --git a/common/env_flash.c b/common/env_flash.c
index 00792cd38..b860c48db 100644
--- a/common/env_flash.c
+++ b/common/env_flash.c
@@ -83,7 +83,6 @@ static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1;
#endif /* CONFIG_ENV_ADDR_REDUND */
extern uchar default_environment[];
-extern int default_environment_size;
uchar env_get_char_spec (int index)
diff --git a/common/env_mgdisk.c b/common/env_mgdisk.c
index 363ee68c2..b9de1ed0d 100644
--- a/common/env_mgdisk.c
+++ b/common/env_mgdisk.c
@@ -29,7 +29,6 @@
/* references to names in env_common.c */
extern uchar default_environment[];
-extern int default_environment_size;
char * env_name_spec = "MG_DISK";
diff --git a/common/env_nand.c b/common/env_nand.c
index 8052fb79e..ca631af19 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -59,7 +59,6 @@
/* references to names in env_common.c */
extern uchar default_environment[];
-extern int default_environment_size;
char * env_name_spec = "NAND";
diff --git a/common/env_nowhere.c b/common/env_nowhere.c
index 78e8f8eb4..ccc068b8e 100644
--- a/common/env_nowhere.c
+++ b/common/env_nowhere.c
@@ -34,7 +34,6 @@ DECLARE_GLOBAL_DATA_PTR;
env_t *env_ptr = NULL;
extern uchar default_environment[];
-extern int default_environment_size;
void env_relocate_spec (void)
diff --git a/common/env_nvram.c b/common/env_nvram.c
index 562edd049..2628fe434 100644
--- a/common/env_nvram.c
+++ b/common/env_nvram.c
@@ -58,7 +58,6 @@ env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR;
char * env_name_spec = "NVRAM";
extern uchar default_environment[];
-extern int default_environment_size;
#ifdef CONFIG_AMIGAONEG3SE
uchar env_get_char_spec (int index)
diff --git a/common/env_sf.c b/common/env_sf.c
index 2f52e2561..6575b6da3 100644
--- a/common/env_sf.c
+++ b/common/env_sf.c
@@ -47,7 +47,6 @@ DECLARE_GLOBAL_DATA_PTR;
/* references to names in env_common.c */
extern uchar default_environment[];
-extern int default_environment_size;
char * env_name_spec = "SPI Flash";
env_t *env_ptr;
@@ -143,16 +142,7 @@ err_probe:
err_crc:
puts("*** Warning - bad CRC, using default environment\n\n");
- if (default_environment_size > CONFIG_ENV_SIZE) {
- gd->env_valid = 0;
- puts("*** Error - default environment is too large\n\n");
- return;
- }
-
- memset(env_ptr, 0, sizeof(env_t));
- memcpy(env_ptr->data, default_environment, default_environment_size);
- env_ptr->crc = crc32(0, env_ptr->data, ENV_SIZE);
- gd->env_valid = 1;
+ set_default_env();
}
int env_init(void)