Date:2009-09-16 21:07:23 (10 years 8 months ago)
Author:Lars C.
Commit:476d9bc3c4bfe043064ed6c92abba2fa158f9d9e
Message:Dont' write ecc data if written page is empty.

Files: usbboot/xburst_stage2/nandflash_4740.c (2 diffs)

Change Details

usbboot/xburst_stage2/nandflash_4740.c
541541
542542u32 nand_program_4740(void *context, int spage, int pages, int option)
543543{
544    size_t datasize;
544545    u32 i, j, cur, rowaddr;
545546    u8 *tmpbuf;
546547    u32 ecccnt,oobsize_sav,ecccnt_sav,eccpos_sav;
547548    u8 ecc_buf[256];
548549
550    datasize = pagesize;
551    if (option != NO_OOB)
552        datasize += oobsize;
553
554
549555    if (wp_pin)
550556        __gpio_set_pin(wp_pin);
551557restart:
...... 
581587            }
582588        }
583589
584        //if NO_OOB do not perform vaild check!
585        if ( option != NO_OOB ) {
586            for ( j = 0 ; j < pagesize + oobsize; j ++) {
587                if (tmpbuf[j] != 0xff)
588                    break;
589            }
590        for (j = 0; j < datasize; ++j) {
591            if (tmpbuf[j] != 0xff)
592                break;
593        }
590594
591            if ( j == oobsize + pagesize ) {
592                tmpbuf += ( pagesize + oobsize ) ;
593                i ++;
594                cur ++;
595                continue;
596            }
595        if (j == datasize) {
596            tmpbuf += datasize;
597            ++i;
598            ++cur;
599            continue;
597600        }
598601
599602        if (pagesize == 512)

Archive Download the corresponding diff file



interactive