Date:2010-12-23 12:10:51 (8 years 4 months ago)
Author:Xiangfu Liu
Commit:0e92eb8bd72ed858d92b3f43c899269b0dce6b99
Message:xburst_stage2: don't skip bad block when nand erase

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

Change Details

usbboot/xburst_stage2/nandflash_4740.c
309309
310310u32 nand_erase_4740(int blk_num, int sblk, int force)
311311{
312    int i, j;
312    int j;
313313    u32 cur, rowaddr;
314314
315315    if (wp_pin)
316316        __gpio_set_pin(wp_pin);
317317
318    cur = sblk * ppb;
319    for (i = 0; i < blk_num; ) {
318    for (cur = sblk * ppb; cur < (sblk + blk_num) * ppb; cur += ppb) {
320319        rowaddr = cur;
321320        select_chip(cur / ppb);
322321        if (!force) {
323            if (nand_check_block(cur/ppb)) {
324                cur += ppb;
322            if (nand_check_block(cur / ppb)) {
325323                blk_num += Hand.nand_plane;
326324                continue;
327325            }
...... 
341339            serial_puts("\nErase fail at: \t");
342340            serial_put_hex(cur / ppb);
343341            nand_mark_bad_4740(cur/ppb);
344            cur += ppb;
345342            continue;
346343        }
347        cur += ppb;
348        i++;
349344    }
350345
351346    if (wp_pin)
352347        __gpio_clear_pin(wp_pin);
348
353349    return cur;
354350}
355351
...... 
744740{
745741    u32 rowaddr;
746742
747    /* nand_erase_4740( 1, block, 1); force erase before */
748743    if (bad_block_page >= ppb) { /* mark four page! */
749744        rowaddr = block * ppb + 0;
750745        nand_mark_bad_page(rowaddr);

Archive Download the corresponding diff file



interactive