mxc_nand: write problem with i.MX-27L + ST NAND512R3A2DZA6E flash
A message that is not in the archive (sent off-list or not yet received): 15264957.5891277991162932.JavaMail.root@hermes
Hi,
Quoted 11 lines
I have a device based on i.MX-27L and I am updating kernel from 2.6.24 with a custom set of patches to vanilla 2.6.34. I am having problems using
mxc_nanddriver with ST NAND512R3A2DZA6E flash chip (64MB, 8-bit, 512 byte page size). I am usingarch/arm/mach-mx2/mach-mx27ads.cbased board file.The problem is that write operations fail. If I have
CONFIG_MTD_NAND_VERIFY_WRITE=y,CONFIG_MTD_DEBUG=y,CONFIG_MTD_DEBUG_VERBOSE=0enabled in my kernel config and usemtd_pagetestmodule I see the following output:
Quoted 14 lines
$> modprobe
mtd_pagetestdev=4
=================================================mtd_pagetest: MTD device: 4mtd_pagetest: MTD device size 1048576, eraseblock size 16384, page size 512, count of eraseblocks 64, pages per eraseblock 32, OOB size 16mtd_pagetest: scanning for bad eraseblocksmtd_pagetest: scanned 64 eraseblocks, 0 are badmtd_pagetest: erasing whole devicemtd_pagetest: erased 64 eraseblocksmtd_pagetest: writing whole devicemtd_pagetest: error: write failed at0x0mtd_pagetest: error -5 occurred
=================================================
It seems that using CONFIG_MTD_NAND_VERIFY_WRITE option with mxc_nand driver in kernel 2.6.34 causes every MTD write to fail. That is because in nand_base.c, nand_write_page function there is a call to chip->verify_buf(mtd, buf, mtd->writesize), but mxc_nand has registered a function called mxc_nand_verify_buf to it in mxc_nand.c, which always returns -EFAULT, thus failing every mtd_write operation.
I previously had problems when trying to use nandwrite to write JFFS2 root filesystem to NAND partition, but after applying patch "mxc_nand: Fix OOB accesses on i.MX27" (http://lists.infradead.org/pipermail/linux-mtd/2010-May/030366.html) and using nandwrite with -a option, everything works now ok also with 2.6.34.
--
Teemu