summaryrefslogtreecommitdiff
path: root/board/zeus/zeus.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-09-28 23:30:47 +0200
committerWolfgang Denk <wd@denx.de>2010-09-28 23:30:47 +0200
commit2e6e1772c0e34871769be4aef79748fe3e47d953 (patch)
tree00e4e19d7bccd2a1cd5753854ff4c2b8a26bebb0 /board/zeus/zeus.c
parent1e4e5ef0469050f014aee1204dae8a9ab6053e49 (diff)
parent3df61957938586c512c17e72d83551d190400981 (diff)
downloadu-boot-imx-2e6e1772c0e34871769be4aef79748fe3e47d953.zip
u-boot-imx-2e6e1772c0e34871769be4aef79748fe3e47d953.tar.gz
u-boot-imx-2e6e1772c0e34871769be4aef79748fe3e47d953.tar.bz2
Merge branch 'next' of /home/wd/git/u-boot/next
Conflicts: include/ppc4xx.h Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'board/zeus/zeus.c')
-rw-r--r--board/zeus/zeus.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/board/zeus/zeus.c b/board/zeus/zeus.c
index e295151..a29e518 100644
--- a/board/zeus/zeus.c
+++ b/board/zeus/zeus.c
@@ -30,7 +30,7 @@
#include <asm/processor.h>
#include <asm/io.h>
-#include <asm/gpio.h>
+#include <asm/ppc4xx-gpio.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -222,27 +222,8 @@ static int restore_default(void)
char *buf_save;
u32 crc;
- /*
- * Unprotect and erase environment area
- */
- flash_protect(FLAG_PROTECT_CLEAR,
- CONFIG_ENV_ADDR_REDUND,
- CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1,
- &flash_info[0]);
+ set_default_env("");
- flash_sect_erase(CONFIG_ENV_ADDR_REDUND,
- CONFIG_ENV_ADDR_REDUND + 2*CONFIG_ENV_SECT_SIZE - 1);
-
- /*
- * Now restore default environment from U-Boot image
- * -> ipaddr, serverip...
- */
- memset(env_ptr, 0, sizeof(env_t));
- memcpy(env_ptr->data, default_environment, ENV_SIZE);
-#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
- env_ptr->flags = 0xFF;
-#endif
- env_crc_update();
gd->env_valid = 1;
/*
@@ -251,6 +232,10 @@ static int restore_default(void)
* -> ethaddr, eth1addr, serial#
*/
buf = buf_save = malloc(FACTORY_RESET_ENV_SIZE);
+ if (buf == NULL) {
+ printf("ERROR: malloc() failed\n");
+ return -1;
+ }
if (eeprom_read(FACTORY_RESET_I2C_EEPROM, FACTORY_RESET_ENV_OFFS,
(u8 *)buf, FACTORY_RESET_ENV_SIZE)) {
puts("\nError reading EEPROM!\n");