diff options
| author | Cástor Muñoz <cmvidal@gmail.com> | 2016-05-27 22:12:27 +0200 |
|---|---|---|
| committer | Cástor Muñoz <cmvidal@gmail.com> | 2016-07-08 00:24:46 +0200 |
| commit | 993a819feacc97a7d15b4aacaf71ca9148204973 (patch) | |
| tree | e0199a325eaf3b3aba164ae569bb894b1c63fcf9 /firmware/usbstack | |
| parent | c7a561e9f16b9c14631b448510297ffa912c298c (diff) | |
| download | rockbox-993a819feacc97a7d15b4aacaf71ca9148204973.zip rockbox-993a819feacc97a7d15b4aacaf71ca9148204973.tar.gz rockbox-993a819feacc97a7d15b4aacaf71ca9148204973.tar.bz2 rockbox-993a819feacc97a7d15b4aacaf71ca9148204973.tar.xz | |
usb-designware: New USB driver for Synopsys DesignWare USB OTG core.
Patch Set 1:
This bundle includes:
- USBOTG_DESIGNWARE driver based on g#844 and g#949
- USBOTG_DESIGNWARE for s5l8702 (Classic)
- USBOTG_DESIGNWARE for s5l8701 (Nano2G)
- USBOTG_DESIGNWARE for as3525v2 (enabled on Sansa Zip Clip)
- ALIGNED_BUFFER_QUICK_PATCH (usb_serial.c)
Preliminary version, needs to adjust some things and rework to
optimize in size.
Tested on Linux (USB_STORAGE, USB_HID and USB_SERIAL).
Known issues:
- n2g: panics when USB is extracted and then re-inserted quickly. This
only happens when "Error accessing playlist control file" is shown
(RB bug?).
Patch Set 2:
- Enable USBOTG_DESIGNWARE for sansaclipplus, sansaclipv2 and sansafuzev2,
these targets have never been tested.
- First round of optimizations, mainly tries to homogenize the names of
the endpoints and other small changes, functionality should be the same
as in the previous patch set.
Patch Set 3:
- Some rewrite/optimizations, functionality should be the same as in the
previous patch set.
Patch Set 4:
- n2g: enable EPROTO workaround, EPROTO errors are produced while the
device is receiving bulk data, they are highly mitigated running the
PHY @60 MHz. but it seems that occasionally the problem still persists.
This workaround tries to solve the issue by flushing the Rx FIFO/queue
that were corrupted by the received data.
- Some minor miscellaneous changes, previous functionality should not be
affected.
Patch Set 5:
- Changes in commit message.
Patch Set 6:
- Small rewrite/optimizacions including some minor changes, previous
functionallity should not be affected.
- Add usb_drv_recv_blocking(), not tested.
Patch Set 7:
- Fix panics when USB is extracted and then re-inserted quickly
("usb_storage_init_connection(): OOM" panic on Nano2G and Classic).
Change-Id: Iecf21dacc458ba2bdfc93782d3e08b3acdf0720d
Diffstat (limited to 'firmware/usbstack')
| -rw-r--r-- | firmware/usbstack/usb_serial.c | 10 | ||||
| -rw-r--r-- | firmware/usbstack/usb_storage.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c index 4a80433..7c425dc 100644 --- a/firmware/usbstack/usb_serial.c +++ b/firmware/usbstack/usb_serial.c @@ -60,6 +60,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 +168,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 } } diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 59ec191..efc243f 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -438,6 +438,7 @@ void usb_storage_init_connection(void) state = WAITING_FOR_COMMAND; #if (CONFIG_CPU == IMX31L || defined(CPU_TCC77X) || defined(CPU_TCC780X) || \ + CONFIG_CPU == S5L8702 || CONFIG_CPU == S5L8701 || \ defined(BOOTLOADER) || CONFIG_CPU == DM320) && !defined(CPU_PP502x) static unsigned char _cbw_buffer[MAX_CBW_SIZE] USB_DEVBSS_ATTR __attribute__((aligned(32))); |