From 3f7c508a09354e501342996601d7b3dace0cda07 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Tue, 14 Sep 2004 23:06:10 +0000 Subject: 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 --- firmware/drivers/ata_mmc.c | 13 +++++++++---- 1 file 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) 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; -- cgit v1.2.3