diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-14 22:27:52 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-14 22:27:52 +0000 |
commit | eb8fef7ccee4a4acff14e5f2e660ba0eb85f8528 (patch) | |
tree | 4168e4a0edc53ccd2b3a2347a3925229dff5d95d | |
parent | 7025d835c81e665f550c62c16b96d1d4b1a90eaf (diff) | |
download | rockbox-eb8fef7ccee4a4acff14e5f2e660ba0eb85f8528.tar.gz rockbox-eb8fef7ccee4a4acff14e5f2e660ba0eb85f8528.zip |
Ondio USB mode works, but only with external MMC
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5072 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/ata_mmc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index a29795789d..e88931698c 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -242,16 +242,17 @@ int ata_soft_reset(void) | |||
242 | 242 | ||
243 | void ata_enable(bool on) | 243 | void ata_enable(bool on) |
244 | { | 244 | { |
245 | PBCR1 &= ~0x0C00; /* use PB13 as GPIO, if not modified below */ | 245 | PBCR1 &= ~0x0CC0; /* PB13 and TxD1 become GPIOs, if not modified below */ |
246 | if (on) | 246 | if (on) |
247 | { | 247 | { |
248 | /* serial setup */ | 248 | /* serial setup */ |
249 | PBCR1 |= 0x0800; /* as SCK1 */ | 249 | PBCR1 |= 0x0880; /* as SCK1, TxD1 */ |
250 | } | 250 | } |
251 | else | 251 | else |
252 | { | 252 | { |
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 | } | 256 | } |
256 | } | 257 | } |
257 | 258 | ||
@@ -275,10 +276,12 @@ int ata_init(void) | |||
275 | if(adc_read(ADC_MMC_SWITCH) < 0x200) | 276 | if(adc_read(ADC_MMC_SWITCH) < 0x200) |
276 | { /* MMC inserted */ | 277 | { /* MMC inserted */ |
277 | PADR &= ~0x1000; /* clear PA12 */ | 278 | PADR &= ~0x1000; /* clear PA12 */ |
279 | PADR |= 0x0400; /* chip select internal flash */ | ||
278 | } | 280 | } |
279 | else | 281 | else |
280 | { /* no MMC, use internal memory */ | 282 | { /* no MMC, use internal memory */ |
281 | PADR |= 0x1000; /* set PA12 */ | 283 | PADR |= 0x1000; /* set PA12 */ |
284 | PADR |= 0x0200; /* chip select external flash */ | ||
282 | } | 285 | } |
283 | 286 | ||
284 | sleeping = false; | 287 | sleeping = false; |