A question on ECC

Thomas Gleixner tglx at linutronix.de
Mon Apr 14 07:17:28 EDT 2003


On Monday 14 April 2003 12:03, Gerhard Uttenthaler wrote:

> Which eccmode is used seems to be set from the calling function of
> nand_read_ecc. I found:
TRUE
> in nandwrite.c:
> struct nand_oobinfo jffs2_oobinfo = {
> 	useecc: 1,
> 	eccpos:	{ 0, 1, 2, 3, 6, 7}
> };
> Here useecc is set to 1, which is found in nand.h:
> #define NAND_ECC_SOFT	1
CRAP. 
ECC_TYPE (SOFT OR HARD) is set in the board specific driver and nowhere else.

Read: http://www.linux-mtd.infradead.org/tech/nand.html

useecc is given by the calling program (filesystem or userspace utility) to 
tell the nand driver to USE ECC. eccpos is given to tell te nand driver
WHERE to put / get ECC in oobarea 
This was made to have support for different filesystems on one NAND chip. eg. 
JFFS2 and YAFFS.

>
> I found this while studying nftlmount.c. In function find_boot_record
> there might be a bug.
NTFL does _NOT_ use nand.c functions at all !!!!!!
DO NOT MIXUP STUFF HERE !

> Hope this all makes some sense and helps.
NO, see above

--- 
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: tglx at linutronix.de




More information about the linux-mtd mailing list