summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-09-11 15:18:10 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-09-11 15:18:10 +0000
commitc4e8bed5a743f7cdd2e94919ce33b98bceb05317 (patch)
tree94548547ec4f0ce4e047b1eea412775a2fe5a21d /firmware
parent00be7469d6bd0810cfa65f4b935da5db6fac09d4 (diff)
some fixes for Ondio USB passthrough (but still doesn't work yet)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5067 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata_mmc.c21
-rw-r--r--firmware/usb.c9
2 files changed, 17 insertions, 13 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index 7ce1547085..a29795789d 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -242,7 +242,17 @@ int ata_soft_reset(void)
void ata_enable(bool on)
{
- (void)on;
+ PBCR1 &= ~0x0C00; /* use PB13 as GPIO, if not modified below */
+ if (on)
+ {
+ /* serial setup */
+ PBCR1 |= 0x0800; /* as SCK1 */
+ }
+ else
+ {
+ PBDR |= 0x2000; /* drive PB13 high */
+ PBIOR |= 0x2000; /* output PB13 */
+ }
}
unsigned short* ata_get_identify(void)
@@ -261,19 +271,14 @@ int ata_init(void)
/* 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;
+ PADR &= ~0x1000; /* clear PA12 */
}
else
{ /* no MMC, use internal memory */
- PADR |= 0x0400;
+ PADR |= 0x1000; /* set PA12 */
}
sleeping = false;
diff --git a/firmware/usb.c b/firmware/usb.c
index 6b226bd43b..2adf28a52b 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -72,11 +72,6 @@ static bool usb_monitor_enabled;
static void usb_enable(bool on)
{
-#ifdef HAVE_LCD_BITMAP
- if(read_hw_mask() & USB_ACTIVE_HIGH)
- on = !on;
-#endif
-
#ifdef USB_ENABLE_ONDIOSTYLE
if(on)
{
@@ -88,6 +83,10 @@ static void usb_enable(bool on)
}
or_b(0x20, &PAIORL); /* output for USB enable */
#else /* standard HD Jukebox */
+#ifdef HAVE_LCD_BITMAP
+ if(read_hw_mask() & USB_ACTIVE_HIGH)
+ on = !on;
+#endif
if(on)
{
and_b(~0x04, &PADRH); /* enable USB */