diff mbox

[U-Boot,5/5] cmd_nand: also drop 0xff pages for jffs2

Message ID ae06426a98d43b99331ecdb4e4b618ba8c7e9fd0.1304026883.git.bengardiner@nanometrics.ca
State Superseded
Headers show

Commit Message

Ben Gardiner April 28, 2011, 9:47 p.m. UTC
The behaviour of dropping trailing 0xff pages of an eraseblock was
observed to fix JFFS2 images on da850evm which usually resulted in
numerous 'ECC errors.'

Assign also the behaviour of dropping trailing 0xff pages to the
.jffs2 nand write variant as it was to the previously introduced
.ubi variant.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
---
 common/cmd_nand.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index faece07..b9d5ae6 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -567,12 +567,11 @@  int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 		rwsize = size;
 
 		s = strchr(cmd, '.');
-		if (!strcmp(s, ".ubi")) {
+		if (!strcmp(s, ".ubi") || !strcmp(s, ".jffs2")) {
 			ret = nand_write_skip_bad(nand, off, &rwsize,
 						  (u_char *)addr,
 						  WITH_DROP_FFS);
-		} else if (!s || !strcmp(s, ".jffs2") ||
-		    !strcmp(s, ".e") || !strcmp(s, ".i")) {
+		} else if (!s || !strcmp(s, ".e") || !strcmp(s, ".i")) {
 			if (read)
 				ret = nand_read_skip_bad(nand, off, &rwsize,
 							 (u_char *)addr);