as3525: don't use IRAM for usb, and avoid usb storage using uncached addresses behind our back

No need for special address handling, all addresses are equal to their physical address

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26176 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-05-19 17:56:47 +00:00
parent 0b28594036
commit bae0756acf
3 changed files with 5 additions and 18 deletions

View file

@ -626,19 +626,6 @@ void usb_drv_cancel_all_transfers(void)
restore_irq(flags);
}
static void *virt_to_bus(void *addr)
{
unsigned int x = (long)addr;
x -= (x & 0x40000000) >> 2; /* fix uncached address */
if (x >= IRAM_ORIG) { /* iram address */
x -= IRAM_ORIG;
}
return (void*)x;
}
int usb_drv_recv(int ep, void *ptr, int len)
{
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
@ -664,7 +651,7 @@ int usb_drv_recv(int ep, void *ptr, int len)
uc_desc->status |= USB_DMA_DESC_ZERO_LEN;
uc_desc->data_ptr = 0;
} else {
uc_desc->data_ptr = virt_to_bus(ptr);
uc_desc->data_ptr = ptr;
}
USB_OEP_DESC_PTR(ep) = (int)&dmadescs[ep][1];
USB_OEP_STS(ep) = USB_EP_STAT_OUT_RCVD; /* clear status */
@ -716,7 +703,7 @@ void ep_send(int ep, void *ptr, int len)
if (len == 0)
uc_desc->status |= USB_DMA_DESC_ZERO_LEN;
uc_desc->data_ptr = virt_to_bus(ptr);
uc_desc->data_ptr = ptr;
USB_IEP_DESC_PTR(ep) = (int)&dmadescs[ep][0];
USB_IEP_STS(ep) = 0xffffffff; /* clear status */