diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2016-07-31 03:00:43 +0200 |
---|---|---|
committer | Cástor Muñoz <cmvidal@gmail.com> | 2016-08-02 04:57:49 +0200 |
commit | 5e305d35c94199241f71a994cf6a691aec49688c (patch) | |
tree | 51b52755a57017b3270720e303193e2daac3d3cf /firmware/usbstack | |
parent | 0f89b041c0803e7e1cee2c9bcfc08b209d1c88fd (diff) |
Introduce new USB driver for Synopsys DesignWare USB OTG core.
Based on g#844 and g#949, it is intended as a replacement for the
current s3c6400x USB driver.
The DesignWare USB OTG core is integrated into many SoC's, however
HW core version and capabilities (mainly DMA mode, Tx FIFO mode,
FIFO size and number of available IN/OUT endpoins) may differ:
CPU targets HW ver DMA NPTX FIFO FIFO sz #IN/OUT
-------- ------------- ------ --- --------- ------- -------
as3525v2 sansaclipplus 2.60a Yes Dedicated 0x535 4/4
sansaclipv2
sansaclipzip
sansafuzev2
s5l8701 ipodnano2g 2.20a Yes Shared 0x500 4/5
s5l8702 ipod6g 2.60a Yes Dedicated 0x820 7/7
ipodnano3g
s5l8720 ipodnano4g ? ? ? ? ?
Functionality supported by this driver:
- Device mode, compatible with USB 1.1/2.0 hosts.
- Shared FIFO (USB_DW_SHARED_FIFO) or dedicated FIFOs.
- No DMA (USB_DW_ARCH_SLAVE) or internal DMA mode.
- Concurrent transfers: control, bulk (usb_storage, usb_serial) and
interrupt (usb_hid).
Actually this driver is not used by any CPU, it will be enabled for
each individual CPU/target in next patches.
Change-Id: I74a1e836d18927a31f6977d71115fb442477dd5f
Diffstat (limited to 'firmware/usbstack')
-rw-r--r-- | firmware/usbstack/usb_serial.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c index 4a80433435..e3ef4f5814 100644 --- a/firmware/usbstack/usb_serial.c +++ b/firmware/usbstack/usb_serial.c @@ -19,6 +19,7 @@ * ****************************************************************************/ #include "string.h" +#include "config.h" #include "system.h" #include "usb_core.h" #include "usb_drv.h" @@ -60,6 +61,11 @@ static unsigned char send_buffer[BUFFER_SIZE] USB_DEVBSS_ATTR __attribute__((aligned(32))); static unsigned char receive_buffer[32] USB_DEVBSS_ATTR __attribute__((aligned(32))); +#if CONFIG_USBOTG == USBOTG_DESIGNWARE +/* Aligned transit buffer */ +static unsigned char transit_buffer[32] + USB_DEVBSS_ATTR __attribute__((aligned(4))); +#endif static void sendout(void); @@ -163,8 +169,13 @@ static void sendout(void) if(buffer_transitlength > 0) { buffer_length -= buffer_transitlength; +#if CONFIG_USBOTG == USBOTG_DESIGNWARE + memcpy(transit_buffer,&send_buffer[buffer_start],buffer_transitlength); + usb_drv_send_nonblocking(ep_in,transit_buffer,buffer_transitlength); +#else usb_drv_send_nonblocking(ep_in, &send_buffer[buffer_start], buffer_transitlength); +#endif } } |