Skip to contentSkip to conversation

nandwrite fix

DISCUSSION Davide CASCONE 2 participants 2 messages Jul 18, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 3 lines · Davide CASCONE

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?

My POV is that it's better to never use anything but autoplacement and remove jffs2_oobinfo from nandwrite completely.

Vitaly