summaryrefslogtreecommitdiff
path: root/common/env_onenand.c
diff options
context:
space:
mode:
authorKyungmin Park <kmpark@infradead.org>2008-08-13 09:11:02 +0900
committerScott Wood <scottwood@freescale.com>2008-08-13 11:00:19 -0500
commitd438d50848e9425286e5fb0493e0affb5a0b1e1b (patch)
tree49406f77ad245aca8e1e21b98f2d3216c2a3f774 /common/env_onenand.c
parent8641ff266ae6638da201747c239fd39ba34c4958 (diff)
downloadu-boot-imx-d438d50848e9425286e5fb0493e0affb5a0b1e1b.zip
u-boot-imx-d438d50848e9425286e5fb0493e0affb5a0b1e1b.tar.gz
u-boot-imx-d438d50848e9425286e5fb0493e0affb5a0b1e1b.tar.bz2
Fix OneNAND build break
Since page size field is changed from oobblock to writesize. But OneNAND is not updated. - fix bufferram management at erase operation This patch includes the NAND/OneNAND state filed too. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'common/env_onenand.c')
-rw-r--r--common/env_onenand.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/env_onenand.c b/common/env_onenand.c
index dbd0883..d5c907c 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;