diff options
author | Michael Sparmann <theseven@rockbox.org> | 2009-10-11 18:21:15 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2009-10-11 18:21:15 +0000 |
commit | 6cea8c1e1aa9a7888ceec0cf35181632b5b0eb29 (patch) | |
tree | cd54eb04550c7f64f7e7a90a0241e1b62b5ac84c /firmware | |
parent | b729a7d75ec5b2fb73aa67c8f986e2793f8efcaf (diff) | |
download | rockbox-6cea8c1e1aa9a7888ceec0cf35181632b5b0eb29.tar.gz rockbox-6cea8c1e1aa9a7888ceec0cf35181632b5b0eb29.zip |
Fix the latest iPod Nano 2G NAND issues
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23115 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c index 6289fbc66f..b0780799ef 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c | |||
@@ -301,9 +301,8 @@ uint32_t nand_get_chip_type(uint32_t bank) | |||
301 | 301 | ||
302 | void nand_power_up(void) | 302 | void nand_power_up(void) |
303 | { | 303 | { |
304 | unsigned char powerup[2] = {0x15, 1}; | ||
305 | uint32_t i; | 304 | uint32_t i; |
306 | mutex_lock(&ecc_mtx); | 305 | mutex_lock(&nand_mtx); |
307 | PWRCONEXT &= ~0x40; | 306 | PWRCONEXT &= ~0x40; |
308 | PWRCON &= ~0x100000; | 307 | PWRCON &= ~0x100000; |
309 | PCON2 = 0x33333333; | 308 | PCON2 = 0x33333333; |
@@ -314,18 +313,18 @@ void nand_power_up(void) | |||
314 | PDAT4 = 0; | 313 | PDAT4 = 0; |
315 | PCON5 = (PCON5 & ~0xF) | 3; | 314 | PCON5 = (PCON5 & ~0xF) | 3; |
316 | PUNK5 = 1; | 315 | PUNK5 = 1; |
317 | pmu_write_multiple(0x35, 2, powerup); | 316 | pmu_ldo_set_voltage(4, 0x15); |
318 | sleep(HZ / 50); | 317 | pmu_ldo_power_on(4); |
318 | sleep(HZ / 20); | ||
319 | for (i = 0; i < 4; i++) nand_reset(i); | 319 | for (i = 0; i < 4; i++) nand_reset(i); |
320 | nand_powered = 1; | 320 | nand_powered = 1; |
321 | mutex_unlock(&ecc_mtx); | 321 | mutex_unlock(&nand_mtx); |
322 | } | 322 | } |
323 | 323 | ||
324 | void nand_power_down(void) | 324 | void nand_power_down(void) |
325 | { | 325 | { |
326 | unsigned char powerdown[2] = {0x15, 0}; | 326 | mutex_lock(&nand_mtx); |
327 | mutex_lock(&ecc_mtx); | 327 | pmu_ldo_power_off(4); |
328 | pmu_write_multiple(0x35, 2, powerdown); | ||
329 | PCON2 = 0x11111111; | 328 | PCON2 = 0x11111111; |
330 | PDAT2 = 0; | 329 | PDAT2 = 0; |
331 | PCON3 = 0x11111111; | 330 | PCON3 = 0x11111111; |
@@ -337,7 +336,7 @@ void nand_power_down(void) | |||
337 | PWRCONEXT |= 0x40; | 336 | PWRCONEXT |= 0x40; |
338 | PWRCON |= 0x100000; | 337 | PWRCON |= 0x100000; |
339 | nand_powered = 0; | 338 | nand_powered = 0; |
340 | mutex_unlock(&ecc_mtx); | 339 | mutex_unlock(&nand_mtx); |
341 | } | 340 | } |
342 | 341 | ||
343 | uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, | 342 | uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer, |