summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2010-03-14 16:06:54 +0000
committerMichael Sparmann <theseven@rockbox.org>2010-03-14 16:06:54 +0000
commit7e4b53892ed250ad124b0970cfdb493abc64f379 (patch)
tree1e13fefe2042bc88b1a4a7fd03cc00047faaf94d /firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
parentc18e80e1276f3d54d97ff79564f5bfc09fe20957 (diff)
downloadrockbox-7e4b53892ed250ad124b0970cfdb493abc64f379.tar.gz
rockbox-7e4b53892ed250ad124b0970cfdb493abc64f379.zip
Revert Nano2G fast VFL reads for now. They just won't work on some hardware.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25170 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c')
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c65
1 files changed, 9 insertions, 56 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
index a24cc4b77c..abff716ae7 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/ftl-nano2g.c
@@ -863,65 +863,18 @@ uint32_t ftl_vfl_read_fast(uint32_t vpage, void* buffer, void* sparebuffer,
panicf("FTL: Trying to read out-of-bounds vPage %u", (unsigned)vpage);
//return 4;
- uint32_t bank = abspage % ftl_banks;
- uint32_t block = abspage / ((*ftl_nand_type).pagesperblock * ftl_banks);
- uint32_t page = (abspage / ftl_banks) % (*ftl_nand_type).pagesperblock;
- if (bank)
- {
- for (i = 0; i < ftl_banks; i++)
- {
- void* databuf = (void*)0;
- void* sparebuf = (void*)0;
- if (buffer) databuf = (void*)((uint32_t)buffer + 0x800 * i);
- if (sparebuffer) sparebuf = (void*)((uint32_t)sparebuffer + 0x40 * i);
- uint32_t ret = ftl_vfl_read(vpage + i, databuf, sparebuf, checkempty, remaponfail);
- if (ret & 1) rc |= 1 << (i << 2);
- if (ret & 2) rc |= 2 << (i << 2);
- if (ret & 0x10) rc |= 4 << (i << 2);
- if (ret & 0x100) rc |= 8 << (i << 2);
- }
- return rc;
- }
- uint32_t physblock = ftl_vfl_get_physical_block(bank, block);
- uint32_t physpage = physblock * (*ftl_nand_type).pagesperblock + page;
-
- rc = nand_read_page_fast(physpage, buffer, sparebuffer, 1, checkempty);
- if (!(rc & 0xdddd)) return rc;
-
for (i = 0; i < ftl_banks; i++)
{
- if ((rc >> (i << 2)) & 0x2) continue;
- if ((rc >> (i << 2)) & 0xf)
- {
- nand_reset(i);
- uint32_t ret = nand_read_page(i, physpage,
- (void*)((uint32_t)buffer + 0x800 * i),
- (void*)((uint32_t)sparebuffer + 0x40 * i),
- 1, checkempty);
- if ((ret & 0x11D) != 0 && (ret & 2) == 0)
- {
- nand_reset(i);
- ret = nand_read_page(i, physpage,
- (void*)((uint32_t)buffer + 0x800 * i),
- (void*)((uint32_t)sparebuffer + 0x40 * i),
- 1, checkempty);
-#ifdef FTL_READONLY
- (void)remaponfail;
-#else
- if (remaponfail == 1 && (ret & 0x11D) != 0 && (ret & 2) == 0)
- panicf("FTL: VFL fast read failed, RC %04X, bank %d, RET %03X, base %d",
- rc, i, ret, vpage);
-// ftl_vfl_schedule_block_for_remap(i, block);
-#endif
- }
- rc &= ~(0xf << (i << 2));
- if (ret & 1) rc |= 1 << (i << 2);
- if (ret & 2) rc |= 2 << (i << 2);
- if (ret & 0x10) rc |= 4 << (i << 2);
- if (ret & 0x100) rc |= 8 << (i << 2);
- }
+ void* databuf = (void*)0;
+ void* sparebuf = (void*)0;
+ if (buffer) databuf = (void*)((uint32_t)buffer + 0x800 * i);
+ if (sparebuffer) sparebuf = (void*)((uint32_t)sparebuffer + 0x40 * i);
+ uint32_t ret = ftl_vfl_read(vpage + i, databuf, sparebuf, checkempty, remaponfail);
+ if (ret & 1) rc |= 1 << (i << 2);
+ if (ret & 2) rc |= 2 << (i << 2);
+ if (ret & 0x10) rc |= 4 << (i << 2);
+ if (ret & 0x100) rc |= 8 << (i << 2);
}
-
return rc;
}