AT91: NAND OOB and ECC in U-Boot vs Linux (Jesus Alvarez)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Dear Jesus Alvarez
Quoted 8 lines
The AT91 Linux kernel patches for versions 2.6.27 or later use a separate
atmel_nand.cdriver that implements some OOB and ECC options that are not exactly the same as those in the standard kernel NAND driver (nand_base.c, etc.). AT91 based boards can use theCONFIG_MTD_NAND_ATMELoption to enable theatmel_nanddriver together withCONFIG_MTD_NAND_ATMEL_ECC_HW,CONFIG_MTD_NAND_ATMEL_ECC_SOFTorCONFIG_MTD_NAND_ATMEL_ECC_NONEfor the desired ECC. The OOB layout used by that driver appears to be different.
I have no problem using kernel 2.6.27 and u-boot (1.3.4 and 2009.01) on my at91sam9263ek.
The Linux kernel driver uses ECC_HW by default and it does not work with U-boot. As long as
I set the kernel driver to use ECC_SOFT, Linux kernel loads the root file system (written by U-boot)
and detects bad blocks correctly. And I think the ECC_HW is not implemented in U-boot at91
driver. At least in version 1.3.4, the at91 nand driver just points ECC_HW back to ECC_SOFT
instead of using the at91 ECC hardware module.
Quoted 5 lines
Could this create the potential for incompatibilities when a NAND filesystem is created by U-Boot for mounting from a Linux kernel using the
atmel_nanddriver? Are there any kernel config options to avoid to make filesystems initialized with the U-Boot "nand write.jffs2" command fully compatible with the kernel MTD NAND drivers
nand write.jffs2 just means skipping bad blocks when writing to NAND. You should always use it.
Without ".jffs2", you will write data to bad blocks. Actually after ver 1.3.4, jffs2 is no longer
necessary for "nand write" and bad blocks will be skipped by default.
Derek