Imported Upstream version 3.0
[debian/gnuradio] / usrp / firmware / src / usrp2 / usb_descriptors.a51
1 ;;; -*- asm -*-
2 ;;;
3 ;;; Copyright 2003 Free Software Foundation, Inc.
4 ;;; 
5 ;;; This file is part of GNU Radio
6 ;;; 
7 ;;; GNU Radio is free software; you can redistribute it and/or modify
8 ;;; it under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 2, or (at your option)
10 ;;; any later version.
11 ;;; 
12 ;;; GNU Radio is distributed in the hope that it will be useful,
13 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ;;; GNU General Public License for more details.
16 ;;; 
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Radio; see the file COPYING.  If not, write to
19 ;;; the Free Software Foundation, Inc., 51 Franklin Street,
20 ;;; Boston, MA 02110-1301, USA.
21 ;;;
22         
23 ;;; USB Descriptor table for the USRP
24 ;;; 
25 ;;; We're a high-speed only device (480 Mb/sec) with 1 configuration
26 ;;; and 3 interfaces.  
27 ;;; 
28 ;;;     interface 0:    command and status (ep0 COMMAND)
29 ;;;     interface 1:    Transmit path (ep2 OUT BULK)
30 ;;;     interface 2:    Receive path (ep6 IN BULK)
31
32         .module usb_descriptors
33         
34         VID_FREE         = 0xfffe       ; Free Software Folks
35         PID_USRP         = 0x0002       ; USRP
36
37         ;; We distinguish configured from unconfigured USRPs using the Device ID.
38         ;; If the MSB of the DID is 0, the device is unconfigured.
39         ;; The LSB of the DID is reserved for hardware revs.
40         
41         DID_USRP         = 0x0100       ; Device ID (bcd)
42
43         
44         DSCR_DEVICE      =   1  ; Descriptor type: Device
45         DSCR_CONFIG      =   2  ; Descriptor type: Configuration
46         DSCR_STRING      =   3  ; Descriptor type: String
47         DSCR_INTRFC      =   4  ; Descriptor type: Interface
48         DSCR_ENDPNT      =   5  ; Descriptor type: Endpoint
49         DSCR_DEVQUAL     =   6  ; Descriptor type: Device Qualifier
50         
51         DSCR_DEVICE_LEN  =  18
52         DSCR_CONFIG_LEN  =   9
53         DSCR_INTRFC_LEN  =   9
54         DSCR_ENDPNT_LEN  =   7
55         DSCR_DEVQUAL_LEN =  10
56         
57         ET_CONTROL       =   0  ; Endpoint type: Control
58         ET_ISO           =   1  ; Endpoint type: Isochronous
59         ET_BULK          =   2  ; Endpoint type: Bulk
60         ET_INT           =   3  ; Endpoint type: Interrupt
61         
62         
63         ;; configuration attributes
64         bmSELF_POWERED  =       1 << 6
65
66 ;;; --------------------------------------------------------
67 ;;;     external ram data
68 ;;;--------------------------------------------------------
69         
70         .area USBDESCSEG    (XDATA)
71         
72 ;;; ----------------------------------------------------------------
73 ;;; descriptors used when operating at high speed (480Mb/sec)
74 ;;; ----------------------------------------------------------------
75         
76         .even   ; descriptors must be 2-byte aligned for SUDPTR{H,L} to work
77
78         ;; The .even directive isn't really honored by the linker.  Bummer!
79         ;; (There's no way to specify an alignment requirement for a given area,
80         ;; hence when they're concatenated together, even doesn't work.)
81         ;; 
82         ;; We work around this by telling the linker to put USBDESCSEG
83         ;; at 0xE000 absolute.  This means that the maximimum length of this
84         ;; segment is 480 bytes, leaving room for the two hash slots 
85         ;; at 0xE1EO to 0xE1FF.  
86         ;; 
87         ;; As of July 7, 2004, this segment is 326 bytes long
88         
89 _high_speed_device_descr::
90         .db     DSCR_DEVICE_LEN
91         .db     DSCR_DEVICE
92         .db     <0x0200         ; Specification version (LSB)
93         .db     >0x0200         ; Specification version (MSB)
94         .db     0xff            ; device class (vendor specific)
95         .db     0xff            ; device subclass (vendor specific)
96         .db     0xff            ; device protocol (vendor specific)
97         .db     64              ; bMaxPacketSize0 for endpoint 0
98         .db     <VID_FREE       ; idVendor
99         .db     >VID_FREE       ; idVendor
100         .db     <PID_USRP       ; idProduct
101         .db     >PID_USRP       ; idProduct
102 _usb_desc_hw_rev_binary_patch_location_0::
103         .db     <DID_USRP       ; bcdDevice
104         .db     >DID_USRP       ; bcdDevice
105         .db     SI_VENDOR       ; iManufacturer (string index)
106         .db     SI_PRODUCT      ; iProduct (string index)
107         .db     SI_SERIAL       ; iSerial number (string index)
108         .db     1               ; bNumConfigurations
109         
110 ;;; describes the other speed (12Mb/sec)
111         .even
112 _high_speed_devqual_descr::
113         .db     DSCR_DEVQUAL_LEN
114         .db     DSCR_DEVQUAL
115         .db     <0x0200         ; bcdUSB (LSB)
116         .db     >0x0200         ; bcdUSB (MSB)
117         .db     0xff            ; bDeviceClass
118         .db     0xff            ; bDeviceSubClass
119         .db     0xff            ; bDeviceProtocol
120         .db     64              ; bMaxPacketSize0
121         .db     1               ; bNumConfigurations (one config at 12Mb/sec)
122         .db     0               ; bReserved
123         
124         .even
125 _high_speed_config_descr::      
126         .db     DSCR_CONFIG_LEN
127         .db     DSCR_CONFIG
128         .db     <(_high_speed_config_descr_end - _high_speed_config_descr) ; LSB
129         .db     >(_high_speed_config_descr_end - _high_speed_config_descr) ; MSB
130         .db     3               ; bNumInterfaces
131         .db     1               ; bConfigurationValue
132         .db     0               ; iConfiguration
133         .db     0x80 | bmSELF_POWERED ; bmAttributes
134         .db     0               ; bMaxPower
135
136         ;; interface descriptor 0 (command & status, ep0 COMMAND)
137         
138         .db     DSCR_INTRFC_LEN
139         .db     DSCR_INTRFC
140         .db     0               ; bInterfaceNumber (zero based)
141         .db     0               ; bAlternateSetting
142         .db     0               ; bNumEndpoints
143         .db     0xff            ; bInterfaceClass (vendor specific)
144         .db     0xff            ; bInterfaceSubClass (vendor specific)
145         .db     0xff            ; bInterfaceProtocol (vendor specific)
146         .db     SI_COMMAND_AND_STATUS   ; iInterface (description)
147
148         ;; interface descriptor 1 (transmit path, ep2 OUT BULK)
149         
150         .db     DSCR_INTRFC_LEN
151         .db     DSCR_INTRFC
152         .db     1               ; bInterfaceNumber (zero based)
153         .db     0               ; bAlternateSetting
154         .db     1               ; bNumEndpoints
155         .db     0xff            ; bInterfaceClass (vendor specific)
156         .db     0xff            ; bInterfaceSubClass (vendor specific)
157         .db     0xff            ; bInterfaceProtocol (vendor specific)
158         .db     SI_TX_PATH      ; iInterface (description)
159
160         ;; interface 1's end point
161
162         .db     DSCR_ENDPNT_LEN
163         .db     DSCR_ENDPNT
164         .db     0x02            ; bEndpointAddress (ep 2 OUT)
165         .db     ET_BULK         ; bmAttributes
166         .db     <512            ; wMaxPacketSize (LSB)
167         .db     >512            ; wMaxPacketSize (MSB)
168         .db     0               ; bInterval (iso only)
169
170         ;; interface descriptor 2 (receive path, ep6 IN BULK)
171         
172         .db     DSCR_INTRFC_LEN
173         .db     DSCR_INTRFC
174         .db     2               ; bInterfaceNumber (zero based)
175         .db     0               ; bAlternateSetting
176         .db     1               ; bNumEndpoints
177         .db     0xff            ; bInterfaceClass (vendor specific)
178         .db     0xff            ; bInterfaceSubClass (vendor specific)
179         .db     0xff            ; bInterfaceProtocol (vendor specific)
180         .db     SI_RX_PATH      ; iInterface (description)
181
182         ;; interface 2's end point
183
184         .db     DSCR_ENDPNT_LEN
185         .db     DSCR_ENDPNT
186         .db     0x86            ; bEndpointAddress (ep 6 IN)
187         .db     ET_BULK         ; bmAttributes
188         .db     <512            ; wMaxPacketSize (LSB)
189         .db     >512            ; wMaxPacketSize (MSB)
190         .db     0               ; bInterval (iso only)
191
192 _high_speed_config_descr_end:           
193
194 ;;; ----------------------------------------------------------------
195 ;;; descriptors used when operating at full speed (12Mb/sec)
196 ;;; ----------------------------------------------------------------
197
198         .even
199 _full_speed_device_descr::      
200         .db     DSCR_DEVICE_LEN
201         .db     DSCR_DEVICE
202         .db     <0x0200         ; Specification version (LSB)
203         .db     >0x0200         ; Specification version (MSB)
204         .db     0xff            ; device class (vendor specific)
205         .db     0xff            ; device subclass (vendor specific)
206         .db     0xff            ; device protocol (vendor specific)
207         .db     64              ; bMaxPacketSize0 for endpoint 0
208         .db     <VID_FREE       ; idVendor
209         .db     >VID_FREE       ; idVendor
210         .db     <PID_USRP       ; idProduct
211         .db     >PID_USRP       ; idProduct
212 _usb_desc_hw_rev_binary_patch_location_1::
213         .db     <DID_USRP       ; bcdDevice
214         .db     >DID_USRP       ; bcdDevice
215         .db     SI_VENDOR       ; iManufacturer (string index)
216         .db     SI_PRODUCT      ; iProduct (string index)
217         .db     SI_NONE         ; iSerial number (None)
218         .db     1               ; bNumConfigurations
219         
220         
221 ;;; describes the other speed (480Mb/sec)
222         .even
223 _full_speed_devqual_descr::
224         .db     DSCR_DEVQUAL_LEN
225         .db     DSCR_DEVQUAL
226         .db     <0x0200         ; bcdUSB
227         .db     >0x0200         ; bcdUSB
228         .db     0xff            ; bDeviceClass
229         .db     0xff            ; bDeviceSubClass
230         .db     0xff            ; bDeviceProtocol
231         .db     64              ; bMaxPacketSize0
232         .db     1               ; bNumConfigurations (one config at 480Mb/sec)
233         .db     0               ; bReserved
234         
235         .even
236 _full_speed_config_descr::      
237         .db     DSCR_CONFIG_LEN
238         .db     DSCR_CONFIG
239         .db     <(_full_speed_config_descr_end - _full_speed_config_descr) ; LSB
240         .db     >(_full_speed_config_descr_end - _full_speed_config_descr) ; MSB
241         .db     1               ; bNumInterfaces
242         .db     1               ; bConfigurationValue
243         .db     0               ; iConfiguration
244         .db     0x80 | bmSELF_POWERED ; bmAttributes
245         .db     0               ; bMaxPower
246
247         ;; interface descriptor 0 (command & status, ep0 COMMAND)
248         
249         .db     DSCR_INTRFC_LEN
250         .db     DSCR_INTRFC
251         .db     0               ; bInterfaceNumber (zero based)
252         .db     0               ; bAlternateSetting
253         .db     0               ; bNumEndpoints
254         .db     0xff            ; bInterfaceClass (vendor specific)
255         .db     0xff            ; bInterfaceSubClass (vendor specific)
256         .db     0xff            ; bInterfaceProtocol (vendor specific)
257         .db     SI_COMMAND_AND_STATUS   ; iInterface (description)
258         
259 _full_speed_config_descr_end:   
260         
261 ;;; ----------------------------------------------------------------
262 ;;;                     string descriptors
263 ;;; ----------------------------------------------------------------
264
265 _nstring_descriptors::
266         .db     (_string_descriptors_end - _string_descriptors) / 2
267
268 _string_descriptors::
269         .db     <str0, >str0
270         .db     <str1, >str1
271         .db     <str2, >str2
272         .db     <str3, >str3
273         .db     <str4, >str4
274         .db     <str5, >str5
275         .db     <str6, >str6
276 _string_descriptors_end:
277
278         SI_NONE = 0
279         ;; str0 contains the language ID's.
280         .even
281 str0:   .db     str0_end - str0
282         .db     DSCR_STRING
283         .db     0
284         .db     0
285         .db     <0x0409         ; magic code for US English (LSB)
286         .db     >0x0409         ; magic code for US English (MSB)
287 str0_end:
288
289         SI_VENDOR = 1
290         .even
291 str1:   .db     str1_end - str1
292         .db     DSCR_STRING
293         .db     'F, 0           ; 16-bit unicode
294         .db     'r, 0
295         .db     'e, 0
296         .db     'e, 0
297         .db     ' , 0
298         .db     'S, 0
299         .db     'o, 0
300         .db     'f, 0
301         .db     't, 0
302         .db     'w, 0
303         .db     'a, 0
304         .db     'r, 0
305         .db     'e, 0
306         .db     ' , 0
307         .db     'F, 0
308         .db     'o, 0
309         .db     'l, 0
310         .db     'k, 0
311         .db     's, 0
312 str1_end:
313
314         SI_PRODUCT = 2
315         .even
316 str2:   .db     str2_end - str2
317         .db     DSCR_STRING
318         .db     'U, 0
319         .db     'S, 0
320         .db     'R, 0
321         .db     'P, 0
322         .db     ' , 0
323         .db     'R, 0
324         .db     'e, 0
325         .db     'v, 0
326         .db     ' , 0
327 _usb_desc_hw_rev_ascii_patch_location_0::
328         .db     '?, 0
329 str2_end:
330
331         SI_COMMAND_AND_STATUS = 3
332         .even
333 str3:   .db     str3_end - str3
334         .db     DSCR_STRING
335         .db     'C, 0
336         .db     'o, 0
337         .db     'm, 0
338         .db     'm, 0
339         .db     'a, 0
340         .db     'n, 0
341         .db     'd, 0
342         .db     ' , 0
343         .db     '&, 0
344         .db     ' , 0
345         .db     'S, 0
346         .db     't, 0
347         .db     'a, 0
348         .db     't, 0
349         .db     'u, 0
350         .db     's, 0
351 str3_end:
352
353         SI_TX_PATH = 4
354         .even
355 str4:   .db     str4_end - str4
356         .db     DSCR_STRING
357         .db     'T, 0
358         .db     'r, 0
359         .db     'a, 0
360         .db     'n, 0
361         .db     's, 0
362         .db     'm, 0
363         .db     'i, 0
364         .db     't, 0
365         .db     ' , 0
366         .db     'P, 0
367         .db     'a, 0
368         .db     't, 0
369         .db     'h, 0
370 str4_end:
371
372         SI_RX_PATH = 5
373         .even
374 str5:   .db     str5_end - str5
375         .db     DSCR_STRING
376         .db     'R, 0
377         .db     'e, 0
378         .db     'c, 0
379         .db     'e, 0
380         .db     'i, 0
381         .db     'v, 0
382         .db     'e, 0
383         .db     ' , 0
384         .db     'P, 0
385         .db     'a, 0
386         .db     't, 0
387         .db     'h, 0
388 str5_end:
389
390         SI_SERIAL = 6
391         .even
392 str6:   .db     str6_end - str6
393         .db     DSCR_STRING
394 _usb_desc_serial_number_ascii::
395         .db     '3, 0
396         .db     '., 0
397         .db     '1, 0
398         .db     '4, 0
399         .db     '1, 0
400         .db     '5, 0
401         .db     '9, 0
402         .db     '3, 0
403 str6_end:
404