]>
Commit | Line | Data |
---|---|---|
a77606e9 UH |
1 | ;; |
2 | ;; This file is part of the sigrok-firmware-fx2lafw project. | |
3 | ;; | |
4 | ;; Copyright (C) 2009 Ubixum, Inc. | |
5 | ;; | |
6 | ;; This library is free software; you can redistribute it and/or | |
7 | ;; modify it under the terms of the GNU Lesser General Public | |
8 | ;; License as published by the Free Software Foundation; either | |
9 | ;; version 2.1 of the License, or (at your option) any later version. | |
10 | ;; | |
11 | ;; This library is distributed in the hope that it will be useful, | |
12 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | ;; Lesser General Public License for more details. | |
15 | ;; | |
16 | ;; You should have received a copy of the GNU Lesser General Public | |
17 | ;; License along with this library; if not, write to the Free Software | |
18 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | ;; | |
189db3d4 | 20 | |
e0c25b8e UH |
21 | .module DEV_DSCR |
22 | ||
23 | ; Descriptor types | |
24 | DSCR_DEVICE_TYPE = 1 | |
25 | DSCR_CONFIG_TYPE = 2 | |
26 | DSCR_STRING_TYPE = 3 | |
27 | DSCR_INTERFACE_TYPE = 4 | |
28 | DSCR_ENDPOINT_TYPE = 5 | |
29 | DSCR_DEVQUAL_TYPE = 6 | |
30 | ||
31 | ; Descriptor lengths | |
32 | DSCR_INTERFACE_LEN = 9 | |
33 | DSCR_ENDPOINT_LEN = 7 | |
34 | ||
35 | ; Endpoint types | |
36 | ENDPOINT_TYPE_CONTROL = 0 | |
37 | ENDPOINT_TYPE_ISO = 1 | |
38 | ENDPOINT_TYPE_BULK = 2 | |
39 | ENDPOINT_TYPE_INT = 3 | |
40 | ||
41 | .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end | |
42 | .area DSCR_AREA (CODE) | |
43 | ||
44 | ; ----------------------------------------------------------------------------- | |
45 | ; Device descriptor | |
46 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 47 | _dev_dscr: |
e0c25b8e UH |
48 | .db dev_dscr_end - _dev_dscr |
49 | .db DSCR_DEVICE_TYPE | |
50 | .dw 0x0002 ; USB 2.0 | |
51 | .db 0xff ; Class (vendor specific) | |
52 | .db 0xff ; Subclass (vendor specific) | |
53 | .db 0xff ; Protocol (vendor specific) | |
54 | .db 64 ; Max. EP0 packet size | |
55 | .dw VID ; Manufacturer ID | |
56 | .dw PID ; Product ID | |
57 | .dw 0x0000 ; Product version (0.00) | |
58 | .db 1 ; Manufacturer string index | |
59 | .db 2 ; Product string index | |
60 | .db 0 ; Serial number string index (none) | |
61 | .db 1 ; Number of configurations | |
189db3d4 UH |
62 | dev_dscr_end: |
63 | ||
e0c25b8e UH |
64 | ; ----------------------------------------------------------------------------- |
65 | ; Device qualifier (for "other device speed") | |
66 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 67 | _dev_qual_dscr: |
e0c25b8e | 68 | .db dev_qualdscr_end - _dev_qual_dscr |
189db3d4 | 69 | .db DSCR_DEVQUAL_TYPE |
e0c25b8e UH |
70 | .dw 0x0002 ; USB 2.0 |
71 | .db 0 ; Class (0) | |
72 | .db 0 ; Subclass (0) | |
73 | .db 0 ; Protocol (0) | |
74 | .db 64 ; Max. EP0 packet size | |
75 | .db 1 ; Number of configurations | |
76 | .db 0 ; Extra reserved byte | |
189db3d4 UH |
77 | dev_qualdscr_end: |
78 | ||
e0c25b8e UH |
79 | ; ----------------------------------------------------------------------------- |
80 | ; High-Speed configuration descriptor | |
81 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 82 | _highspd_dscr: |
e0c25b8e | 83 | .db highspd_dscr_end - _highspd_dscr |
189db3d4 | 84 | .db DSCR_CONFIG_TYPE |
e0c25b8e UH |
85 | ; Total length of the configuration (1st line LSB, 2nd line MSB) |
86 | .db (highspd_dscr_realend - _highspd_dscr) % 256 | |
87 | .db (highspd_dscr_realend - _highspd_dscr) / 256 | |
88 | .db 1 ; Number of interfaces | |
89 | .db 1 ; Configuration number | |
90 | .db 0 ; Configuration string (none) | |
91 | .db 0x80 ; Attributes (bus powered, no wakeup) | |
92 | .db 0x37 ; Max. power (110mA) | |
189db3d4 UH |
93 | highspd_dscr_end: |
94 | ||
e0c25b8e | 95 | ; Bulk interface 0, alt 0 |
189db3d4 UH |
96 | .db DSCR_INTERFACE_LEN |
97 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
98 | .db 0 ; Interface index |
99 | .db 0 ; Alternate setting index | |
100 | .db 1 ; Number of endpoints | |
101 | .db 0xff ; Class (vendor specific) | |
102 | .db 0 ; Subclass (0) | |
103 | .db 0 ; Protocol (0) | |
104 | .db 0 ; String index (none) | |
105 | ||
106 | ; Endpoint 6 (IN) | |
189db3d4 UH |
107 | .db DSCR_ENDPOINT_LEN |
108 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
109 | .db 0x86 ; EP number (6), direction (IN) |
110 | .db ENDPOINT_TYPE_BULK ; Endpoint type (bulk) | |
111 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
112 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
113 | .db 0x00 ; Polling interval | |
189db3d4 | 114 | |
e0c25b8e | 115 | ; Isochronous interface 0, alt 1 |
189db3d4 UH |
116 | .db DSCR_INTERFACE_LEN |
117 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
118 | .db 0 ; Interface index |
119 | .db 1 ; Alternate setting index | |
120 | .db 1 ; Number of endpoints | |
121 | .db 0xff ; Class (vendor specific) | |
122 | .db 0 ; Subclass (0) | |
123 | .db 1 ; Protocol (1) | |
124 | .db 0 ; String index (none) | |
125 | ||
126 | ; Endpoint 2 (IN) | |
189db3d4 UH |
127 | .db DSCR_ENDPOINT_LEN |
128 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
129 | .db 0x82 ; EP number (2), direction (IN) |
130 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
131 | .db 0x00 ; Max. packet size, LSB (3*1024 bytes) | |
132 | .db 0x14 ; Max. packet size, MSB (3*1024 bytes) | |
133 | .db 0x01 ; Polling interval | |
189db3d4 | 134 | |
e0c25b8e | 135 | ; Isochronous interface 0, alt 2, 16MB/s |
189db3d4 UH |
136 | .db DSCR_INTERFACE_LEN |
137 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
138 | .db 0 ; Interface index |
139 | .db 2 ; Alternate setting index | |
140 | .db 1 ; Number of endpoints | |
141 | .db 0xff ; Class (vendor specific) | |
142 | .db 0 ; Subclass (0) | |
143 | .db 1 ; Protocol (1) | |
144 | .db 0 ; String index (none) | |
145 | ||
146 | ; Endpoint 2 (IN) | |
189db3d4 UH |
147 | .db DSCR_ENDPOINT_LEN |
148 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
149 | .db 0x82 ; EP number (2), direction (IN) |
150 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
151 | .db 0x00 ; Max. packet size, LSB (2*1024 bytes) | |
152 | .db 0x0c ; Max. packet size, MSB (2*1024 bytes) | |
153 | .db 0x01 ; Polling interval | |
189db3d4 | 154 | |
e0c25b8e | 155 | ; Isochronous interface 0, alt 3, 8MB/s |
189db3d4 UH |
156 | .db DSCR_INTERFACE_LEN |
157 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
158 | .db 0 ; Interface index |
159 | .db 3 ; Alternate setting index | |
160 | .db 1 ; Number of endpoints | |
161 | .db 0xff ; Class (vendor specific) | |
162 | .db 0 ; Subclass (0) | |
163 | .db 1 ; Protocol (1) | |
164 | .db 0 ; String index (none) | |
165 | ||
166 | ; Endpoint 2 (IN) | |
189db3d4 UH |
167 | .db DSCR_ENDPOINT_LEN |
168 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
169 | .db 0x82 ; EP number (2), direction (IN) |
170 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
171 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
172 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
173 | .db 0x01 ; Polling interval | |
189db3d4 | 174 | |
e0c25b8e | 175 | ; Isochronous interface 0, alt 4, 4MB/s |
189db3d4 UH |
176 | .db DSCR_INTERFACE_LEN |
177 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
178 | .db 0 ; Interface index |
179 | .db 4 ; Alternate setting index | |
180 | .db 1 ; Number of endpoints | |
181 | .db 0xff ; Class (vendor specific) | |
182 | .db 0 ; Subclass (0) | |
183 | .db 1 ; Protocol (1) | |
184 | .db 0 ; String index (none) | |
185 | ||
186 | ; Endpoint 2 (IN) | |
189db3d4 UH |
187 | .db DSCR_ENDPOINT_LEN |
188 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
189 | .db 0x82 ; EP number (2), direction (IN) |
190 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
191 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
192 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
193 | .db 0x02 ; Polling interval | |
189db3d4 | 194 | |
e0c25b8e | 195 | ; Isochronous interface 0, alt 5, 2MB/s |
189db3d4 UH |
196 | .db DSCR_INTERFACE_LEN |
197 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
198 | .db 0 ; Interface index |
199 | .db 5 ; Alternate setting index | |
200 | .db 1 ; Number of endpoints | |
201 | .db 0xff ; Class (vendor specific) | |
202 | .db 0 ; Subclass (0) | |
203 | .db 1 ; Protocol (1) | |
204 | .db 0 ; String index (none) | |
205 | ||
206 | ; Endpoint 2 (IN) | |
189db3d4 UH |
207 | .db DSCR_ENDPOINT_LEN |
208 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
209 | .db 0x82 ; EP number (2), direction (IN) |
210 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
211 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
212 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
213 | .db 0x03 ; Polling interval | |
189db3d4 | 214 | |
e0c25b8e | 215 | ; Isochronous interface 0, alt 6, 1MB/s |
189db3d4 UH |
216 | .db DSCR_INTERFACE_LEN |
217 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
218 | .db 0 ; Interface index |
219 | .db 6 ; Alternate setting index | |
220 | .db 1 ; Number of endpoints | |
221 | .db 0xff ; Class (vendor specific) | |
222 | .db 0 ; Subclass (0) | |
223 | .db 1 ; Protocol (1) | |
224 | .db 0 ; String index (none) | |
225 | ||
226 | ; Endpoint 2 (IN) | |
189db3d4 UH |
227 | .db DSCR_ENDPOINT_LEN |
228 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
229 | .db 0x82 ; EP number (2), direction (IN) |
230 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
231 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
232 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
233 | .db 0x04 ; Polling interval | |
189db3d4 | 234 | |
e0c25b8e | 235 | ; Isochronous interface 0, alt 7, 500kB/s |
189db3d4 UH |
236 | .db DSCR_INTERFACE_LEN |
237 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
238 | .db 0 ; Interface index |
239 | .db 7 ; Alternate setting index | |
240 | .db 1 ; Number of endpoints | |
241 | .db 0xff ; Class (vendor specific) | |
242 | .db 0 ; Subclass (0) | |
243 | .db 1 ; Protocol (1) | |
244 | .db 0 ; String index (none) | |
245 | ||
246 | ; Endpoint 2 (IN) | |
189db3d4 UH |
247 | .db DSCR_ENDPOINT_LEN |
248 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
249 | .db 0x82 ; EP number (2), direction (IN) |
250 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
251 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
252 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
253 | .db 0x04 ; Polling interval | |
189db3d4 UH |
254 | |
255 | highspd_dscr_realend: | |
256 | ||
e0c25b8e UH |
257 | .even |
258 | ||
259 | ; ----------------------------------------------------------------------------- | |
260 | ; Full-Speed configuration descriptor | |
261 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 262 | _fullspd_dscr: |
e0c25b8e | 263 | .db fullspd_dscr_end - _fullspd_dscr |
189db3d4 | 264 | .db DSCR_CONFIG_TYPE |
e0c25b8e UH |
265 | ; Total length of the configuration (1st line LSB, 2nd line MSB) |
266 | .db (fullspd_dscr_realend - _fullspd_dscr) % 256 | |
267 | .db (fullspd_dscr_realend - _fullspd_dscr) / 256 | |
268 | .db 2 ; Number of interfaces | |
269 | .db 1 ; Configuration number | |
270 | .db 0 ; Configuration string (none) | |
271 | .db 0x80 ; Attributes (bus powered, no wakeup) | |
272 | .db 0x37 ; Max. power (110mA) | |
189db3d4 UH |
273 | fullspd_dscr_end: |
274 | ||
e0c25b8e | 275 | ; Bulk interface 0, alt 0 |
189db3d4 UH |
276 | .db DSCR_INTERFACE_LEN |
277 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
278 | .db 0 ; Interface index |
279 | .db 0 ; Alternate setting index | |
280 | .db 1 ; Number of endpoints | |
281 | .db 0xff ; Class (vendor specific) | |
282 | .db 0 ; Subclass (0) | |
283 | .db 0 ; Protocol (0) | |
284 | .db 0 ; String index (none) | |
285 | ||
286 | ; Endpoint 6 (IN) | |
189db3d4 UH |
287 | .db DSCR_ENDPOINT_LEN |
288 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
289 | .db 0x86 ; EP number (6), direction (IN) |
290 | .db ENDPOINT_TYPE_BULK ; Endpoint type (bulk) | |
291 | .db 0x40 ; Max. packet size, LSB (512 bytes) | |
292 | .db 0x00 ; Max. packet size, MSB (512 bytes) | |
293 | .db 0x00 ; Polling interval | |
189db3d4 | 294 | |
e0c25b8e | 295 | ; Isochronous interface 0, alt 1, 1MB/s |
189db3d4 UH |
296 | .db DSCR_INTERFACE_LEN |
297 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
298 | .db 0 ; Interface index |
299 | .db 1 ; Alternate setting index | |
300 | .db 1 ; Number of endpoints | |
301 | .db 0xff ; Class (vendor specific) | |
302 | .db 0 ; Subclass (0) | |
303 | .db 1 ; Protocol (1) | |
304 | .db 0 ; String index (none) | |
305 | ||
306 | ; Endpoint 2 (IN) | |
189db3d4 UH |
307 | .db DSCR_ENDPOINT_LEN |
308 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
309 | .db 0x82 ; EP number (2), direction (IN) |
310 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
311 | .db 0xff ; Max. packet size, LSB (1023 bytes) | |
312 | .db 0x03 ; Max. packet size, MSB (1023 bytes) | |
313 | .db 0x01 ; Polling interval | |
189db3d4 | 314 | |
e0c25b8e | 315 | ; Isochronous interface 0, alt 2, 500kB/s |
189db3d4 UH |
316 | .db DSCR_INTERFACE_LEN |
317 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
318 | .db 0 ; Interface index |
319 | .db 2 ; Alternate setting index | |
320 | .db 1 ; Number of endpoints | |
321 | .db 0xff ; Class (vendor specific) | |
322 | .db 0 ; Subclass (0) | |
323 | .db 1 ; Protocol (1) | |
324 | .db 0 ; String index (none) | |
325 | ||
326 | ; Endpoint 2 (IN) | |
189db3d4 UH |
327 | .db DSCR_ENDPOINT_LEN |
328 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
329 | .db 0x82 ; EP number (2), direction (IN) |
330 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
331 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
332 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
333 | .db 0x01 ; Polling interval | |
189db3d4 UH |
334 | |
335 | fullspd_dscr_realend: | |
336 | ||
e0c25b8e UH |
337 | .even |
338 | ||
339 | ; ----------------------------------------------------------------------------- | |
340 | ; Strings | |
341 | ; ----------------------------------------------------------------------------- | |
342 | ||
189db3d4 | 343 | _dev_strings: |
e0c25b8e UH |
344 | |
345 | ; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list. | |
189db3d4 | 346 | _string0: |
e0c25b8e | 347 | .db string0end - _string0 |
189db3d4 | 348 | .db DSCR_STRING_TYPE |
e0c25b8e | 349 | .db 0x09, 0x04 ; Language code 0x0409 (English, US) |
189db3d4 | 350 | string0end: |
e0c25b8e | 351 | |
189db3d4 | 352 | _string1: |
e0c25b8e | 353 | .db string1end - _string1 |
189db3d4 | 354 | .db DSCR_STRING_TYPE |
e0c25b8e | 355 | .ascii 'O\0D\0M\0' |
189db3d4 | 356 | string1end: |
e0c25b8e | 357 | |
189db3d4 | 358 | _string2: |
e0c25b8e | 359 | .db string2end - _string2 |
189db3d4 | 360 | .db DSCR_STRING_TYPE |
e0c25b8e | 361 | .ascii 'f\0x\0002\0l\0a\0f\0w\0' |
189db3d4 UH |
362 | string2end: |
363 | ||
189db3d4 | 364 | _dev_strings_end: |
e0c25b8e UH |
365 | .dw 0x0000 |
366 |