diff options
author | Michael Sparmann <theseven@rockbox.org> | 2010-03-13 21:45:23 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2010-03-13 21:45:23 +0000 |
commit | a99f8fae7916bbc8888763d6b88caf6054477659 (patch) | |
tree | 9af662b3e7ee755be67f0ef64330081485b3dcf9 /firmware | |
parent | 382b6dca08254e815a39db5fefbc2bf98142c812 (diff) |
Nano2G NAND interleaved erase support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25155 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c index e9eab73df9..ba1f0df534 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c @@ -676,6 +676,41 @@ uint32_t nand_write_page_collect(uint32_t bank) return nand_wait_status_ready(bank); } +uint32_t nand_block_erase_fast(uint32_t page) +{ + uint32_t i, rc = 0; + mutex_lock(&nand_mtx); + nand_last_activity_value = current_tick; + led(true); + if (!nand_powered) nand_power_up(); + for (i = 0; i < 4; i++) + { + if (nand_type[i] == 0xFFFFFFFF) continue; + nand_set_fmctrl0(i, 0); + if (nand_send_cmd(NAND_CMD_BLOCKERASE)) + { + rc |= 1 << i; + continue; + } + FMANUM = 2; + FMADDR0 = page; + FMCTRL1 = FMCTRL1_DOTRANSADDR; + if (nand_wait_cmddone()) + { + rc |= 1 << i; + continue; + } + if (nand_send_cmd(NAND_CMD_ERASECNFRM)) rc |= 1 << i; + } + for (i = 0; i < 4; i++) + { + if (nand_type[i] == 0xFFFFFFFF) continue; + if (rc & (1 << i)) continue; + if (nand_wait_status_ready(i)) rc |= 1 << i; + } + return nand_unlock(rc); +} + const struct nand_device_info_type* nand_get_device_type(uint32_t bank) { if (nand_type[bank] == 0xFFFFFFFF) |