summaryrefslogtreecommitdiff
path: root/tools/env/fw_env.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-08-10 22:20:27 +0200
committerWolfgang Denk <wd@denx.de>2010-08-10 22:20:27 +0200
commit201532a69cf7e7a84bff354fdab45947425d22b4 (patch)
tree4a09ca44e9fb720ec5b6ef29cca2de627e29f29a /tools/env/fw_env.c
parent560639806da5172147a3b1ebd99839feac38b718 (diff)
parentb417260d871d4d8d336c160d95ed40cc8c0fb0fa (diff)
downloadu-boot-imx-201532a69cf7e7a84bff354fdab45947425d22b4.zip
u-boot-imx-201532a69cf7e7a84bff354fdab45947425d22b4.tar.gz
u-boot-imx-201532a69cf7e7a84bff354fdab45947425d22b4.tar.bz2
Merge branch 'master' of ../master
Diffstat (limited to 'tools/env/fw_env.c')
-rw-r--r--tools/env/fw_env.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 04f3bf0..8ff7052 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2000-2008
+ * (C) Copyright 2000-2010
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* (C) Copyright 2008
@@ -899,7 +899,10 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
static int flash_flag_obsolete (int dev, int fd, off_t offset)
{
int rc;
+ struct erase_info_user erase;
+ erase.start = DEVOFFSET (dev);
+ erase.length = DEVESIZE (dev);
/* This relies on the fact, that obsolete_flag == 0 */
rc = lseek (fd, offset, SEEK_SET);
if (rc < 0) {
@@ -907,7 +910,9 @@ static int flash_flag_obsolete (int dev, int fd, off_t offset)
DEVNAME (dev));
return rc;
}
+ ioctl (fd, MEMUNLOCK, &erase);
rc = write (fd, &obsolete_flag, sizeof (obsolete_flag));
+ ioctl (fd, MEMLOCK, &erase);
if (rc < 0)
perror ("Could not set obsolete flag");