summaryrefslogtreecommitdiffstats
path: root/include/nand.h
diff options
context:
space:
mode:
authorBen Gardiner <bengardiner@nanometrics.ca>2011-06-14 16:35:06 -0400
committerScott Wood <scottwood@freescale.com>2011-07-01 15:56:51 -0500
commit169d54d8b33b4d06d6f215e2b312a0b18f7909dc (patch)
tree0911e2f0acb0279b3bf8239c8d32546499a9ee18 /include/nand.h
parentc135456ff59aed0302f99a2e1327939bdced77f5 (diff)
downloadtalos-obmc-uboot-169d54d8b33b4d06d6f215e2b312a0b18f7909dc.tar.gz
talos-obmc-uboot-169d54d8b33b4d06d6f215e2b312a0b18f7909dc.zip
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 <bengardiner@nanometrics.ca> CC: Artem Bityutskiy <dedekind1@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de> CC: Scott Wood <scottwood@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'include/nand.h')
-rw-r--r--include/nand.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/nand.h b/include/nand.h
index c5818f179d..8d94b5cbd7 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);
OpenPOWER on IntegriCloud