<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>SA11X0 USB Device Driver</TITLE
|
>SA11X0 USB Device Driver</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="eCos Reference Manual"
|
TITLE="eCos Reference Manual"
|
HREF="ecos-ref.html"><LINK
|
HREF="ecos-ref.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="SA11X0 USB Device Driver"
|
TITLE="SA11X0 USB Device Driver"
|
HREF="devs-usb-sa11x0-ref.html"><LINK
|
HREF="devs-usb-sa11x0-ref.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="SA11X0 USB Device Driver"
|
TITLE="SA11X0 USB Device Driver"
|
HREF="devs-usb-sa11x0-ref.html"><LINK
|
HREF="devs-usb-sa11x0-ref.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="NEC uPD985xx USB Device Driver"
|
TITLE="NEC uPD985xx USB Device Driver"
|
HREF="devs-usb-nec-upd985xx-ref.html"></HEAD
|
HREF="devs-usb-nec-upd985xx-ref.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="REFENTRY"
|
CLASS="REFENTRY"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>eCos Reference Manual</TH
|
>eCos Reference Manual</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="devs-usb-sa11x0-ref.html"
|
HREF="devs-usb-sa11x0-ref.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="devs-usb-nec-upd985xx-ref.html"
|
HREF="devs-usb-nec-upd985xx-ref.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><H1
|
><H1
|
><A
|
><A
|
NAME="DEVS-USB-SA11X0">SA11X0 USB Device Driver</H1
|
NAME="DEVS-USB-SA11X0">SA11X0 USB Device Driver</H1
|
><DIV
|
><DIV
|
CLASS="REFNAMEDIV"
|
CLASS="REFNAMEDIV"
|
><A
|
><A
|
NAME="AEN18754"
|
NAME="AEN18754"
|
></A
|
></A
|
><H2
|
><H2
|
>Name</H2
|
>Name</H2
|
>SA11X0 USB Support -- Device driver for the on-chip SA11X0 USB device</DIV
|
>SA11X0 USB Support -- Device driver for the on-chip SA11X0 USB device</DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN18757"
|
NAME="AEN18757"
|
></A
|
></A
|
><H2
|
><H2
|
>SA11X0 USB Hardware</H2
|
>SA11X0 USB Hardware</H2
|
><P
|
><P
|
>The Intel StrongARM SA11x0 family of processors is supplied with an
|
>The Intel StrongARM SA11x0 family of processors is supplied with an
|
on-chip USB slave device, the UDC (USB Device Controller). This
|
on-chip USB slave device, the UDC (USB Device Controller). This
|
supports three endpoints. Endpoint 0 can only be used for control
|
supports three endpoints. Endpoint 0 can only be used for control
|
messages. Endpoint 1 can only be used for bulk transfers from host to
|
messages. Endpoint 1 can only be used for bulk transfers from host to
|
peripheral. Endpoint 2 can only be used for bulk transfers from
|
peripheral. Endpoint 2 can only be used for bulk transfers from
|
peripheral to host. Isochronous and interrupt transfers are not
|
peripheral to host. Isochronous and interrupt transfers are not
|
supported.</P
|
supported.</P
|
><DIV
|
><DIV
|
CLASS="CAUTION"
|
CLASS="CAUTION"
|
><P
|
><P
|
></P
|
></P
|
><TABLE
|
><TABLE
|
CLASS="CAUTION"
|
CLASS="CAUTION"
|
BORDER="1"
|
BORDER="1"
|
WIDTH="100%"
|
WIDTH="100%"
|
><TR
|
><TR
|
><TD
|
><TD
|
ALIGN="CENTER"
|
ALIGN="CENTER"
|
><B
|
><B
|
>Caution</B
|
>Caution</B
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
><P
|
><P
|
>Different revisions of the SA11x0 silicon have had various problems
|
>Different revisions of the SA11x0 silicon have had various problems
|
with the USB support. The device driver has been tested primarily
|
with the USB support. The device driver has been tested primarily
|
against stepping B4 of the SA1110 processor, and may not function as
|
against stepping B4 of the SA1110 processor, and may not function as
|
expected with other revisions. Application developers should obtain
|
expected with other revisions. Application developers should obtain
|
the manufacturer's current errata sheets and specification updates.
|
the manufacturer's current errata sheets and specification updates.
|
The B4 stepping still has a number of problems, but the device driver
|
The B4 stepping still has a number of problems, but the device driver
|
can work around these. However there is a penalty in terms of extra
|
can work around these. However there is a penalty in terms of extra
|
code, extra cpu cycles, and increased dispatch latency because extra
|
code, extra cpu cycles, and increased dispatch latency because extra
|
processing is needed at DSR level. Interrupt latency should not be
|
processing is needed at DSR level. Interrupt latency should not be
|
affected.</P
|
affected.</P
|
><P
|
><P
|
>There is one specific problem inherent in the UDC design of which
|
>There is one specific problem inherent in the UDC design of which
|
application developers should be aware: the hardware cannot fully
|
application developers should be aware: the hardware cannot fully
|
implement the USB standard for bulk transfers. A bulk transfer
|
implement the USB standard for bulk transfers. A bulk transfer
|
typically consists of some number of full-size 64-byte packets and is
|
typically consists of some number of full-size 64-byte packets and is
|
terminated by a packet less than the full size. If the amount of data
|
terminated by a packet less than the full size. If the amount of data
|
transferred is an exact multiple of 64 bytes then this requires a
|
transferred is an exact multiple of 64 bytes then this requires a
|
terminating packet of 0 bytes of data (plus header and checksum). The
|
terminating packet of 0 bytes of data (plus header and checksum). The
|
SA11x0 USB hardware does not allow a 0-byte packet to be transmitted,
|
SA11x0 USB hardware does not allow a 0-byte packet to be transmitted,
|
so the device driver is forced to substitute a 1-byte packet and the
|
so the device driver is forced to substitute a 1-byte packet and the
|
host receives more data than expected. Protocol support is needed so
|
host receives more data than expected. Protocol support is needed so
|
that the appropriate host-side device driver can allow buffer space
|
that the appropriate host-side device driver can allow buffer space
|
for the extra byte, detect when it gets sent, and discard it.
|
for the extra byte, detect when it gets sent, and discard it.
|
Consequently certain standard USB class protocols cannot be
|
Consequently certain standard USB class protocols cannot be
|
implemented using the SA11x0, and therefore custom host-side device
|
implemented using the SA11x0, and therefore custom host-side device
|
drivers will generally have to be provided, rather than re-using
|
drivers will generally have to be provided, rather than re-using
|
existing ones that understand the standard protocol.</P
|
existing ones that understand the standard protocol.</P
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN18763"
|
NAME="AEN18763"
|
></A
|
></A
|
><H2
|
><H2
|
>Endpoint Data Structures</H2
|
>Endpoint Data Structures</H2
|
><P
|
><P
|
>The SA11x0 USB device driver can provide up to three data structures
|
>The SA11x0 USB device driver can provide up to three data structures
|
corresponding to the three endpoints: a
|
corresponding to the three endpoints: a
|
<SPAN
|
<SPAN
|
CLASS="STRUCTNAME"
|
CLASS="STRUCTNAME"
|
>usbs_control_endpoint</SPAN
|
>usbs_control_endpoint</SPAN
|
> structure
|
> structure
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>usbs_sa11x0_ep0</TT
|
>usbs_sa11x0_ep0</TT
|
>; a
|
>; a
|
<SPAN
|
<SPAN
|
CLASS="STRUCTNAME"
|
CLASS="STRUCTNAME"
|
>usbs_rx_endpoint</SPAN
|
>usbs_rx_endpoint</SPAN
|
>
|
>
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>usbs_sa11x0_ep1</TT
|
>usbs_sa11x0_ep1</TT
|
>; and a
|
>; and a
|
<SPAN
|
<SPAN
|
CLASS="STRUCTNAME"
|
CLASS="STRUCTNAME"
|
>usbs_tx_endpoint</SPAN
|
>usbs_tx_endpoint</SPAN
|
>
|
>
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>usbs_sa11x0_ep2</TT
|
>usbs_sa11x0_ep2</TT
|
>. The header file
|
>. The header file
|
<TT
|
<TT
|
CLASS="FILENAME"
|
CLASS="FILENAME"
|
>cyg/io/usb/usbs_sa11x0.h</TT
|
>cyg/io/usb/usbs_sa11x0.h</TT
|
>
|
>
|
provides declarations for these.</P
|
provides declarations for these.</P
|
><P
|
><P
|
>Not all applications will require support for all the endpoints. For
|
>Not all applications will require support for all the endpoints. For
|
example, if the intended use of the UDC only involves peripheral to
|
example, if the intended use of the UDC only involves peripheral to
|
host transfers then <TT
|
host transfers then <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>usbs_sa11x0_ep1</TT
|
>usbs_sa11x0_ep1</TT
|
> is redundant.
|
> is redundant.
|
The device driver provides configuration options to control the
|
The device driver provides configuration options to control the
|
presence of each endpoint:</P
|
presence of each endpoint:</P
|
><P
|
><P
|
></P
|
></P
|
><OL
|
><OL
|
TYPE="1"
|
TYPE="1"
|
><LI
|
><LI
|
><P
|
><P
|
>Endpoint 0 is controlled by
|
>Endpoint 0 is controlled by
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGFUN_DEVS_USB_SA11X0_EP0</TT
|
>CYGFUN_DEVS_USB_SA11X0_EP0</TT
|
>. This defaults to
|
>. This defaults to
|
enabled if there are any higher-level packages that require USB
|
enabled if there are any higher-level packages that require USB
|
hardware or if the global preference
|
hardware or if the global preference
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGGLO_IO_USB_SLAVE_APPLICATION</TT
|
>CYGGLO_IO_USB_SLAVE_APPLICATION</TT
|
> is enabled,
|
> is enabled,
|
otherwise it is disabled. Usually this has the desired effect. It may
|
otherwise it is disabled. Usually this has the desired effect. It may
|
be necessary to override this in special circumstances, for example if
|
be necessary to override this in special circumstances, for example if
|
the target board uses an external USB chip in preference to the UDC
|
the target board uses an external USB chip in preference to the UDC
|
and it is that external chip's device driver that should be used
|
and it is that external chip's device driver that should be used
|
rather than the on-chip UDC. It is not possible to disable endpoint 0
|
rather than the on-chip UDC. It is not possible to disable endpoint 0
|
and at the same time enable one or both of the other endpoints, since
|
and at the same time enable one or both of the other endpoints, since
|
a USB device is only usable if it can process the standard control
|
a USB device is only usable if it can process the standard control
|
messages.</P
|
messages.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Endpoint 1 is controlled by
|
>Endpoint 1 is controlled by
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_DEVS_USB_SA11X0_EP1</TT
|
>CYGPKG_DEVS_USB_SA11X0_EP1</TT
|
>. By default it is
|
>. By default it is
|
enabled whenever endpoint 0 is enabled, but it can be disabled
|
enabled whenever endpoint 0 is enabled, but it can be disabled
|
manually when not required.</P
|
manually when not required.</P
|
></LI
|
></LI
|
><LI
|
><LI
|
><P
|
><P
|
>Similarly endpoint 2 is controlled by
|
>Similarly endpoint 2 is controlled by
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_DEVS_USB_SA11X0_EP2</TT
|
>CYGPKG_DEVS_USB_SA11X0_EP2</TT
|
>. This is also enabled by
|
>. This is also enabled by
|
default whenever endpoint 0 is enabled, but it can be disabled manually.</P
|
default whenever endpoint 0 is enabled, but it can be disabled manually.</P
|
></LI
|
></LI
|
></OL
|
></OL
|
><P
|
><P
|
>The SA11X0 USB device driver implements the interface specified by the
|
>The SA11X0 USB device driver implements the interface specified by the
|
common eCos USB Slave Support package. The documentation for that
|
common eCos USB Slave Support package. The documentation for that
|
package should be consulted for further details. There is only one
|
package should be consulted for further details. There is only one
|
major deviation: when there is a peripheral to host transfer on
|
major deviation: when there is a peripheral to host transfer on
|
endpoint 2 which is an exact multiple of the bulk transfer packet size
|
endpoint 2 which is an exact multiple of the bulk transfer packet size
|
(usually 64 bytes) the device driver has to pad the transfer with one
|
(usually 64 bytes) the device driver has to pad the transfer with one
|
extra byte. This is because of a hardware limitation: the UDC is
|
extra byte. This is because of a hardware limitation: the UDC is
|
incapable of transmitting 0-byte packets as required by the USB
|
incapable of transmitting 0-byte packets as required by the USB
|
specification. Higher-level code, including the host-side device
|
specification. Higher-level code, including the host-side device
|
driver, needs to be aware of this and adapt accordingly.</P
|
driver, needs to be aware of this and adapt accordingly.</P
|
><P
|
><P
|
>The device driver assumes a bulk packet size of 64 bytes, so this
|
>The device driver assumes a bulk packet size of 64 bytes, so this
|
value should be used in the endpoint descriptors in the enumeration
|
value should be used in the endpoint descriptors in the enumeration
|
data provided by application code. There is experimental code
|
data provided by application code. There is experimental code
|
for running with <A
|
for running with <A
|
HREF="devs-usb-sa11x0.html#AEN18808"
|
HREF="devs-usb-sa11x0.html#AEN18808"
|
>DMA disabled</A
|
>DMA disabled</A
|
>,
|
>,
|
in which case the packet size will be 16 bytes rather than 64.</P
|
in which case the packet size will be 16 bytes rather than 64.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN18789"
|
NAME="AEN18789"
|
></A
|
></A
|
><H2
|
><H2
|
>Devtab Entries</H2
|
>Devtab Entries</H2
|
><P
|
><P
|
>In addition to the endpoint data structures the SA11X0 USB device
|
>In addition to the endpoint data structures the SA11X0 USB device
|
driver can also provide devtab entries for each endpoint. This allows
|
driver can also provide devtab entries for each endpoint. This allows
|
higher-level code to use traditional I/O operations such as
|
higher-level code to use traditional I/O operations such as
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>open</TT
|
>open</TT
|
>/<TT
|
>/<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>read</TT
|
>read</TT
|
>/<TT
|
>/<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>write</TT
|
>write</TT
|
>
|
>
|
rather than the USB-specific non-blocking functions like
|
rather than the USB-specific non-blocking functions like
|
<TT
|
<TT
|
CLASS="FUNCTION"
|
CLASS="FUNCTION"
|
>usbs_start_rx_buffer</TT
|
>usbs_start_rx_buffer</TT
|
>. These devtab entries are
|
>. These devtab entries are
|
optional since they are not always required. The relevant
|
optional since they are not always required. The relevant
|
configuration options are
|
configuration options are
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGVAR_DEVS_USB_SA11X0_EP0_DEVTAB_ENTRY</TT
|
>CYGVAR_DEVS_USB_SA11X0_EP0_DEVTAB_ENTRY</TT
|
>,
|
>,
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGVAR_DEVS_USB_SA11X0_EP1_DEVTAB_ENTRY</TT
|
>CYGVAR_DEVS_USB_SA11X0_EP1_DEVTAB_ENTRY</TT
|
> and
|
> and
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGVAR_DEVS_USB_SA11X0_EP2_DEVTAB_ENTRY</TT
|
>CYGVAR_DEVS_USB_SA11X0_EP2_DEVTAB_ENTRY</TT
|
>. By default
|
>. By default
|
these devtab entries are provided if the global preference
|
these devtab entries are provided if the global preference
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGGLO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES</TT
|
>CYGGLO_USB_SLAVE_PROVIDE_DEVTAB_ENTRIES</TT
|
> is enabled,
|
> is enabled,
|
which is usually the case. Obviously a devtab entry for a given
|
which is usually the case. Obviously a devtab entry for a given
|
endpoint will only be provided if the underlying endpoint is enabled.
|
endpoint will only be provided if the underlying endpoint is enabled.
|
For example, there will not be a devtab entry for endpoint 1 if
|
For example, there will not be a devtab entry for endpoint 1 if
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGPKG_DEVS_USB_SA11X0_EP1</TT
|
>CYGPKG_DEVS_USB_SA11X0_EP1</TT
|
> is disabled.</P
|
> is disabled.</P
|
><P
|
><P
|
>The names for the three devtab entries are determined by using a
|
>The names for the three devtab entries are determined by using a
|
configurable base name and appending <TT
|
configurable base name and appending <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>0c</TT
|
>0c</TT
|
>,
|
>,
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>1r</TT
|
>1r</TT
|
> or <TT
|
> or <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>2w</TT
|
>2w</TT
|
>. The base name is
|
>. The base name is
|
determined by the configuration option
|
determined by the configuration option
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGDAT_DEVS_USB_SA11X0_DEVTAB_BASENAME</TT
|
>CYGDAT_DEVS_USB_SA11X0_DEVTAB_BASENAME</TT
|
> and has a
|
> and has a
|
default value of <TT
|
default value of <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>/dev/usbs</TT
|
>/dev/usbs</TT
|
>, so the devtab entry for
|
>, so the devtab entry for
|
endpoint 1 would default to <TT
|
endpoint 1 would default to <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>/dev/usbs1r</TT
|
>/dev/usbs1r</TT
|
>. If the
|
>. If the
|
target hardware involves multiple USB devices then application
|
target hardware involves multiple USB devices then application
|
developers may have to change the base name to prevent a name clash.</P
|
developers may have to change the base name to prevent a name clash.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN18808"
|
NAME="AEN18808"
|
></A
|
></A
|
><H2
|
><H2
|
>DMA Engines</H2
|
>DMA Engines</H2
|
><P
|
><P
|
>The SA11X0 UDC provides only limited fifos for bulk transfers on
|
>The SA11X0 UDC provides only limited fifos for bulk transfers on
|
endpoints 1 and 2; smaller than the normal 64-byte bulk packet size.
|
endpoints 1 and 2; smaller than the normal 64-byte bulk packet size.
|
Therefore a typical transfer requires the use of DMA engines. The
|
Therefore a typical transfer requires the use of DMA engines. The
|
SA11x0 provides six DMA engines that can be used for this, and the
|
SA11x0 provides six DMA engines that can be used for this, and the
|
endpoints require one each (assuming both endpoints are enabled). At
|
endpoints require one each (assuming both endpoints are enabled). At
|
the time of writing there is no arbitration mechanism to control
|
the time of writing there is no arbitration mechanism to control
|
access to the DMA engines. By default the device driver will use
|
access to the DMA engines. By default the device driver will use
|
DMA engine 4 for endpoint 1 and DMA engine 5 for endpoint 2, and it
|
DMA engine 4 for endpoint 1 and DMA engine 5 for endpoint 2, and it
|
assumes that no other code uses these particular engines.</P
|
assumes that no other code uses these particular engines.</P
|
><P
|
><P
|
>The exact DMA engines that will be used are determined by the
|
>The exact DMA engines that will be used are determined by the
|
configuration options
|
configuration options
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGNUM_DEVS_USB_SA11X0_EP1_DMA_CHANNEL</TT
|
>CYGNUM_DEVS_USB_SA11X0_EP1_DMA_CHANNEL</TT
|
> and
|
> and
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>CYGNUM_DEVS_USB_SA11X0_EP2_DMA_CHANNEL</TT
|
>CYGNUM_DEVS_USB_SA11X0_EP2_DMA_CHANNEL</TT
|
>. These
|
>. These
|
options have the booldata flavor, allowing the use of DMA to be
|
options have the booldata flavor, allowing the use of DMA to be
|
disabled completely in addition to controlling which DMA engines are
|
disabled completely in addition to controlling which DMA engines are
|
used. If DMA is disabled then the device driver will attempt to
|
used. If DMA is disabled then the device driver will attempt to
|
work purely using the fifos, and the packet size will be limited to
|
work purely using the fifos, and the packet size will be limited to
|
only 16 bytes. This limit should be reflected in the appropriate
|
only 16 bytes. This limit should be reflected in the appropriate
|
endpoint descriptors in the enumeration data. The code for driving the
|
endpoint descriptors in the enumeration data. The code for driving the
|
endpoints without DMA should be considered experimental. At best it
|
endpoints without DMA should be considered experimental. At best it
|
will be suitable only for applications where the amount of data
|
will be suitable only for applications where the amount of data
|
transferred is relatively small, because four times as many interrupts
|
transferred is relatively small, because four times as many interrupts
|
will be raised and performance will suffer accordingly.</P
|
will be raised and performance will suffer accordingly.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="devs-usb-sa11x0-ref.html"
|
HREF="devs-usb-sa11x0-ref.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ecos-ref.html"
|
HREF="ecos-ref.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="devs-usb-nec-upd985xx-ref.html"
|
HREF="devs-usb-nec-upd985xx-ref.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
>SA11X0 USB Device Driver</TD
|
>SA11X0 USB Device Driver</TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="devs-usb-sa11x0-ref.html"
|
HREF="devs-usb-sa11x0-ref.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
>NEC uPD985xx USB Device Driver</TD
|
>NEC uPD985xx USB Device Driver</TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|