summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-18 05:07:00 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-18 05:07:00 +0000
commit8260a79689892854abfdd493592ba04387c2f4b8 (patch)
treecc6b1417a53d8099115579814c335ae80d9242d4
parentfe47966f0e06c14fa0b82325c1eee029a0be827a (diff)
downloadrockbox-8260a79689892854abfdd493592ba04387c2f4b8.tar.gz
rockbox-8260a79689892854abfdd493592ba04387c2f4b8.zip
Avoid ifdefs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26908 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525.c26
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525.h6
2 files changed, 16 insertions, 16 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525.c b/firmware/target/arm/as3525/usb-drv-as3525.c
index a5a3689403..e90bc04aee 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525.c
@@ -395,10 +395,10 @@ int usb_drv_recv(int ep, void *ptr, int len)
395 endpoints[ep][1].len = len; 395 endpoints[ep][1].len = len;
396 endpoints[ep][1].rc = -1; 396 endpoints[ep][1].rc = -1;
397 397
398#ifndef BOOTLOADER
399 /* remove data buffer from cache */ 398 /* remove data buffer from cache */
400 invalidate_dcache(); 399 if (!is_bootloader()) /* bootloader is running uncached */
401#endif 400 invalidate_dcache();
401
402 /* DMA setup */ 402 /* DMA setup */
403 uc_desc->status = USB_DMA_DESC_BS_HST_RDY | 403 uc_desc->status = USB_DMA_DESC_BS_HST_RDY |
404 USB_DMA_DESC_LAST | 404 USB_DMA_DESC_LAST |
@@ -447,10 +447,9 @@ void ep_send(int ep, void *ptr, int len)
447 endpoints[ep][0].len = len; 447 endpoints[ep][0].len = len;
448 endpoints[ep][0].rc = -1; 448 endpoints[ep][0].rc = -1;
449 449
450#ifndef BOOTLOADER
451 /* Make sure data is committed to memory */ 450 /* Make sure data is committed to memory */
452 clean_dcache(); 451 if (!is_bootloader()) /* bootloader is running uncached */
453#endif 452 clean_dcache();
454 453
455 logf("xx%s\n", make_hex(ptr, len)); 454 logf("xx%s\n", make_hex(ptr, len));
456 455
@@ -549,21 +548,16 @@ static void handle_out_ep(int ep)
549 if (ep_sts & USB_EP_STAT_OUT_RCVD) { 548 if (ep_sts & USB_EP_STAT_OUT_RCVD) {
550 int dma_sts = uc_desc->status; 549 int dma_sts = uc_desc->status;
551 int dma_len = dma_sts & 0xffff; 550 int dma_len = dma_sts & 0xffff;
552#ifdef LOGF_ENABLE
553 int dma_frm = (dma_sts >> 16) & 0x7ff;
554 int dma_mst = dma_sts & 0xf8000000;
555#endif
556 551
557 if (!(dma_sts & USB_DMA_DESC_ZERO_LEN)) { 552 if (!(dma_sts & USB_DMA_DESC_ZERO_LEN)) {
558 logf("EP%d OUT token, st:%08x len:%d frm:%x data=%s epstate=%d\n", ep, 553 logf("EP%d OUT token, st:%08x len:%d frm:%x data=%s epstate=%d\n",
559 dma_mst, dma_len, dma_frm, make_hex(uc_desc->data_ptr, dma_len), 554 ep, dma_sts & 0xf8000000, dma_len, (dma_sts >> 16) & 0x7ff,
560 endpoints[ep][1].state); 555 make_hex(uc_desc->data_ptr, dma_len), endpoints[ep][1].state);
561#ifndef BOOTLOADER
562 /* 556 /*
563 * If parts of the just dmaed range are in cache, dump them now. 557 * If parts of the just dmaed range are in cache, dump them now.
564 */ 558 */
565 dump_dcache_range(uc_desc->data_ptr, dma_len); 559 if (!is_bootloader()) /* bootloader is running uncached */
566#endif 560 dump_dcache_range(uc_desc->data_ptr, dma_len);
567 } else{ 561 } else{
568 logf("EP%d OUT token, st:%08x frm:%x (no data)\n", ep, 562 logf("EP%d OUT token, st:%08x frm:%x (no data)\n", ep,
569 dma_mst, dma_frm); 563 dma_mst, dma_frm);
diff --git a/firmware/target/arm/as3525/usb-drv-as3525.h b/firmware/target/arm/as3525/usb-drv-as3525.h
index 3a434170d7..f579638cfb 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525.h
+++ b/firmware/target/arm/as3525/usb-drv-as3525.h
@@ -23,6 +23,12 @@
23 23
24#include "as3525.h" 24#include "as3525.h"
25 25
26#ifdef BOOTLOADER
27#define is_bootloader() 1
28#else
29#define is_bootloader() 0
30#endif /* BOOTLOADER */
31
26#define USB_NUM_EPS 4 32#define USB_NUM_EPS 4
27 33
28typedef struct { 34typedef struct {