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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user