diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-14 23:06:10 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-14 23:06:10 +0000 |
commit | 3f7c508a09354e501342996601d7b3dace0cda07 (patch) | |
tree | 5f898d4e99cfbe3c8bc8cccbf3524f1e55841a74 | |
parent | eb8fef7ccee4a4acff14e5f2e660ba0eb85f8528 (diff) | |
download | rockbox-3f7c508a09354e501342996601d7b3dace0cda07.tar.gz rockbox-3f7c508a09354e501342996601d7b3dace0cda07.zip |
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.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index e88931698c..7bff2046ce 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -253,6 +253,11 @@ void ata_enable(bool on) | |||
253 | PBDR |= 0x2000; /* drive PB13 high */ | 253 | PBDR |= 0x2000; /* drive PB13 high */ |
254 | PBIOR |= 0x2000; /* output PB13 */ | 254 | PBIOR |= 0x2000; /* output PB13 */ |
255 | PBIOR &= ~0x0800; /* high impedance for TxD1 GPIO */ | 255 | PBIOR &= ~0x0800; /* high impedance for TxD1 GPIO */ |
256 | PADR |= 0x0680; /* set all the selects+reset high (=inactive) */ | ||
257 | |||
258 | PADR &= ~0x0080; /* assert reset */ | ||
259 | sleep(1); | ||
260 | PADR |= 0x0080; /* de-assert reset */ | ||
256 | } | 261 | } |
257 | } | 262 | } |
258 | 263 | ||
@@ -270,18 +275,18 @@ int ata_init(void) | |||
270 | led(false); | 275 | led(false); |
271 | 276 | ||
272 | /* Port setup */ | 277 | /* Port setup */ |
273 | PADR |= 0x1600; /* set all the selects high (=inactive) */ | 278 | PADR |= 0x0680; /* set all the selects + reset high (=inactive) */ |
274 | PAIOR |= 0x1600; /* make outputs for them */ | 279 | PAIOR |= 0x1680; /* make outputs for them and the PA12 clock gate */ |
275 | 280 | ||
276 | if(adc_read(ADC_MMC_SWITCH) < 0x200) | 281 | if(adc_read(ADC_MMC_SWITCH) < 0x200) |
277 | { /* MMC inserted */ | 282 | { /* MMC inserted */ |
278 | PADR &= ~0x1000; /* clear PA12 */ | 283 | PADR &= ~0x1000; /* clear PA12 */ |
279 | PADR |= 0x0400; /* chip select internal flash */ | 284 | PADR &= ~0x0400; /* chip select internal flash */ |
280 | } | 285 | } |
281 | else | 286 | else |
282 | { /* no MMC, use internal memory */ | 287 | { /* no MMC, use internal memory */ |
283 | PADR |= 0x1000; /* set PA12 */ | 288 | PADR |= 0x1000; /* set PA12 */ |
284 | PADR |= 0x0200; /* chip select external flash */ | 289 | PADR &= ~0x0200; /* chip select external flash */ |
285 | } | 290 | } |
286 | 291 | ||
287 | sleeping = false; | 292 | sleeping = false; |