mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
usb-drv-as3525: set bulk max packet size according to speed
only dump/clean dcache for the needed range git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26946 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cefd1856af
commit
1d5cc0a505
1 changed files with 3 additions and 10 deletions
|
|
@ -156,6 +156,7 @@ static void dma_desc_init(int ep, int dir)
|
||||||
static void reset_endpoints(int init)
|
static void reset_endpoints(int init)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
int mps = i == 0 ? 64 : (usb_drv_port_speed() ? 512 : 64);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OUT EP 2 is an alias for OUT EP 0 on this HW!
|
* OUT EP 2 is an alias for OUT EP 0 on this HW!
|
||||||
|
|
@ -168,14 +169,6 @@ static void reset_endpoints(int init)
|
||||||
endpoints[2][1].state |= EP_STATE_ALLOCATED;
|
endpoints[2][1].state |= EP_STATE_ALLOCATED;
|
||||||
|
|
||||||
for(i = 0; i < USB_NUM_EPS; i++) {
|
for(i = 0; i < USB_NUM_EPS; i++) {
|
||||||
/*
|
|
||||||
* LS: 8 (control), no bulk available
|
|
||||||
* FS: 64 (control), 64 (bulk)
|
|
||||||
* HS: 64 (control), 512 (bulk)
|
|
||||||
* TODO: switch depending on speed.
|
|
||||||
*/
|
|
||||||
int mps = i == 0 ? 64 : 512;
|
|
||||||
|
|
||||||
if (init) {
|
if (init) {
|
||||||
endpoints[i][0].state = 0;
|
endpoints[i][0].state = 0;
|
||||||
wakeup_init(&endpoints[i][0].complete);
|
wakeup_init(&endpoints[i][0].complete);
|
||||||
|
|
@ -395,7 +388,7 @@ int usb_drv_recv(int ep, void *ptr, int len)
|
||||||
endpoints[ep][1].rc = -1;
|
endpoints[ep][1].rc = -1;
|
||||||
|
|
||||||
/* remove data buffer from cache */
|
/* remove data buffer from cache */
|
||||||
invalidate_dcache();
|
dump_dcache_range(ptr, len);
|
||||||
|
|
||||||
/* DMA setup */
|
/* DMA setup */
|
||||||
uc_desc->status = USB_DMA_DESC_BS_HST_RDY |
|
uc_desc->status = USB_DMA_DESC_BS_HST_RDY |
|
||||||
|
|
@ -446,7 +439,7 @@ void ep_send(int ep, void *ptr, int len)
|
||||||
endpoints[ep][0].rc = -1;
|
endpoints[ep][0].rc = -1;
|
||||||
|
|
||||||
/* Make sure data is committed to memory */
|
/* Make sure data is committed to memory */
|
||||||
clean_dcache();
|
clean_dcache_range(ptr, len);
|
||||||
|
|
||||||
logf("xx%s\n", make_hex(ptr, len));
|
logf("xx%s\n", make_hex(ptr, len));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue