diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2011-12-13 04:21:06 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2011-12-13 04:21:06 +0000 |
commit | bc943a06ba06e7f23837a122ef760c6f660c26d3 (patch) | |
tree | 9220d218e292d19460134f616b647745f0907670 /firmware/target/arm/usb-s3c6400x.c | |
parent | 62e0cdca26433d639e04fe0e172380cd599f8f5f (diff) | |
download | rockbox-bc943a06ba06e7f23837a122ef760c6f660c26d3.tar.gz rockbox-bc943a06ba06e7f23837a122ef760c6f660c26d3.zip |
Move usb-s3c6400 register comments to usb-s3c6400.h
Use common defines in usb-s3c6400.c and usb-drv-as3525v2.c
No functional changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31220 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/usb-s3c6400x.c')
-rw-r--r-- | firmware/target/arm/usb-s3c6400x.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c index 4476549aa7..4bae6f10f3 100644 --- a/firmware/target/arm/usb-s3c6400x.c +++ b/firmware/target/arm/usb-s3c6400x.c | |||
@@ -78,32 +78,32 @@ static void reset_endpoints(int reinit) | |||
78 | endpoints[i].done = true; | 78 | endpoints[i].done = true; |
79 | semaphore_release(&endpoints[i].complete); | 79 | semaphore_release(&endpoints[i].complete); |
80 | } | 80 | } |
81 | DIEPCTL0 = 0x8800; /* EP0 IN ACTIVE NEXT=1 */ | 81 | DIEPCTL(0) = 0x8800; /* EP0 IN ACTIVE NEXT=1 */ |
82 | DOEPCTL0 = 0x8000; /* EP0 OUT ACTIVE */ | 82 | DOEPCTL(0) = 0x8000; /* EP0 OUT ACTIVE */ |
83 | DOEPTSIZ0 = 0x20080040; /* EP0 OUT Transfer Size: | 83 | DOEPTSIZ(0) = 0x20080040; /* EP0 OUT Transfer Size: |
84 | 64 Bytes, 1 Packet, 1 Setup Packet */ | 84 | 64 Bytes, 1 Packet, 1 Setup Packet */ |
85 | DOEPDMA0 = &ctrlreq; | 85 | DOEPDMA(0) = &ctrlreq; |
86 | DOEPCTL0 |= 0x84000000; /* EP0 OUT ENABLE CLEARNAK */ | 86 | DOEPCTL(0) |= 0x84000000; /* EP0 OUT ENABLE CLEARNAK */ |
87 | if (reinit) | 87 | if (reinit) |
88 | { | 88 | { |
89 | /* The size is getting set to zero, because we don't know | 89 | /* The size is getting set to zero, because we don't know |
90 | whether we are Full Speed or High Speed at this stage */ | 90 | whether we are Full Speed or High Speed at this stage */ |
91 | /* EP1 IN INACTIVE DATA0 SIZE=0 NEXT=3 */ | 91 | /* EP1 IN INACTIVE DATA0 SIZE=0 NEXT=3 */ |
92 | DIEPCTL1 = 0x10001800; | 92 | DIEPCTL(1) = 0x10001800; |
93 | /* EP2 OUT INACTIVE DATA0 SIZE=0 */ | 93 | /* EP2 OUT INACTIVE DATA0 SIZE=0 */ |
94 | DOEPCTL2 = 0x10000000; | 94 | DOEPCTL(2) = 0x10000000; |
95 | /* EP3 IN INACTIVE DATA0 SIZE=0 NEXT=0 */ | 95 | /* EP3 IN INACTIVE DATA0 SIZE=0 NEXT=0 */ |
96 | DIEPCTL3 = 0x10000000; | 96 | DIEPCTL(3) = 0x10000000; |
97 | /* EP4 OUT INACTIVE DATA0 SIZE=0 */ | 97 | /* EP4 OUT INACTIVE DATA0 SIZE=0 */ |
98 | DOEPCTL4 = 0x10000000; | 98 | DOEPCTL(4) = 0x10000000; |
99 | } | 99 | } |
100 | else | 100 | else |
101 | { | 101 | { |
102 | /* INACTIVE DATA0 */ | 102 | /* INACTIVE DATA0 */ |
103 | DIEPCTL1 = (DIEPCTL1 & ~0x00008000) | 0x10000000; | 103 | DIEPCTL(1) = (DIEPCTL(1) & ~0x00008000) | 0x10000000; |
104 | DOEPCTL2 = (DOEPCTL2 & ~0x00008000) | 0x10000000; | 104 | DOEPCTL(2) = (DOEPCTL(2) & ~0x00008000) | 0x10000000; |
105 | DIEPCTL3 = (DIEPCTL3 & ~0x00008000) | 0x10000000; | 105 | DIEPCTL(3) = (DIEPCTL(3) & ~0x00008000) | 0x10000000; |
106 | DOEPCTL4 = (DOEPCTL4 & ~0x00008000) | 0x10000000; | 106 | DOEPCTL(4) = (DOEPCTL(4) & ~0x00008000) | 0x10000000; |
107 | } | 107 | } |
108 | DAINTMSK = 0xFFFFFFFF; /* Enable interrupts on all EPs */ | 108 | DAINTMSK = 0xFFFFFFFF; /* Enable interrupts on all EPs */ |
109 | } | 109 | } |
@@ -161,8 +161,8 @@ static void usb_reset(void) | |||
161 | while (GRSTCTL & 1); /* Wait for OTG to ack reset */ | 161 | while (GRSTCTL & 1); /* Wait for OTG to ack reset */ |
162 | while (!(GRSTCTL & 0x80000000)); /* Wait for OTG AHB master idle */ | 162 | while (!(GRSTCTL & 0x80000000)); /* Wait for OTG AHB master idle */ |
163 | 163 | ||
164 | GRXFSIZ = 0x00000200; /* RX FIFO: 512 bytes */ | 164 | GRXFSIZ = 512; /* RX FIFO: 512 bytes */ |
165 | GNPTXFSIZ = 0x02000200; /* Non-periodic TX FIFO: 512 bytes */ | 165 | GNPTXFSIZ = MAKE_FIFOSIZE_DATA(512); /* Non-periodic TX FIFO: 512 bytes */ |
166 | GAHBCFG = SYNOPSYSOTG_AHBCFG; | 166 | GAHBCFG = SYNOPSYSOTG_AHBCFG; |
167 | GUSBCFG = 0x1408; /* OTG: 16bit PHY and some reserved bits */ | 167 | GUSBCFG = 0x1408; /* OTG: 16bit PHY and some reserved bits */ |
168 | 168 | ||
@@ -193,10 +193,10 @@ void INT_USB_FUNC(void) | |||
193 | { | 193 | { |
194 | /* Set up the maximum packet sizes accordingly */ | 194 | /* Set up the maximum packet sizes accordingly */ |
195 | uint32_t maxpacket = usb_drv_port_speed() ? 512 : 64; | 195 | uint32_t maxpacket = usb_drv_port_speed() ? 512 : 64; |
196 | DIEPCTL1 = (DIEPCTL1 & ~0x000003FF) | maxpacket; | 196 | DIEPCTL(1) = (DIEPCTL(1) & ~0x000003FF) | maxpacket; |
197 | DOEPCTL2 = (DOEPCTL2 & ~0x000003FF) | maxpacket; | 197 | DOEPCTL(2) = (DOEPCTL(2) & ~0x000003FF) | maxpacket; |
198 | DIEPCTL3 = (DIEPCTL3 & ~0x000003FF) | maxpacket; | 198 | DIEPCTL(3) = (DIEPCTL(3) & ~0x000003FF) | maxpacket; |
199 | DOEPCTL4 = (DOEPCTL4 & ~0x000003FF) | maxpacket; | 199 | DOEPCTL(4) = (DOEPCTL(4) & ~0x000003FF) | maxpacket; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (ints & 0x40000) /* IN EP event */ | 202 | if (ints & 0x40000) /* IN EP event */ |
@@ -269,9 +269,9 @@ void INT_USB_FUNC(void) | |||
269 | /* Make sure EP0 OUT is set up to accept the next request */ | 269 | /* Make sure EP0 OUT is set up to accept the next request */ |
270 | if (!i) | 270 | if (!i) |
271 | { | 271 | { |
272 | DOEPTSIZ0 = 0x20080040; | 272 | DOEPTSIZ(0) = 0x20080040; |
273 | DOEPDMA0 = &ctrlreq; | 273 | DOEPDMA(0) = &ctrlreq; |
274 | DOEPCTL0 |= 0x84000000; | 274 | DOEPCTL(0) |= 0x84000000; |
275 | } | 275 | } |
276 | DOEPINT(i) = epints; | 276 | DOEPINT(i) = epints; |
277 | } | 277 | } |