Subversion Repositories freemyipod

Rev

Rev 249 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 249 Rev 251
Line 230... Line 230...
230
}
230
}
231
 
231
 
232
static uint32_t nand_transfer_data_collect(uint32_t direction)
232
static uint32_t nand_transfer_data_collect(uint32_t direction)
233
{
233
{
234
    uint32_t timeout = USEC_TIMER + 20000;
234
    uint32_t timeout = USEC_TIMER + 20000;
235
    while ((DMAALLST & DMAALLST_DMABUSY3))
235
    while (DMAALLST & DMAALLST_DMABUSY3)
236
        if (nand_timeout(timeout)) return 1;
236
        if (nand_timeout(timeout)) return 1;
237
    if (!direction) invalidate_dcache();
237
    if (!direction) invalidate_dcache();
238
    if (nand_wait_addrdone()) return 1;
238
    if (nand_wait_addrdone()) return 1;
239
    if (!direction) FMCTRL1 = FMCTRL1_CLEARRFIFO | FMCTRL1_CLEARWFIFO;
239
    if (!direction) FMCTRL1 = FMCTRL1_CLEARRFIFO | FMCTRL1_CLEARWFIFO;
240
    else FMCTRL1 = FMCTRL1_CLEARRFIFO;
240
    else FMCTRL1 = FMCTRL1_CLEARRFIFO;
Line 407... Line 407...
407
    {
407
    {
408
        if (sparebuffer)
408
        if (sparebuffer)
409
        {
409
        {
410
            if (nand_transfer_data(bank, 0, spare, 0x40))
410
            if (nand_transfer_data(bank, 0, spare, 0x40))
411
                return nand_unlock(1);
411
                return nand_unlock(1);
412
            if (sparebuffer) 
-
 
413
                memcpy(sparebuffer, spare, 0x800);
-
 
414
            if (checkempty)
412
            if (checkempty)
415
                rc = nand_check_empty((uint8_t*)sparebuffer) << 1;
413
                rc = nand_check_empty((uint8_t*)sparebuffer) << 1;
416
        }
414
        }
417
        return nand_unlock(rc);
415
        return nand_unlock(rc);
418
    }
416
    }