summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
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)
1174 return 0; 1174 return 0;
1175} 1175}
1176 1176
1177#endif /* #ifndef HAVE_MMC */ \ No newline at end of file 1177#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 @@
29#include "power.h" 29#include "power.h"
30#include "string.h" 30#include "string.h"
31#include "hwcompat.h" 31#include "hwcompat.h"
32#include "adc.h"
32 33
33/* use file for an MMC-based system, FIXME in makefile */ 34/* use file for an MMC-based system, FIXME in makefile */
34#ifdef HAVE_MMC 35#ifdef HAVE_MMC
@@ -257,9 +258,23 @@ int ata_init(void)
257 258
258 led(false); 259 led(false);
259 260
260 /* ToDo: Port setup */ 261 /* Port setup */
261 // PAIOR |= 0x1680; 262 PADR |= 0x1600; /* set all the selects high (=inactive) */
263 PAIOR |= 0x1600; /* make outputs for them */
264 PAIOR &= ~0x0008; /* input for card detect */
262 265
266 /* serial setup */
267 PBCR1 &= ~0x0CF0; /* use PB10, PB11, PB13 */
268 PBCR1 |= 0x08A0; /* as RxD1, TxD1, SCK1 */
269
270 if(adc_read(ADC_MMC_SWITCH) < 0x200)
271 { /* MMC inserted */
272 PADR |= 0x0200;
273 }
274 else
275 { /* no MMC, use internal memory */
276 PADR |= 0x0400;
277 }
263 278
264 sleeping = false; 279 sleeping = false;
265 ata_enable(true); 280 ata_enable(true);