]>
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 | |
01c91958 UH |
21 | .include "common.inc" |
22 | ||
e0c25b8e UH |
23 | .module DEV_DSCR |
24 | ||
25 | ; Descriptor types | |
26 | DSCR_DEVICE_TYPE = 1 | |
27 | DSCR_CONFIG_TYPE = 2 | |
28 | DSCR_STRING_TYPE = 3 | |
29 | DSCR_INTERFACE_TYPE = 4 | |
30 | DSCR_ENDPOINT_TYPE = 5 | |
31 | DSCR_DEVQUAL_TYPE = 6 | |
32 | ||
33 | ; Descriptor lengths | |
34 | DSCR_INTERFACE_LEN = 9 | |
35 | DSCR_ENDPOINT_LEN = 7 | |
36 | ||
37 | ; Endpoint types | |
38 | ENDPOINT_TYPE_CONTROL = 0 | |
39 | ENDPOINT_TYPE_ISO = 1 | |
40 | ENDPOINT_TYPE_BULK = 2 | |
41 | ENDPOINT_TYPE_INT = 3 | |
42 | ||
43 | .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end | |
44 | .area DSCR_AREA (CODE) | |
45 | ||
46 | ; ----------------------------------------------------------------------------- | |
47 | ; Device descriptor | |
48 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 49 | _dev_dscr: |
e0c25b8e UH |
50 | .db dev_dscr_end - _dev_dscr |
51 | .db DSCR_DEVICE_TYPE | |
52 | .dw 0x0002 ; USB 2.0 | |
53 | .db 0xff ; Class (vendor specific) | |
54 | .db 0xff ; Subclass (vendor specific) | |
55 | .db 0xff ; Protocol (vendor specific) | |
56 | .db 64 ; Max. EP0 packet size | |
57 | .dw VID ; Manufacturer ID | |
58 | .dw PID ; Product ID | |
b2fc269a | 59 | .dw VER ; Product version/type |
e0c25b8e UH |
60 | .db 1 ; Manufacturer string index |
61 | .db 2 ; Product string index | |
e59a70a9 | 62 | .db 3 ; Serial number string index |
e0c25b8e | 63 | .db 1 ; Number of configurations |
189db3d4 UH |
64 | dev_dscr_end: |
65 | ||
e0c25b8e UH |
66 | ; ----------------------------------------------------------------------------- |
67 | ; Device qualifier (for "other device speed") | |
68 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 69 | _dev_qual_dscr: |
e0c25b8e | 70 | .db dev_qualdscr_end - _dev_qual_dscr |
189db3d4 | 71 | .db DSCR_DEVQUAL_TYPE |
e0c25b8e UH |
72 | .dw 0x0002 ; USB 2.0 |
73 | .db 0 ; Class (0) | |
74 | .db 0 ; Subclass (0) | |
75 | .db 0 ; Protocol (0) | |
76 | .db 64 ; Max. EP0 packet size | |
77 | .db 1 ; Number of configurations | |
78 | .db 0 ; Extra reserved byte | |
189db3d4 UH |
79 | dev_qualdscr_end: |
80 | ||
e0c25b8e UH |
81 | ; ----------------------------------------------------------------------------- |
82 | ; High-Speed configuration descriptor | |
83 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 84 | _highspd_dscr: |
e0c25b8e | 85 | .db highspd_dscr_end - _highspd_dscr |
189db3d4 | 86 | .db DSCR_CONFIG_TYPE |
e0c25b8e UH |
87 | ; Total length of the configuration (1st line LSB, 2nd line MSB) |
88 | .db (highspd_dscr_realend - _highspd_dscr) % 256 | |
89 | .db (highspd_dscr_realend - _highspd_dscr) / 256 | |
90 | .db 1 ; Number of interfaces | |
91 | .db 1 ; Configuration number | |
92 | .db 0 ; Configuration string (none) | |
93 | .db 0x80 ; Attributes (bus powered, no wakeup) | |
94 | .db 0x37 ; Max. power (110mA) | |
189db3d4 UH |
95 | highspd_dscr_end: |
96 | ||
e0c25b8e | 97 | ; Bulk interface 0, alt 0 |
189db3d4 UH |
98 | .db DSCR_INTERFACE_LEN |
99 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
100 | .db 0 ; Interface index |
101 | .db 0 ; Alternate setting index | |
102 | .db 1 ; Number of endpoints | |
103 | .db 0xff ; Class (vendor specific) | |
104 | .db 0 ; Subclass (0) | |
105 | .db 0 ; Protocol (0) | |
106 | .db 0 ; String index (none) | |
107 | ||
108 | ; Endpoint 6 (IN) | |
189db3d4 UH |
109 | .db DSCR_ENDPOINT_LEN |
110 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
111 | .db 0x86 ; EP number (6), direction (IN) |
112 | .db ENDPOINT_TYPE_BULK ; Endpoint type (bulk) | |
113 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
114 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
b68bc8ea | 115 | .db 0x00 ; Polling interval (ignored for bulk) |
189db3d4 | 116 | |
e0c25b8e | 117 | ; Isochronous interface 0, alt 1 |
189db3d4 UH |
118 | .db DSCR_INTERFACE_LEN |
119 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
120 | .db 0 ; Interface index |
121 | .db 1 ; Alternate setting index | |
122 | .db 1 ; Number of endpoints | |
123 | .db 0xff ; Class (vendor specific) | |
124 | .db 0 ; Subclass (0) | |
125 | .db 1 ; Protocol (1) | |
126 | .db 0 ; String index (none) | |
127 | ||
128 | ; Endpoint 2 (IN) | |
189db3d4 UH |
129 | .db DSCR_ENDPOINT_LEN |
130 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
131 | .db 0x82 ; EP number (2), direction (IN) |
132 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
133 | .db 0x00 ; Max. packet size, LSB (3*1024 bytes) | |
134 | .db 0x14 ; Max. packet size, MSB (3*1024 bytes) | |
1cba5732 UH |
135 | ; 12:11 = 0b10 (3 tr. per microframe) |
136 | ; 10:00 = 1024 | |
b68bc8ea | 137 | .db 0x01 ; Polling interval (1 microframe) |
189db3d4 | 138 | |
e0c25b8e | 139 | ; Isochronous interface 0, alt 2, 16MB/s |
189db3d4 UH |
140 | .db DSCR_INTERFACE_LEN |
141 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
142 | .db 0 ; Interface index |
143 | .db 2 ; Alternate setting index | |
144 | .db 1 ; Number of endpoints | |
145 | .db 0xff ; Class (vendor specific) | |
146 | .db 0 ; Subclass (0) | |
147 | .db 1 ; Protocol (1) | |
148 | .db 0 ; String index (none) | |
149 | ||
150 | ; Endpoint 2 (IN) | |
189db3d4 UH |
151 | .db DSCR_ENDPOINT_LEN |
152 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
153 | .db 0x82 ; EP number (2), direction (IN) |
154 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
155 | .db 0x00 ; Max. packet size, LSB (2*1024 bytes) | |
156 | .db 0x0c ; Max. packet size, MSB (2*1024 bytes) | |
1cba5732 UH |
157 | ; 12:11 = 0b01 (2 tr. per microframe) |
158 | ; 10:00 = 1024 | |
b68bc8ea | 159 | .db 0x01 ; Polling interval (1 microframe) |
189db3d4 | 160 | |
e0c25b8e | 161 | ; Isochronous interface 0, alt 3, 8MB/s |
189db3d4 UH |
162 | .db DSCR_INTERFACE_LEN |
163 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
164 | .db 0 ; Interface index |
165 | .db 3 ; Alternate setting index | |
166 | .db 1 ; Number of endpoints | |
167 | .db 0xff ; Class (vendor specific) | |
168 | .db 0 ; Subclass (0) | |
169 | .db 1 ; Protocol (1) | |
170 | .db 0 ; String index (none) | |
171 | ||
172 | ; Endpoint 2 (IN) | |
189db3d4 UH |
173 | .db DSCR_ENDPOINT_LEN |
174 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
175 | .db 0x82 ; EP number (2), direction (IN) |
176 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
177 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
178 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
b68bc8ea | 179 | .db 0x01 ; Polling interval (1 microframe) |
189db3d4 | 180 | |
e0c25b8e | 181 | ; Isochronous interface 0, alt 4, 4MB/s |
189db3d4 UH |
182 | .db DSCR_INTERFACE_LEN |
183 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
184 | .db 0 ; Interface index |
185 | .db 4 ; Alternate setting index | |
186 | .db 1 ; Number of endpoints | |
187 | .db 0xff ; Class (vendor specific) | |
188 | .db 0 ; Subclass (0) | |
189 | .db 1 ; Protocol (1) | |
190 | .db 0 ; String index (none) | |
191 | ||
192 | ; Endpoint 2 (IN) | |
189db3d4 UH |
193 | .db DSCR_ENDPOINT_LEN |
194 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
195 | .db 0x82 ; EP number (2), direction (IN) |
196 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
197 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
198 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
b68bc8ea | 199 | .db 0x02 ; Polling interval (2 microframes) |
189db3d4 | 200 | |
e0c25b8e | 201 | ; Isochronous interface 0, alt 5, 2MB/s |
189db3d4 UH |
202 | .db DSCR_INTERFACE_LEN |
203 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
204 | .db 0 ; Interface index |
205 | .db 5 ; Alternate setting index | |
206 | .db 1 ; Number of endpoints | |
207 | .db 0xff ; Class (vendor specific) | |
208 | .db 0 ; Subclass (0) | |
209 | .db 1 ; Protocol (1) | |
210 | .db 0 ; String index (none) | |
211 | ||
212 | ; Endpoint 2 (IN) | |
189db3d4 UH |
213 | .db DSCR_ENDPOINT_LEN |
214 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
215 | .db 0x82 ; EP number (2), direction (IN) |
216 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
217 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
218 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
b68bc8ea | 219 | .db 0x03 ; Polling interval (4 microframes) |
189db3d4 | 220 | |
e0c25b8e | 221 | ; Isochronous interface 0, alt 6, 1MB/s |
189db3d4 UH |
222 | .db DSCR_INTERFACE_LEN |
223 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
224 | .db 0 ; Interface index |
225 | .db 6 ; Alternate setting index | |
226 | .db 1 ; Number of endpoints | |
227 | .db 0xff ; Class (vendor specific) | |
228 | .db 0 ; Subclass (0) | |
229 | .db 1 ; Protocol (1) | |
230 | .db 0 ; String index (none) | |
231 | ||
232 | ; Endpoint 2 (IN) | |
189db3d4 UH |
233 | .db DSCR_ENDPOINT_LEN |
234 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
235 | .db 0x82 ; EP number (2), direction (IN) |
236 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
237 | .db 0x00 ; Max. packet size, LSB (1024 bytes) | |
238 | .db 0x04 ; Max. packet size, MSB (1024 bytes) | |
b68bc8ea | 239 | .db 0x04 ; Polling interval (8 microframes) |
189db3d4 | 240 | |
e0c25b8e | 241 | ; Isochronous interface 0, alt 7, 500kB/s |
189db3d4 UH |
242 | .db DSCR_INTERFACE_LEN |
243 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
244 | .db 0 ; Interface index |
245 | .db 7 ; Alternate setting index | |
246 | .db 1 ; Number of endpoints | |
247 | .db 0xff ; Class (vendor specific) | |
248 | .db 0 ; Subclass (0) | |
249 | .db 1 ; Protocol (1) | |
250 | .db 0 ; String index (none) | |
251 | ||
252 | ; Endpoint 2 (IN) | |
189db3d4 UH |
253 | .db DSCR_ENDPOINT_LEN |
254 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
255 | .db 0x82 ; EP number (2), direction (IN) |
256 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
257 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
258 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
b68bc8ea | 259 | .db 0x04 ; Polling interval (8 microframes) |
189db3d4 UH |
260 | |
261 | highspd_dscr_realend: | |
262 | ||
e0c25b8e UH |
263 | .even |
264 | ||
265 | ; ----------------------------------------------------------------------------- | |
266 | ; Full-Speed configuration descriptor | |
267 | ; ----------------------------------------------------------------------------- | |
189db3d4 | 268 | _fullspd_dscr: |
e0c25b8e | 269 | .db fullspd_dscr_end - _fullspd_dscr |
189db3d4 | 270 | .db DSCR_CONFIG_TYPE |
e0c25b8e UH |
271 | ; Total length of the configuration (1st line LSB, 2nd line MSB) |
272 | .db (fullspd_dscr_realend - _fullspd_dscr) % 256 | |
273 | .db (fullspd_dscr_realend - _fullspd_dscr) / 256 | |
274 | .db 2 ; Number of interfaces | |
275 | .db 1 ; Configuration number | |
276 | .db 0 ; Configuration string (none) | |
277 | .db 0x80 ; Attributes (bus powered, no wakeup) | |
278 | .db 0x37 ; Max. power (110mA) | |
189db3d4 UH |
279 | fullspd_dscr_end: |
280 | ||
e0c25b8e | 281 | ; Bulk interface 0, alt 0 |
189db3d4 UH |
282 | .db DSCR_INTERFACE_LEN |
283 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
284 | .db 0 ; Interface index |
285 | .db 0 ; Alternate setting index | |
286 | .db 1 ; Number of endpoints | |
287 | .db 0xff ; Class (vendor specific) | |
288 | .db 0 ; Subclass (0) | |
289 | .db 0 ; Protocol (0) | |
290 | .db 0 ; String index (none) | |
291 | ||
292 | ; Endpoint 6 (IN) | |
189db3d4 UH |
293 | .db DSCR_ENDPOINT_LEN |
294 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
295 | .db 0x86 ; EP number (6), direction (IN) |
296 | .db ENDPOINT_TYPE_BULK ; Endpoint type (bulk) | |
1cba5732 UH |
297 | .db 0x40 ; Max. packet size, LSB (64 bytes) |
298 | .db 0x00 ; Max. packet size, MSB (64 bytes) | |
b68bc8ea | 299 | .db 0x00 ; Polling interval (ignored for bulk) |
189db3d4 | 300 | |
e0c25b8e | 301 | ; Isochronous interface 0, alt 1, 1MB/s |
189db3d4 UH |
302 | .db DSCR_INTERFACE_LEN |
303 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
304 | .db 0 ; Interface index |
305 | .db 1 ; Alternate setting index | |
306 | .db 1 ; Number of endpoints | |
307 | .db 0xff ; Class (vendor specific) | |
308 | .db 0 ; Subclass (0) | |
309 | .db 1 ; Protocol (1) | |
310 | .db 0 ; String index (none) | |
311 | ||
312 | ; Endpoint 2 (IN) | |
189db3d4 UH |
313 | .db DSCR_ENDPOINT_LEN |
314 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
315 | .db 0x82 ; EP number (2), direction (IN) |
316 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
317 | .db 0xff ; Max. packet size, LSB (1023 bytes) | |
318 | .db 0x03 ; Max. packet size, MSB (1023 bytes) | |
b68bc8ea | 319 | .db 0x01 ; Polling interval (1 frame) |
189db3d4 | 320 | |
e0c25b8e | 321 | ; Isochronous interface 0, alt 2, 500kB/s |
189db3d4 UH |
322 | .db DSCR_INTERFACE_LEN |
323 | .db DSCR_INTERFACE_TYPE | |
e0c25b8e UH |
324 | .db 0 ; Interface index |
325 | .db 2 ; Alternate setting index | |
326 | .db 1 ; Number of endpoints | |
327 | .db 0xff ; Class (vendor specific) | |
328 | .db 0 ; Subclass (0) | |
329 | .db 1 ; Protocol (1) | |
330 | .db 0 ; String index (none) | |
331 | ||
332 | ; Endpoint 2 (IN) | |
189db3d4 UH |
333 | .db DSCR_ENDPOINT_LEN |
334 | .db DSCR_ENDPOINT_TYPE | |
e0c25b8e UH |
335 | .db 0x82 ; EP number (2), direction (IN) |
336 | .db ENDPOINT_TYPE_ISO ; Endpoint type (iso) | |
337 | .db 0x00 ; Max. packet size, LSB (512 bytes) | |
338 | .db 0x02 ; Max. packet size, MSB (512 bytes) | |
b68bc8ea | 339 | .db 0x01 ; Polling interval (1 frame) |
189db3d4 UH |
340 | |
341 | fullspd_dscr_realend: | |
342 | ||
e0c25b8e UH |
343 | .even |
344 | ||
345 | ; ----------------------------------------------------------------------------- | |
346 | ; Strings | |
347 | ; ----------------------------------------------------------------------------- | |
348 | ||
189db3d4 | 349 | _dev_strings: |
e0c25b8e UH |
350 | |
351 | ; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list. | |
01c91958 UH |
352 | string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US) |
353 | ||
354 | string_descriptor_a 1,^"sigrok" | |
355 | string_descriptor_a 2,^"fx2lafw" |