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 0x1386 ; product id
61 .dw 0x0100 ; version id
62 .db 0 ; 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 0x01 ; ep1 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 0x81 ; ep1 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
126 .db DSCR_ENDPOINT_LEN
127 .db DSCR_ENDPOINT_TYPE
128 .db 0x02 ; ep2 dir=OUT and address
129 .db ENDPOINT_TYPE_BULK ; type
130 .db 0x00 ; max packet LSB
131 .db 0x02 ; max packet size=512 bytes
132 .db 0x00 ; polling interval
135 .db DSCR_ENDPOINT_LEN
136 .db DSCR_ENDPOINT_TYPE
137 .db 0x04 ; ep4 dir=OUT and address
138 .db ENDPOINT_TYPE_BULK ; type
139 .db 0x00 ; max packet LSB
140 .db 0x02 ; max packet size=512 bytes
141 .db 0x00 ; polling interval
144 .db DSCR_ENDPOINT_LEN
145 .db DSCR_ENDPOINT_TYPE
146 .db 0x86 ; ep6 dir=in and address
147 .db ENDPOINT_TYPE_BULK ; type
148 .db 0x00 ; max packet LSB
149 .db 0x02 ; max packet size=512 bytes
150 .db 0x00 ; polling interval
153 .db DSCR_ENDPOINT_LEN
154 .db DSCR_ENDPOINT_TYPE
155 .db 0x88 ; ep8 dir=in and address
156 .db ENDPOINT_TYPE_BULK ; type
157 .db 0x00 ; max packet LSB
158 .db 0x02 ; max packet size=512 bytes
159 .db 0x00 ; polling interval
160 highspd_dscr_realend:
164 .db fullspd_dscr_end-_fullspd_dscr ; dscr len
166 ; can't use .dw because byte order is different
167 .db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length of config lsb
168 .db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length of config msb
170 .db 1 ; config number
171 .db 0 ; config string
172 .db 0x80 ; attrs = bus powered, no wakeup
173 .db 0x32 ; max power = 100ma
176 ; all the interfaces next
177 ; NOTE the default TRM actually has more alt interfaces
178 ; but you can add them back in if you need them.
179 ; here, we just use the default alt setting 1 from the trm
180 .db DSCR_INTERFACE_LEN
181 .db DSCR_INTERFACE_TYPE
183 .db 0 ; alt setting idx
191 .db DSCR_ENDPOINT_LEN
192 .db DSCR_ENDPOINT_TYPE
193 .db 0x01 ; ep1 dir=out and address
194 .db ENDPOINT_TYPE_BULK ; type
195 .db 0x40 ; max packet LSB
196 .db 0x00 ; max packet size=64 bytes
197 .db 0x00 ; polling interval
200 .db DSCR_ENDPOINT_LEN
201 .db DSCR_ENDPOINT_TYPE
202 .db 0x81 ; ep1 dir=in and address
203 .db ENDPOINT_TYPE_BULK ; type
204 .db 0x40 ; max packet LSB
205 .db 0x00 ; max packet size=64 bytes
206 .db 0x00 ; polling interval
209 .db DSCR_ENDPOINT_LEN
210 .db DSCR_ENDPOINT_TYPE
211 .db 0x02 ; ep2 dir=OUT and address
212 .db ENDPOINT_TYPE_BULK ; type
213 .db 0x40 ; max packet LSB
214 .db 0x00 ; max packet size=64 bytes
215 .db 0x00 ; polling interval
218 .db DSCR_ENDPOINT_LEN
219 .db DSCR_ENDPOINT_TYPE
220 .db 0x04 ; ep4 dir=OUT and address
221 .db ENDPOINT_TYPE_BULK ; type
222 .db 0x40 ; max packet LSB
223 .db 0x00 ; max packet size=64 bytes
224 .db 0x00 ; polling interval
227 .db DSCR_ENDPOINT_LEN
228 .db DSCR_ENDPOINT_TYPE
229 .db 0x86 ; ep6 dir=in and address
230 .db ENDPOINT_TYPE_BULK ; type
231 .db 0x40 ; max packet LSB
232 .db 0x00 ; max packet size=64 bytes
233 .db 0x00 ; polling interval
235 .db DSCR_ENDPOINT_LEN
236 .db DSCR_ENDPOINT_TYPE
237 .db 0x88 ; ep6 dir=in and address
238 .db ENDPOINT_TYPE_BULK ; type
239 .db 0x40 ; max packet LSB
240 .db 0x00 ; max packet size=64 bytes
241 .db 0x00 ; polling interval
242 fullspd_dscr_realend:
248 .db string0end-_string0 ; len
250 .db 0x09, 0x04 ; 0x0409 is the language code for English. Possible to add more codes after this.
252 ; add more strings here
256 .dw 0x0000 ; in case you wanted to look at memory between _dev_strings and _dev_strings_end