1 |
27 |
unneback |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# usbs_upd985xx.cdl
|
4 |
|
|
#
|
5 |
|
|
# USB device driver for the NEC uPD985xx family of processors.
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
#####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 2002 Bart Veer
|
12 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
13 |
|
|
##
|
14 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
15 |
|
|
## the terms of the GNU General Public License as published by the Free
|
16 |
|
|
## Software Foundation; either version 2 or (at your option) any later version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
19 |
|
|
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License along
|
24 |
|
|
## with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use macros
|
28 |
|
|
## or inline functions from this file, or you compile this file and link it
|
29 |
|
|
## with other works to produce a work based on this file, this file does not
|
30 |
|
|
## by itself cause the resulting work to be covered by the GNU General Public
|
31 |
|
|
## License. However the source code for this file must still be made available
|
32 |
|
|
## in accordance with section (3) of the GNU General Public License.
|
33 |
|
|
##
|
34 |
|
|
## This exception does not invalidate any other reasons why a work based on
|
35 |
|
|
## this file might be covered by the GNU General Public License.
|
36 |
|
|
##
|
37 |
|
|
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
38 |
|
|
## at http://sources.redhat.com/ecos/ecos-license/
|
39 |
|
|
## -------------------------------------------
|
40 |
|
|
#####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
# ====================================================================
|
42 |
|
|
######DESCRIPTIONBEGIN####
|
43 |
|
|
#
|
44 |
|
|
# Author(s): bartv
|
45 |
|
|
# Original data: bartv
|
46 |
|
|
# Contributors:
|
47 |
|
|
# Date: 2001-05-22
|
48 |
|
|
#
|
49 |
|
|
#####DESCRIPTIONEND####
|
50 |
|
|
# ====================================================================
|
51 |
|
|
|
52 |
|
|
cdl_package CYGPKG_DEVS_USB_UPD985XX {
|
53 |
|
|
display "NEC uPD985xx USB Device Driver"
|
54 |
|
|
include_dir "cyg/io/usb"
|
55 |
|
|
parent CYGPKG_USB
|
56 |
|
|
implements CYGHWR_IO_USB_SLAVE
|
57 |
|
|
doc ref/devs-usb-nec-upd985xx.html
|
58 |
|
|
|
59 |
|
|
# Make sure that we are running on the right hardware.
|
60 |
|
|
requires CYGPKG_HAL_MIPS
|
61 |
|
|
requires CYGPKG_HAL_MIPS_UPD985XX
|
62 |
|
|
|
63 |
|
|
description "
|
64 |
|
|
The NEC uPD985xx family of processors implements an
|
65 |
|
|
on-chip USB device controller, facilitating the use of this
|
66 |
|
|
processor in USB peripherals. This package provides a
|
67 |
|
|
suitable eCos device driver."
|
68 |
|
|
|
69 |
|
|
cdl_component CYGFUN_DEVS_USB_UPD985XX_EP0 {
|
70 |
|
|
display "Support the control endpoint 0"
|
71 |
|
|
default_value CYGINT_IO_USB_SLAVE_CLIENTS
|
72 |
|
|
requires CYGPKG_IO_USB CYGPKG_IO_USB_SLAVE
|
73 |
|
|
compile usbs_upd985xx.c
|
74 |
|
|
compile -library=libextras.a usbs_upd985xx_data.cxx
|
75 |
|
|
description "
|
76 |
|
|
Enable support for endpoint 0. If this support is disabled
|
77 |
|
|
then the entire USB port is unusable."
|
78 |
|
|
|
79 |
|
|
cdl_option CYGVAR_DEVS_USB_UPD985XX_EP0_DEVTAB_ENTRY {
|
80 |
|
|
display "Provide a devtab entry for endpoint 0"
|
81 |
|
|
default_value CYGGLO_IO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES
|
82 |
|
|
requires CYGPKG_IO
|
83 |
|
|
description "
|
84 |
|
|
If endpoint 0 will only be accessed via the low-level
|
85 |
|
|
USB-specific calls then there is no need for an entry
|
86 |
|
|
in the device table, saving some memory. If the
|
87 |
|
|
application intends to access the endpoint by means
|
88 |
|
|
of open and ioctl calls then a devtab entry is needed.
|
89 |
|
|
"
|
90 |
|
|
}
|
91 |
|
|
|
92 |
|
|
cdl_option CYGNUM_DEVS_USB_UPD985XX_EP0_PKTSIZE {
|
93 |
|
|
display "Size of endpoint 0 control packets"
|
94 |
|
|
flavor data
|
95 |
|
|
default_value 8
|
96 |
|
|
legal_values { 8 16 32 64 }
|
97 |
|
|
description "
|
98 |
|
|
Control messages on endpoint 0 are split into packets of
|
99 |
|
|
8, 16, 32 or 64 bytes - these are the values permitted by the
|
100 |
|
|
USB specification. The same packet size is used for both
|
101 |
|
|
receives and transmits. This value must also be used for the
|
102 |
|
|
max_packet_size field of the device descriptor in the
|
103 |
|
|
application's USB enumeration data.
|
104 |
|
|
|
105 |
|
|
According to section 5.5.5 of the USB specification, if a new
|
106 |
|
|
control message is received before the previous transaction
|
107 |
|
|
has completed then the previous transaction must be aborted.
|
108 |
|
|
If that transaction involved transferring data to the host
|
109 |
|
|
then there is a problem: that data may still be queued for
|
110 |
|
|
transmission and the NEC USB device appears to provide no way
|
111 |
|
|
of aborting that transmit. The problem is unlikely to arise
|
112 |
|
|
with normal usage, but may be detected by compliance
|
113 |
|
|
testsuites. Increasing the packet size to its maximum value
|
114 |
|
|
of 64 reduces the probability of failure.
|
115 |
|
|
"
|
116 |
|
|
}
|
117 |
|
|
|
118 |
|
|
cdl_option CYGNUM_DEVS_USB_UPD985XX_EP0_TXBUFSIZE {
|
119 |
|
|
display "Size of statically-allocated endpoint 0 transmit buffer"
|
120 |
|
|
flavor data
|
121 |
|
|
default_value 256
|
122 |
|
|
requires { CYGNUM_DEVS_USB_UPD985XX_EP0_TXBUFSIZE >= CYGNUM_DEVS_USB_UPD985XX_EP0_PKTSIZE }
|
123 |
|
|
description "
|
124 |
|
|
The implementation of the support for endpoint 0 uses
|
125 |
|
|
a single static buffer to hold the response to the
|
126 |
|
|
current control message. Typically this buffer can be
|
127 |
|
|
fairly small since replies to control messages tend to
|
128 |
|
|
be small: typically some tens of bytes for the enumeration
|
129 |
|
|
data, perhaps a bit more for unicode-encoded string
|
130 |
|
|
descriptors. However if some application-specific protocol
|
131 |
|
|
depends on larger control messages then this buffer
|
132 |
|
|
size may need to be increased.
|
133 |
|
|
"
|
134 |
|
|
}
|
135 |
|
|
|
136 |
|
|
cdl_option CYGNUM_DEVS_USB_UPD985XX_EP0_RXBUFSIZE {
|
137 |
|
|
display "Size of statically-allocated endpoint 0 transmit buffer"
|
138 |
|
|
flavor data
|
139 |
|
|
default_value 64
|
140 |
|
|
requires { CYGNUM_DEVS_USB_UPD985XX_EP0_RXBUFSIZE >= CYGNUM_DEVS_USB_UPD985XX_EP0_PKTSIZE }
|
141 |
|
|
description "
|
142 |
|
|
The implementation of the support for endpoint 0 uses
|
143 |
|
|
a single static buffer to hold incoming control messages.
|
144 |
|
|
Typically this buffer can be small: standard control messages
|
145 |
|
|
involve an initial eight-byte header, sometimes followed by
|
146 |
|
|
a small amount of additional data. However if some
|
147 |
|
|
application-specific protocol depends on larger control
|
148 |
|
|
messages then this buffer size may need to be increased.
|
149 |
|
|
"
|
150 |
|
|
}
|
151 |
|
|
}
|
152 |
|
|
cdl_component CYGPKG_DEVS_USB_UPD985XX_EP3 {
|
153 |
|
|
display "Support endpoint 3, used for slave->host IN bulk transfers"
|
154 |
|
|
implements CYGHWR_IO_USB_SLAVE_IN_ENDPOINTS
|
155 |
|
|
requires CYGFUN_DEVS_USB_UPD985XX_EP0
|
156 |
|
|
default_value 0
|
157 |
|
|
description "
|
158 |
|
|
In the uPD985xx USB implementation endpoint 3 can only be
|
159 |
|
|
used for slave->host IN bulk transfers. If the intended application
|
160 |
|
|
only involves host->slave transfers then this endpoint is
|
161 |
|
|
not relevant.
|
162 |
|
|
|
163 |
|
|
By default this endpoint is disabled: according to NEC erratum
|
164 |
|
|
U3 there may be problems when doing transfers of 192 bytes or
|
165 |
|
|
greater. Instead the interrupt endpoint 5 is used, with
|
166 |
|
|
software emulation of the bulk protocol. If the application
|
167 |
|
|
involves only transfers of less than 192 bytes then endpoint
|
168 |
|
|
3 can be enabled.
|
169 |
|
|
"
|
170 |
|
|
|
171 |
|
|
cdl_option CYGVAR_DEVS_USB_UPD985XX_EP3_DEVTAB_ENTRY {
|
172 |
|
|
display "Provide a devtab entry for endpoint 3"
|
173 |
|
|
default_value CYGGLO_IO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES
|
174 |
|
|
requires CYGPKG_IO
|
175 |
|
|
description "
|
176 |
|
|
If endpoint 3 will only be accessed via the low-level
|
177 |
|
|
USB-specific calls then there is no need for an entry
|
178 |
|
|
in the device table, saving some memory. If the
|
179 |
|
|
application intends to access the endpoint by means
|
180 |
|
|
of open and read calls then a devtab entry is needed.
|
181 |
|
|
"
|
182 |
|
|
}
|
183 |
|
|
}
|
184 |
|
|
|
185 |
|
|
cdl_component CYGPKG_DEVS_USB_UPD985XX_EP4 {
|
186 |
|
|
display "Support endpoint 4, used for slave->host OUT bulk transfers"
|
187 |
|
|
implements CYGHWR_IO_USB_SLAVE_OUT_ENDPOINTS
|
188 |
|
|
requires CYGFUN_DEVS_USB_UPD985XX_EP0
|
189 |
|
|
default_value CYGFUN_DEVS_USB_UPD985XX_EP0
|
190 |
|
|
description "
|
191 |
|
|
In the uPD985xx USB implementation endpoint 4 can only be
|
192 |
|
|
used for host->slave OUT bulk transfers. If the intended application
|
193 |
|
|
only involves slave->host transfers then the support for
|
194 |
|
|
endpoint 4 can be disabled. Note that this does not affect
|
195 |
|
|
control messages which always go via endpoint 0."
|
196 |
|
|
|
197 |
|
|
cdl_option CYGVAR_DEVS_USB_UPD985XX_EP4_DEVTAB_ENTRY {
|
198 |
|
|
display "Provide a devtab entry for endpoint 4"
|
199 |
|
|
default_value CYGGLO_IO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES
|
200 |
|
|
requires CYGPKG_IO
|
201 |
|
|
description "
|
202 |
|
|
If endpoint 4 will only be accessed via the low-level
|
203 |
|
|
USB-specific calls then there is no need for an entry
|
204 |
|
|
in the device table, saving some memory. If the
|
205 |
|
|
application intends to access the endpoint by means
|
206 |
|
|
of open and write calls then a devtab entry is needed."
|
207 |
|
|
}
|
208 |
|
|
}
|
209 |
|
|
|
210 |
|
|
cdl_component CYGPKG_DEVS_USB_UPD985XX_EP5 {
|
211 |
|
|
display "Support endpoint 5, used for slave->host IN transfers"
|
212 |
|
|
implements CYGHWR_IO_USB_SLAVE_IN_ENDPOINTS
|
213 |
|
|
requires CYGFUN_DEVS_USB_UPD985XX_EP0
|
214 |
|
|
default_value CYGFUN_DEVS_USB_UPD985XX_EP0
|
215 |
|
|
description "
|
216 |
|
|
In the uPD985xx USB implementation endpoint 5 can only be
|
217 |
|
|
used for slave->host communication. This endpoint is
|
218 |
|
|
intended primarily for interrupt transfers, but can be
|
219 |
|
|
used for bulk transfers given a small amount of additional
|
220 |
|
|
software support."
|
221 |
|
|
|
222 |
|
|
cdl_option CYGIMP_DEVS_USB_UPD985XX_EP5_BULK {
|
223 |
|
|
display "Implement bulk transfers rather than interrupt transfers"
|
224 |
|
|
default_value 1
|
225 |
|
|
description "
|
226 |
|
|
Endpoint 5 is normally used for interrupt transfers, which
|
227 |
|
|
are limited to 64 bytes. However with a little bit of software
|
228 |
|
|
support it is possible to implement bulk transfers instead.
|
229 |
|
|
With some revisions of the silicon this provides a workaround
|
230 |
|
|
for problems with endpoint 3 - NEC erratum U3 should be consulted
|
231 |
|
|
for additional information."
|
232 |
|
|
}
|
233 |
|
|
|
234 |
|
|
cdl_option CYGVAR_DEVS_USB_UPD985XX_EP5_DEVTAB_ENTRY {
|
235 |
|
|
display "Provide a devtab entry for endpoint 5"
|
236 |
|
|
default_value CYGGLO_IO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES
|
237 |
|
|
requires CYGPKG_IO
|
238 |
|
|
description "
|
239 |
|
|
If endpoint 5 will only be accessed via the low-level
|
240 |
|
|
USB-specific calls then there is no need for an entry
|
241 |
|
|
in the device table, saving some memory. If the
|
242 |
|
|
application intends to access the endpoint by means
|
243 |
|
|
of open and write calls then a devtab entry is needed.
|
244 |
|
|
"
|
245 |
|
|
}
|
246 |
|
|
}
|
247 |
|
|
|
248 |
|
|
cdl_option CYGDAT_DEVS_USB_UPD985XX_DEVTAB_BASENAME {
|
249 |
|
|
display "Base name for devtab entries"
|
250 |
|
|
flavor data
|
251 |
|
|
active_if { CYGVAR_DEVS_USB_UPD985XX_EP0_DEVTAB_ENTRY ||
|
252 |
|
|
CYGVAR_DEVS_USB_UPD985XX_EP3_DEVTAB_ENTRY ||
|
253 |
|
|
CYGVAR_DEVS_USB_UPD985XX_EP4_DEVTAB_ENTRY
|
254 |
|
|
}
|
255 |
|
|
default_value { "\"/dev/usbs\"" }
|
256 |
|
|
description "
|
257 |
|
|
If the uPD985xx USB device driver package provides devtab
|
258 |
|
|
entries for any of the endpoints then this option gives
|
259 |
|
|
control over the names of these entries. By default the
|
260 |
|
|
endpoints will be called \"/dev/usbs0c\", \"/dev/usbs3w\"
|
261 |
|
|
and \"/dev/usbs4r\" (assuming all three endpoints are
|
262 |
|
|
enabled. The common part \"/dev/usbs\" is determined
|
263 |
|
|
by this configuration option. It may be necessary to
|
264 |
|
|
change this if there are multiple USB slave-side
|
265 |
|
|
devices on the target hardware to prevent a name clash.
|
266 |
|
|
"
|
267 |
|
|
}
|
268 |
|
|
|
269 |
|
|
cdl_option CYGIMP_DEVS_USB_UPD985XX_IBUS_WRITE_LIMIT {
|
270 |
|
|
display "Work around potential hardware problem with IBUS writes"
|
271 |
|
|
default_value 1
|
272 |
|
|
description "
|
273 |
|
|
With some revisions of the silicon there may be problems if
|
274 |
|
|
a device driver performs multiple writes to the IBUS in
|
275 |
|
|
quick succession. By default this driver avoids such problems,
|
276 |
|
|
at the cost of some cpu cycles and a small amount of extra code.
|
277 |
|
|
NEC erratum S1 should be consulted for more details."
|
278 |
|
|
}
|
279 |
|
|
|
280 |
|
|
cdl_option CYGIMP_DEVS_USB_UPD985XX_SERIALIZE_TRANSMITS {
|
281 |
|
|
display "Work around potential hardware problem with concurrent transmits"
|
282 |
|
|
default_value 1
|
283 |
|
|
description "
|
284 |
|
|
With some revisions of the silicon there may be problems if
|
285 |
|
|
the device driver is asked to perform concurrent slave->host
|
286 |
|
|
transmissions on different endpoints, for example sending
|
287 |
|
|
a reply to a control message while there is a bulk transfer
|
288 |
|
|
in progress. This option enables a workaround for the
|
289 |
|
|
problem by ensuring that only one transmit operation is in
|
290 |
|
|
progress at any one time. NEC errata U3 and U4 should be
|
291 |
|
|
consulted for more details."
|
292 |
|
|
}
|
293 |
|
|
}
|