1 ; Copyright (C) 2009 Ubixum, Inc.
3 ; This library is free software; you can redistribute it and/or
4 ; modify it under the terms of the GNU Lesser General Public
5 ; License as published by the Free Software Foundation; either
6 ; version 2.1 of the License, or (at your option) any later version.
8 ; This library is distributed in the hope that it will be useful,
9 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ; Lesser General Public License for more details.
13 ; You should have received a copy of the GNU Lesser General Public
14 ; License along with this library; if not, write to the Free Software
15 ; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 ; this is a the default
18 ; full speed and high speed
19 ; descriptors found in the TRM
20 ; change however you want but leave
21 ; the descriptor pointers so the setupdat.c file works right
35 ; for the repeating interfaces
40 ENDPOINT_TYPE_CONTROL=0
45 .globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end
46 ; These need to be in code memory. If
47 ; they aren't you'll have to manully copy them somewhere
48 ; in code memory otherwise SUDPTRH:L don't work right
49 .area DSCR_AREA (CODE)
52 .db dev_dscr_end-_dev_dscr ; len
53 .db DSCR_DEVICE_TYPE ; type
55 .db 0xff ; class (vendor specific)
56 .db 0xff ; subclass (vendor specific)
57 .db 0xff ; protocol (vendor specific)
58 .db 64 ; packet size (ep0)
59 .dw 0xB404 ; vendor id
60 .dw 0x0410 ; product id
61 .dw 0x0100 ; version id
62 .db 1 ; manufacturure str idx
63 .db 2 ; product str idx
64 .db 0 ; serial str idx
65 .db 1 ; n configurations
69 .db dev_qualdscr_end-_dev_qual_dscr
77 .db 0 ; extra reserved byte
81 .db highspd_dscr_end-_highspd_dscr ; dscr len ;; Descriptor length
83 ; can't use .dw because byte order is different
84 .db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length of config lsb
85 .db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length of config msb
89 .db 0x80 ; attrs = bus powered, no wakeup
90 .db 0x32 ; max power = 100ma
93 ; all the interfaces next
94 ; NOTE the default TRM actually has more alt interfaces
95 ; but you can add them back in if you need them.
96 ; here, we just use the default alt setting 1 from the trm
97 .db DSCR_INTERFACE_LEN
98 .db DSCR_INTERFACE_TYPE
100 .db 0 ; alt setting idx
108 .db DSCR_ENDPOINT_LEN
109 .db DSCR_ENDPOINT_TYPE
110 .db 0x02 ; ep2 dir=OUT and address
111 .db ENDPOINT_TYPE_BULK ; type
112 .db 0x00 ; max packet LSB
113 .db 0x02 ; max packet size=512 bytes
114 .db 0x00 ; polling interval
117 .db DSCR_ENDPOINT_LEN
118 .db DSCR_ENDPOINT_TYPE
119 .db 0x86 ; ep6 dir=in and address
120 .db ENDPOINT_TYPE_BULK ; type
121 .db 0x00 ; max packet LSB
122 .db 0x02 ; max packet size=512 bytes
123 .db 0x00 ; polling interval
125 highspd_dscr_realend:
129 .db fullspd_dscr_end-_fullspd_dscr ; dscr len
131 ; can't use .dw because byte order is different
132 .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb
133 .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb
135 .db 1 ; config number
136 .db 0 ; config string
137 .db 0x80 ; attrs = bus powered, no wakeup
138 .db 0x32 ; max power = 100ma
141 ; all the interfaces next
142 ; NOTE the default TRM actually has more alt interfaces
143 ; but you can add them back in if you need them.
144 ; here, we just use the default alt setting 1 from the trm
145 .db DSCR_INTERFACE_LEN
146 .db DSCR_INTERFACE_TYPE
148 .db 0 ; alt setting idx
156 .db DSCR_ENDPOINT_LEN
157 .db DSCR_ENDPOINT_TYPE
158 .db 0x02 ; ep2 dir=OUT and address
159 .db ENDPOINT_TYPE_BULK ; type
160 .db 0x40 ; max packet LSB
161 .db 0x00 ; max packet size=64 bytes
162 .db 0x00 ; polling interval
165 .db DSCR_ENDPOINT_LEN
166 .db DSCR_ENDPOINT_TYPE
167 .db 0x86 ; ep6 dir=in and address
168 .db ENDPOINT_TYPE_BULK ; type
169 .db 0x40 ; max packet LSB
170 .db 0x00 ; max packet size=64 bytes
171 .db 0x00 ; polling interval
173 fullspd_dscr_realend:
179 .db string0end-_string0 ; len
181 .db 0x09, 0x04 ; who knows
183 ; add more strings here
186 .db string1end-_string1
195 .db string2end-_string2
210 .db string3end-_string3
225 .dw 0x0000 ; just in case someone passes an index higher than the end to the firmware