aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-07-06 01:57:53 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-07-07 04:37:45 -0400
commitebf53f421308c2f59c9bcbad4c5c297a0d00199a (patch)
tree1ec5084484bcaea259a210147cb278af4286f7e6 /drivers/mtd/ubi/ubi.h
parentfe96efc1a3c049f0a1bcd9b65e0faeb751ce5ec6 (diff)
UBI: fix NOR flash recovery
This commit fixes NOR flash recovery issues observed with Spansion S29GL512N NOR. When NOR erases, it first fills PEBs with zeroes, then sets all bytes to 0xFF. Filling with zeroes starts from the end of the PEB. And when power is cut, this results in PEBs containing correct EC and VID headers but corrupted with zeros at the end. This confuses UBI and it mistakinly accepts these PEBs and associate them with LEBs. Fis this issue by zeroing EC and VID magics before erasing PEBs, to make UBI later refuse zem. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 64604e8809ec..6a5fe9633783 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -373,6 +373,7 @@ struct ubi_wl_entry;
373 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset 373 * @vid_hdr_shift: contains @vid_hdr_offset - @vid_hdr_aloffset
374 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or 374 * @bad_allowed: whether the MTD device admits of bad physical eraseblocks or
375 * not 375 * not
376 * @nor_flash: non-zero if working on top of NOR flash
376 * @mtd: MTD device descriptor 377 * @mtd: MTD device descriptor
377 * 378 *
378 * @peb_buf1: a buffer of PEB size used for different purposes 379 * @peb_buf1: a buffer of PEB size used for different purposes
@@ -454,7 +455,8 @@ struct ubi_device {
454 int vid_hdr_offset; 455 int vid_hdr_offset;
455 int vid_hdr_aloffset; 456 int vid_hdr_aloffset;
456 int vid_hdr_shift; 457 int vid_hdr_shift;
457 int bad_allowed; 458 unsigned int bad_allowed:1;
459 unsigned int nor_flash:1;
458 struct mtd_info *mtd; 460 struct mtd_info *mtd;
459 461
460 void *peb_buf1; 462 void *peb_buf1;