diff options
author | Wolfgang Denk | 2008-08-14 11:26:22 +0200 |
---|---|---|
committer | Wolfgang Denk | 2008-08-14 11:26:22 +0200 |
commit | 28ac6719108e989429de2b3dfa90312ba7c4d27b (patch) | |
tree | 876a26cd366f7bd80b88f02d6bf5b149f385dfa1 /common | |
parent | 2fd0aad443c966ce62008225e57b18e2dcf4e330 (diff) | |
parent | 68cf19aae48f2969ec70669604d0d776f02c8bc4 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
Diffstat (limited to 'common')
-rw-r--r-- | common/env_onenand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/env_onenand.c b/common/env_onenand.c index dbd0883fa8a..d5c907c6f0a 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -40,7 +40,7 @@ extern struct onenand_chip onenand_chip; /* References to names in env_common.c */ extern uchar default_environment[]; -#define ONENAND_ENV_SIZE(mtd) (mtd.oobblock - ENV_HEADER_SIZE) +#define ONENAND_ENV_SIZE(mtd) (mtd.writesize - ENV_HEADER_SIZE) char *env_name_spec = "OneNAND"; @@ -68,12 +68,12 @@ void env_relocate_spec(void) env_addr = CFG_ENV_ADDR; /* Check OneNAND exist */ - if (onenand_mtd.oobblock) + if (onenand_mtd.writesize) /* Ignore read fail */ - onenand_read(&onenand_mtd, env_addr, onenand_mtd.oobblock, + onenand_read(&onenand_mtd, env_addr, onenand_mtd.writesize, &retlen, (u_char *) env_ptr); else - onenand_mtd.oobblock = MAX_ONENAND_PAGESIZE; + onenand_mtd.writesize = MAX_ONENAND_PAGESIZE; if (crc32(0, env_ptr->data, ONENAND_ENV_SIZE(onenand_mtd)) != env_ptr->crc) @@ -109,7 +109,7 @@ int saveenv(void) env_ptr->crc = crc32(0, env_ptr->data, ONENAND_ENV_SIZE(onenand_mtd)); - if (onenand_write(&onenand_mtd, env_addr, onenand_mtd.oobblock, &retlen, + if (onenand_write(&onenand_mtd, env_addr, onenand_mtd.writesize, &retlen, (u_char *) env_ptr)) { printf("OneNAND: write failed at 0x%08x\n", instr.addr); return 2; |