summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2008-04-22 04:13:07 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2008-04-22 04:13:07 +0000
commit68afa9dc3438a03705544745654cd7f4d53d72c0 (patch)
treee3aeaa5b560cd6444ad79c75c15e1d496189dd3e /firmware/target/arm/s3c2440/gigabeat-fx
parent8ec1dca0da5d4d2d4d81768ab31ccb2f0981aadc (diff)
Cleanup/fixup the USB initialization for the Gigabeat F
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17212 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s3c2440/gigabeat-fx')
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c
index 217a7d3cef..79f43f07a6 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/usb-meg-fx.c
@@ -26,8 +26,8 @@
#define USB_RST_ASSERT GPBDAT &= ~(1 << 4)
#define USB_RST_DEASSERT GPBDAT |= (1 << 4)
-#define USB_VPLUS_PWR_ASSERT GPBDAT |= (1 << 6)
-#define USB_VPLUS_PWR_DEASSERT GPBDAT &= ~(1 << 6)
+#define USB_VBUS_PWR_ASSERT GPBDAT |= (1 << 6)
+#define USB_VBUS_PWR_DEASSERT GPBDAT &= ~(1 << 6)
#define USB_UNIT_IS_PRESENT !(GPFDAT & 0x01)
#define USB_CRADLE_IS_PRESENT ((GPFDAT &0x02)&&((GPGDAT&(3<<13))==(1<<13)))
@@ -46,16 +46,21 @@ int usb_detect(void)
void usb_init_device(void)
{
- /* Input is the default configuration, only pullups need to be disabled */
-/* GPFUP|=0x02; */
+ /* Setup USB Cradle Power control (output, disabled, no pullup) */
+ GPHCON=( GPHCON&~(1<<17) ) | (1<<16);
+ GPHUP|=1<<8;
+ USB_CRADLE_BUS_DISABLE;
+ /* Setup VBUS PWR (output, asserted, no pullup) */
GPBCON=( GPBCON&~(1<<13) ) | (1 << 12);
- USB_VPLUS_PWR_ASSERT;
+ GPBUP|=1<<6;
+ USB_VBUS_PWR_ASSERT;
sleep(HZ/20);
- /* Reset the usb port */
+ /* Setup USB reset (output, asserted, no pullup) */
GPBCON = (GPBCON & ~0x200) | 0x100; /* Make sure reset line is an output */
+ GPBUP|=1<<4;
USB_RST_ASSERT;
sleep(HZ/25);
@@ -71,25 +76,22 @@ void usb_init_device(void)
sleep(HZ/25);
/* leave chip in low power mode */
- USB_VPLUS_PWR_DEASSERT;
+ USB_VBUS_PWR_DEASSERT;
sleep(HZ/25);
}
void usb_enable(bool on)
-{
- GPHCON=( GPHCON&~(1<<17) ) | (1<<16); /* Make the pin an output */
- GPHUP|=1<<8; /* Disable pullup in SOC as we are now driving */
-
+{
if (on)
{
- USB_VPLUS_PWR_ASSERT;
+ USB_VBUS_PWR_ASSERT;
if(USB_CRADLE_IS_PRESENT) USB_CRADLE_BUS_ENABLE;
}
else
{
if(USB_CRADLE_IS_PRESENT) USB_CRADLE_BUS_DISABLE;
- USB_VPLUS_PWR_DEASSERT;
+ USB_VBUS_PWR_DEASSERT;
}
sleep(HZ/20); // > 50ms for detecting the enable state change