[PATCH RESEND] mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

Matthieu CASTET matthieu.castet at parrot.com
Tue Jul 31 09:28:18 EDT 2012


Hi Marek,

Marek Vasut a écrit :
> Dear Matthieu CASTET,
> 
>> Hi,
>>
>> for ONFI flash (like this micron one) the information should be extracted
>> form the ONFI table (programs_per_page IIRC)
>>
>> This should be better than relying on the SOC driver for setting this
>> flags.
>>
>> Does the gpmi driver set this flag because it do not support partial write
>> ?
> 
> Yes
> 
>> In this case why it doesn't set  chip->ecc.steps to 1 ?
> 
> Can you elabore how exactly will that help please?
> 
If you look at the nand_base.c, you will see that mtd->subpage_sft = 0 if
NAND_NO_SUBPAGE_WRITE flags is set or chip->ecc.steps == 1 [1].


Matthieu



[1]
    /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */
    if (!(chip->options & NAND_NO_SUBPAGE_WRITE) &&
        !(chip->cellinfo & NAND_CI_CELLTYPE_MSK)) {
        switch (chip->ecc.steps) {
        case 2:
            mtd->subpage_sft = 1;
            break;
        case 4:
        case 8:
        case 16:
            mtd->subpage_sft = 2;
            break;
        }
    }
    chip->subpagesize = mtd->writesize >> mtd->subpage_sft;



More information about the linux-mtd mailing list