mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
Nano 2G VFL: try slow read twice if fast read failed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25166 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a0692a40b2
commit
884147c5e2
1 changed files with 13 additions and 6 deletions
|
|
@ -893,20 +893,27 @@ uint32_t ftl_vfl_read_fast(uint32_t vpage, void* buffer, void* sparebuffer,
|
||||||
if ((rc >> (i << 2)) & 0x2) continue;
|
if ((rc >> (i << 2)) & 0x2) continue;
|
||||||
if ((rc >> (i << 2)) & 0xf)
|
if ((rc >> (i << 2)) & 0xf)
|
||||||
{
|
{
|
||||||
rc &= ~(0xf << (i << 2));
|
|
||||||
nand_reset(i);
|
nand_reset(i);
|
||||||
uint32_t ret = nand_read_page(i, physpage,
|
uint32_t ret = nand_read_page(i, physpage,
|
||||||
(void*)((uint32_t)buffer + 0x800 * i),
|
(void*)((uint32_t)buffer + 0x800 * i),
|
||||||
(void*)((uint32_t)sparebuffer + 0x40 * i),
|
(void*)((uint32_t)sparebuffer + 0x40 * i),
|
||||||
1, checkempty);
|
1, checkempty);
|
||||||
|
if ((ret & 0x11D) != 0 && (ret & 2) == 0)
|
||||||
|
{
|
||||||
|
ret = nand_read_page(i, physpage,
|
||||||
|
(void*)((uint32_t)buffer + 0x800 * i),
|
||||||
|
(void*)((uint32_t)sparebuffer + 0x40 * i),
|
||||||
|
1, checkempty);
|
||||||
#ifdef FTL_READONLY
|
#ifdef FTL_READONLY
|
||||||
(void)remaponfail;
|
(void)remaponfail;
|
||||||
#else
|
#else
|
||||||
if (remaponfail == 1 && (ret & 0x11D) != 0 && (ret & 2) == 0)
|
if (remaponfail == 1 && (ret & 0x11D) != 0 && (ret & 2) == 0)
|
||||||
panicf("FTL: VFL fast read failed, RC %04X, bank %d, RET %03X, base %d",
|
panicf("FTL: VFL fast read failed, RC %04X, bank %d, RET %03X, base %d",
|
||||||
rc, i, ret, vpage);
|
rc, i, ret, vpage);
|
||||||
// ftl_vfl_schedule_block_for_remap(i, block);
|
// ftl_vfl_schedule_block_for_remap(i, block);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
rc &= ~(0xf << (i << 2));
|
||||||
if (ret & 1) rc |= 1 << (i << 2);
|
if (ret & 1) rc |= 1 << (i << 2);
|
||||||
if (ret & 2) rc |= 2 << (i << 2);
|
if (ret & 2) rc |= 2 << (i << 2);
|
||||||
if (ret & 0x10) rc |= 4 << (i << 2);
|
if (ret & 0x10) rc |= 4 << (i << 2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue