]>
Commit | Line | Data |
---|---|---|
ce1d0a86 BL |
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 | ;; | |
20 | ||
21 | ; this is a the default | |
22 | ; full speed and high speed | |
23 | ; descriptors found in the TRM | |
24 | ; change however you want but leave | |
25 | ; the descriptor pointers so the setupdat.c file works right | |
26 | ||
27 | ||
28 | .module DEV_DSCR | |
29 | ||
30 | ; descriptor types | |
31 | ; same as setupdat.h | |
32 | DSCR_DEVICE_TYPE=1 | |
33 | DSCR_CONFIG_TYPE=2 | |
34 | DSCR_STRING_TYPE=3 | |
35 | DSCR_INTERFACE_TYPE=4 | |
36 | DSCR_ENDPOINT_TYPE=5 | |
37 | DSCR_DEVQUAL_TYPE=6 | |
38 | ||
39 | ; for the repeating interfaces | |
40 | DSCR_INTERFACE_LEN=9 | |
41 | DSCR_ENDPOINT_LEN=7 | |
42 | ||
43 | ; endpoint types | |
44 | ENDPOINT_TYPE_CONTROL=0 | |
45 | ENDPOINT_TYPE_ISO=1 | |
46 | ENDPOINT_TYPE_BULK=2 | |
47 | ENDPOINT_TYPE_INT=3 | |
48 | ||
49 | .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end | |
50 | ; These need to be in code memory. If | |
51 | ; they aren't you'll have to manully copy them somewhere | |
52 | ; in code memory otherwise SUDPTRH:L don't work right | |
53 | .area DSCR_AREA (CODE) | |
54 | ||
55 | _dev_dscr: | |
56 | .db dev_dscr_end-_dev_dscr ; len | |
57 | .db DSCR_DEVICE_TYPE ; type | |
58 | .dw 0x0002 ; usb 2.0 | |
59 | .db 0xff ; class (vendor specific) | |
60 | .db 0xff ; subclass (vendor specific) | |
61 | .db 0xff ; protocol (vendor specific) | |
62 | .db 64 ; packet size (ep0) | |
5b8b366d MS |
63 | .dw 0x501D ; vendor id |
64 | .dw 0x8E60 ; product id | |
ce1d0a86 BL |
65 | .dw 0x0000 ; version id |
66 | .db 1 ; manufacturure str idx | |
67 | .db 2 ; product str idx | |
68 | .db 0 ; serial str idx | |
69 | .db 1 ; n configurations | |
70 | dev_dscr_end: | |
71 | ||
72 | _dev_qual_dscr: | |
73 | .db dev_qualdscr_end-_dev_qual_dscr | |
74 | .db DSCR_DEVQUAL_TYPE | |
75 | .dw 0x0002 ; usb 2.0 | |
76 | .db 0 | |
77 | .db 0 | |
78 | .db 0 | |
79 | .db 64 ; max packet | |
80 | .db 1 ; n configs | |
81 | .db 0 ; extra reserved byte | |
82 | dev_qualdscr_end: | |
83 | ||
84 | _highspd_dscr: | |
85 | .db highspd_dscr_end-_highspd_dscr ; dscr len ;; Descriptor length | |
86 | .db DSCR_CONFIG_TYPE | |
87 | ; can't use .dw because byte order is different | |
88 | .db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length of config lsb | |
89 | .db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length of config msb | |
90 | .db 1 ; n interfaces | |
91 | .db 1 ; config number | |
92 | .db 0 ; config string | |
93 | .db 0x80 ; attrs = bus powered, no wakeup | |
94 | .db 55 ; max power = 110mA | |
95 | highspd_dscr_end: | |
96 | ||
97 | ; all the interfaces next | |
98 | ; BULK interface | |
99 | .db DSCR_INTERFACE_LEN | |
100 | .db DSCR_INTERFACE_TYPE | |
101 | .db 0 ; index | |
102 | .db 0 ; alt setting idx | |
103 | .db 1 ; n endpoints | |
104 | .db 0xff ; class | |
105 | .db 0 | |
106 | .db 0 | |
107 | .db 0 ; string index | |
108 | ||
109 | ; endpoint 6 in | |
110 | .db DSCR_ENDPOINT_LEN | |
111 | .db DSCR_ENDPOINT_TYPE | |
112 | .db 0x86 ; ep1 dir=in and address | |
113 | .db ENDPOINT_TYPE_BULK ; type | |
114 | .db 0x00 ; max packet LSB | |
115 | .db 0x02 ; max packet size=512 bytes | |
116 | .db 0x00 ; polling interval | |
117 | ||
118 | ; ISOCHRONOUS interface | |
119 | .db DSCR_INTERFACE_LEN | |
120 | .db DSCR_INTERFACE_TYPE | |
121 | .db 0 ; index | |
122 | .db 1 ; alt setting idx | |
123 | .db 1 ; n endpoints | |
124 | .db 0xff ; class | |
125 | .db 0 | |
126 | .db 1 | |
127 | .db 0 ; string index | |
128 | ||
129 | ; endpoint 2 in | |
130 | .db DSCR_ENDPOINT_LEN | |
131 | .db DSCR_ENDPOINT_TYPE | |
132 | .db 0x82 ; ep1 dir=in and address | |
133 | .db ENDPOINT_TYPE_ISO ; type | |
134 | .db 0x00 ; max packet LSB | |
135 | .db 0x14 ; max packet size=3*1024 bytes | |
136 | .db 0x01 ; polling interval | |
137 | ||
138 | ; ISOCHRONOUS interface 16MB/s | |
139 | .db DSCR_INTERFACE_LEN | |
140 | .db DSCR_INTERFACE_TYPE | |
141 | .db 0 ; index | |
142 | .db 2 ; alt setting idx | |
143 | .db 1 ; n endpoints | |
144 | .db 0xff ; class | |
145 | .db 0 | |
146 | .db 1 | |
147 | .db 0 ; string index | |
148 | ||
149 | ; endpoint 2 in | |
150 | .db DSCR_ENDPOINT_LEN | |
151 | .db DSCR_ENDPOINT_TYPE | |
152 | .db 0x82 ; ep1 dir=in and address | |
153 | .db ENDPOINT_TYPE_ISO ; type | |
154 | .db 0x00 ; max packet LSB | |
155 | .db 0x0c ; max packet size=2*1024 bytes | |
156 | .db 0x01 ; polling interval | |
157 | ||
158 | ; ISOCHRONOUS interface 8MB/s | |
159 | .db DSCR_INTERFACE_LEN | |
160 | .db DSCR_INTERFACE_TYPE | |
161 | .db 0 ; index | |
162 | .db 3 ; alt setting idx | |
163 | .db 1 ; n endpoints | |
164 | .db 0xff ; class | |
165 | .db 0 | |
166 | .db 1 | |
167 | .db 0 ; string index | |
168 | ||
169 | ; endpoint 2 in | |
170 | .db DSCR_ENDPOINT_LEN | |
171 | .db DSCR_ENDPOINT_TYPE | |
172 | .db 0x82 ; ep1 dir=in and address | |
173 | .db ENDPOINT_TYPE_ISO ; type | |
174 | .db 0x00 ; max packet LSB | |
175 | .db 0x04 ; max packet size=1024 bytes | |
176 | .db 0x01 ; polling interval | |
177 | ||
178 | ; ISOCHRONOUS interface 4MB/s | |
179 | .db DSCR_INTERFACE_LEN | |
180 | .db DSCR_INTERFACE_TYPE | |
181 | .db 0 ; index | |
182 | .db 4 ; alt setting idx | |
183 | .db 1 ; n endpoints | |
184 | .db 0xff ; class | |
185 | .db 0 | |
186 | .db 1 | |
187 | .db 0 ; string index | |
188 | ||
189 | ; endpoint 2 in | |
190 | .db DSCR_ENDPOINT_LEN | |
191 | .db DSCR_ENDPOINT_TYPE | |
192 | .db 0x82 ; ep1 dir=in and address | |
193 | .db ENDPOINT_TYPE_ISO ; type | |
194 | .db 0x00 ; max packet LSB | |
195 | .db 0x04 ; max packet size=1024 bytes | |
196 | .db 0x02 ; polling interval | |
197 | ||
198 | ||
199 | ; ISOCHRONOUS interface 2MB/s | |
200 | .db DSCR_INTERFACE_LEN | |
201 | .db DSCR_INTERFACE_TYPE | |
202 | .db 0 ; index | |
203 | .db 5 ; alt setting idx | |
204 | .db 1 ; n endpoints | |
205 | .db 0xff ; class | |
206 | .db 0 | |
207 | .db 1 | |
208 | .db 0 ; string index | |
209 | ||
210 | ; endpoint 2 in | |
211 | .db DSCR_ENDPOINT_LEN | |
212 | .db DSCR_ENDPOINT_TYPE | |
213 | .db 0x82 ; ep1 dir=in and address | |
214 | .db ENDPOINT_TYPE_ISO ; type | |
215 | .db 0x00 ; max packet LSB | |
216 | .db 0x04 ; max packet size=1024 bytes | |
217 | .db 0x03 ; polling interval | |
218 | ||
219 | ; ISOCHRONOUS interface 1MB/s | |
220 | .db DSCR_INTERFACE_LEN | |
221 | .db DSCR_INTERFACE_TYPE | |
222 | .db 0 ; index | |
223 | .db 6 ; alt setting idx | |
224 | .db 1 ; n endpoints | |
225 | .db 0xff ; class | |
226 | .db 0 | |
227 | .db 1 | |
228 | .db 0 ; string index | |
229 | ||
230 | ; endpoint 2 in | |
231 | .db DSCR_ENDPOINT_LEN | |
232 | .db DSCR_ENDPOINT_TYPE | |
233 | .db 0x82 ; ep1 dir=in and address | |
234 | .db ENDPOINT_TYPE_ISO ; type | |
235 | .db 0x00 ; max packet LSB | |
236 | .db 0x04 ; max packet size=1024 bytes | |
237 | .db 0x04 ; polling interval | |
238 | ||
239 | ; ISOCHRONOUS interface 500 kB/s | |
240 | .db DSCR_INTERFACE_LEN | |
241 | .db DSCR_INTERFACE_TYPE | |
242 | .db 0 ; index | |
243 | .db 7 ; alt setting idx | |
244 | .db 1 ; n endpoints | |
245 | .db 0xff ; class | |
246 | .db 0 | |
247 | .db 1 | |
248 | .db 0 ; string index | |
249 | ||
250 | ; endpoint 2 in | |
251 | .db DSCR_ENDPOINT_LEN | |
252 | .db DSCR_ENDPOINT_TYPE | |
253 | .db 0x82 ; ep1 dir=in and address | |
254 | .db ENDPOINT_TYPE_ISO ; type | |
255 | .db 0x00 ; max packet LSB | |
256 | .db 0x02 ; max packet size=512 bytes | |
257 | .db 0x04 ; polling interval | |
258 | ||
259 | ||
260 | highspd_dscr_realend: | |
261 | ||
262 | .even | |
263 | _fullspd_dscr: | |
264 | .db fullspd_dscr_end-_fullspd_dscr ; dscr len | |
265 | .db DSCR_CONFIG_TYPE | |
266 | ; can't use .dw because byte order is different | |
267 | .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb | |
268 | .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb | |
269 | .db 2 ; n interfaces | |
270 | .db 1 ; config number | |
271 | .db 0 ; config string | |
272 | .db 0x80 ; attrs = bus powered, no wakeup | |
273 | .db 55 ; max power = 110mA | |
274 | fullspd_dscr_end: | |
275 | ||
276 | ||
277 | ; all the interfaces next | |
278 | ; BULK interface | |
279 | .db DSCR_INTERFACE_LEN | |
280 | .db DSCR_INTERFACE_TYPE | |
281 | .db 0 ; index | |
282 | .db 0 ; alt setting idx | |
283 | .db 1 ; n endpoints | |
284 | .db 0xff ; class | |
285 | .db 0 | |
286 | .db 0 | |
287 | .db 0 ; string index | |
288 | ||
289 | ; endpoint 6 in | |
290 | .db DSCR_ENDPOINT_LEN | |
291 | .db DSCR_ENDPOINT_TYPE | |
292 | .db 0x86 ; ep1 dir=in and address | |
293 | .db ENDPOINT_TYPE_BULK ; type | |
294 | .db 0x40 ; max packet LSB | |
295 | .db 0x00 ; max packet size=512 bytes | |
296 | .db 0x00 ; polling interval | |
297 | ||
298 | ; ISOCHRONOUS interface 1 MB/s | |
299 | .db DSCR_INTERFACE_LEN | |
300 | .db DSCR_INTERFACE_TYPE | |
301 | .db 0 ; index | |
302 | .db 1 ; alt setting idx | |
303 | .db 1 ; n endpoints | |
304 | .db 0xff ; class | |
305 | .db 0 | |
306 | .db 1 | |
307 | .db 0 ; string index | |
308 | ||
309 | ; endpoint 2 in | |
310 | .db DSCR_ENDPOINT_LEN | |
311 | .db DSCR_ENDPOINT_TYPE | |
312 | .db 0x82 ; ep1 dir=in and address | |
313 | .db ENDPOINT_TYPE_ISO ; type | |
314 | .db 0xff ; max packet LSB | |
315 | .db 0x03 ; max packet size=1023 bytes | |
316 | .db 0x01 ; polling interval | |
317 | ||
318 | ; ISOCHRONOUS interface 500 kB/s | |
319 | .db DSCR_INTERFACE_LEN | |
320 | .db DSCR_INTERFACE_TYPE | |
321 | .db 0 ; index | |
322 | .db 2 ; alt setting idx | |
323 | .db 1 ; n endpoints | |
324 | .db 0xff ; class | |
325 | .db 0 | |
326 | .db 1 | |
327 | .db 0 ; string index | |
328 | ||
329 | ; endpoint 2 in | |
330 | .db DSCR_ENDPOINT_LEN | |
331 | .db DSCR_ENDPOINT_TYPE | |
332 | .db 0x82 ; ep1 dir=in and address | |
333 | .db ENDPOINT_TYPE_ISO ; type | |
334 | .db 0x00 ; max packet LSB | |
335 | .db 0x02 ; max packet size=512 bytes | |
336 | .db 0x01 ; polling interval | |
337 | ||
338 | fullspd_dscr_realend: | |
339 | ||
340 | .even | |
341 | _dev_strings: | |
342 | ; sample string | |
343 | _string0: | |
344 | .db string0end-_string0 ; len | |
345 | .db DSCR_STRING_TYPE | |
346 | .db 0x09, 0x04 ; 0x0409 is the language code for English. Possible to add more codes after this. | |
347 | string0end: | |
348 | ; add more strings here | |
349 | _string1: | |
350 | .db string1end-_string1 ; len | |
351 | .db DSCR_STRING_TYPE | |
352 | .ascii 'O\0D\0M\0' | |
353 | string1end: | |
354 | _string2: | |
355 | .db string2end-_string2 ; len | |
356 | .db DSCR_STRING_TYPE | |
e1602744 | 357 | .ascii 'f\0x\0002\0l\0a\0f\0w\0' |
ce1d0a86 BL |
358 | string2end: |
359 | ||
360 | ||
361 | _dev_strings_end: | |
362 | .dw 0x0000 ; in case you wanted to look at memory between _dev_strings and _dev_strings_end |