[PATCH 2/2] NAND on DM355: Add 4-bit ECC support for large page NAND chips

Troy Kisky troy.kisky at boundarydevices.com
Thu May 7 18:37:25 EDT 2009


>>>> +static struct nand_ecclayout hwecc4_2048 __initconst = {
>>>> +       .eccbytes = 10,
>>> Not ".eccbytes = 40"?  This is 4 chunks, 10 ecc bytes each...
>> No, .eccbytes is for each chips->ecc.steps. 
> 
> So it's the same as ecc.bytes, which is not exported to userspace.
> 
> 
>> And all nand read/write 
>> APIs, we handle ecc.steps (for loop). There is chips->ecc.total that
>> is initialized as (chips->ecc.steps * chips->ecc.bytes).  
>>
>> It is strange that .eccbytes is for each chunk, while eccpos[] and
>> .oobfree[] have to handle/cover all chunks. 

No, eccbytes should equal ecc.total


i.e. from nand_base.c

static struct nand_ecclayout nand_oob_64 = {
        .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 = {
                {.offset = 2,
                 .length = 38}}
};
Troy





More information about the linux-mtd mailing list