summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-21 12:50:06 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-11-21 12:50:06 +0000
commitc0b43a5ac2fcda473800b9c9a4036c5348ac5084 (patch)
tree0fdf827d5f65e26da35341c4a67a006e36ca5dc2 /firmware/target/mips/ingenic_jz47xx
parent0a61b71f73556592af6e1f127a42a27d48564b72 (diff)
downloadrockbox-c0b43a5ac2fcda473800b9c9a4036c5348ac5084.tar.gz
rockbox-c0b43a5ac2fcda473800b9c9a4036c5348ac5084.zip
Commit some USB and ATA rework/refactoring (+ USB GPIO detection).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19165 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-jz4740.c6
-rw-r--r--firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c44
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h (renamed from firmware/target/mips/ingenic_jz47xx/ata-sd-target.h)22
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c3
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h (renamed from firmware/target/mips/ingenic_jz47xx/usb-target.h)25
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/ata-sd-target.h55
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h48
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c49
8 files changed, 205 insertions, 47 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
index dd14a4c651..4c177d8ded 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/ata-jz4740.c
@@ -32,7 +32,7 @@ int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* bu
32 case 0: 32 case 0:
33 return nand_read_sectors(start, count, buf); 33 return nand_read_sectors(start, count, buf);
34 case 1: 34 case 1:
35 return sd_read_sectors(start, count, buf); 35 return _sd_read_sectors(start, count, buf);
36 default: 36 default:
37 panicf("ata_read_sectors: Drive %d unhandled!", drive); 37 panicf("ata_read_sectors: Drive %d unhandled!", drive);
38 return -1; 38 return -1;
@@ -46,7 +46,7 @@ int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const v
46 case 0: 46 case 0:
47 return nand_write_sectors(start, count, buf); 47 return nand_write_sectors(start, count, buf);
48 case 1: 48 case 1:
49 return sd_write_sectors(start, count, buf); 49 return _sd_write_sectors(start, count, buf);
50 default: 50 default:
51 panicf("ata_write_sectors: Drive %d unhandled!", drive); 51 panicf("ata_write_sectors: Drive %d unhandled!", drive);
52 return -1; 52 return -1;
@@ -55,7 +55,7 @@ int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const v
55 55
56int ata_init(void) 56int ata_init(void)
57{ 57{
58 if(sd_init() != 0) 58 if(_sd_init() != 0)
59 return -1; 59 return -1;
60 if(nand_init() != 0) 60 if(nand_init() != 0)
61 return -2; 61 return -2;
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
index ccd71630a6..22e274b4d1 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/ata-sd-jz4740.c
@@ -23,6 +23,7 @@
23#include "jz4740.h" 23#include "jz4740.h"
24#include "ata.h" 24#include "ata.h"
25#include "ata-sd-target.h" 25#include "ata-sd-target.h"
26#include "sd.h"
26#include "system.h" 27#include "system.h"
27#include "kernel.h" 28#include "kernel.h"
28#include "panic.h" 29#include "panic.h"
@@ -36,10 +37,7 @@ static struct wakeup sd_wakeup;
36//#define DEBUG(x...) DEBUGF(x); 37//#define DEBUG(x...) DEBUGF(x);
37#define DEBUG(x...) printf(x); 38#define DEBUG(x...) printf(x);
38 39
39#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */ 40#ifdef MMC_POWER_PIN
40#define MMC_POWER_PIN (30 + 1 * 32) /* Pin to enable/disable card power */
41//#define MMC_PW_PIN (14 + 3 * 32) /* Pin to check protect card */
42
43#define MMC_POWER_OFF() \ 41#define MMC_POWER_OFF() \
44do { \ 42do { \
45 __gpio_set_pin(MMC_POWER_PIN); \ 43 __gpio_set_pin(MMC_POWER_PIN); \
@@ -49,8 +47,11 @@ do { \
49do { \ 47do { \
50 __gpio_clear_pin(MMC_POWER_PIN); \ 48 __gpio_clear_pin(MMC_POWER_PIN); \
51} while (0) 49} while (0)
50#endif
52 51
52#ifdef MMC_CD_PIN
53#define MMC_INSERT_STATUS() __gpio_get_pin(MMC_CD_PIN) 53#define MMC_INSERT_STATUS() __gpio_get_pin(MMC_CD_PIN)
54#endif
54 55
55#define MMC_RESET() __msc_reset() 56#define MMC_RESET() __msc_reset()
56 57
@@ -60,24 +61,6 @@ do { \
60 REG_MSC_IREG = 0xffff; \ 61 REG_MSC_IREG = 0xffff; \
61} while (0) 62} while (0)
62 63
63static inline void mmc_init_gpio(void)
64{
65 __gpio_as_msc();
66#ifdef MMC_POWER_PIN
67 __gpio_as_output(MMC_POWER_PIN);
68 __gpio_disable_pull(MMC_POWER_PIN);
69 __gpio_set_pin(MMC_POWER_PIN);
70#endif
71#ifdef MMC_CD_PIN
72 __gpio_as_input(MMC_CD_PIN);
73 __gpio_disable_pull(MMC_CD_PIN);
74#endif
75#ifdef MMC_PW_PIN
76 __gpio_as_input(MMC_PW_PIN);
77 __gpio_disable_pull(MMC_PW_PIN);
78#endif
79}
80
81/* Error codes */ 64/* Error codes */
82enum mmc_result_t 65enum mmc_result_t
83{ 66{
@@ -509,7 +492,7 @@ static void jz_mmc_get_response(struct mmc_request *request)
509 buf[i] = (data >> 8) & 0xff; 492 buf[i] = (data >> 8) & 0xff;
510 buf[i + 1] = data & 0xff; 493 buf[i + 1] = data & 0xff;
511 } 494 }
512 DEBUG("request %d, response [", request->rtype); 495 DEBUG("request %d, response []", request->rtype);
513 break; 496 break;
514 } 497 }
515 case RESPONSE_NONE: 498 case RESPONSE_NONE:
@@ -768,12 +751,14 @@ static int jz_mmc_exec_cmd(struct mmc_request *request)
768 /* On reset, stop MMC clock */ 751 /* On reset, stop MMC clock */
769 jz_mmc_stop_clock(); 752 jz_mmc_stop_clock();
770 } 753 }
754#if 0
771 if (request->cmd == MMC_SEND_OP_COND) 755 if (request->cmd == MMC_SEND_OP_COND)
772 { 756 {
773 DEBUG("Have a MMC card"); 757 DEBUG("Have a MMC card");
774 /* always use 1bit for MMC */ 758 /* always use 1bit for MMC */
775 use_4bit = 0; 759 use_4bit = 0;
776 } 760 }
761#endif
777 if (request->cmd == SET_BUS_WIDTH) 762 if (request->cmd == SET_BUS_WIDTH)
778 { 763 {
779 if (request->arg == 0x2) 764 if (request->arg == 0x2)
@@ -1070,13 +1055,16 @@ void MSC(void)
1070static void jz_mmc_hardware_init(void) 1055static void jz_mmc_hardware_init(void)
1071{ 1056{
1072 mmc_init_gpio(); /* init GPIO */ 1057 mmc_init_gpio(); /* init GPIO */
1058#ifdef MMC_POWER_ON
1073 MMC_POWER_ON(); /* turn on power of card */ 1059 MMC_POWER_ON(); /* turn on power of card */
1060#endif
1074 MMC_RESET(); /* reset mmc/sd controller */ 1061 MMC_RESET(); /* reset mmc/sd controller */
1075 MMC_IRQ_MASK(); /* mask all IRQs */ 1062 MMC_IRQ_MASK(); /* mask all IRQs */
1076 jz_mmc_stop_clock(); /* stop MMC/SD clock */ 1063 jz_mmc_stop_clock(); /* stop MMC/SD clock */
1064 __cpm_start_msc();
1077#ifdef MMC_DMA_ENABLE 1065#ifdef MMC_DMA_ENABLE
1078 __cpm_start_dmac(); 1066// __cpm_start_dmac();
1079 __dmac_enable_module(); 1067// __dmac_enable_module();
1080// REG_DMAC_DMACR = DMAC_DMACR_DME; 1068// REG_DMAC_DMACR = DMAC_DMACR_DME;
1081#if MMC_DMA_INTERRUPT 1069#if MMC_DMA_INTERRUPT
1082 mmc_dma_rx_sem = OSSemCreate(0); 1070 mmc_dma_rx_sem = OSSemCreate(0);
@@ -1105,7 +1093,7 @@ static void mmc_send_cmd(struct mmc_request *request, int cmd, unsigned int arg,
1105} 1093}
1106 1094
1107static bool inited = false; 1095static bool inited = false;
1108int sd_init(void) 1096int _sd_init(void)
1109{ 1097{
1110 if(!inited) 1098 if(!inited)
1111 { 1099 {
@@ -1150,7 +1138,7 @@ tCardInfo* card_get_info_target(int card_no)
1150} 1138}
1151 1139
1152/* TODO */ 1140/* TODO */
1153int sd_read_sectors(unsigned long start, int count, void* buf) 1141int _sd_read_sectors(unsigned long start, int count, void* buf)
1154{ 1142{
1155 (void)start; 1143 (void)start;
1156 (void)count; 1144 (void)count;
@@ -1159,7 +1147,7 @@ int sd_read_sectors(unsigned long start, int count, void* buf)
1159} 1147}
1160 1148
1161/* TODO */ 1149/* TODO */
1162int sd_write_sectors(unsigned long start, int count, const void* buf) 1150int _sd_write_sectors(unsigned long start, int count, const void* buf)
1163{ 1151{
1164 (void)start; 1152 (void)start;
1165 (void)count; 1153 (void)count;
diff --git a/firmware/target/mips/ingenic_jz47xx/ata-sd-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h
index f788fd6a41..cc6bd8a773 100644
--- a/firmware/target/mips/ingenic_jz47xx/ata-sd-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/ata-sd-target.h
@@ -18,11 +18,13 @@
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21
21#ifndef ATA_SD_TARGET_H 22#ifndef ATA_SD_TARGET_H
22#define ATA_SD_TARGET_H 23#define ATA_SD_TARGET_H
23 24
24#include "inttypes.h" 25#include "inttypes.h"
25#include "hotswap.h" 26#include "hotswap.h"
27#include "jz4740.h"
26 28
27tCardInfo *card_get_info_target(int card_no); 29tCardInfo *card_get_info_target(int card_no);
28bool card_detect_target(void); 30bool card_detect_target(void);
@@ -32,8 +34,22 @@ void card_enable_monitoring_target(bool on);
32void microsd_int(void); /* ??? */ 34void microsd_int(void); /* ??? */
33#endif 35#endif
34 36
35int sd_read_sectors(unsigned long start, int count, void* buf); 37int _sd_read_sectors(unsigned long start, int count, void* buf);
36int sd_write_sectors(unsigned long start, int count, const void* buf); 38int _sd_write_sectors(unsigned long start, int count, const void* buf);
37int sd_init(void); 39int _sd_init(void);
40
41#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */
42//#define MMC_POWER_PIN (30 + 1 * 32) /* Pin to enable/disable card power */
43//#define MMC_PW_PIN (14 + 3 * 32) /* Pin to check protect card */
44
45static inline void mmc_init_gpio(void)
46{
47 __gpio_as_msc();
48 __gpio_as_input(MMC_CD_PIN);
49 __gpio_enable_pull(32*3+29);
50 __gpio_enable_pull(32*3+10);
51 __gpio_enable_pull(32*3+11);
52 __gpio_enable_pull(32*3+12);
53}
38 54
39#endif 55#endif
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c
index 598fa1a0eb..501a90551e 100644
--- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/backlight-onda_vx747.c
@@ -23,8 +23,7 @@
23#include "jz4740.h" 23#include "jz4740.h"
24#include "backlight-target.h" 24#include "backlight-target.h"
25 25
26#define GPIO_PWM (32*3)+31 26#define PWM_CHN 7 /* PWM_CHN7 == GPIO(32*3 + 31) */
27#define PWM_CHN 7
28#define __gpio_as_PWM_CHN __gpio_as_pwm7 27#define __gpio_as_PWM_CHN __gpio_as_pwm7
29 28
30static void set_backlight(int val) 29static void set_backlight(int val)
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h
index ec700de892..c681bdaa12 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-target.h
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/usb-target.h
@@ -19,7 +19,30 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include <stdbool.h> 22#ifndef __USB_TARGET_H
23#define __USB_TARGET_H
24
25#include "config.h"
26
27#define __gpio_as_usb_detect() \
28do { \
29 REG_GPIO_PXFUNS(3) = 0x10000000; \
30 REG_GPIO_PXSELS(3) = 0x10000000; \
31 REG_GPIO_PXPES(3) = 0x10000000; \
32} while (0)
33
34#define GPIO_UDC_DETE (32 * 3 + 28)
35#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
36
37static inline void usb_init_gpio(void)
38{
39 __gpio_as_usb_detect();
40 system_enable_irq(IRQ_UDC);
41 __gpio_as_input(GPIO_UDC_DETE);
42}
43
23int usb_detect(void); 44int usb_detect(void);
24void usb_init_device(void); 45void usb_init_device(void);
25bool usb_drv_connected(void); 46bool usb_drv_connected(void);
47
48#endif
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/ata-sd-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx767/ata-sd-target.h
new file mode 100644
index 0000000000..cc6bd8a773
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/ata-sd-target.h
@@ -0,0 +1,55 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Maurus Cuelenaere
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef ATA_SD_TARGET_H
23#define ATA_SD_TARGET_H
24
25#include "inttypes.h"
26#include "hotswap.h"
27#include "jz4740.h"
28
29tCardInfo *card_get_info_target(int card_no);
30bool card_detect_target(void);
31
32#ifdef HAVE_HOTSWAP
33void card_enable_monitoring_target(bool on);
34void microsd_int(void); /* ??? */
35#endif
36
37int _sd_read_sectors(unsigned long start, int count, void* buf);
38int _sd_write_sectors(unsigned long start, int count, const void* buf);
39int _sd_init(void);
40
41#define MMC_CD_PIN (29 + 1 * 32) /* Pin to check card insertion */
42//#define MMC_POWER_PIN (30 + 1 * 32) /* Pin to enable/disable card power */
43//#define MMC_PW_PIN (14 + 3 * 32) /* Pin to check protect card */
44
45static inline void mmc_init_gpio(void)
46{
47 __gpio_as_msc();
48 __gpio_as_input(MMC_CD_PIN);
49 __gpio_enable_pull(32*3+29);
50 __gpio_enable_pull(32*3+10);
51 __gpio_enable_pull(32*3+11);
52 __gpio_enable_pull(32*3+12);
53}
54
55#endif
diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h b/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h
new file mode 100644
index 0000000000..c681bdaa12
--- /dev/null
+++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/usb-target.h
@@ -0,0 +1,48 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by Maurus Cuelenaere
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef __USB_TARGET_H
23#define __USB_TARGET_H
24
25#include "config.h"
26
27#define __gpio_as_usb_detect() \
28do { \
29 REG_GPIO_PXFUNS(3) = 0x10000000; \
30 REG_GPIO_PXSELS(3) = 0x10000000; \
31 REG_GPIO_PXPES(3) = 0x10000000; \
32} while (0)
33
34#define GPIO_UDC_DETE (32 * 3 + 28)
35#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
36
37static inline void usb_init_gpio(void)
38{
39 __gpio_as_usb_detect();
40 system_enable_irq(IRQ_UDC);
41 __gpio_as_input(GPIO_UDC_DETE);
42}
43
44int usb_detect(void);
45void usb_init_device(void);
46bool usb_drv_connected(void);
47
48#endif
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index 7cefdadbe3..f0b4eb4694 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -25,6 +25,7 @@
25#include "usb_ch9.h" 25#include "usb_ch9.h"
26#include "usb_drv.h" 26#include "usb_drv.h"
27#include "usb_core.h" 27#include "usb_core.h"
28#include "usb-target.h"
28#include "jz4740.h" 29#include "jz4740.h"
29#include "thread.h" 30#include "thread.h"
30 31
@@ -33,10 +34,6 @@
33#define EP1_INTR_BIT 2 34#define EP1_INTR_BIT 2
34#define EP_FIFO_NOEMPTY 2 35#define EP_FIFO_NOEMPTY 2
35 36
36#define GPIO_UDC_DETE_PIN (32 * 3 + 6)
37#define GPIO_UDC_DETE GPIO_UDC_DETE_PIN
38#define IRQ_GPIO_UDC_DETE (IRQ_GPIO_0 + GPIO_UDC_DETE)
39
40#define IS_CACHE(x) (x < 0xa0000000) 37#define IS_CACHE(x) (x < 0xa0000000)
41 38
42#define USB_EP0_IDLE 0 39#define USB_EP0_IDLE 0
@@ -81,7 +78,7 @@ static inline void select_endpoint(int ep)
81} 78}
82 79
83static void readFIFO(struct usb_endpoint *ep, unsigned int size) 80static void readFIFO(struct usb_endpoint *ep, unsigned int size)
84{ 81{
85 unsigned int *d = (unsigned int *)ep->ptr; 82 unsigned int *d = (unsigned int *)ep->ptr;
86 unsigned int s; 83 unsigned int s;
87 s = (size + 3) >> 2; 84 s = (size + 3) >> 2;
@@ -90,7 +87,7 @@ static void readFIFO(struct usb_endpoint *ep, unsigned int size)
90} 87}
91 88
92static void writeFIFO(struct usb_endpoint *ep, unsigned int size) 89static void writeFIFO(struct usb_endpoint *ep, unsigned int size)
93{ 90{
94 unsigned int *d = (unsigned int *)ep->ptr; 91 unsigned int *d = (unsigned int *)ep->ptr;
95 unsigned char *c; 92 unsigned char *c;
96 int s, q; 93 int s, q;
@@ -359,7 +356,7 @@ bool usb_drv_connected(void)
359 356
360int usb_detect(void) 357int usb_detect(void)
361{ 358{
362 if(__gpio_get_pin(GPIO_UDC_DETE) == 1) 359 if(usb_drv_connected())
363 return USB_INSERTED; 360 return USB_INSERTED;
364 else 361 else
365 return USB_EXTRACTED; 362 return USB_EXTRACTED;
@@ -367,9 +364,7 @@ int usb_detect(void)
367 364
368void usb_init_device(void) 365void usb_init_device(void)
369{ 366{
370 system_enable_irq(IRQ_UDC); 367 usb_init_gpio();
371 __gpio_as_input(GPIO_UDC_DETE_PIN);
372 return;
373} 368}
374 369
375void usb_enable(bool on) 370void usb_enable(bool on)
@@ -442,6 +437,40 @@ void usb_drv_set_address(int address)
442 REG_USB_REG_FADDR = address; 437 REG_USB_REG_FADDR = address;
443} 438}
444 439
440int usb_drv_send(int endpoint, void* ptr, int length)
441{
442 return 0;
443}
444
445int usb_drv_recv(int endpoint, void* ptr, int length)
446{
447 return 0;
448}
449
450void usb_drv_set_test_mode(int mode)
451{
452
453}
454
455int usb_drv_port_speed(void)
456{
457 return ((REG_USB_REG_POWER & USB_POWER_HSMODE) != 0) ? 1 : 0;
458}
459
460void usb_drv_cancel_all_transfers(void)
461{
462 int i;
463 for(i=0; i<5; i++)
464 {
465 endpoints[i].ptr = endpoints[i].buf;
466 endpoints[i].length = 0;
467 }
468}
469
470void usb_drv_release_endpoint(int ep)
471{
472
473}
445 474
446#else 475#else
447 476