OpenCores
URL https://opencores.org/ocsvn/gecko4/gecko4/trunk

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [fx2_firmware/] [asm/] [usb_descriptors.a51] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ktt1
;;; -*- asm -*-
2
 
3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4
;;            _   _            __   ____                                      ;;
5
;;           / / | |          / _| |  __|                                     ;;
6
;;           | |_| |  _   _  / /   | |_                                       ;;
7
;;           |  _  | | | | | | |   |  _|                                      ;;
8
;;           | | | | | |_| | \ \_  | |__                                      ;;
9
;;           |_| |_| \_____|  \__| |____| microLab                            ;;
10
;;                                                                            ;;
11
;;           Bern University of Applied Sciences (BFH)                        ;;
12
;;           Quellgasse 21                                                    ;;
13
;;           Room HG 4.33                                                     ;;
14
;;           2501 Biel/Bienne                                                 ;;
15
;;           Switzerland                                                      ;;
16
;;                                                                            ;;
17
;;           http://www.microlab.ch                                           ;;
18
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19
;;;
20
;;; GECKO4COM
21
;;;
22
;;; This program is free software: you can redistribute it and/or modify
23
;;; it under the terms of the GNU General Public License as published by
24
;;; the Free Software Foundation, either version 3 of the License, or
25
;;; (at your option) any later version.
26
;;;
27
;;; This program is distributed in the hope that it will be useful,
28
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
29
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
;;; GNU General Public License for more details.
31
;;; You should have received a copy of the GNU General Public License
32
;;; along with this program.  If not, see .
33
;;;
34
;;;********************************************************************
35
;;;
36
;;; Endpoint configuration is according to USB TMC specification 1.0
37
;;;
38
 
39
   .module  usb_descriptors
40
 
41
   VID_BFH        = 0xBFF1    ; Just stole a non defined VID, not registered
42
   PID_GECKO      = 0x0004    ; GECKO4 PID
43
   DID_GECKO      = 0x0100    ; Device ID in BCD
44
 
45
   DSCR_DEVICE_LENGTH      = 18
46
   DSCR_DQUAL_LENGTH       = 10
47
   DSCR_CONFIG_LENGTH      = 9
48
   DSCR_IF_LENGTH          = 9
49
   DSCR_EP_LENGTH          = 7
50
   DSCR_DEVICE             = 1
51
   DSCR_CONFIG             = 2
52
   DSCR_STRING             = 3
53
   DSCR_INTERFACE          = 4
54
   DSCR_END_POINT          = 5
55
   DSCR_DEVICE_QUAL        = 6
56
   DSCR_USB_VER            = 0x0200
57
   DSCR_US_ENGLISH         = 0x0409
58
   DSCR_DEVICE_CLASS       = 0x00
59
   DSCR_DEVICE_SUBCLASS    = 0x00
60
   DSCR_DEVICE_PROTOCOL    = 0x00
61
   DSCR_MAX_PACKET_SIZE    = 64
62
   DSCR_NUMBER_CONFIGS     = 1
63
   DSCR_RESERVED           = 0
64
   DSCR_BUS_POWERED        = 0x80
65
   DSCR_BUS_POWER_100mA    = 50
66
   DSCR_BUS_POWER_500mA    = 250
67
 
68
   DSCR_EP2_OUT            = 0x02
69
   DSCR_EP2_IN             = 0x82
70
   DSCR_EP4_OUT            = 0x04
71
   DSCR_EP4_IN             = 0x84
72
   DSCR_EP6_OUT            = 0x06
73
   DSCR_EP6_IN             = 0x86
74
   DSCR_EP8_OUT            = 0x08
75
   DSCR_EP8_IN             = 0x88
76
 
77
   NUM_INTERFACES          = 1
78
   CONFIG_VALUE            = 1
79
   INTERFACE_0             = 0
80
   ALT_SETTING_0           = 0
81
   NR_ENDPOINTS_ONE        = 1
82
   NR_ENDPOINTS_TWO        = 2
83
 
84
   ET_BULK                 = 0x02
85
   FS_MAX_PACK_SIZE        = 64
86
   HS_MAX_PACK_SIZE        = 512
87
 
88
   USBTMC_IF_CLASS         = 0xFE
89
   USBTMC_IF_SUBCLASS      = 0x03
90
   USBTMC_PROTO            = 0x01
91
 
92
   INTERVAL_0              = 0
93
;;;-----------------------------------------------------------------------------
94
;;;   external ram data
95
;;;-----------------------------------------------------------------------------
96
 
97
   .area USBDESCSEG    (XDATA)
98
 
99
;;;-----------------------------------------------------------------------------
100
;;;   Default descriptors at initial enumeration (full speed mode)
101
;;;-----------------------------------------------------------------------------
102
_high_speed_device_descr::
103
_full_speed_device_descr::
104
   .db   DSCR_DEVICE_LENGTH
105
   .db   DSCR_DEVICE
106
   .db   
107
   .db   >DSCR_USB_VER
108
   .db   DSCR_DEVICE_CLASS
109
   .db   DSCR_DEVICE_SUBCLASS
110
   .db   DSCR_DEVICE_PROTOCOL
111
   .db   DSCR_MAX_PACKET_SIZE
112
   .db   
113
   .db   >VID_BFH
114
   .db   
115
   .db   >PID_GECKO
116
   .db   
117
   .db   >DID_GECKO
118
   .db   ID_MANUFACTURER
119
   .db   ID_PRODUCT
120
   .db   ID_SERIAL
121
   .db   DSCR_NUMBER_CONFIGS           ; 18 bytes
122
_high_speed_devqual_descr::
123
_full_speed_devqual_descr::
124
   .db   DSCR_DQUAL_LENGTH
125
   .db   DSCR_DEVICE_QUAL
126
   .db   
127
   .db   >DSCR_USB_VER
128
   .db   DSCR_DEVICE_CLASS
129
   .db   DSCR_DEVICE_SUBCLASS
130
   .db   DSCR_DEVICE_PROTOCOL
131
   .db   DSCR_MAX_PACKET_SIZE
132
   .db   DSCR_NUMBER_CONFIGS
133
   .db   DSCR_RESERVED                 ; 28 bytes
134
 
135
_full_speed_config_descr::
136
   .db   DSCR_CONFIG_LENGTH
137
   .db   DSCR_CONFIG
138
   .db   <(_full_speed_config_descr_end-_full_speed_config_descr)
139
   .db   >(_full_speed_config_descr_end-_full_speed_config_descr)
140
   .db   NUM_INTERFACES
141
   .db   CONFIG_VALUE
142
   .db   ID_FULL_SPEED
143
_device_bus_attributes_fs::
144
   .db   DSCR_BUS_POWERED
145
   .db   DSCR_BUS_POWER_500mA          ; 37 bytes
146
 
147
;;; Interface 0 descriptor (USB TMC, ep8 OUT BULK, ep6 IN BULK)
148
   .db   DSCR_IF_LENGTH
149
   .db   DSCR_INTERFACE
150
   .db   INTERFACE_0
151
   .db   ALT_SETTING_0
152
   .db   NR_ENDPOINTS_TWO
153
   .db   USBTMC_IF_CLASS
154
   .db   USBTMC_IF_SUBCLASS
155
   .db   USBTMC_PROTO
156
   .db   ID_USBTMC                     ; 46 bytes
157
;;; Interface 0 OUT endpoint
158
   .db   DSCR_EP_LENGTH
159
   .db   DSCR_END_POINT
160
   .db   DSCR_EP8_OUT
161
   .db   ET_BULK
162
   .db   
163
   .db   >FS_MAX_PACK_SIZE
164
   .db   INTERVAL_0                    ; 53 bytes
165
;;; Interface 0 IN endpoint
166
   .db   DSCR_EP_LENGTH
167
   .db   DSCR_END_POINT
168
   .db   DSCR_EP6_IN
169
   .db   ET_BULK
170
   .db   
171
   .db   >FS_MAX_PACK_SIZE
172
   .db   INTERVAL_0                    ; 60 bytes
173
_full_speed_config_descr_end:
174
 
175
;;;-----------------------------------------------------------------------------
176
;;;   High Speed descriptors
177
;;;-----------------------------------------------------------------------------
178
_high_speed_config_descr::
179
   .db   DSCR_CONFIG_LENGTH
180
   .db   DSCR_CONFIG
181
   .db   <(_high_speed_config_descr_end-_high_speed_config_descr)
182
   .db   >(_high_speed_config_descr_end-_high_speed_config_descr)
183
   .db   NUM_INTERFACES
184
   .db   CONFIG_VALUE
185
   .db   ID_HI_SPEED
186
_device_bus_attributes_hs::
187
   .db   DSCR_BUS_POWERED
188
   .db   DSCR_BUS_POWER_500mA
189
 
190
;;; Interface 0 descriptor (USB TMC, ep8 OUT BULK, ep6 IN BULK)
191
   .db   DSCR_IF_LENGTH
192
   .db   DSCR_INTERFACE
193
   .db   INTERFACE_0
194
   .db   ALT_SETTING_0
195
   .db   NR_ENDPOINTS_TWO
196
   .db   USBTMC_IF_CLASS
197
   .db   USBTMC_IF_SUBCLASS
198
   .db   USBTMC_PROTO
199
   .db   ID_USBTMC                     ; 46 bytes
200
;;; Interface 0 OUT endpoint
201
   .db   DSCR_EP_LENGTH
202
   .db   DSCR_END_POINT
203
   .db   DSCR_EP8_OUT
204
   .db   ET_BULK
205
   .db   
206
   .db   >HS_MAX_PACK_SIZE
207
   .db   INTERVAL_0                    ; 53 bytes
208
;;; Interface 0 IN endpoint
209
   .db   DSCR_EP_LENGTH
210
   .db   DSCR_END_POINT
211
   .db   DSCR_EP6_IN
212
   .db   ET_BULK
213
   .db   
214
   .db   >HS_MAX_PACK_SIZE
215
   .db   INTERVAL_0                    ; 60 bytes
216
_high_speed_config_descr_end:
217
 
218
;;;-----------------------------------------------------------------------------
219
;;; String index table
220
;;;-----------------------------------------------------------------------------
221
_nstring_descriptors::
222
   .db   (_string_index_table_end - _string_descriptors) / 2
223
_string_descriptors::
224
   .db   <_str_language , >_str_language
225
   .db   <_manufacturer , >_manufacturer
226
   .db   <_product , >_product
227
   .db   <_serial , >_serial
228
   .db   <_full_speed , >_full_speed
229
   .db   <_usbtmc , >_usbtmc
230
   .db   <_hi_speed , >_hi_speed
231
_string_index_table_end::
232
   .db   0         ;; make even address, as the table is by definition odd
233
                                       ; +16 => 76 bytes
234
;;;-----------------------------------------------------------------------------
235
;;; String descriptors
236
;;;-----------------------------------------------------------------------------
237
 
238
   ID_LANGUAGE = 0
239
_str_language:
240
   .db   _str_language_end - _str_language
241
   .db   DSCR_STRING
242
   .db   0
243
   .db   0
244
   .db   
245
   .db   >DSCR_US_ENGLISH
246
_str_language_end:                      ; +6 => 82 bytes
247
 
248
   ID_MANUFACTURER = 1
249
_manufacturer:
250
   .db   _manufacturer_end - _manufacturer
251
   .db   DSCR_STRING
252
   .db   'B , 0
253
   .db   'e , 0
254
   .db   'r , 0
255
   .db   'n , 0
256
   .db   '  , 0
257
   .db   'U , 0
258
   .db   'n , 0
259
   .db   'i , 0
260
   .db   'v , 0
261
   .db   'e , 0
262
   .db   'r , 0
263
   .db   's , 0
264
   .db   'i , 0
265
   .db   't , 0
266
   .db   'y , 0
267
   .db   '  , 0
268
   .db   'o , 0
269
   .db   'f , 0
270
   .db   '  , 0
271
   .db   'A , 0
272
   .db   'p , 0
273
   .db   'p , 0
274
   .db   'l , 0
275
   .db   'i , 0
276
   .db   'e , 0
277
   .db   'd , 0
278
   .db   '  , 0
279
   .db   'S , 0
280
   .db   'c , 0
281
   .db   'i , 0
282
   .db   'e , 0
283
   .db   'n , 0
284
   .db   'c , 0
285
   .db   'e , 0
286
   .db   's , 0
287
   .db   ': , 0
288
   .db   '  , 0
289
   .db   'H , 0
290
   .db   'U , 0
291
   .db   'C , 0
292
   .db   'E , 0
293
   .db   '- , 0
294
   .db   'm , 0
295
   .db   'i , 0
296
   .db   'c , 0
297
   .db   'r , 0
298
   .db   'o , 0
299
   .db   'l , 0
300
   .db   'a , 0
301
   .db   'b , 0
302
_manufacturer_end:
303
 
304
   ID_PRODUCT = 2
305
_product:
306
   .db   _product_end - _product
307
   .db   DSCR_STRING
308
   .db   'G , 0
309
   .db   'E , 0
310
   .db   'C , 0
311
   .db   'K , 0
312
   .db   'O , 0
313
   .db   '4 , 0
314
   .db   'C , 0
315
   .db   'O , 0
316
   .db   'M , 0                        ; +20 => 134 bytes
317
_product_end:
318
 
319
   ID_SERIAL = 3
320
_serial:
321
   .db   _serial_end - _serial
322
   .db   DSCR_STRING
323
   .db   'V , 0
324
   .db   '1 , 0
325
   .db   '. , 0
326
   .db   '0 , 0                        ; +10 => 144 bytes
327
_serial_end:
328
 
329
   ID_FULL_SPEED = 4
330
_full_speed:
331
   .db   _full_speed_end - _full_speed
332
   .db   DSCR_STRING
333
   .db   'F , 0
334
   .db   'u , 0
335
   .db   'l , 0
336
   .db   'l , 0
337
   .db   '  , 0
338
   .db   'S , 0
339
   .db   'p , 0
340
   .db   'e , 0
341
   .db   'e , 0
342
   .db   'd , 0                        ; +22 => 166 bytes
343
_full_speed_end:
344
 
345
   ID_USBTMC = 5
346
_usbtmc:
347
   .db   _usbtmc_end - _usbtmc
348
   .db   DSCR_STRING
349
   .db   'U , 0
350
   .db   'S , 0
351
   .db   'B , 0
352
   .db   'T , 0
353
   .db   'M , 0
354
   .db   'C , 0
355
   .db   '  , 0
356
   .db   'U , 0
357
   .db   'S , 0
358
   .db   'B , 0
359
   .db   '4 , 0
360
   .db   '8 , 0
361
   .db   '8 , 0                        ; +28 => 194 bytes
362
_usbtmc_end:
363
 
364
   ID_HI_SPEED = 6
365
_hi_speed:
366
   .db   _hi_speed_end - _hi_speed
367
   .db   DSCR_STRING
368
   .db   'H , 0
369
   .db   'i , 0
370
   .db   'g , 0
371
   .db   'h , 0
372
   .db   '  , 0
373
   .db   'S , 0
374
   .db   'p , 0
375
   .db   'e , 0
376
   .db   'e , 0
377
   .db   'd , 0                        ; +22 => 216 bytes
378
_hi_speed_end:
379
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.