forked from len0rd/rockbox
as3525: hide our UNCACHED_ADDR from usb_storage.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26178 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2e188a4dad
commit
6b46cc08ed
5 changed files with 15 additions and 24 deletions
|
|
@ -180,7 +180,7 @@ const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||||
void * pcm_dma_addr(void *addr)
|
void * pcm_dma_addr(void *addr)
|
||||||
{
|
{
|
||||||
if (addr != NULL)
|
if (addr != NULL)
|
||||||
addr = UNCACHED_ADDR(addr);
|
addr = AS3525_UNCACHED_ADDR(addr);
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -271,7 +271,7 @@ static void rec_dma_callback(void)
|
||||||
rec_dma_start_addr += rec_dma_transfer_size;
|
rec_dma_start_addr += rec_dma_transfer_size;
|
||||||
|
|
||||||
/* the 2nd channel is silent when recording microphone on as3525v1 */
|
/* the 2nd channel is silent when recording microphone on as3525v1 */
|
||||||
mono2stereo(UNCACHED_ADDR((int16_t*)rec_dma_start_addr));
|
mono2stereo(AS3525_UNCACHED_ADDR((int16_t*)rec_dma_start_addr));
|
||||||
|
|
||||||
if(!rec_dma_size)
|
if(!rec_dma_size)
|
||||||
{
|
{
|
||||||
|
|
@ -294,7 +294,7 @@ void pcm_rec_dma_record_more(void *start, size_t size)
|
||||||
dump_dcache_range(start, size);
|
dump_dcache_range(start, size);
|
||||||
rec_dma_start_addr = start;
|
rec_dma_start_addr = start;
|
||||||
#if CONFIG_CPU == AS3525
|
#if CONFIG_CPU == AS3525
|
||||||
mono_samples = UNCACHED_ADDR(start);
|
mono_samples = AS3525_UNCACHED_ADDR(start);
|
||||||
#endif
|
#endif
|
||||||
rec_dma_size = size;
|
rec_dma_size = size;
|
||||||
}
|
}
|
||||||
|
|
@ -319,7 +319,7 @@ void pcm_rec_dma_start(void *addr, size_t size)
|
||||||
dump_dcache_range(addr, size);
|
dump_dcache_range(addr, size);
|
||||||
rec_dma_start_addr = addr;
|
rec_dma_start_addr = addr;
|
||||||
#if CONFIG_CPU == AS3525
|
#if CONFIG_CPU == AS3525
|
||||||
mono_samples = UNCACHED_ADDR(addr);
|
mono_samples = AS3525_UNCACHED_ADDR(addr);
|
||||||
#endif
|
#endif
|
||||||
rec_dma_size = size;
|
rec_dma_size = size;
|
||||||
|
|
||||||
|
|
@ -359,7 +359,7 @@ void pcm_rec_dma_init(void)
|
||||||
const void * pcm_rec_dma_get_peak_buffer(void)
|
const void * pcm_rec_dma_get_peak_buffer(void)
|
||||||
{
|
{
|
||||||
pcm_rec_lock();
|
pcm_rec_lock();
|
||||||
int16_t *addr = UNCACHED_ADDR((int16_t *)DMAC_CH_DST_ADDR(1));
|
int16_t *addr = AS3525_UNCACHED_ADDR((int16_t *)DMAC_CH_DST_ADDR(1));
|
||||||
mono2stereo(addr);
|
mono2stereo(addr);
|
||||||
pcm_rec_unlock();
|
pcm_rec_unlock();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ static volatile unsigned int transfer_error[NUM_VOLUMES];
|
||||||
|
|
||||||
#define UNALIGNED_NUM_SECTORS 10
|
#define UNALIGNED_NUM_SECTORS 10
|
||||||
static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SD_BLOCK_SIZE] __attribute__((aligned(32))); /* align on cache line size */
|
static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SD_BLOCK_SIZE] __attribute__((aligned(32))); /* align on cache line size */
|
||||||
static unsigned char *uncached_buffer = UNCACHED_ADDR(&aligned_buffer[0]);
|
static unsigned char *uncached_buffer = AS3525_UNCACHED_ADDR(&aligned_buffer[0]);
|
||||||
|
|
||||||
|
|
||||||
static inline void mci_delay(void) { udelay(1000) ; }
|
static inline void mci_delay(void) { udelay(1000) ; }
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@
|
||||||
|
|
||||||
#define UNALIGNED_NUM_SECTORS 10
|
#define UNALIGNED_NUM_SECTORS 10
|
||||||
static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SD_BLOCK_SIZE] __attribute__((aligned(32))); /* align on cache line size */
|
static unsigned char aligned_buffer[UNALIGNED_NUM_SECTORS* SD_BLOCK_SIZE] __attribute__((aligned(32))); /* align on cache line size */
|
||||||
static unsigned char *uncached_buffer = UNCACHED_ADDR(&aligned_buffer[0]);
|
static unsigned char *uncached_buffer = AS3525_UNCACHED_ADDR(&aligned_buffer[0]);
|
||||||
|
|
||||||
static void init_controller(void);
|
static void init_controller(void);
|
||||||
static int sd_wait_for_state(const int drive, unsigned int state);
|
static int sd_wait_for_state(const int drive, unsigned int state);
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOTLOADER
|
#ifdef BOOTLOADER
|
||||||
#define UNCACHED_ADDR(a) (a)
|
#define AS3525_UNCACHED_ADDR(a) (a)
|
||||||
#else
|
#else
|
||||||
#define UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
|
#define AS3525_UNCACHED_ADDR(a) ((typeof(a)) ((uintptr_t)(a) + 0x10000000))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SANSA_C200V2
|
#ifdef SANSA_C200V2
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ static void usb_phy_resume(void)
|
||||||
|
|
||||||
static void setup_desc_init(struct usb_dev_setup_buf *desc)
|
static void setup_desc_init(struct usb_dev_setup_buf *desc)
|
||||||
{
|
{
|
||||||
struct usb_dev_setup_buf *uc_desc = UNCACHED_ADDR(desc);
|
struct usb_dev_setup_buf *uc_desc = AS3525_UNCACHED_ADDR(desc);
|
||||||
|
|
||||||
uc_desc->status = USB_DMA_DESC_BS_HST_RDY;
|
uc_desc->status = USB_DMA_DESC_BS_HST_RDY;
|
||||||
uc_desc->resv = 0xffffffff;
|
uc_desc->resv = 0xffffffff;
|
||||||
|
|
@ -397,7 +397,7 @@ static void setup_desc_init(struct usb_dev_setup_buf *desc)
|
||||||
static void dma_desc_init(int ep, int dir)
|
static void dma_desc_init(int ep, int dir)
|
||||||
{
|
{
|
||||||
struct usb_dev_dma_desc *desc = &dmadescs[ep][dir];
|
struct usb_dev_dma_desc *desc = &dmadescs[ep][dir];
|
||||||
struct usb_dev_dma_desc *uc_desc = UNCACHED_ADDR(desc);
|
struct usb_dev_dma_desc *uc_desc = AS3525_UNCACHED_ADDR(desc);
|
||||||
|
|
||||||
endpoints[ep][dir].uc_desc = uc_desc;
|
endpoints[ep][dir].uc_desc = uc_desc;
|
||||||
|
|
||||||
|
|
@ -626,15 +626,6 @@ void usb_drv_cancel_all_transfers(void)
|
||||||
restore_irq(flags);
|
restore_irq(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *virt_to_bus(void *addr)
|
|
||||||
{
|
|
||||||
unsigned int x = (long)addr;
|
|
||||||
|
|
||||||
x -= (x & 0x40000000) >> 2; /* fix uncached address */
|
|
||||||
|
|
||||||
return (void*)x;
|
|
||||||
}
|
|
||||||
|
|
||||||
int usb_drv_recv(int ep, void *ptr, int len)
|
int usb_drv_recv(int ep, void *ptr, int len)
|
||||||
{
|
{
|
||||||
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
|
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
|
||||||
|
|
@ -660,7 +651,7 @@ int usb_drv_recv(int ep, void *ptr, int len)
|
||||||
uc_desc->status |= USB_DMA_DESC_ZERO_LEN;
|
uc_desc->status |= USB_DMA_DESC_ZERO_LEN;
|
||||||
uc_desc->data_ptr = 0;
|
uc_desc->data_ptr = 0;
|
||||||
} else {
|
} 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_DESC_PTR(ep) = (int)&dmadescs[ep][1];
|
||||||
USB_OEP_STS(ep) = USB_EP_STAT_OUT_RCVD; /* clear status */
|
USB_OEP_STS(ep) = USB_EP_STAT_OUT_RCVD; /* clear status */
|
||||||
|
|
@ -677,7 +668,7 @@ char *make_hex(char *data, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (!((int)data & 0x40000000))
|
if (!((int)data & 0x40000000))
|
||||||
data = UNCACHED_ADDR(data); /* don't pollute the cache */
|
data = AS3525_UNCACHED_ADDR(data); /* don't pollute the cache */
|
||||||
|
|
||||||
if (len > 512)
|
if (len > 512)
|
||||||
len = 512;
|
len = 512;
|
||||||
|
|
@ -712,7 +703,7 @@ void ep_send(int ep, void *ptr, int len)
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
uc_desc->status |= USB_DMA_DESC_ZERO_LEN;
|
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_DESC_PTR(ep) = (int)&dmadescs[ep][0];
|
||||||
USB_IEP_STS(ep) = 0xffffffff; /* clear status */
|
USB_IEP_STS(ep) = 0xffffffff; /* clear status */
|
||||||
|
|
@ -785,7 +776,7 @@ static void handle_in_ep(int ep)
|
||||||
|
|
||||||
static void handle_out_ep(int ep)
|
static void handle_out_ep(int ep)
|
||||||
{
|
{
|
||||||
struct usb_ctrlrequest *req = (void*)UNCACHED_ADDR(&setup_desc->data1);
|
struct usb_ctrlrequest *req = (void*)AS3525_UNCACHED_ADDR(&setup_desc->data1);
|
||||||
int ep_sts = USB_OEP_STS(ep) & ~USB_OEP_STS_MASK(ep);
|
int ep_sts = USB_OEP_STS(ep) & ~USB_OEP_STS_MASK(ep);
|
||||||
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
|
struct usb_dev_dma_desc *uc_desc = endpoints[ep][1].uc_desc;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue