summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorMichael Sparmann <theseven@rockbox.org>2010-02-01 01:23:43 +0000
committerMichael Sparmann <theseven@rockbox.org>2010-02-01 01:23:43 +0000
commit40a3e806974ff482006d4ee99b718a52d1e85224 (patch)
tree03b2bb561eb1207522f019cacffae69afb3a710f /firmware/target/arm
parentd99440c4fa33438b0c32fa28575a269c4d8d3d52 (diff)
Fix iPod Nano 2G bank detection broken in r24414.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24431 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
index d4839893d3..6b2020a980 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/nand-nano2g.c
@@ -339,7 +339,7 @@ void nand_power_up(void)
if(nand_type[i] != 0xFFFFFFFF)
{
if(nand_reset(i))
- if(nand_reset(i)) panicf("nand_power_up: nand_reset(bank=%d) failed.",(unsigned int)i);
+ panicf("nand_power_up: nand_reset(bank=%d) failed.",(unsigned int)i);
}
}
nand_powered = 1;
@@ -511,7 +511,14 @@ uint32_t nand_device_init(void)
uint32_t type;
uint32_t i, j;
+
+ /* Assume there are 0 banks, to prevent
+ nand_power_up from talking with them yet. */
+ for(i = 0; i < 4; i++) nand_type[i] = 0xFFFFFFFF;
nand_power_up();
+
+ /* Now that the flash is powered on, detect how
+ many banks we really have and initialize them. */
for (i = 0; i < 4; i++)
{
nand_tunk1[i] = 7;
@@ -519,7 +526,6 @@ uint32_t nand_device_init(void)
nand_tunk2[i] = 7;
nand_tunk3[i] = 7;
type = nand_get_chip_type(i);
- nand_type[i] = 0xFFFFFFFF;
if (type == 0xFFFFFFFF) continue;
for (j = 0; ; j++)
{