mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-01 10:22:48 +02:00
fix usbboot skips empty pages during write
This commit is contained in:
parent
5efe423426
commit
3e030a84f8
@ -541,11 +541,17 @@ u32 nand_read_4740(void *buf, u32 startpage, u32 pagecount, int option)
|
|||||||
|
|
||||||
u32 nand_program_4740(void *context, int spage, int pages, int option)
|
u32 nand_program_4740(void *context, int spage, int pages, int option)
|
||||||
{
|
{
|
||||||
|
size_t datasize;
|
||||||
u32 i, j, cur, rowaddr;
|
u32 i, j, cur, rowaddr;
|
||||||
u8 *tmpbuf;
|
u8 *tmpbuf;
|
||||||
u32 ecccnt,oobsize_sav,ecccnt_sav,eccpos_sav;
|
u32 ecccnt,oobsize_sav,ecccnt_sav,eccpos_sav;
|
||||||
u8 ecc_buf[256];
|
u8 ecc_buf[256];
|
||||||
|
|
||||||
|
datasize = pagesize;
|
||||||
|
if (option != NO_OOB)
|
||||||
|
datasize += oobsize;
|
||||||
|
|
||||||
|
|
||||||
if (wp_pin)
|
if (wp_pin)
|
||||||
__gpio_set_pin(wp_pin);
|
__gpio_set_pin(wp_pin);
|
||||||
restart:
|
restart:
|
||||||
@ -581,19 +587,16 @@ restart:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if NO_OOB do not perform vaild check!
|
for (j = 0; j < datasize; ++j) {
|
||||||
if ( option != NO_OOB ) {
|
if (tmpbuf[j] != 0xff)
|
||||||
for ( j = 0 ; j < pagesize + oobsize; j ++) {
|
break;
|
||||||
if (tmpbuf[j] != 0xff)
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( j == oobsize + pagesize ) {
|
if (j == datasize) {
|
||||||
tmpbuf += ( pagesize + oobsize ) ;
|
tmpbuf += datasize;
|
||||||
i ++;
|
++i;
|
||||||
cur ++;
|
++cur;
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pagesize == 512)
|
if (pagesize == 512)
|
||||||
|
Loading…
Reference in New Issue
Block a user