summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2009-10-11 18:21:15 +0000
committerMichael Sparmann <theseven@rockbox.org>2009-10-11 18:21:15 +0000
commit6cea8c1e1aa9a7888ceec0cf35181632b5b0eb29 (patch)
treecd54eb04550c7f64f7e7a90a0241e1b62b5ac84c
parentb729a7d75ec5b2fb73aa67c8f986e2793f8efcaf (diff)
Fix the latest iPod Nano 2G NAND issues
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23115 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c17
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)
void nand_power_up(void)
{
- unsigned char powerup[2] = {0x15, 1};
uint32_t i;
- mutex_lock(&ecc_mtx);
+ mutex_lock(&nand_mtx);
PWRCONEXT &= ~0x40;
PWRCON &= ~0x100000;
PCON2 = 0x33333333;
@@ -314,18 +313,18 @@ void nand_power_up(void)
PDAT4 = 0;
PCON5 = (PCON5 & ~0xF) | 3;
PUNK5 = 1;
- pmu_write_multiple(0x35, 2, powerup);
- sleep(HZ / 50);
+ pmu_ldo_set_voltage(4, 0x15);
+ pmu_ldo_power_on(4);
+ sleep(HZ / 20);
for (i = 0; i < 4; i++) nand_reset(i);
nand_powered = 1;
- mutex_unlock(&ecc_mtx);
+ mutex_unlock(&nand_mtx);
}
void nand_power_down(void)
{
- unsigned char powerdown[2] = {0x15, 0};
- mutex_lock(&ecc_mtx);
- pmu_write_multiple(0x35, 2, powerdown);
+ mutex_lock(&nand_mtx);
+ pmu_ldo_power_off(4);
PCON2 = 0x11111111;
PDAT2 = 0;
PCON3 = 0x11111111;
@@ -337,7 +336,7 @@ void nand_power_down(void)
PWRCONEXT |= 0x40;
PWRCON |= 0x100000;
nand_powered = 0;
- mutex_unlock(&ecc_mtx);
+ mutex_unlock(&nand_mtx);
}
uint32_t nand_read_page(uint32_t bank, uint32_t page, void* databuffer,