From 169d54d8b33b4d06d6f215e2b312a0b18f7909dc Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Tue, 14 Jun 2011 16:35:06 -0400 Subject: nand_util: drop trailing all-0xff pages if requested Add a flag to nand_read_skip_bad() such that if true, any trailing pages in an eraseblock whose contents are entirely 0xff will be dropped. The implementation is via a new drop_ffs() function which is based on the function of the same name from the ubiformat utility by Artem Bityutskiy. This is as-per the reccomendations of the UBI FAQ [1] [1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo Signed-off-by: Ben Gardiner CC: Artem Bityutskiy Acked-by: Detlev Zundel CC: Scott Wood Signed-off-by: Scott Wood --- include/nand.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/nand.h b/include/nand.h index c5818f179da..8d94b5cbd75 100644 --- a/include/nand.h +++ b/include/nand.h @@ -118,6 +118,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, #define WITH_YAFFS_OOB (1 << 0) /* whether write with yaffs format. This flag * is a 'mode' meaning it cannot be mixed with * other flags */ +#define WITH_DROP_FFS (1 << 1) /* drop trailing all-0xff pages */ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length, u_char *buffer, int flags); -- cgit v1.2.3