diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm/usb-target.h')
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/usb-target.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h new file mode 100644 index 0000000000..4e3303911c --- /dev/null +++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Maurus Cuelenaere | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef USB_TARGET_H | ||
21 | #define USB_TARGET_H | ||
22 | |||
23 | #include "dm320.h" | ||
24 | |||
25 | #define ISP1583_IOBASE 0x60FFC000 | ||
26 | #define ISP1583_H_OVERRIDE | ||
27 | |||
28 | #define ISP1583_INIT_ADDRESS (*((volatile unsigned char*)(ISP1583_IOBASE+0x0))) //char | ||
29 | #define ISP1583_INIT_MODE (*((volatile unsigned short*)(ISP1583_IOBASE+0xC*2))) | ||
30 | #define ISP1583_INIT_INTCONF (*((volatile unsigned char*)(ISP1583_IOBASE+0x10*2))) //char | ||
31 | #define ISP1583_INIT_OTG (*((volatile unsigned char*)(ISP1583_IOBASE+0x12*2))) //char | ||
32 | #define ISP1583_INIT_INTEN_A (*((volatile unsigned short*)(ISP1583_IOBASE+0x14*2))) | ||
33 | #define ISP1583_INIT_INTEN_B (*((volatile unsigned short*)(ISP1583_IOBASE+0x14*2+4))) | ||
34 | #define ISP1583_INIT_INTEN_READ (unsigned long)( (ISP1583_INIT_INTEN_A & 0xFFFF) | ((ISP1583_INIT_INTEN_B & 0xFFFF) << 16) ) | ||
35 | /* Data flow registers */ | ||
36 | #define ISP1583_DFLOW_EPINDEX (*((volatile unsigned char*)(ISP1583_IOBASE+0xC2*2))) //char | ||
37 | #define ISP1583_DFLOW_CTRLFUN (*((volatile unsigned char*)(ISP1583_IOBASE+0x28*2))) //char | ||
38 | #define ISP1583_DFLOW_DATA (*((volatile unsigned short*)(ISP1583_IOBASE+0x20*2))) | ||
39 | #define ISP1583_DFLOW_BUFLEN (*((volatile unsigned short*)(ISP1583_IOBASE+0x1C*2))) | ||
40 | #define ISP1583_DFLOW_BUFSTAT (*((volatile unsigned char*)(ISP1583_IOBASE+0x1E*2))) //char | ||
41 | #define ISP1583_DFLOW_MAXPKSZ (*((volatile unsigned short*)(ISP1583_IOBASE+0x04*2))) | ||
42 | #define ISP1583_DFLOW_EPTYPE (*((volatile unsigned short*)(ISP1583_IOBASE+0x08*2))) | ||
43 | /* DMA registers */ | ||
44 | #define ISP1583_DMA_ENDPOINT (*((volatile unsigned char*)(ISP1583_IOBASE+0x58*2))) | ||
45 | /* General registers */ | ||
46 | #define ISP1583_GEN_INT_A (*((volatile unsigned short*)(ISP1583_IOBASE+0x18*2))) | ||
47 | #define ISP1583_GEN_INT_B (*((volatile unsigned short*)(ISP1583_IOBASE+0x18*2+4))) | ||
48 | #define ISP1583_GEN_INT_READ (unsigned long)( (ISP1583_GEN_INT_A & 0xFFFF) | ((ISP1583_GEN_INT_B & 0xFFFF) << 16)) | ||
49 | #define ISP1583_GEN_CHIPID_A (*((volatile unsigned short*)(ISP1583_IOBASE+0x70*2))) | ||
50 | #define ISP1583_GEN_CHIPID_B (*((volatile unsigned char*)(ISP1583_IOBASE+0x70*2+4))) //char | ||
51 | #define ISP1583_GEN_CHIPID (unsigned long)( (ISP1583_GEN_CHIPID_A & 0xFFFF) | ((ISP1583_GEN_CHIPID_B & 0xFFFF) << 16) ) | ||
52 | #define ISP1583_GEN_FRAMEN0 (*((volatile unsigned short*)(ISP1583_IOBASE+0x74*2))) | ||
53 | #define ISP1583_GEN_SCRATCH (*((volatile unsigned short*)(ISP1583_IOBASE+0x78*2))) | ||
54 | #define ISP1583_GEN_UNLCKDEV (*((volatile unsigned short*)(ISP1583_IOBASE+0x7C*2))) | ||
55 | #define ISP1583_GEN_TSTMOD (*((volatile unsigned char*)(ISP1583_IOBASE+0x84*2))) //char | ||
56 | |||
57 | #define EN_INT_CPU_TARGET IO_INTC_EINT1 |= INTR_EINT1_EXT7 | ||
58 | #define DIS_INT_CPU_TARGET IO_INTC_EINT1 &= ~INTR_EINT1_EXT7 | ||
59 | #define INT_CONF_TARGET 0 | ||
60 | //#define INT_CONF_TARGET 2 | ||
61 | #define set_int_value(a,b,value) a = value & 0xFFFF; \ | ||
62 | b = value >> 16; | ||
63 | |||
64 | |||
65 | #define ZVM_SPECIFIC asm volatile( \ | ||
66 | "LDR R12, =0x50FFC000\n" \ | ||
67 | "LDRH R12, [R12]\n" \ | ||
68 | : : : "r12") | ||
69 | //#define ZVM_SPECIFIC | ||
70 | |||
71 | #include "kernel.h" | ||
72 | int usb_detect(void); | ||
73 | void usb_init_device(void); | ||
74 | bool usb_drv_connected(void); | ||
75 | |||
76 | #endif | ||