summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-09-14 23:06:10 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-09-14 23:06:10 +0000
commit3f7c508a09354e501342996601d7b3dace0cda07 (patch)
tree5f898d4e99cfbe3c8bc8cccbf3524f1e55841a74
parenteb8fef7ccee4a4acff14e5f2e660ba0eb85f8528 (diff)
downloadrockbox-3f7c508a09354e501342996601d7b3dace0cda07.zip
rockbox-3f7c508a09354e501342996601d7b3dace0cda07.tar.gz
rockbox-3f7c508a09354e501342996601d7b3dace0cda07.tar.bz2
rockbox-3f7c508a09354e501342996601d7b3dace0cda07.tar.xz
Ondio USB mode works with both internal and external MMC
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5073 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/ata_mmc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index e889316..7bff204 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -253,6 +253,11 @@ void ata_enable(bool on)
PBDR |= 0x2000; /* drive PB13 high */
PBIOR |= 0x2000; /* output PB13 */
PBIOR &= ~0x0800; /* high impedance for TxD1 GPIO */
+ PADR |= 0x0680; /* set all the selects+reset high (=inactive) */
+
+ PADR &= ~0x0080; /* assert reset */
+ sleep(1);
+ PADR |= 0x0080; /* de-assert reset */
}
}
@@ -270,18 +275,18 @@ int ata_init(void)
led(false);
/* Port setup */
- PADR |= 0x1600; /* set all the selects high (=inactive) */
- PAIOR |= 0x1600; /* make outputs for them */
+ PADR |= 0x0680; /* set all the selects + reset high (=inactive) */
+ PAIOR |= 0x1680; /* make outputs for them and the PA12 clock gate */
if(adc_read(ADC_MMC_SWITCH) < 0x200)
{ /* MMC inserted */
PADR &= ~0x1000; /* clear PA12 */
- PADR |= 0x0400; /* chip select internal flash */
+ PADR &= ~0x0400; /* chip select internal flash */
}
else
{ /* no MMC, use internal memory */
PADR |= 0x1000; /* set PA12 */
- PADR |= 0x0200; /* chip select external flash */
+ PADR &= ~0x0200; /* chip select external flash */
}
sleeping = false;