summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-09-11 09:06:58 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-09-11 09:06:58 +0000
commit00be7469d6bd0810cfa65f4b935da5db6fac09d4 (patch)
treebf7b43a7c188906eec01d499a9f597dc6001e854 /firmware/drivers
parent57ea92cae1f4d0f28b453e0caf68977c599cc096 (diff)
prepared Ondio USB passthrough (but doesn't work yet)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c2
-rw-r--r--firmware/drivers/ata_mmc.c19
2 files changed, 18 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 21d97aa939..af6955b2b0 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1174,4 +1174,4 @@ int ata_init(void)
return 0;
}
-#endif /* #ifndef HAVE_MMC */ \ No newline at end of file
+#endif /* #ifndef HAVE_MMC */
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index a3669573e0..7ce1547085 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -29,6 +29,7 @@
#include "power.h"
#include "string.h"
#include "hwcompat.h"
+#include "adc.h"
/* use file for an MMC-based system, FIXME in makefile */
#ifdef HAVE_MMC
@@ -257,9 +258,23 @@ int ata_init(void)
led(false);
- /* ToDo: Port setup */
- // PAIOR |= 0x1680;
+ /* Port setup */
+ PADR |= 0x1600; /* set all the selects high (=inactive) */
+ PAIOR |= 0x1600; /* make outputs for them */
+ PAIOR &= ~0x0008; /* input for card detect */
+ /* serial setup */
+ PBCR1 &= ~0x0CF0; /* use PB10, PB11, PB13 */
+ PBCR1 |= 0x08A0; /* as RxD1, TxD1, SCK1 */
+
+ if(adc_read(ADC_MMC_SWITCH) < 0x200)
+ { /* MMC inserted */
+ PADR |= 0x0200;
+ }
+ else
+ { /* no MMC, use internal memory */
+ PADR |= 0x0400;
+ }
sleeping = false;
ata_enable(true);