diff options
author | Michael Sparmann <theseven@rockbox.org> | 2010-03-14 16:10:53 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2010-03-14 16:10:53 +0000 |
commit | 4d8bf06bf3f4642fcddac70af97498db54b449db (patch) | |
tree | 37aa1188bc42cd32bb8889cb1023f685c17e8c0c | |
parent | 7e4b53892ed250ad124b0970cfdb493abc64f379 (diff) |
Nano2G NAND: Detect if the chip supports interleaved and/or cached writes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25171 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c index ba1f0df534..2b13b55edd 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c @@ -89,6 +89,8 @@ uint8_t nand_tunk2[4]; uint8_t nand_tunk3[4]; uint32_t nand_type[4]; int nand_powered = 0; +int nand_interleaved = 0; +int nand_cached = 0; long nand_last_activity_value = -1; static long nand_stack[32]; @@ -643,8 +645,8 @@ uint32_t nand_write_page_start(uint32_t bank, uint32_t page, void* databuffer, void* sparebuffer, uint32_t doecc) { if (((uint32_t)databuffer & 0xf) || ((uint32_t)sparebuffer & 0xf) - || !databuffer || !sparebuffer || !doecc) - return nand_write_page_int(bank, page, databuffer, sparebuffer, doecc, 0); + || !databuffer || !sparebuffer || !doecc || !nand_interleaved) + return nand_write_page_int(bank, page, databuffer, sparebuffer, doecc, !nand_interleaved); mutex_lock(&nand_mtx); nand_last_activity_value = current_tick; @@ -769,6 +771,8 @@ uint32_t nand_device_init(void) nand_tunk3[i] = nand_deviceinfotable[nand_type[i]].tunk3; } if (nand_type[0] == 0xFFFFFFFF) return 1; + nand_interleaved = ((nand_type[0] >> 22) & 1); + nand_cached = ((nand_type[0] >> 23) & 1); nand_last_activity_value = current_tick; create_thread(nand_thread, nand_stack, |