summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-06-08 00:19:16 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-06-08 00:19:16 +0000
commit4a483bb1bf69a0f0a1bf99aaa9bb47c6f79ab990 (patch)
tree974333299e937024bcd8b34ab998ceb137011d56 /firmware/export
parentf8a861961582c2809a8267ad0918d9c74072a440 (diff)
downloadrockbox-4a483bb1bf69a0f0a1bf99aaa9bb47c6f79ab990.tar.gz
rockbox-4a483bb1bf69a0f0a1bf99aaa9bb47c6f79ab990.zip
M:Robe 500: Mostly complete USB driver, supports BULK mode currently and gets about 2 MB/s writes vs 1.1 MB/s on the OF. Mostly tested against Linux, preliminary testing in Windows appears to work. There is currently a bug in the attach process where it only works once per boot that needs to be fixed. There are a few other minor M:Robe 500 changes as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21208 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config-mrobe500.h16
-rw-r--r--firmware/export/config.h3
-rw-r--r--firmware/export/m66591.h102
3 files changed, 120 insertions, 1 deletions
diff --git a/firmware/export/config-mrobe500.h b/firmware/export/config-mrobe500.h
index f9e8d9ebf6..619e3fe8e7 100644
--- a/firmware/export/config-mrobe500.h
+++ b/firmware/export/config-mrobe500.h
@@ -35,6 +35,9 @@
35/* define this if you use an ATA controller */ 35/* define this if you use an ATA controller */
36#define CONFIG_STORAGE STORAGE_ATA 36#define CONFIG_STORAGE STORAGE_ATA
37 37
38/* Define this to add support for ATA DMA */
39//#define HAVE_ATA_DMA
40
38/* define this if you have a bitmap LCD display */ 41/* define this if you have a bitmap LCD display */
39#define HAVE_LCD_BITMAP 42#define HAVE_LCD_BITMAP
40 43
@@ -114,6 +117,19 @@
114#define HAVE_TOUCHSCREEN 117#define HAVE_TOUCHSCREEN
115#define HAVE_BUTTON_DATA 118#define HAVE_BUTTON_DATA
116 119
120/* M66591 register base */
121#define M66591_BASE 0x60000000
122
123/* enable these for the usb stack */
124#define CONFIG_USBOTG USBOTG_M66591
125#define USE_ROCKBOX_USB
126#define HAVE_USBSTACK
127#define USB_STORAGE
128/* usb stack and driver settings */
129#define USB_NUM_ENDPOINTS 7
130#define USB_VENDOR_ID 0x07b4
131#define USB_PRODUCT_ID 0x0281
132
117/* define this if the target has volume keys which can be used in the lists */ 133/* define this if the target has volume keys which can be used in the lists */
118#define HAVE_VOLUME_IN_LIST 134#define HAVE_VOLUME_IN_LIST
119 135
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 5cdf46dcfd..696c923bb6 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -250,6 +250,7 @@ Lyre prototype 1*/
250#define RTC_JZ47XX 16 /* Ingenic Jz47XX */ 250#define RTC_JZ47XX 16 /* Ingenic Jz47XX */
251 251
252/* USB On-the-go */ 252/* USB On-the-go */
253#define USBOTG_M66591 6591 /* M:Robe 500 */
253#define USBOTG_ISP1362 1362 /* iriver H300 */ 254#define USBOTG_ISP1362 1362 /* iriver H300 */
254#define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */ 255#define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
255#define USBOTG_M5636 5636 /* iAudio X5 */ 256#define USBOTG_M5636 5636 /* iAudio X5 */
@@ -775,7 +776,7 @@ Lyre prototype 1*/
775#elif CONFIG_USBOTG == USBOTG_JZ4740 776#elif CONFIG_USBOTG == USBOTG_JZ4740
776#define USB_HAS_BULK 777#define USB_HAS_BULK
777#define USB_HAS_INTERRUPT 778#define USB_HAS_INTERRUPT
778#elif defined(CPU_TCC780X) || defined(CPU_TCC77X) 779#elif defined(CPU_TCC780X) || defined(CPU_TCC77X) || defined(MROBE_500)
779#define USB_HAS_BULK 780#define USB_HAS_BULK
780#endif /* CONFIG_USBOTG */ 781#endif /* CONFIG_USBOTG */
781 782
diff --git a/firmware/export/m66591.h b/firmware/export/m66591.h
new file mode 100644
index 0000000000..db7776e45f
--- /dev/null
+++ b/firmware/export/m66591.h
@@ -0,0 +1,102 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: $
9 *
10 * Copyright (C) 2009 by Karl Kurbjun
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#include "config.h"
23
24#define M66591_REG(addr) (*(volatile unsigned short *) \
25 ((unsigned char *) M66591_BASE + (addr)) )
26
27/* Interrupt handler routine, visible for target handler */
28void USB_DEVICE(void);
29
30/* Register offsets */
31#define M66591_TRN_CTRL M66591_REG(0x00) /* pg 14 */
32#define M66591_TRN_LNSTAT M66591_REG(0x02) /* pg 16 */
33
34#define M66591_HSFS M66591_REG(0x04) /* pg 17 */
35#define M66591_TESTMODE M66591_REG(0x06) /* pg 18 */
36
37#define M66591_PIN_CFG0 M66591_REG(0x08) /* pg 19 */
38#define M66591_PIN_CFG1 M66591_REG(0x0A) /* pg 20 */
39#define M66591_PIN_CFG2 M66591_REG(0x0C) /* pg 21 */
40
41#define M66591_CPORT M66591_REG(0x14) /* pg 23 */
42#define M66591_DPORT M66591_REG(0x18) /* pg 24 */
43
44#define M66591_DCP_CTRLEN M66591_REG(0x26) /* pg 25 */
45
46#define M66591_CPORT_CTRL0 M66591_REG(0x28) /* pg 26 */
47#define M66591_CPORT_CTRL1 M66591_REG(0x2C) /* pg 28 */
48#define M66591_CPORT_CTRL2 M66591_REG(0x2E) /* pg 30 */
49
50#define M66591_DPORT_CTRL0 M66591_REG(0x30) /* pg 31 */
51#define M66591_DPORT_CTRL1 M66591_REG(0x34) /* pg 34 */
52#define M66591_DPORT_CTRL2 M66591_REG(0x36) /* pg 36 */
53
54#define M66591_INTCFG_MAIN M66591_REG(0x40) /* pg 37 */
55#define M66591_INTCFG_OUT M66591_REG(0x42) /* pg 40 */
56#define M66591_INTCFG_RDY M66591_REG(0x44) /* pg 41 */
57#define M66591_INTCFG_NRDY M66591_REG(0x48) /* pg 42 */
58#define M66591_INTCFG_EMP M66591_REG(0x4C) /* pg 43 */
59
60#define M66591_INTSTAT_MAIN M66591_REG(0x60) /* pg 44 */
61#define M66591_INTSTAT_RDY M66591_REG(0x64) /* pg 48 */
62#define M66591_INTSTAT_NRDY M66591_REG(0x68) /* pg 50 */
63#define M66591_INTSTAT_EMP M66591_REG(0x6C) /* pg 53 */
64
65#define M66591_USB_ADDRESS M66591_REG(0x74) /* pg 56 */
66
67#define M66591_USB_REQ0 M66591_REG(0x78) /* pg 57 */
68#define M66591_USB_REQ1 M66591_REG(0x7A) /* pg 58 */
69#define M66591_USB_REQ2 M66591_REG(0x7C) /* pg 59 */
70#define M66591_USB_REQ3 M66591_REG(0x7E) /* pg 60 */
71
72#define M66591_DCP_CNTMD M66591_REG(0x82) /* pg 61 */
73#define M66591_DCP_MXPKSZ M66591_REG(0x84) /* pg 62 */
74#define M66591_DCPCTRL M66591_REG(0x88) /* pg 63 */
75
76#define M66591_PIPE_CFGSEL M66591_REG(0x8C) /* pg 65 */
77#define M66591_PIPE_CFGWND M66591_REG(0x90) /* pg 66 */
78
79#define M66591_PIPECTRL1 M66591_REG(0xA0) /* pg 69 */
80#define M66591_PIPECTRL2 M66591_REG(0xA2) /* pg 69 */
81#define M66591_PIPECTRL3 M66591_REG(0xA4) /* pg 69 */
82#define M66591_PIPECTRL4 M66591_REG(0xA6) /* pg 69 */
83#define M66591_PIPECTRL5 M66591_REG(0xA8) /* pg 71 */
84#define M66591_PIPECTRL6 M66591_REG(0xAA) /* pg 71 */
85
86/* These defines are used for CTRL register handshake setup
87 * They are used on the following registers:
88 * DCPCTRL and PIPECTRL(1-6)
89 */
90#define PIPE_SHAKE_NAK 0x00
91#define PIPE_SHAKE_BUF 0x01
92#define PIPE_SHAKE_STALL 0x02
93
94/* These defines are used for the control transfer stage status */
95#define CTRL_IDLE 0x00 /* Idle Stage */
96#define CTRL_RTDS 0x01 /* Read transfer data stage */
97#define CTRL_RTSS 0x02 /* Read transfer status stage */
98#define CTRL_WTDS 0x03 /* Write transfer data stage */
99#define CTRL_WTSS 0x04 /* Write transfer status stage */
100#define CTRL_WTND 0x05 /* Write transfer no data stage */
101#define CTRL_TRER 0x06 /* Transmit error stage */
102