diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-03-26 10:50:09 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-03-26 10:50:09 +0000 |
commit | 608f4fe3b040089b30a019f1a28efeda1ca5809f (patch) | |
tree | 501b30c771418fcffdb4d9d7867552f7ab021d11 /package/system/mtd/src/mtd.h | |
parent | 0555ebf66d415045b176181cde25ba2ed063c09d (diff) | |
download | upstream-608f4fe3b040089b30a019f1a28efeda1ca5809f.tar.gz upstream-608f4fe3b040089b30a019f1a28efeda1ca5809f.tar.bz2 upstream-608f4fe3b040089b30a019f1a28efeda1ca5809f.zip |
mtd: add support for bad blocks in NAND flash
NAND flash is very likely to contain bad blocks.
Currently, mtd and therefore sysupgrade fails when it encounters a single bad block, potentially leaving an unbootable system.
This patch allows the mtd utility to skip bad blocks in NAND flash and complete sysupgrade successfully.
Patch by: Matthew Redfearn <matt.redfearn@nxp.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40021
Diffstat (limited to 'package/system/mtd/src/mtd.h')
-rw-r--r-- | package/system/mtd/src/mtd.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h index c2133fc37c..d94f394396 100644 --- a/package/system/mtd/src/mtd.h +++ b/package/system/mtd/src/mtd.h @@ -15,6 +15,7 @@ extern int erasesize; extern int mtd_open(const char *mtd, bool block); extern int mtd_check_open(const char *mtd); +extern int mtd_block_is_bad(int fd, int offset); extern int mtd_erase_block(int fd, int offset); extern int mtd_write_buffer(int fd, const char *buf, int offset, int length); extern int mtd_write_jffs2(const char *mtd, const char *filename, const char *dir); |