diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c | 10 | ||||
-rw-r--r-- | firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c | 23 |
2 files changed, 11 insertions, 22 deletions
diff --git a/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c index 3c6374f0cd..bc2b53d776 100644 --- a/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/ata-meg-fx.c | |||
@@ -53,15 +53,7 @@ void ata_enable(bool on) | |||
53 | USB_ATA_ENABLE; | 53 | USB_ATA_ENABLE; |
54 | 54 | ||
55 | GPBCON=( GPGCON&~(1<<11) ) | (1<<10); /* Make the pin an output */ | 55 | GPBCON=( GPGCON&~(1<<11) ) | (1<<10); /* Make the pin an output */ |
56 | GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */ | 56 | // GPBUP|=1<<5; /* Disable pullup in SOC as we are now driving */ |
57 | |||
58 | /* Code was originally: (Does not seem that GPG12 is connected in the F series) | ||
59 | if(on) | ||
60 | GPGDAT &= 1<<12; | ||
61 | else | ||
62 | GPGDAT |= 1<<12; | ||
63 | */ | ||
64 | |||
65 | } | 57 | } |
66 | 58 | ||
67 | bool ata_is_coldstart(void) | 59 | bool ata_is_coldstart(void) |
diff --git a/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c index ead286cec4..3aed8c3256 100644 --- a/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/usb-meg-fx.c | |||
@@ -44,35 +44,32 @@ inline bool usb_detect(void) | |||
44 | void usb_init_device(void) | 44 | void usb_init_device(void) |
45 | { | 45 | { |
46 | /* Input is the default configuration, only pullups need to be disabled */ | 46 | /* Input is the default configuration, only pullups need to be disabled */ |
47 | GPFUP|=0x03; | 47 | GPFUP|=0x02; |
48 | GPGUP|= 1<<14; | ||
49 | 48 | ||
50 | USB_VPLUS_PWR_ASSERT; | 49 | USB_VPLUS_PWR_ASSERT; |
51 | GPBCON=( GPBCON&~(1<<13) ) | (1 << 12); | 50 | GPBCON=( GPBCON&~(1<<13) ) | (1 << 12); |
52 | GPBUP|= 1<<6; | ||
53 | 51 | ||
54 | sleep(HZ/20); | 52 | sleep(HZ/20); |
55 | 53 | ||
56 | /* Reset the usb port */ | 54 | /* Reset the usb port */ |
57 | USB_RST_ASSERT; | 55 | USB_RST_ASSERT; |
58 | GPBCON = (GPBCON & ~0x200) | 0x100; /* Make sure reset line is an output */ | 56 | GPBCON = (GPBCON & ~0x200) | 0x100; /* Make sure reset line is an output */ |
59 | GPBUP |= 1<<4; /* Make sure pullup is disabled */ | ||
60 | 57 | ||
61 | sleep(HZ/25); | 58 | sleep(HZ/25); |
62 | USB_RST_DEASSERT; | 59 | USB_RST_DEASSERT; |
63 | 60 | ||
64 | /* needed to complete the reset */ | 61 | /* needed to complete the reset */ |
65 | ata_enable(false); | 62 | ata_enable(false); |
66 | 63 | ||
67 | sleep(HZ/15); /* 66ms */ | 64 | sleep(HZ/15); /* 66ms */ |
68 | 65 | ||
69 | ata_enable(true); | 66 | ata_enable(true); |
70 | 67 | ||
71 | sleep(HZ/25); | 68 | sleep(HZ/25); |
72 | 69 | ||
73 | /* leave chip in low power mode */ | 70 | /* leave chip in low power mode */ |
74 | USB_VPLUS_PWR_DEASSERT; | 71 | USB_VPLUS_PWR_DEASSERT; |
75 | 72 | ||
76 | sleep(HZ/25); | 73 | sleep(HZ/25); |
77 | } | 74 | } |
78 | 75 | ||
@@ -90,8 +87,8 @@ void usb_enable(bool on) | |||
90 | } | 87 | } |
91 | 88 | ||
92 | /* Make sure USB_CRADLE_BUS pin is an output */ | 89 | /* Make sure USB_CRADLE_BUS pin is an output */ |
93 | GPHCON=( GPGCON&~(1<<17) ) | (1<<16); /* Make the pin an output */ | 90 | GPHCON=( GPHCON&~(1<<17) ) | (1<<16); /* Make the pin an output */ |
94 | GPBUP|=1<<8; /* Disable pullup in SOC as we are now driving */ | 91 | GPHUP|=1<<8; /* Disable pullup in SOC as we are now driving */ |
95 | 92 | ||
96 | sleep(HZ/20); // > 50ms for detecting the enable state change | 93 | sleep(HZ/20); // > 50ms for detecting the enable state change |
97 | } | 94 | } |