* [U-Boot] [PATCH 1/5] nand: Add verification functions
@ 2015-02-03 17:58 Peter Tyser
2015-02-03 17:58 ` [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND Peter Tyser
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Peter Tyser @ 2015-02-03 17:58 UTC (permalink / raw)
To: u-boot
Add nand_verify() and nand_verify_page_oob(). nand_verify() verifies
NAND contents against an arbitrarily sized buffer using ECC while
nand_verify_page_oob() verifies a NAND page's contents and OOB.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
drivers/mtd/nand/nand_util.c | 97 +++++++++++++++++++++++++++++++++++++++++++-
include/nand.h | 4 ++
2 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index afdd160..f487756 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -464,6 +464,87 @@ static size_t drop_ffs(const nand_info_t *nand, const u_char *buf,
#endif
/**
+ * nand_verify_page_oob:
+ *
+ * Verify a page of NAND flash, including the OOB.
+ * Reads page of NAND and verifies the contents and OOB against the
+ * values in ops.
+ *
+ * @param nand NAND device
+ * @param ops MTD operations, including data to verify
+ * @param ofs offset in flash
+ * @return 0 in case of success
+ */
+int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops, loff_t ofs)
+{
+ int rval;
+ struct mtd_oob_ops vops;
+ size_t verlen = nand->writesize + nand->oobsize;
+
+ memcpy(&vops, ops, sizeof(vops));
+
+ vops.datbuf = malloc(verlen);
+
+ if (!vops.datbuf)
+ return -ENOMEM;
+
+ vops.oobbuf = vops.datbuf + nand->writesize;
+
+ rval = mtd_read_oob(nand, ofs, &vops);
+ if (!rval)
+ rval = memcmp(ops->datbuf, vops.datbuf, vops.len);
+ if (!rval)
+ rval = memcmp(ops->oobbuf, vops.oobbuf, vops.ooblen);
+
+ free(vops.datbuf);
+
+ return rval ? -EIO : 0;
+}
+
+/**
+ * nand_verify:
+ *
+ * Verify a region of NAND flash.
+ * Reads NAND in page-sized chunks and verifies the contents against
+ * the contents of a buffer. The offset into the NAND must be
+ * page-aligned, and the function doesn't handle skipping bad blocks.
+ *
+ * @param nand NAND device
+ * @param ofs offset in flash
+ * @param len buffer length
+ * @param buf buffer to read from
+ * @return 0 in case of success
+ */
+int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf)
+{
+ int rval = 0;
+ size_t verofs;
+ size_t verlen = nand->writesize;
+ uint8_t *verbuf = malloc(verlen);
+
+ if (!verbuf)
+ return -ENOMEM;
+
+ /* Read the NAND back in page-size groups to limit malloc size */
+ for (verofs = ofs; verofs < ofs + len;
+ verofs += verlen, buf += verlen) {
+ verlen = min(nand->writesize, (uint32_t)(ofs + len - verofs));
+ rval = nand_read(nand, verofs, &verlen, verbuf);
+ if (!rval || (rval == -EUCLEAN))
+ rval = memcmp(buf, verbuf, verlen);
+
+ if (rval)
+ break;
+ }
+
+ free(verbuf);
+
+ return rval ? -EIO : 0;
+}
+
+
+
+/**
* nand_write_skip_bad:
*
* Write image to NAND flash.
@@ -501,7 +582,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
#ifdef CONFIG_CMD_NAND_YAFFS
if (flags & WITH_YAFFS_OOB) {
- if (flags & ~WITH_YAFFS_OOB)
+ if (flags & (~WITH_YAFFS_OOB & ~WITH_WR_VERIFY))
return -EINVAL;
int pages;
@@ -554,6 +635,10 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
if (!need_skip && !(flags & WITH_DROP_FFS)) {
rval = nand_write(nand, offset, length, buffer);
+
+ if ((flags & WITH_WR_VERIFY) && !rval)
+ rval = nand_verify(nand, offset, *length, buffer);
+
if (rval == 0)
return 0;
@@ -601,6 +686,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
ops.oobbuf = ops.datbuf + pagesize;
rval = mtd_write_oob(nand, offset, &ops);
+
+ if ((flags & WITH_WR_VERIFY) && !rval)
+ rval = nand_verify_page_oob(nand,
+ &ops, offset);
+
if (rval != 0)
break;
@@ -620,6 +710,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
rval = nand_write(nand, offset, &truncated_write_size,
p_buffer);
+
+ if ((flags & WITH_WR_VERIFY) && !rval)
+ rval = nand_verify(nand, offset,
+ truncated_write_size, p_buffer);
+
offset += write_size;
p_buffer += write_size;
}
diff --git a/include/nand.h b/include/nand.h
index 15e31ab..49a05dc 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -134,11 +134,15 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
* is a 'mode' meaning it cannot be mixed with
* other flags */
#define WITH_DROP_FFS (1 << 1) /* drop trailing all-0xff pages */
+#define WITH_WR_VERIFY (1 << 2) /* verify data was written correctly */
int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
size_t *actual, loff_t lim, u_char *buffer, int flags);
int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts);
int nand_torture(nand_info_t *nand, loff_t offset);
+int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops,
+ loff_t ofs);
+int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf);
#define NAND_LOCK_STATUS_TIGHT 0x01
#define NAND_LOCK_STATUS_UNLOCK 0x04
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
@ 2015-02-03 17:58 ` Peter Tyser
2015-02-11 6:45 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 3/5] dfu: nand: Verify writes Peter Tyser
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Peter Tyser @ 2015-02-03 17:58 UTC (permalink / raw)
To: u-boot
Previously NAND writes were only verified when CONFIG_MTD_NAND_VERIFY_WRITE
was defined. On boards without this define writes could fail silently.
Boards with CONFIG_MTD_NAND_VERIFY_WRITE could prematurely report
failures which ECC could correct.
Add a verification step after all "nand write[.x]" commands to ensure the
writes were successful. The verification uses ECC for for "normal"
writes, but does not for raw and yaffs writes. Some test cases which
inject fake bad bits on a 2K page flash are below.
Test cases with CONFIG_MTD_NAND_VERIFY_WRITE defined:
Example of an ECC write which previously failed when
CONFIG_MTD_NAND_VERIFY_WRITE was defined, but now succeeds because ECC
is used during verification:
nand erase 0 0x10000
dhcp /somefile
mw.b 0x10000 0xff 0x2000
mw.b 0x10020 0xfe 1
nand write.raw 0x10000 0x800 1
mw.b 0x1000020 0x01 1
nand write 0x1000000 0x800 0x1800
Test cases without CONFIG_MTD_NAND_VERIFY_WRITE defined:
Example of an ECC write which previously silently failed:
nand erase 0 0x10000
dhcp /somefile
mw.b 0x10000 0xff 0x2000
mw.b 0x10020 0x00 1
nand write.raw 0x10000 0x800 1
mw.b 0x1000020 0xff 1
nand write 0x1000000 0x800 0x1800
Example of a raw write which previously failed silently due to stuck
data bit, but now errors out:
nand erase 0 0x10000
dhcp /somefile
mw.b 0x10000 0xff 0x2000
mw.b 0x10020 0xfe 1
nand write.raw 0x10000 0x800 1
mw.b 0x1000020 0x01 1
nand write.raw 0x1000000 0x800 3
Example of a raw write which previously failed silently due to stuck OOB
bit, but now errors out:
nand erase 0 0x10000
dhcp /somefile
mw.b 0x10000 0xff 0x2000
mw.b 0x10810 0xfe 1
nand write.raw 0x10000 0x800 1
mw.b 0x1000810 0x01 1
nand write.raw 0x1000000 0x800 3
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
common/cmd_nand.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 7f962dc..bada28c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -419,10 +419,13 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count,
.mode = MTD_OPS_RAW
};
- if (read)
+ if (read) {
ret = mtd_read_oob(nand, off, &ops);
- else
+ } else {
ret = mtd_write_oob(nand, off, &ops);
+ if (!ret)
+ ret = nand_verify_page_oob(nand, &ops, off);
+ }
if (ret) {
printf("%s: error at offset %llx, ret %d\n",
@@ -690,7 +693,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
else
ret = nand_write_skip_bad(nand, off, &rwsize,
NULL, maxsize,
- (u_char *)addr, 0);
+ (u_char *)addr,
+ WITH_WR_VERIFY);
#ifdef CONFIG_CMD_NAND_TRIMFFS
} else if (!strcmp(s, ".trimffs")) {
if (read) {
@@ -699,7 +703,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
ret = nand_write_skip_bad(nand, off, &rwsize, NULL,
maxsize, (u_char *)addr,
- WITH_DROP_FFS);
+ WITH_DROP_FFS | WITH_WR_VERIFY);
#endif
#ifdef CONFIG_CMD_NAND_YAFFS
} else if (!strcmp(s, ".yaffs")) {
@@ -709,7 +713,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
ret = nand_write_skip_bad(nand, off, &rwsize, NULL,
maxsize, (u_char *)addr,
- WITH_YAFFS_OOB);
+ WITH_YAFFS_OOB | WITH_WR_VERIFY);
#endif
} else if (!strcmp(s, ".oob")) {
/* out-of-band data */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 3/5] dfu: nand: Verify writes
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
2015-02-03 17:58 ` [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND Peter Tyser
@ 2015-02-03 17:58 ` Peter Tyser
2015-02-04 9:22 ` Lukasz Majewski
2015-02-11 6:45 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE Peter Tyser
` (2 subsequent siblings)
4 siblings, 2 replies; 10+ messages in thread
From: Peter Tyser @ 2015-02-03 17:58 UTC (permalink / raw)
To: u-boot
Previously NAND writes were not verified and could fail silently. Add
a verification step after all writes to NAND.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
I don't have a board with DFU support, so this change is untested.
drivers/dfu/dfu_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index f9ee189..a975492 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -64,7 +64,7 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
return ret;
/* then write */
ret = nand_write_skip_bad(nand, start, &count, &actual,
- lim, buf, 0);
+ lim, buf, WITH_WR_VERIFY);
}
if (ret != 0) {
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
2015-02-03 17:58 ` [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND Peter Tyser
2015-02-03 17:58 ` [U-Boot] [PATCH 3/5] dfu: nand: Verify writes Peter Tyser
@ 2015-02-03 17:58 ` Peter Tyser
2015-02-11 6:46 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 5/5] nand: yaffs: Remove the "nand write.yaffs" command Peter Tyser
2015-02-11 6:45 ` [U-Boot] [PATCH 1/5] nand: Add verification functions Heiko Schocher
4 siblings, 1 reply; 10+ messages in thread
From: Peter Tyser @ 2015-02-03 17:58 UTC (permalink / raw)
To: u-boot
The CONFIG_MTD_NAND_VERIFY_WRITE has been removed from Linux for some
time and a more generic method of NAND verification now exists in U-Boot.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
README | 3 --
board/prodrive/alpr/nand.c | 16 ---------
board/socrates/nand.c | 25 --------------
drivers/mtd/nand/davinci_nand.c | 12 -------
drivers/mtd/nand/fsl_elbc_nand.c | 38 ----------------------
drivers/mtd/nand/fsl_ifc_nand.c | 38 ----------------------
drivers/mtd/nand/fsl_upm.c | 18 ----------
drivers/mtd/nand/mpc5121_nfc.c | 26 ---------------
drivers/mtd/nand/mxc_nand.c | 33 -------------------
drivers/mtd/nand/nand_base.c | 65 -------------------------------------
drivers/mtd/nand/ndfc.c | 18 ----------
include/configs/B4860QDS.h | 1 -
include/configs/BSC9131RDB.h | 1 -
include/configs/BSC9132QDS.h | 1 -
include/configs/C29XPCIE.h | 1 -
include/configs/MPC8313ERDB.h | 1 -
include/configs/MPC8315ERDB.h | 1 -
include/configs/MPC837XEMDS.h | 1 -
include/configs/MPC8536DS.h | 1 -
include/configs/MPC8569MDS.h | 1 -
include/configs/MPC8572DS.h | 1 -
include/configs/P1010RDB.h | 1 -
include/configs/P1022DS.h | 1 -
include/configs/P1023RDB.h | 1 -
include/configs/P2041RDB.h | 1 -
include/configs/T102xQDS.h | 1 -
include/configs/T102xRDB.h | 1 -
include/configs/T1040QDS.h | 1 -
include/configs/T104xRDB.h | 1 -
include/configs/T208xQDS.h | 1 -
include/configs/T208xRDB.h | 1 -
include/configs/T4240QDS.h | 1 -
include/configs/T4240RDB.h | 1 -
include/configs/corenet_ds.h | 1 -
include/configs/ids8313.h | 1 -
include/configs/km/kmp204x-common.h | 1 -
include/configs/ls1021aqds.h | 1 -
include/configs/ls2085a_common.h | 1 -
include/configs/p1_p2_rdb_pc.h | 1 -
include/configs/ve8313.h | 1 -
include/configs/xpedite537x.h | 1 -
include/configs/xpedite550x.h | 1 -
include/linux/mtd/nand.h | 5 ---
43 files changed, 328 deletions(-)
diff --git a/README b/README
index fefa71c..88a21ff 100644
--- a/README
+++ b/README
@@ -3493,9 +3493,6 @@ FIT uImage format:
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.
- CONFIG_MTD_NAND_VERIFY_WRITE
- verify if the written data is correct reread.
-
- UBI support
CONFIG_CMD_UBI
diff --git a/board/prodrive/alpr/nand.c b/board/prodrive/alpr/nand.c
index 5427de5..ca40cea 100644
--- a/board/prodrive/alpr/nand.c
+++ b/board/prodrive/alpr/nand.c
@@ -93,19 +93,6 @@ static void alpr_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
}
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
-{
- int i;
-
- for (i = 0; i < len; i++)
- if (buf[i] != readb(&(alpr_ndfc->data)))
- return i;
-
- return 0;
-}
-#endif
-
static int alpr_nand_dev_ready(struct mtd_info *mtd)
{
/*
@@ -130,9 +117,6 @@ int board_nand_init(struct nand_chip *nand)
nand->read_byte = alpr_nand_read_byte;
nand->write_buf = alpr_nand_write_buf;
nand->read_buf = alpr_nand_read_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- nand->verify_buf = alpr_nand_verify_buf;
-#endif
nand->dev_ready = alpr_nand_dev_ready;
return 0;
diff --git a/board/socrates/nand.c b/board/socrates/nand.c
index 7394478..15e6ea6 100644
--- a/board/socrates/nand.c
+++ b/board/socrates/nand.c
@@ -18,9 +18,6 @@ static void sc_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len);
static u_char sc_nand_read_byte(struct mtd_info *mtd);
static u16 sc_nand_read_word(struct mtd_info *mtd);
static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len);
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len);
-#endif
static int sc_nand_device_ready(struct mtd_info *mtdinfo);
#define FPGA_NAND_CMD_MASK (0x7 << 28)
@@ -102,25 +99,6 @@ static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
}
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/**
- * sc_nand_verify_buf - Verify chip data against buffer
- * @mtd: MTD device structure
- * @buf: buffer containing the data to compare
- * @len: number of bytes to compare
- */
-static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
-{
- int i;
-
- for (i = 0; i < len; i++) {
- if (buf[i] != sc_nand_read_byte(mtd));
- return -EFAULT;
- }
- return 0;
-}
-#endif
-
/**
* sc_nand_device_ready - Check the NAND device is ready for next command.
* @mtd: MTD device structure
@@ -178,9 +156,6 @@ int board_nand_init(struct nand_chip *nand)
nand->read_word = sc_nand_read_word;
nand->write_buf = sc_nand_write_buf;
nand->read_buf = sc_nand_read_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- nand->verify_buf = sc_nand_verify_buf;
-#endif
return 0;
}
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 41689b5..a397074 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -405,18 +405,6 @@ static int nand_davinci_write_page(struct mtd_info *mtd, struct nand_chip *chip,
goto err;
}
-#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
- /* Send command to read back the data */
- chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
-
- if (chip->verify_buf(mtd, buf, mtd->writesize)) {
- ret = -EIO;
- goto err;
- }
-
- /* Make sure the next page prog is preceded by a status read */
- chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
-#endif
err:
/* restore ECC layout */
if (page < CONFIG_KEYSTONE_NAND_MAX_RBL_PAGE) {
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 3372b64..e85832d 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -561,41 +561,6 @@ static void fsl_elbc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
len, avail);
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/*
- * Verify buffer against the FCM Controller Data Buffer
- */
-static int fsl_elbc_verify_buf(struct mtd_info *mtd,
- const u_char *buf, int len)
-{
- struct nand_chip *chip = mtd->priv;
- struct fsl_elbc_mtd *priv = chip->priv;
- struct fsl_elbc_ctrl *ctrl = priv->ctrl;
- int i;
-
- if (len < 0) {
- printf("write_buf of %d bytes", len);
- return -EINVAL;
- }
-
- if ((unsigned int)len > ctrl->read_bytes - ctrl->index) {
- printf("verify_buf beyond end of buffer "
- "(%d requested, %u available)\n",
- len, ctrl->read_bytes - ctrl->index);
-
- ctrl->index = ctrl->read_bytes;
- return -EINVAL;
- }
-
- for (i = 0; i < len; i++)
- if (in_8(&ctrl->addr[ctrl->index + i]) != buf[i])
- break;
-
- ctrl->index += len;
- return i == len && ctrl->status == LTESR_CC ? 0 : -EIO;
-}
-#endif
-
/* This function is called after Program and Erase Operations to
* check for success or failure.
*/
@@ -727,9 +692,6 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr)
nand->read_byte = fsl_elbc_read_byte;
nand->write_buf = fsl_elbc_write_buf;
nand->read_buf = fsl_elbc_read_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- nand->verify_buf = fsl_elbc_verify_buf;
-#endif
nand->select_chip = fsl_elbc_select_chip;
nand->cmdfunc = fsl_elbc_cmdfunc;
nand->waitfunc = fsl_elbc_wait;
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index b283eae..7903eeb 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -683,41 +683,6 @@ static void fsl_ifc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
__func__, len, avail);
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/*
- * Verify buffer against the IFC Controller Data Buffer
- */
-static int fsl_ifc_verify_buf(struct mtd_info *mtd,
- const u_char *buf, int len)
-{
- struct nand_chip *chip = mtd->priv;
- struct fsl_ifc_mtd *priv = chip->priv;
- struct fsl_ifc_ctrl *ctrl = priv->ctrl;
- int i;
-
- if (len < 0) {
- printf("%s of %d bytes", __func__, len);
- return -EINVAL;
- }
-
- if ((unsigned int)len > ctrl->read_bytes - ctrl->index) {
- printf("%s beyond end of buffer "
- "(%d requested, %u available)\n",
- __func__, len, ctrl->read_bytes - ctrl->index);
-
- ctrl->index = ctrl->read_bytes;
- return -EINVAL;
- }
-
- for (i = 0; i < len; i++)
- if (in_8(&ctrl->addr[ctrl->index + i]) != buf[i])
- break;
-
- ctrl->index += len;
- return i == len && ctrl->status == IFC_NAND_EVTER_STAT_OPC ? 0 : -EIO;
-}
-#endif
-
/* This function is called after Program and Erase Operations to
* check for success or failure.
*/
@@ -940,9 +905,6 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
nand->write_buf = fsl_ifc_write_buf;
nand->read_buf = fsl_ifc_read_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- nand->verify_buf = fsl_ifc_verify_buf;
-#endif
nand->select_chip = fsl_ifc_select_chip;
nand->cmdfunc = fsl_ifc_cmdfunc;
nand->waitfunc = fsl_ifc_wait;
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index 65ce98a..5426c32 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -153,21 +153,6 @@ static void upm_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
buf[i] = in_8(chip->IO_ADDR_R);
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int upm_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
-{
- int i;
- struct nand_chip *chip = mtd->priv;
-
- for (i = 0; i < len; i++) {
- if (buf[i] != in_8(chip->IO_ADDR_R))
- return -EFAULT;
- }
-
- return 0;
-}
-#endif
-
static int nand_dev_ready(struct mtd_info *mtd)
{
struct nand_chip *chip = mtd->priv;
@@ -193,9 +178,6 @@ int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun)
chip->read_byte = upm_nand_read_byte;
chip->read_buf = upm_nand_read_buf;
chip->write_buf = upm_nand_write_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- chip->verify_buf = upm_nand_verify_buf;
-#endif
if (fun->dev_ready)
chip->dev_ready = nand_dev_ready;
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 7233bfc..e621c36 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -459,29 +459,6 @@ static void mpc5121_nfc_write_buf(struct mtd_info *mtd,
mpc5121_nfc_buf_copy(mtd, (u_char *) buf, len, 1);
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/* Compare buffer with NAND flash */
-static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
- const u_char * buf, int len)
-{
- u_char tmp[256];
- uint bsize;
-
- while (len) {
- bsize = min(len, 256);
- mpc5121_nfc_read_buf(mtd, tmp, bsize);
-
- if (memcmp(buf, tmp, bsize))
- return 1;
-
- buf += bsize;
- len -= bsize;
- }
-
- return 0;
-}
-#endif
-
/* Read byte from NFC buffers */
static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
{
@@ -609,9 +586,6 @@ int board_nand_init(struct nand_chip *chip)
chip->read_word = mpc5121_nfc_read_word;
chip->read_buf = mpc5121_nfc_read_buf;
chip->write_buf = mpc5121_nfc_write_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- chip->verify_buf = mpc5121_nfc_verify_buf;
-#endif
chip->select_chip = mpc5121_nfc_select_chip;
chip->bbt_options = NAND_BBT_USE_FLASH;
chip->ecc.mode = NAND_ECC_SOFT;
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 2e5b5b9..f12b07e 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -949,34 +949,6 @@ static void mxc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
host->col_addr = col;
}
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/*
- * Used by the upper layer to verify the data in NAND Flash
- * with the data in the buf.
- */
-static int mxc_nand_verify_buf(struct mtd_info *mtd,
- const u_char *buf, int len)
-{
- u_char tmp[256];
- uint bsize;
-
- while (len) {
- bsize = min(len, 256);
- mxc_nand_read_buf(mtd, tmp, bsize);
-
- if (memcmp(buf, tmp, bsize))
- return 1;
-
- buf += bsize;
- len -= bsize;
- }
-
- return 0;
-}
-#endif
-#endif
-
/*
* This function is used by upper layer for select and
* deselect of the NAND chip
@@ -1207,11 +1179,6 @@ int board_nand_init(struct nand_chip *this)
this->read_word = mxc_nand_read_word;
this->write_buf = mxc_nand_write_buf;
this->read_buf = mxc_nand_read_buf;
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- this->verify_buf = mxc_nand_verify_buf;
-#endif
-#endif
host->regs = (struct mxc_nand_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
#ifdef MXC_NFC_V3_2
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 6db6566..c0e381a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -361,51 +361,6 @@ void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
ioread8_rep(chip->IO_ADDR_R, buf, len);
}
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-/**
- * nand_verify_buf - [DEFAULT] Verify chip data against buffer
- * @mtd: MTD device structure
- * @buf: buffer containing the data to compare
- * @len: number of bytes to compare
- *
- * Default verify function for 8bit buswidth.
- */
-static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
-{
- int i;
- struct nand_chip *chip = mtd->priv;
-
- for (i = 0; i < len; i++)
- if (buf[i] != readb(chip->IO_ADDR_R))
- return -EFAULT;
- return 0;
-}
-
-/**
- * nand_verify_buf16 - [DEFAULT] Verify chip data against buffer
- * @mtd: MTD device structure
- * @buf: buffer containing the data to compare
- * @len: number of bytes to compare
- *
- * Default verify function for 16bit buswidth.
- */
-static int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
-{
- int i;
- struct nand_chip *chip = mtd->priv;
- u16 *p = (u16 *) buf;
- len >>= 1;
-
- for (i = 0; i < len; i++)
- if (p[i] != readw(chip->IO_ADDR_R))
- return -EFAULT;
-
- return 0;
-}
-#endif
-#endif
-
/**
* nand_write_buf16 - [DEFAULT] write buffer to chip
* @mtd: MTD device structure
@@ -2435,20 +2390,6 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
status = chip->waitfunc(mtd, chip);
}
-
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- /* Send command to read back the data */
- chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
-
- if (chip->verify_buf(mtd, buf, mtd->writesize))
- return -EIO;
-
- /* Make sure the next page prog is preceded by a status read */
- chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
-#endif
-#endif
-
return 0;
}
@@ -3139,12 +3080,6 @@ static void nand_set_defaults(struct nand_chip *chip, int busw)
chip->read_buf = busw ? nand_read_buf16 : nand_read_buf;
if (!chip->scan_bbt)
chip->scan_bbt = nand_default_bbt;
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- if (!chip->verify_buf)
- chip->verify_buf = busw ? nand_verify_buf16 : nand_verify_buf;
-#endif
-#endif
if (!chip->controller) {
chip->controller = &chip->hwcontrol;
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 2659595..8a68cb0 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -118,21 +118,6 @@ static void ndfc_write_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len
out_be32((u32 *)(base + NDFC_DATA), *p++);
}
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
-static int ndfc_verify_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len)
-{
- struct nand_chip *this = mtdinfo->priv;
- ulong base = (ulong) this->IO_ADDR_W & 0xffffff00;
- uint32_t *p = (uint32_t *) buf;
-
- for (; len > 0; len -= 4)
- if (*p++ != in_be32((u32 *)(base + NDFC_DATA)))
- return -1;
-
- return 0;
-}
-#endif
-
/*
* Read a byte from the NDFC.
*/
@@ -207,9 +192,6 @@ int board_nand_init(struct nand_chip *nand)
#endif
nand->write_buf = ndfc_write_buf;
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- nand->verify_buf = ndfc_verify_buf;
-#endif
nand->read_byte = ndfc_read_byte;
chip++;
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 838a0b1..dca1ca5 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -391,7 +391,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/BSC9131RDB.h b/include/configs/BSC9131RDB.h
index 6aaaaa4..047ed8b 100644
--- a/include/configs/BSC9131RDB.h
+++ b/include/configs/BSC9131RDB.h
@@ -198,7 +198,6 @@ extern unsigned long get_sdram_size(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
index 59a8d1b..ceee0e4 100644
--- a/include/configs/BSC9132QDS.h
+++ b/include/configs/BSC9132QDS.h
@@ -320,7 +320,6 @@ combinations. this should be removed later
/* NAND */
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
index e24b923..7c45c36 100644
--- a/include/configs/C29XPCIE.h
+++ b/include/configs/C29XPCIE.h
@@ -234,7 +234,6 @@
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (1024 * 1024)
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index dd81229..e18ce2f 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -269,7 +269,6 @@
"mtdparts=e2800000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)"
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE 16384
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 98e9072..99c38d8 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -242,7 +242,6 @@
"mtdparts=e0600000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)"
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE 1
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE 16384
diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index 832c10f..ad42d1e 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -280,7 +280,6 @@
* NAND Flash on the Local Bus
*/
#define CONFIG_CMD_NAND 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE 1
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_NAND_FSL_ELBC 1
diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index 2722164..dc09b1f 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -308,7 +308,6 @@
CONFIG_SYS_NAND_BASE + 0x80000, \
CONFIG_SYS_NAND_BASE + 0xC0000}
#define CONFIG_SYS_MAX_NAND_DEVICE 4
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h
index 4da247c..e624c71 100644
--- a/include/configs/MPC8569MDS.h
+++ b/include/configs/MPC8569MDS.h
@@ -194,7 +194,6 @@ extern unsigned long get_clock_freq(void);
#define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE, }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE 1
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 0b07876..5e7bc49 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -303,7 +303,6 @@
CONFIG_SYS_NAND_BASE + 0x80000,\
CONFIG_SYS_NAND_BASE + 0xC0000}
#define CONFIG_SYS_MAX_NAND_DEVICE 4
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index cd6a39c..ccf3ce3 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -444,7 +444,6 @@ extern unsigned long get_sdram_size(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#if defined(CONFIG_P1010RDB_PA)
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 4371110..795e3b5 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -290,7 +290,6 @@
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND 1
#define CONFIG_SYS_NAND_BLOCK_SIZE (256 * 1024)
#define CONFIG_ELBC_NAND_SPL_STATIC_PGSIZE
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index a8b7817..d65c461 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -136,7 +136,6 @@ extern unsigned long get_clock_freq(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_NAND_FSL_ELBC
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index d8d30bb..f99da65 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -251,7 +251,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index 3f02ced..2927043 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -398,7 +398,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index bd40d6a..84e8336 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -379,7 +379,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index 92f5f56..faf8c9d 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -308,7 +308,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index d47f1be..ce0a741 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -342,7 +342,6 @@
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index ff6d2c1..046aa48 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -357,7 +357,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
index db6b42e..faaf22c 100644
--- a/include/configs/T208xRDB.h
+++ b/include/configs/T208xRDB.h
@@ -328,7 +328,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
index dd7d52f..cfe6557 100644
--- a/include/configs/T4240QDS.h
+++ b/include/configs/T4240QDS.h
@@ -281,7 +281,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index b644a6c..c1ad35a 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -467,7 +467,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_DDR_LAW 11
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index 225ffdd..8e27ae4 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -248,7 +248,6 @@
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index f084834..67f724b 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -214,7 +214,6 @@
#define CONFIG_SYS_NAND_BASE 0xE1000000
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_SYS_NAND_MAX_CHIPS 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_NAND_FSL_ELBC
#define CONFIG_SYS_NAND_PAGE_SIZE (2048)
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 << 10)
diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h
index 949b3da..b70b5b1 100644
--- a/include/configs/km/kmp204x-common.h
+++ b/include/configs/km/kmp204x-common.h
@@ -167,7 +167,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 2874ccc..7fb09fd 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -251,7 +251,6 @@ unsigned long get_board_ddr_clk(void);
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/ls2085a_common.h b/include/configs/ls2085a_common.h
index 6fe032c..7fc5735 100644
--- a/include/configs/ls2085a_common.h
+++ b/include/configs/ls2085a_common.h
@@ -189,7 +189,6 @@
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 5f27c2a..a5f9717 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -494,7 +494,6 @@
#define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND
#if defined(CONFIG_P1020RDB_PD)
#define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
index 00787bb..8a25783 100644
--- a/include/configs/ve8313.h
+++ b/include/configs/ve8313.h
@@ -183,7 +183,6 @@
*/
#define CONFIG_SYS_NAND_BASE 0x61000000
#define CONFIG_SYS_MAX_NAND_DEVICE 1
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_CMD_NAND 1
#define CONFIG_NAND_FSL_ELBC 1
#define CONFIG_SYS_NAND_BLOCK_SIZE 16384
diff --git a/include/configs/xpedite537x.h b/include/configs/xpedite537x.h
index 860cfc3..9f93c36 100644
--- a/include/configs/xpedite537x.h
+++ b/include/configs/xpedite537x.h
@@ -131,7 +131,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
CONFIG_SYS_NAND_BASE2}
#define CONFIG_SYS_MAX_NAND_DEVICE 2
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_SYS_NAND_QUIET_TEST /* 2nd NAND flash not always populated */
#define CONFIG_NAND_FSL_ELBC
diff --git a/include/configs/xpedite550x.h b/include/configs/xpedite550x.h
index 4536b94..ac3f4f1 100644
--- a/include/configs/xpedite550x.h
+++ b/include/configs/xpedite550x.h
@@ -122,7 +122,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
#define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
CONFIG_SYS_NAND_BASE2}
#define CONFIG_SYS_MAX_NAND_DEVICE 2
-#define CONFIG_MTD_NAND_VERIFY_WRITE
#define CONFIG_SYS_NAND_QUIET_TEST /* 2nd NAND flash not always populated */
#define CONFIG_NAND_FSL_ELBC
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 8438490..bc927ec 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -678,11 +678,6 @@ struct nand_chip {
void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
-#ifdef __UBOOT__
-#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
- int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
-#endif
-#endif
void (*select_chip)(struct mtd_info *mtd, int chip);
int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 5/5] nand: yaffs: Remove the "nand write.yaffs" command
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
` (2 preceding siblings ...)
2015-02-03 17:58 ` [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE Peter Tyser
@ 2015-02-03 17:58 ` Peter Tyser
2015-02-11 6:45 ` [U-Boot] [PATCH 1/5] nand: Add verification functions Heiko Schocher
4 siblings, 0 replies; 10+ messages in thread
From: Peter Tyser @ 2015-02-03 17:58 UTC (permalink / raw)
To: u-boot
This command is only enabled by one board, complicates the NAND code,
and doesn't appear to have been functioning properly for several
years. If there are no bad blocks in the NAND region being written
nand_write_skip_bad() will take the shortcut of calling nand_write()
which bypasses the special yaffs handling. This causes invalid YAFFS
data to be written. See
http://lists.denx.de/pipermail/u-boot/2011-September/102830.html for
an example and a potential workaround.
U-Boot still retains the ability to mount and access YAFFS partitions
via CONFIG_YAFFS2.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
If people are actively using nand write.yaffs, feel free to chime in
if you'd like it to be kept in. I spent a little time trying to use
it and ran into a handful of issues which made me think it wasn't
actively used.
It's also not clear to me why nand write.raw wouldn't be usable since
it should allow writing any arbitrary data?
common/cmd_nand.c | 15 ---------
drivers/mtd/nand/nand_util.c | 77 +++++++-------------------------------------
include/configs/M54418TWR.h | 1 -
include/configs/VCMA9.h | 1 -
include/nand.h | 7 ++--
5 files changed, 14 insertions(+), 87 deletions(-)
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index bada28c..17fa7ea 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -705,16 +705,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
maxsize, (u_char *)addr,
WITH_DROP_FFS | WITH_WR_VERIFY);
#endif
-#ifdef CONFIG_CMD_NAND_YAFFS
- } else if (!strcmp(s, ".yaffs")) {
- if (read) {
- printf("Unknown nand command suffix '%s'.\n", s);
- return 1;
- }
- ret = nand_write_skip_bad(nand, off, &rwsize, NULL,
- maxsize, (u_char *)addr,
- WITH_YAFFS_OOB | WITH_WR_VERIFY);
-#endif
} else if (!strcmp(s, ".oob")) {
/* out-of-band data */
mtd_oob_ops_t ops = {
@@ -857,11 +847,6 @@ static char nand_help_text[] =
" 'addr', skipping bad blocks and dropping any pages at the end\n"
" of eraseblocks that contain only 0xFF\n"
#endif
-#ifdef CONFIG_CMD_NAND_YAFFS
- "nand write.yaffs - addr off|partition size\n"
- " write 'size' bytes starting at offset 'off' with yaffs format\n"
- " from memory address 'addr', skipping bad blocks.\n"
-#endif
"nand erase[.spread] [clean] off size - erase 'size' bytes "
"from offset 'off'\n"
" With '.spread', erase enough for given file size, otherwise,\n"
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index f487756..12dd26a 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -580,24 +580,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
if (actual)
*actual = 0;
-#ifdef CONFIG_CMD_NAND_YAFFS
- if (flags & WITH_YAFFS_OOB) {
- if (flags & (~WITH_YAFFS_OOB & ~WITH_WR_VERIFY))
- return -EINVAL;
-
- int pages;
- pages = nand->erasesize / nand->writesize;
- blocksize = (pages * nand->oobsize) + nand->erasesize;
- if (*length % (nand->writesize + nand->oobsize)) {
- printf("Attempt to write incomplete page"
- " in yaffs mode\n");
- return -EINVAL;
- }
- } else
-#endif
- {
- blocksize = nand->erasesize;
- }
+ blocksize = nand->erasesize;
/*
* nand_write() handles unaligned, partial page writes.
@@ -666,58 +649,22 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
else
write_size = blocksize - block_offset;
-#ifdef CONFIG_CMD_NAND_YAFFS
- if (flags & WITH_YAFFS_OOB) {
- int page, pages;
- size_t pagesize = nand->writesize;
- size_t pagesize_oob = pagesize + nand->oobsize;
- struct mtd_oob_ops ops;
-
- ops.len = pagesize;
- ops.ooblen = nand->oobsize;
- ops.mode = MTD_OPS_AUTO_OOB;
- ops.ooboffs = 0;
-
- pages = write_size / pagesize_oob;
- for (page = 0; page < pages; page++) {
- WATCHDOG_RESET();
-
- ops.datbuf = p_buffer;
- ops.oobbuf = ops.datbuf + pagesize;
-
- rval = mtd_write_oob(nand, offset, &ops);
-
- if ((flags & WITH_WR_VERIFY) && !rval)
- rval = nand_verify_page_oob(nand,
- &ops, offset);
-
- if (rval != 0)
- break;
-
- offset += pagesize;
- p_buffer += pagesize_oob;
- }
- }
- else
-#endif
- {
- truncated_write_size = write_size;
+ truncated_write_size = write_size;
#ifdef CONFIG_CMD_NAND_TRIMFFS
- if (flags & WITH_DROP_FFS)
- truncated_write_size = drop_ffs(nand, p_buffer,
- &write_size);
+ if (flags & WITH_DROP_FFS)
+ truncated_write_size = drop_ffs(nand, p_buffer,
+ &write_size);
#endif
- rval = nand_write(nand, offset, &truncated_write_size,
- p_buffer);
+ rval = nand_write(nand, offset, &truncated_write_size,
+ p_buffer);
- if ((flags & WITH_WR_VERIFY) && !rval)
- rval = nand_verify(nand, offset,
- truncated_write_size, p_buffer);
+ if ((flags & WITH_WR_VERIFY) && !rval)
+ rval = nand_verify(nand, offset,
+ truncated_write_size, p_buffer);
- offset += write_size;
- p_buffer += write_size;
- }
+ offset += write_size;
+ p_buffer += write_size;
if (rval != 0) {
printf("NAND write to offset %llx failed %d\n",
diff --git a/include/configs/M54418TWR.h b/include/configs/M54418TWR.h
index 3d7dc1f..e107a2b 100644
--- a/include/configs/M54418TWR.h
+++ b/include/configs/M54418TWR.h
@@ -55,7 +55,6 @@
#define CONFIG_CMD_MISC
#define CONFIG_CMD_MII
#undef CONFIG_CMD_NAND
-#undef CONFIG_CMD_NAND_YAFFS
#define CONFIG_CMD_NET
#define CONFIG_CMD_NFS
#define CONFIG_CMD_PING
diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h
index 94078f5..6aee6db 100644
--- a/include/configs/VCMA9.h
+++ b/include/configs/VCMA9.h
@@ -62,7 +62,6 @@
#define CONFIG_CMD_PING
#define CONFIG_CMD_BSP
#define CONFIG_CMD_NAND
-#define CONFIG_CMD_NAND_YAFFS
#define CONFIG_BOARD_LATE_INIT
diff --git a/include/nand.h b/include/nand.h
index 49a05dc..b702a97 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -130,11 +130,8 @@ typedef struct nand_erase_options nand_erase_options_t;
int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
size_t *actual, loff_t lim, u_char *buffer);
-#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 */
-#define WITH_WR_VERIFY (1 << 2) /* verify data was written correctly */
+#define WITH_DROP_FFS (1 << 0) /* drop trailing all-0xff pages */
+#define WITH_WR_VERIFY (1 << 1) /* verify data was written correctly */
int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
size_t *actual, loff_t lim, u_char *buffer, int flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 3/5] dfu: nand: Verify writes
2015-02-03 17:58 ` [U-Boot] [PATCH 3/5] dfu: nand: Verify writes Peter Tyser
@ 2015-02-04 9:22 ` Lukasz Majewski
2015-02-11 6:45 ` Heiko Schocher
1 sibling, 0 replies; 10+ messages in thread
From: Lukasz Majewski @ 2015-02-04 9:22 UTC (permalink / raw)
To: u-boot
Hi Peter,
> Previously NAND writes were not verified and could fail silently. Add
> a verification step after all writes to NAND.
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
> I don't have a board with DFU support, so this change is untested.
>
> drivers/dfu/dfu_nand.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
> index f9ee189..a975492 100644
> --- a/drivers/dfu/dfu_nand.c
> +++ b/drivers/dfu/dfu_nand.c
> @@ -64,7 +64,7 @@ static int nand_block_op(enum dfu_op op, struct
> dfu_entity *dfu, return ret;
> /* then write */
> ret = nand_write_skip_bad(nand, start, &count,
> &actual,
> - lim, buf, 0);
> + lim, buf, WITH_WR_VERIFY);
> }
>
> if (ret != 0) {
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
I think that Heiko or Tom, who are active users of DFU NAND, should
check this patch too.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/5] nand: Add verification functions
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
` (3 preceding siblings ...)
2015-02-03 17:58 ` [U-Boot] [PATCH 5/5] nand: yaffs: Remove the "nand write.yaffs" command Peter Tyser
@ 2015-02-11 6:45 ` Heiko Schocher
4 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2015-02-11 6:45 UTC (permalink / raw)
To: u-boot
Hello Peter,
Am 03.02.2015 18:58, schrieb Peter Tyser:
> Add nand_verify() and nand_verify_page_oob(). nand_verify() verifies
> NAND contents against an arbitrarily sized buffer using ECC while
> nand_verify_page_oob() verifies a NAND page's contents and OOB.
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>
> drivers/mtd/nand/nand_util.c | 97 +++++++++++++++++++++++++++++++++++++++++++-
> include/nand.h | 4 ++
> 2 files changed, 100 insertions(+), 1 deletion(-)
Tested on the am335x based dxr2 board with writing a ubifs image
into a nand mtd partition.
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
> index afdd160..f487756 100644
> --- a/drivers/mtd/nand/nand_util.c
> +++ b/drivers/mtd/nand/nand_util.c
> @@ -464,6 +464,87 @@ static size_t drop_ffs(const nand_info_t *nand, const u_char *buf,
> #endif
>
> /**
> + * nand_verify_page_oob:
> + *
> + * Verify a page of NAND flash, including the OOB.
> + * Reads page of NAND and verifies the contents and OOB against the
> + * values in ops.
> + *
> + * @param nand NAND device
> + * @param ops MTD operations, including data to verify
> + * @param ofs offset in flash
> + * @return 0 in case of success
> + */
> +int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops, loff_t ofs)
> +{
> + int rval;
> + struct mtd_oob_ops vops;
> + size_t verlen = nand->writesize + nand->oobsize;
> +
> + memcpy(&vops, ops, sizeof(vops));
> +
> + vops.datbuf = malloc(verlen);
> +
> + if (!vops.datbuf)
> + return -ENOMEM;
> +
> + vops.oobbuf = vops.datbuf + nand->writesize;
> +
> + rval = mtd_read_oob(nand, ofs, &vops);
> + if (!rval)
> + rval = memcmp(ops->datbuf, vops.datbuf, vops.len);
> + if (!rval)
> + rval = memcmp(ops->oobbuf, vops.oobbuf, vops.ooblen);
> +
> + free(vops.datbuf);
> +
> + return rval ? -EIO : 0;
> +}
> +
> +/**
> + * nand_verify:
> + *
> + * Verify a region of NAND flash.
> + * Reads NAND in page-sized chunks and verifies the contents against
> + * the contents of a buffer. The offset into the NAND must be
> + * page-aligned, and the function doesn't handle skipping bad blocks.
> + *
> + * @param nand NAND device
> + * @param ofs offset in flash
> + * @param len buffer length
> + * @param buf buffer to read from
> + * @return 0 in case of success
> + */
> +int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf)
> +{
> + int rval = 0;
> + size_t verofs;
> + size_t verlen = nand->writesize;
> + uint8_t *verbuf = malloc(verlen);
> +
> + if (!verbuf)
> + return -ENOMEM;
> +
> + /* Read the NAND back in page-size groups to limit malloc size */
> + for (verofs = ofs; verofs < ofs + len;
> + verofs += verlen, buf += verlen) {
> + verlen = min(nand->writesize, (uint32_t)(ofs + len - verofs));
> + rval = nand_read(nand, verofs, &verlen, verbuf);
> + if (!rval || (rval == -EUCLEAN))
> + rval = memcmp(buf, verbuf, verlen);
> +
> + if (rval)
> + break;
> + }
> +
> + free(verbuf);
> +
> + return rval ? -EIO : 0;
> +}
> +
> +
> +
> +/**
> * nand_write_skip_bad:
> *
> * Write image to NAND flash.
> @@ -501,7 +582,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
>
> #ifdef CONFIG_CMD_NAND_YAFFS
> if (flags & WITH_YAFFS_OOB) {
> - if (flags & ~WITH_YAFFS_OOB)
> + if (flags & (~WITH_YAFFS_OOB & ~WITH_WR_VERIFY))
> return -EINVAL;
>
> int pages;
> @@ -554,6 +635,10 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
>
> if (!need_skip && !(flags & WITH_DROP_FFS)) {
> rval = nand_write(nand, offset, length, buffer);
> +
> + if ((flags & WITH_WR_VERIFY) && !rval)
> + rval = nand_verify(nand, offset, *length, buffer);
> +
> if (rval == 0)
> return 0;
>
> @@ -601,6 +686,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> ops.oobbuf = ops.datbuf + pagesize;
>
> rval = mtd_write_oob(nand, offset, &ops);
> +
> + if ((flags & WITH_WR_VERIFY) && !rval)
> + rval = nand_verify_page_oob(nand,
> + &ops, offset);
> +
> if (rval != 0)
> break;
>
> @@ -620,6 +710,11 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
>
> rval = nand_write(nand, offset, &truncated_write_size,
> p_buffer);
> +
> + if ((flags & WITH_WR_VERIFY) && !rval)
> + rval = nand_verify(nand, offset,
> + truncated_write_size, p_buffer);
> +
> offset += write_size;
> p_buffer += write_size;
> }
> diff --git a/include/nand.h b/include/nand.h
> index 15e31ab..49a05dc 100644
> --- a/include/nand.h
> +++ b/include/nand.h
> @@ -134,11 +134,15 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> * is a 'mode' meaning it cannot be mixed with
> * other flags */
> #define WITH_DROP_FFS (1 << 1) /* drop trailing all-0xff pages */
> +#define WITH_WR_VERIFY (1 << 2) /* verify data was written correctly */
>
> int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> size_t *actual, loff_t lim, u_char *buffer, int flags);
> int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts);
> int nand_torture(nand_info_t *nand, loff_t offset);
> +int nand_verify_page_oob(nand_info_t *nand, struct mtd_oob_ops *ops,
> + loff_t ofs);
> +int nand_verify(nand_info_t *nand, loff_t ofs, size_t len, u_char *buf);
>
> #define NAND_LOCK_STATUS_TIGHT 0x01
> #define NAND_LOCK_STATUS_UNLOCK 0x04
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND
2015-02-03 17:58 ` [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND Peter Tyser
@ 2015-02-11 6:45 ` Heiko Schocher
0 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2015-02-11 6:45 UTC (permalink / raw)
To: u-boot
Hello Peter,
Am 03.02.2015 18:58, schrieb Peter Tyser:
> Previously NAND writes were only verified when CONFIG_MTD_NAND_VERIFY_WRITE
> was defined. On boards without this define writes could fail silently.
> Boards with CONFIG_MTD_NAND_VERIFY_WRITE could prematurely report
> failures which ECC could correct.
>
> Add a verification step after all "nand write[.x]" commands to ensure the
> writes were successful. The verification uses ECC for for "normal"
> writes, but does not for raw and yaffs writes. Some test cases which
> inject fake bad bits on a 2K page flash are below.
>
> Test cases with CONFIG_MTD_NAND_VERIFY_WRITE defined:
> Example of an ECC write which previously failed when
> CONFIG_MTD_NAND_VERIFY_WRITE was defined, but now succeeds because ECC
> is used during verification:
> nand erase 0 0x10000
> dhcp /somefile
> mw.b 0x10000 0xff 0x2000
> mw.b 0x10020 0xfe 1
> nand write.raw 0x10000 0x800 1
> mw.b 0x1000020 0x01 1
> nand write 0x1000000 0x800 0x1800
>
> Test cases without CONFIG_MTD_NAND_VERIFY_WRITE defined:
> Example of an ECC write which previously silently failed:
> nand erase 0 0x10000
> dhcp /somefile
> mw.b 0x10000 0xff 0x2000
> mw.b 0x10020 0x00 1
> nand write.raw 0x10000 0x800 1
> mw.b 0x1000020 0xff 1
> nand write 0x1000000 0x800 0x1800
>
> Example of a raw write which previously failed silently due to stuck
> data bit, but now errors out:
> nand erase 0 0x10000
> dhcp /somefile
> mw.b 0x10000 0xff 0x2000
> mw.b 0x10020 0xfe 1
> nand write.raw 0x10000 0x800 1
> mw.b 0x1000020 0x01 1
> nand write.raw 0x1000000 0x800 3
>
> Example of a raw write which previously failed silently due to stuck OOB
> bit, but now errors out:
> nand erase 0 0x10000
> dhcp /somefile
> mw.b 0x10000 0xff 0x2000
> mw.b 0x10810 0xfe 1
> nand write.raw 0x10000 0x800 1
> mw.b 0x1000810 0x01 1
> nand write.raw 0x1000000 0x800 3
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>
> common/cmd_nand.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
Tested on the am335x based dxr2 board with writing a ubifs image
into a nand mtd partition.
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 7f962dc..bada28c 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -419,10 +419,13 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count,
> .mode = MTD_OPS_RAW
> };
>
> - if (read)
> + if (read) {
> ret = mtd_read_oob(nand, off, &ops);
> - else
> + } else {
> ret = mtd_write_oob(nand, off, &ops);
> + if (!ret)
> + ret = nand_verify_page_oob(nand, &ops, off);
> + }
>
> if (ret) {
> printf("%s: error at offset %llx, ret %d\n",
> @@ -690,7 +693,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> else
> ret = nand_write_skip_bad(nand, off, &rwsize,
> NULL, maxsize,
> - (u_char *)addr, 0);
> + (u_char *)addr,
> + WITH_WR_VERIFY);
> #ifdef CONFIG_CMD_NAND_TRIMFFS
> } else if (!strcmp(s, ".trimffs")) {
> if (read) {
> @@ -699,7 +703,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> }
> ret = nand_write_skip_bad(nand, off, &rwsize, NULL,
> maxsize, (u_char *)addr,
> - WITH_DROP_FFS);
> + WITH_DROP_FFS | WITH_WR_VERIFY);
> #endif
> #ifdef CONFIG_CMD_NAND_YAFFS
> } else if (!strcmp(s, ".yaffs")) {
> @@ -709,7 +713,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> }
> ret = nand_write_skip_bad(nand, off, &rwsize, NULL,
> maxsize, (u_char *)addr,
> - WITH_YAFFS_OOB);
> + WITH_YAFFS_OOB | WITH_WR_VERIFY);
> #endif
> } else if (!strcmp(s, ".oob")) {
> /* out-of-band data */
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 3/5] dfu: nand: Verify writes
2015-02-03 17:58 ` [U-Boot] [PATCH 3/5] dfu: nand: Verify writes Peter Tyser
2015-02-04 9:22 ` Lukasz Majewski
@ 2015-02-11 6:45 ` Heiko Schocher
1 sibling, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2015-02-11 6:45 UTC (permalink / raw)
To: u-boot
Hello Peter,
Am 03.02.2015 18:58, schrieb Peter Tyser:
> Previously NAND writes were not verified and could fail silently. Add
> a verification step after all writes to NAND.
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
> I don't have a board with DFU support, so this change is untested.
Tested on the am335x based dxr2 board with writing a ubifs image
into a nand mtd partition.
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> drivers/dfu/dfu_nand.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
> index f9ee189..a975492 100644
> --- a/drivers/dfu/dfu_nand.c
> +++ b/drivers/dfu/dfu_nand.c
> @@ -64,7 +64,7 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
> return ret;
> /* then write */
> ret = nand_write_skip_bad(nand, start, &count, &actual,
> - lim, buf, 0);
> + lim, buf, WITH_WR_VERIFY);
> }
>
> if (ret != 0) {
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE
2015-02-03 17:58 ` [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE Peter Tyser
@ 2015-02-11 6:46 ` Heiko Schocher
0 siblings, 0 replies; 10+ messages in thread
From: Heiko Schocher @ 2015-02-11 6:46 UTC (permalink / raw)
To: u-boot
Hello Peter,
Am 03.02.2015 18:58, schrieb Peter Tyser:
> The CONFIG_MTD_NAND_VERIFY_WRITE has been removed from Linux for some
> time and a more generic method of NAND verification now exists in U-Boot.
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>
> README | 3 --
> board/prodrive/alpr/nand.c | 16 ---------
> board/socrates/nand.c | 25 --------------
> drivers/mtd/nand/davinci_nand.c | 12 -------
> drivers/mtd/nand/fsl_elbc_nand.c | 38 ----------------------
> drivers/mtd/nand/fsl_ifc_nand.c | 38 ----------------------
> drivers/mtd/nand/fsl_upm.c | 18 ----------
> drivers/mtd/nand/mpc5121_nfc.c | 26 ---------------
> drivers/mtd/nand/mxc_nand.c | 33 -------------------
> drivers/mtd/nand/nand_base.c | 65 -------------------------------------
> drivers/mtd/nand/ndfc.c | 18 ----------
> include/configs/B4860QDS.h | 1 -
> include/configs/BSC9131RDB.h | 1 -
> include/configs/BSC9132QDS.h | 1 -
> include/configs/C29XPCIE.h | 1 -
> include/configs/MPC8313ERDB.h | 1 -
> include/configs/MPC8315ERDB.h | 1 -
> include/configs/MPC837XEMDS.h | 1 -
> include/configs/MPC8536DS.h | 1 -
> include/configs/MPC8569MDS.h | 1 -
> include/configs/MPC8572DS.h | 1 -
> include/configs/P1010RDB.h | 1 -
> include/configs/P1022DS.h | 1 -
> include/configs/P1023RDB.h | 1 -
> include/configs/P2041RDB.h | 1 -
> include/configs/T102xQDS.h | 1 -
> include/configs/T102xRDB.h | 1 -
> include/configs/T1040QDS.h | 1 -
> include/configs/T104xRDB.h | 1 -
> include/configs/T208xQDS.h | 1 -
> include/configs/T208xRDB.h | 1 -
> include/configs/T4240QDS.h | 1 -
> include/configs/T4240RDB.h | 1 -
> include/configs/corenet_ds.h | 1 -
> include/configs/ids8313.h | 1 -
> include/configs/km/kmp204x-common.h | 1 -
> include/configs/ls1021aqds.h | 1 -
> include/configs/ls2085a_common.h | 1 -
> include/configs/p1_p2_rdb_pc.h | 1 -
> include/configs/ve8313.h | 1 -
> include/configs/xpedite537x.h | 1 -
> include/configs/xpedite550x.h | 1 -
> include/linux/mtd/nand.h | 5 ---
> 43 files changed, 328 deletions(-)
Tested on the am335x based dxr2 board with writing a ubifs image
into a nand mtd partition.
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/README b/README
> index fefa71c..88a21ff 100644
> --- a/README
> +++ b/README
> @@ -3493,9 +3493,6 @@ FIT uImage format:
> Adds the MTD partitioning infrastructure from the Linux
> kernel. Needed for UBI support.
>
> - CONFIG_MTD_NAND_VERIFY_WRITE
> - verify if the written data is correct reread.
> -
> - UBI support
> CONFIG_CMD_UBI
>
> diff --git a/board/prodrive/alpr/nand.c b/board/prodrive/alpr/nand.c
> index 5427de5..ca40cea 100644
> --- a/board/prodrive/alpr/nand.c
> +++ b/board/prodrive/alpr/nand.c
> @@ -93,19 +93,6 @@ static void alpr_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> }
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -static int alpr_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
> -{
> - int i;
> -
> - for (i = 0; i < len; i++)
> - if (buf[i] != readb(&(alpr_ndfc->data)))
> - return i;
> -
> - return 0;
> -}
> -#endif
> -
> static int alpr_nand_dev_ready(struct mtd_info *mtd)
> {
> /*
> @@ -130,9 +117,6 @@ int board_nand_init(struct nand_chip *nand)
> nand->read_byte = alpr_nand_read_byte;
> nand->write_buf = alpr_nand_write_buf;
> nand->read_buf = alpr_nand_read_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - nand->verify_buf = alpr_nand_verify_buf;
> -#endif
> nand->dev_ready = alpr_nand_dev_ready;
>
> return 0;
> diff --git a/board/socrates/nand.c b/board/socrates/nand.c
> index 7394478..15e6ea6 100644
> --- a/board/socrates/nand.c
> +++ b/board/socrates/nand.c
> @@ -18,9 +18,6 @@ static void sc_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len);
> static u_char sc_nand_read_byte(struct mtd_info *mtd);
> static u16 sc_nand_read_word(struct mtd_info *mtd);
> static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len);
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len);
> -#endif
> static int sc_nand_device_ready(struct mtd_info *mtdinfo);
>
> #define FPGA_NAND_CMD_MASK (0x7 << 28)
> @@ -102,25 +99,6 @@ static void sc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> }
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/**
> - * sc_nand_verify_buf - Verify chip data against buffer
> - * @mtd: MTD device structure
> - * @buf: buffer containing the data to compare
> - * @len: number of bytes to compare
> - */
> -static int sc_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
> -{
> - int i;
> -
> - for (i = 0; i < len; i++) {
> - if (buf[i] != sc_nand_read_byte(mtd));
> - return -EFAULT;
> - }
> - return 0;
> -}
> -#endif
> -
> /**
> * sc_nand_device_ready - Check the NAND device is ready for next command.
> * @mtd: MTD device structure
> @@ -178,9 +156,6 @@ int board_nand_init(struct nand_chip *nand)
> nand->read_word = sc_nand_read_word;
> nand->write_buf = sc_nand_write_buf;
> nand->read_buf = sc_nand_read_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - nand->verify_buf = sc_nand_verify_buf;
> -#endif
>
> return 0;
> }
> diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
> index 41689b5..a397074 100644
> --- a/drivers/mtd/nand/davinci_nand.c
> +++ b/drivers/mtd/nand/davinci_nand.c
> @@ -405,18 +405,6 @@ static int nand_davinci_write_page(struct mtd_info *mtd, struct nand_chip *chip,
> goto err;
> }
>
> -#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
> - /* Send command to read back the data */
> - chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
> -
> - if (chip->verify_buf(mtd, buf, mtd->writesize)) {
> - ret = -EIO;
> - goto err;
> - }
> -
> - /* Make sure the next page prog is preceded by a status read */
> - chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
> -#endif
> err:
> /* restore ECC layout */
> if (page < CONFIG_KEYSTONE_NAND_MAX_RBL_PAGE) {
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
> index 3372b64..e85832d 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -561,41 +561,6 @@ static void fsl_elbc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
> len, avail);
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/*
> - * Verify buffer against the FCM Controller Data Buffer
> - */
> -static int fsl_elbc_verify_buf(struct mtd_info *mtd,
> - const u_char *buf, int len)
> -{
> - struct nand_chip *chip = mtd->priv;
> - struct fsl_elbc_mtd *priv = chip->priv;
> - struct fsl_elbc_ctrl *ctrl = priv->ctrl;
> - int i;
> -
> - if (len < 0) {
> - printf("write_buf of %d bytes", len);
> - return -EINVAL;
> - }
> -
> - if ((unsigned int)len > ctrl->read_bytes - ctrl->index) {
> - printf("verify_buf beyond end of buffer "
> - "(%d requested, %u available)\n",
> - len, ctrl->read_bytes - ctrl->index);
> -
> - ctrl->index = ctrl->read_bytes;
> - return -EINVAL;
> - }
> -
> - for (i = 0; i < len; i++)
> - if (in_8(&ctrl->addr[ctrl->index + i]) != buf[i])
> - break;
> -
> - ctrl->index += len;
> - return i == len && ctrl->status == LTESR_CC ? 0 : -EIO;
> -}
> -#endif
> -
> /* This function is called after Program and Erase Operations to
> * check for success or failure.
> */
> @@ -727,9 +692,6 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr)
> nand->read_byte = fsl_elbc_read_byte;
> nand->write_buf = fsl_elbc_write_buf;
> nand->read_buf = fsl_elbc_read_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - nand->verify_buf = fsl_elbc_verify_buf;
> -#endif
> nand->select_chip = fsl_elbc_select_chip;
> nand->cmdfunc = fsl_elbc_cmdfunc;
> nand->waitfunc = fsl_elbc_wait;
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index b283eae..7903eeb 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -683,41 +683,6 @@ static void fsl_ifc_read_buf(struct mtd_info *mtd, u8 *buf, int len)
> __func__, len, avail);
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/*
> - * Verify buffer against the IFC Controller Data Buffer
> - */
> -static int fsl_ifc_verify_buf(struct mtd_info *mtd,
> - const u_char *buf, int len)
> -{
> - struct nand_chip *chip = mtd->priv;
> - struct fsl_ifc_mtd *priv = chip->priv;
> - struct fsl_ifc_ctrl *ctrl = priv->ctrl;
> - int i;
> -
> - if (len < 0) {
> - printf("%s of %d bytes", __func__, len);
> - return -EINVAL;
> - }
> -
> - if ((unsigned int)len > ctrl->read_bytes - ctrl->index) {
> - printf("%s beyond end of buffer "
> - "(%d requested, %u available)\n",
> - __func__, len, ctrl->read_bytes - ctrl->index);
> -
> - ctrl->index = ctrl->read_bytes;
> - return -EINVAL;
> - }
> -
> - for (i = 0; i < len; i++)
> - if (in_8(&ctrl->addr[ctrl->index + i]) != buf[i])
> - break;
> -
> - ctrl->index += len;
> - return i == len && ctrl->status == IFC_NAND_EVTER_STAT_OPC ? 0 : -EIO;
> -}
> -#endif
> -
> /* This function is called after Program and Erase Operations to
> * check for success or failure.
> */
> @@ -940,9 +905,6 @@ static int fsl_ifc_chip_init(int devnum, u8 *addr)
>
> nand->write_buf = fsl_ifc_write_buf;
> nand->read_buf = fsl_ifc_read_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - nand->verify_buf = fsl_ifc_verify_buf;
> -#endif
> nand->select_chip = fsl_ifc_select_chip;
> nand->cmdfunc = fsl_ifc_cmdfunc;
> nand->waitfunc = fsl_ifc_wait;
> diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
> index 65ce98a..5426c32 100644
> --- a/drivers/mtd/nand/fsl_upm.c
> +++ b/drivers/mtd/nand/fsl_upm.c
> @@ -153,21 +153,6 @@ static void upm_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> buf[i] = in_8(chip->IO_ADDR_R);
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -static int upm_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
> -{
> - int i;
> - struct nand_chip *chip = mtd->priv;
> -
> - for (i = 0; i < len; i++) {
> - if (buf[i] != in_8(chip->IO_ADDR_R))
> - return -EFAULT;
> - }
> -
> - return 0;
> -}
> -#endif
> -
> static int nand_dev_ready(struct mtd_info *mtd)
> {
> struct nand_chip *chip = mtd->priv;
> @@ -193,9 +178,6 @@ int fsl_upm_nand_init(struct nand_chip *chip, struct fsl_upm_nand *fun)
> chip->read_byte = upm_nand_read_byte;
> chip->read_buf = upm_nand_read_buf;
> chip->write_buf = upm_nand_write_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - chip->verify_buf = upm_nand_verify_buf;
> -#endif
> if (fun->dev_ready)
> chip->dev_ready = nand_dev_ready;
>
> diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
> index 7233bfc..e621c36 100644
> --- a/drivers/mtd/nand/mpc5121_nfc.c
> +++ b/drivers/mtd/nand/mpc5121_nfc.c
> @@ -459,29 +459,6 @@ static void mpc5121_nfc_write_buf(struct mtd_info *mtd,
> mpc5121_nfc_buf_copy(mtd, (u_char *) buf, len, 1);
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/* Compare buffer with NAND flash */
> -static int mpc5121_nfc_verify_buf(struct mtd_info *mtd,
> - const u_char * buf, int len)
> -{
> - u_char tmp[256];
> - uint bsize;
> -
> - while (len) {
> - bsize = min(len, 256);
> - mpc5121_nfc_read_buf(mtd, tmp, bsize);
> -
> - if (memcmp(buf, tmp, bsize))
> - return 1;
> -
> - buf += bsize;
> - len -= bsize;
> - }
> -
> - return 0;
> -}
> -#endif
> -
> /* Read byte from NFC buffers */
> static u8 mpc5121_nfc_read_byte(struct mtd_info *mtd)
> {
> @@ -609,9 +586,6 @@ int board_nand_init(struct nand_chip *chip)
> chip->read_word = mpc5121_nfc_read_word;
> chip->read_buf = mpc5121_nfc_read_buf;
> chip->write_buf = mpc5121_nfc_write_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - chip->verify_buf = mpc5121_nfc_verify_buf;
> -#endif
> chip->select_chip = mpc5121_nfc_select_chip;
> chip->bbt_options = NAND_BBT_USE_FLASH;
> chip->ecc.mode = NAND_ECC_SOFT;
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index 2e5b5b9..f12b07e 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -949,34 +949,6 @@ static void mxc_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
> host->col_addr = col;
> }
>
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/*
> - * Used by the upper layer to verify the data in NAND Flash
> - * with the data in the buf.
> - */
> -static int mxc_nand_verify_buf(struct mtd_info *mtd,
> - const u_char *buf, int len)
> -{
> - u_char tmp[256];
> - uint bsize;
> -
> - while (len) {
> - bsize = min(len, 256);
> - mxc_nand_read_buf(mtd, tmp, bsize);
> -
> - if (memcmp(buf, tmp, bsize))
> - return 1;
> -
> - buf += bsize;
> - len -= bsize;
> - }
> -
> - return 0;
> -}
> -#endif
> -#endif
> -
> /*
> * This function is used by upper layer for select and
> * deselect of the NAND chip
> @@ -1207,11 +1179,6 @@ int board_nand_init(struct nand_chip *this)
> this->read_word = mxc_nand_read_word;
> this->write_buf = mxc_nand_write_buf;
> this->read_buf = mxc_nand_read_buf;
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - this->verify_buf = mxc_nand_verify_buf;
> -#endif
> -#endif
>
> host->regs = (struct mxc_nand_regs __iomem *)CONFIG_MXC_NAND_REGS_BASE;
> #ifdef MXC_NFC_V3_2
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 6db6566..c0e381a 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -361,51 +361,6 @@ void nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
> ioread8_rep(chip->IO_ADDR_R, buf, len);
> }
>
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -/**
> - * nand_verify_buf - [DEFAULT] Verify chip data against buffer
> - * @mtd: MTD device structure
> - * @buf: buffer containing the data to compare
> - * @len: number of bytes to compare
> - *
> - * Default verify function for 8bit buswidth.
> - */
> -static int nand_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
> -{
> - int i;
> - struct nand_chip *chip = mtd->priv;
> -
> - for (i = 0; i < len; i++)
> - if (buf[i] != readb(chip->IO_ADDR_R))
> - return -EFAULT;
> - return 0;
> -}
> -
> -/**
> - * nand_verify_buf16 - [DEFAULT] Verify chip data against buffer
> - * @mtd: MTD device structure
> - * @buf: buffer containing the data to compare
> - * @len: number of bytes to compare
> - *
> - * Default verify function for 16bit buswidth.
> - */
> -static int nand_verify_buf16(struct mtd_info *mtd, const uint8_t *buf, int len)
> -{
> - int i;
> - struct nand_chip *chip = mtd->priv;
> - u16 *p = (u16 *) buf;
> - len >>= 1;
> -
> - for (i = 0; i < len; i++)
> - if (p[i] != readw(chip->IO_ADDR_R))
> - return -EFAULT;
> -
> - return 0;
> -}
> -#endif
> -#endif
> -
> /**
> * nand_write_buf16 - [DEFAULT] write buffer to chip
> * @mtd: MTD device structure
> @@ -2435,20 +2390,6 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip,
> status = chip->waitfunc(mtd, chip);
> }
>
> -
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - /* Send command to read back the data */
> - chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
> -
> - if (chip->verify_buf(mtd, buf, mtd->writesize))
> - return -EIO;
> -
> - /* Make sure the next page prog is preceded by a status read */
> - chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
> -#endif
> -#endif
> -
> return 0;
> }
>
> @@ -3139,12 +3080,6 @@ static void nand_set_defaults(struct nand_chip *chip, int busw)
> chip->read_buf = busw ? nand_read_buf16 : nand_read_buf;
> if (!chip->scan_bbt)
> chip->scan_bbt = nand_default_bbt;
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - if (!chip->verify_buf)
> - chip->verify_buf = busw ? nand_verify_buf16 : nand_verify_buf;
> -#endif
> -#endif
>
> if (!chip->controller) {
> chip->controller = &chip->hwcontrol;
> diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
> index 2659595..8a68cb0 100644
> --- a/drivers/mtd/nand/ndfc.c
> +++ b/drivers/mtd/nand/ndfc.c
> @@ -118,21 +118,6 @@ static void ndfc_write_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len
> out_be32((u32 *)(base + NDFC_DATA), *p++);
> }
>
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> -static int ndfc_verify_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len)
> -{
> - struct nand_chip *this = mtdinfo->priv;
> - ulong base = (ulong) this->IO_ADDR_W & 0xffffff00;
> - uint32_t *p = (uint32_t *) buf;
> -
> - for (; len > 0; len -= 4)
> - if (*p++ != in_be32((u32 *)(base + NDFC_DATA)))
> - return -1;
> -
> - return 0;
> -}
> -#endif
> -
> /*
> * Read a byte from the NDFC.
> */
> @@ -207,9 +192,6 @@ int board_nand_init(struct nand_chip *nand)
> #endif
>
> nand->write_buf = ndfc_write_buf;
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - nand->verify_buf = ndfc_verify_buf;
> -#endif
> nand->read_byte = ndfc_read_byte;
>
> chip++;
> diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
> index 838a0b1..dca1ca5 100644
> --- a/include/configs/B4860QDS.h
> +++ b/include/configs/B4860QDS.h
> @@ -391,7 +391,6 @@ unsigned long get_board_ddr_clk(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/BSC9131RDB.h b/include/configs/BSC9131RDB.h
> index 6aaaaa4..047ed8b 100644
> --- a/include/configs/BSC9131RDB.h
> +++ b/include/configs/BSC9131RDB.h
> @@ -198,7 +198,6 @@ extern unsigned long get_sdram_size(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
>
> diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
> index 59a8d1b..ceee0e4 100644
> --- a/include/configs/BSC9132QDS.h
> +++ b/include/configs/BSC9132QDS.h
> @@ -320,7 +320,6 @@ combinations. this should be removed later
> /* NAND */
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/C29XPCIE.h b/include/configs/C29XPCIE.h
> index e24b923..7c45c36 100644
> --- a/include/configs/C29XPCIE.h
> +++ b/include/configs/C29XPCIE.h
> @@ -234,7 +234,6 @@
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
>
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (1024 * 1024)
>
> diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
> index dd81229..e18ce2f 100644
> --- a/include/configs/MPC8313ERDB.h
> +++ b/include/configs/MPC8313ERDB.h
> @@ -269,7 +269,6 @@
> "mtdparts=e2800000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)"
>
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
> diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
> index 98e9072..99c38d8 100644
> --- a/include/configs/MPC8315ERDB.h
> +++ b/include/configs/MPC8315ERDB.h
> @@ -242,7 +242,6 @@
> "mtdparts=e0600000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)"
>
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE 1
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
> diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
> index 832c10f..ad42d1e 100644
> --- a/include/configs/MPC837XEMDS.h
> +++ b/include/configs/MPC837XEMDS.h
> @@ -280,7 +280,6 @@
> * NAND Flash on the Local Bus
> */
> #define CONFIG_CMD_NAND 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE 1
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> #define CONFIG_NAND_FSL_ELBC 1
>
> diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
> index 2722164..dc09b1f 100644
> --- a/include/configs/MPC8536DS.h
> +++ b/include/configs/MPC8536DS.h
> @@ -308,7 +308,6 @@
> CONFIG_SYS_NAND_BASE + 0x80000, \
> CONFIG_SYS_NAND_BASE + 0xC0000}
> #define CONFIG_SYS_MAX_NAND_DEVICE 4
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/MPC8569MDS.h b/include/configs/MPC8569MDS.h
> index 4da247c..e624c71 100644
> --- a/include/configs/MPC8569MDS.h
> +++ b/include/configs/MPC8569MDS.h
> @@ -194,7 +194,6 @@ extern unsigned long get_clock_freq(void);
> #define CONFIG_SYS_NAND_BASE_PHYS CONFIG_SYS_NAND_BASE
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE, }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE 1
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
> index 0b07876..5e7bc49 100644
> --- a/include/configs/MPC8572DS.h
> +++ b/include/configs/MPC8572DS.h
> @@ -303,7 +303,6 @@
> CONFIG_SYS_NAND_BASE + 0x80000,\
> CONFIG_SYS_NAND_BASE + 0xC0000}
> #define CONFIG_SYS_MAX_NAND_DEVICE 4
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
> index cd6a39c..ccf3ce3 100644
> --- a/include/configs/P1010RDB.h
> +++ b/include/configs/P1010RDB.h
> @@ -444,7 +444,6 @@ extern unsigned long get_sdram_size(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #if defined(CONFIG_P1010RDB_PA)
> diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
> index 4371110..795e3b5 100644
> --- a/include/configs/P1022DS.h
> +++ b/include/configs/P1022DS.h
> @@ -290,7 +290,6 @@
>
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE (256 * 1024)
> #define CONFIG_ELBC_NAND_SPL_STATIC_PGSIZE
> diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
> index a8b7817..d65c461 100644
> --- a/include/configs/P1023RDB.h
> +++ b/include/configs/P1023RDB.h
> @@ -136,7 +136,6 @@ extern unsigned long get_clock_freq(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_NAND_FSL_ELBC
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
> index d8d30bb..f99da65 100644
> --- a/include/configs/P2041RDB.h
> +++ b/include/configs/P2041RDB.h
> @@ -251,7 +251,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
>
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
>
> diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
> index 3f02ced..2927043 100644
> --- a/include/configs/T102xQDS.h
> +++ b/include/configs/T102xQDS.h
> @@ -398,7 +398,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
> index bd40d6a..84e8336 100644
> --- a/include/configs/T102xRDB.h
> +++ b/include/configs/T102xRDB.h
> @@ -379,7 +379,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
> diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
> index 92f5f56..faf8c9d 100644
> --- a/include/configs/T1040QDS.h
> +++ b/include/configs/T1040QDS.h
> @@ -308,7 +308,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
> index d47f1be..ce0a741 100644
> --- a/include/configs/T104xRDB.h
> +++ b/include/configs/T104xRDB.h
> @@ -342,7 +342,6 @@
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
> diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
> index ff6d2c1..046aa48 100644
> --- a/include/configs/T208xQDS.h
> +++ b/include/configs/T208xQDS.h
> @@ -357,7 +357,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
>
> diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
> index db6b42e..faaf22c 100644
> --- a/include/configs/T208xRDB.h
> +++ b/include/configs/T208xRDB.h
> @@ -328,7 +328,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
>
> diff --git a/include/configs/T4240QDS.h b/include/configs/T4240QDS.h
> index dd7d52f..cfe6557 100644
> --- a/include/configs/T4240QDS.h
> +++ b/include/configs/T4240QDS.h
> @@ -281,7 +281,6 @@ unsigned long get_board_ddr_clk(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
> index b644a6c..c1ad35a 100644
> --- a/include/configs/T4240RDB.h
> +++ b/include/configs/T4240RDB.h
> @@ -467,7 +467,6 @@ unsigned long get_board_ddr_clk(void);
> #define CONFIG_SYS_NAND_DDR_LAW 11
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (512 * 1024)
> diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
> index 225ffdd..8e27ae4 100644
> --- a/include/configs/corenet_ds.h
> +++ b/include/configs/corenet_ds.h
> @@ -248,7 +248,6 @@
>
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
>
> diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
> index f084834..67f724b 100644
> --- a/include/configs/ids8313.h
> +++ b/include/configs/ids8313.h
> @@ -214,7 +214,6 @@
> #define CONFIG_SYS_NAND_BASE 0xE1000000
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> #define CONFIG_SYS_NAND_MAX_CHIPS 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_NAND_FSL_ELBC
> #define CONFIG_SYS_NAND_PAGE_SIZE (2048)
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 << 10)
> diff --git a/include/configs/km/kmp204x-common.h b/include/configs/km/kmp204x-common.h
> index 949b3da..b70b5b1 100644
> --- a/include/configs/km/kmp204x-common.h
> +++ b/include/configs/km/kmp204x-common.h
> @@ -167,7 +167,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
>
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE}
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
>
> diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
> index 2874ccc..7fb09fd 100644
> --- a/include/configs/ls1021aqds.h
> +++ b/include/configs/ls1021aqds.h
> @@ -251,7 +251,6 @@ unsigned long get_board_ddr_clk(void);
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/ls2085a_common.h b/include/configs/ls2085a_common.h
> index 6fe032c..7fc5735 100644
> --- a/include/configs/ls2085a_common.h
> +++ b/include/configs/ls2085a_common.h
> @@ -189,7 +189,6 @@
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
>
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
> index 5f27c2a..a5f9717 100644
> --- a/include/configs/p1_p2_rdb_pc.h
> +++ b/include/configs/p1_p2_rdb_pc.h
> @@ -494,7 +494,6 @@
>
> #define CONFIG_SYS_NAND_BASE_LIST { CONFIG_SYS_NAND_BASE }
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND
> #if defined(CONFIG_P1020RDB_PD)
> #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
> diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
> index 00787bb..8a25783 100644
> --- a/include/configs/ve8313.h
> +++ b/include/configs/ve8313.h
> @@ -183,7 +183,6 @@
> */
> #define CONFIG_SYS_NAND_BASE 0x61000000
> #define CONFIG_SYS_MAX_NAND_DEVICE 1
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_CMD_NAND 1
> #define CONFIG_NAND_FSL_ELBC 1
> #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
> diff --git a/include/configs/xpedite537x.h b/include/configs/xpedite537x.h
> index 860cfc3..9f93c36 100644
> --- a/include/configs/xpedite537x.h
> +++ b/include/configs/xpedite537x.h
> @@ -131,7 +131,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
> CONFIG_SYS_NAND_BASE2}
> #define CONFIG_SYS_MAX_NAND_DEVICE 2
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_SYS_NAND_QUIET_TEST /* 2nd NAND flash not always populated */
> #define CONFIG_NAND_FSL_ELBC
>
> diff --git a/include/configs/xpedite550x.h b/include/configs/xpedite550x.h
> index 4536b94..ac3f4f1 100644
> --- a/include/configs/xpedite550x.h
> +++ b/include/configs/xpedite550x.h
> @@ -122,7 +122,6 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
> #define CONFIG_SYS_NAND_BASE_LIST {CONFIG_SYS_NAND_BASE, \
> CONFIG_SYS_NAND_BASE2}
> #define CONFIG_SYS_MAX_NAND_DEVICE 2
> -#define CONFIG_MTD_NAND_VERIFY_WRITE
> #define CONFIG_SYS_NAND_QUIET_TEST /* 2nd NAND flash not always populated */
> #define CONFIG_NAND_FSL_ELBC
>
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 8438490..bc927ec 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -678,11 +678,6 @@ struct nand_chip {
> void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
> void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
> void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
> -#ifdef __UBOOT__
> -#if defined(CONFIG_MTD_NAND_VERIFY_WRITE)
> - int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
> -#endif
> -#endif
> void (*select_chip)(struct mtd_info *mtd, int chip);
> int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
> int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-02-11 6:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 17:58 [U-Boot] [PATCH 1/5] nand: Add verification functions Peter Tyser
2015-02-03 17:58 ` [U-Boot] [PATCH 2/5] cmd_nand: Verify writes to NAND Peter Tyser
2015-02-11 6:45 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 3/5] dfu: nand: Verify writes Peter Tyser
2015-02-04 9:22 ` Lukasz Majewski
2015-02-11 6:45 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 4/5] nand: Remove CONFIG_MTD_NAND_VERIFY_WRITE Peter Tyser
2015-02-11 6:46 ` Heiko Schocher
2015-02-03 17:58 ` [U-Boot] [PATCH 5/5] nand: yaffs: Remove the "nand write.yaffs" command Peter Tyser
2015-02-11 6:45 ` [U-Boot] [PATCH 1/5] nand: Add verification functions Heiko Schocher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox