freemyipod r890 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r889‎ | r890 | r891 >
Date:14:27, 4 August 2013
Author:theseven
Status:new
Tags:
Comment:
UMSboot: Fix some more USB bugs
Modified paths:
  • /umsboot/src/core/synopsysotg/synopsysotg.c (modified) (history)
  • /umsboot/src/protocol/usb/usb.c (modified) (history)

Diff [purge]

Index: umsboot/src/protocol/usb/usb.c
@@ -34,6 +34,12 @@
3535 // Expect zero-length ACK if we are about to actually send data, otherwise expect SETUP.
3636 if (last) usb_ep0_start_rx(data, !!len, usb_ep0_rx_callback);
3737
 38+ if (((uint32_t)buf) & (CACHEALIGN_SIZE - 1))
 39+ {
 40+ memcpy(data->buffer->raw, buf, len);
 41+ buf = data->buffer->raw;
 42+ }
 43+
3844 data->state->ep0_tx_callback = callback;
3945 data->driver->ep0_start_tx(data, buf, len);
4046 }
@@ -44,7 +50,7 @@
4551 int len = MIN(64, data->state->ep0_tx_len);
4652 data->state->ep0_tx_ptr += 64;
4753 data->state->ep0_tx_len -= len;
48 - usb_ep0_start_tx(data, data->state->ep0_tx_ptr, len, !!data->state->ep0_tx_len, usb_ep0_tx_callback);
 54+ usb_ep0_start_tx(data, data->state->ep0_tx_ptr, len, !data->state->ep0_tx_len, usb_ep0_tx_callback);
4955 return true;
5056 }
5157
Index: umsboot/src/core/synopsysotg/synopsysotg.c
@@ -312,7 +312,7 @@
313313 synopsysotg_ep0_init(instance);
314314 }
315315
316 - if (gintsts.b.rxstsqlvl)
 316+ if (gintsts.b.rxstsqlvl && !data->use_dma)
317317 {
318318 // Device to memory part of the "software DMA" implementation, used to receive data if use_dma == 0.
319319 // Handle one packet at a time, the IRQ will re-trigger if there's something left.