nandwrite fix

Davide CASCONE davide.cascone at st.com
Tue Jul 18 07:44:00 EDT 2006


I have tried to use the nandwrite utility with a large page nand, but it doesn't work properly. The problem is related to the jffs2_oobinfo struct. I have fixed the problem replacing the defined jffs2_oobinfo struct (for small page nand)

struct nand_oobinfo jffs2_oobinfo = {
	.useecc = MTD_NANDECC_PLACE,
	.eccbytes = 6,
	.eccpos = { 0, 1, 2, 3, 6, 7 }
};

with the following struct (for large page nand)

struct nand_oobinfo jffs2_oobinfo = {
        .useecc = MTD_NANDECC_AUTOPLACE,
        .eccbytes = 24,
        .eccpos = {
                40, 41, 42, 43, 44, 45, 46, 47,
                48, 49, 50, 51, 52, 53, 54, 55,
                56, 57, 58, 59, 60, 61, 62, 63},
        .oobfree = { {2, 38} }
};

Now the nandwrite utility works properly, but I think it's better to define a macro in order to select the correct jffs2_oobinfo struct depending on the device page size. What do you think about?

Best regards,
Davide






More information about the linux-mtd mailing list