summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-10-19 14:11:01 +0000
committerDave Chapman <dave@dchapman.com>2008-10-19 14:11:01 +0000
commit08c41d42bb699a1be99c9696b4d4fb7b40e8723a (patch)
tree2834231979d52b81a7860fd4a5e19ed79b3ffee7
parent14ee31865e366dc19fb87caf4877a8d93305a01b (diff)
downloadrockbox-08c41d42bb699a1be99c9696b4d4fb7b40e8723a.tar.gz
rockbox-08c41d42bb699a1be99c9696b4d4fb7b40e8723a.zip
Add e200v2 and m200v2 targets. Move the telechips lcd-ssd1815.c (currently used by Logik DAX and m200v1 ports) driver up in the target tree and share with the m200v2 - as2525 parts contributed by Rafael Carre. Includes the start (but is still very incomplete) of an LCD driver for the e200v2. m200v2 is not yet fully supported by mkamsboot - that will come soon. Also some minor cleanups for the Clip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18836 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/SOURCES2
-rw-r--r--bootloader/sansa_as3525.c4
-rw-r--r--firmware/SOURCES29
-rw-r--r--firmware/export/config-clip.h13
-rw-r--r--firmware/export/config-e200v2.h202
-rw-r--r--firmware/export/config-m200v2.h127
-rw-r--r--firmware/export/config.h7
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/adc-target.h24
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/backlight-target.h37
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c98
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/button-target.h60
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c385
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/system-target.h28
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/timer-target.h38
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/adc-target.h24
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/backlight-target.h37
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/button-m200v2.c43
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/button-target.h54
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/system-target.h28
-rw-r--r--firmware/target/arm/as3525/sansa-m200v2/timer-target.h38
-rw-r--r--firmware/target/arm/lcd-ssd1815.c (renamed from firmware/target/arm/tcc77x/lcd-ssd1815.c)149
-rw-r--r--rbutil/mkamsboot/mkamsboot.c8
-rwxr-xr-xtools/configure42
-rw-r--r--tools/scramble.c4
24 files changed, 1427 insertions, 54 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index f0c98a8bd3..c541efba89 100644
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -39,7 +39,7 @@ meizu_m3.c
39ondavx747.c 39ondavx747.c
40#elif defined(CREATIVE_ZVx) 40#elif defined(CREATIVE_ZVx)
41creativezvm.c 41creativezvm.c
42#elif defined(HAVE_AS3525) 42#elif CONFIG_CPU==AS3525
43sansa_as3525.c 43sansa_as3525.c
44show_logo.c 44show_logo.c
45#endif 45#endif
diff --git a/bootloader/sansa_as3525.c b/bootloader/sansa_as3525.c
index 297fb2e769..b9975a9722 100644
--- a/bootloader/sansa_as3525.c
+++ b/bootloader/sansa_as3525.c
@@ -5,7 +5,7 @@
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * $Id:$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2008 by Rafaël Carré 10 * Copyright (C) 2008 by Rafaël Carré
11 * 11 *
@@ -37,7 +37,9 @@ void main(void)
37 37
38 lcd_update(); 38 lcd_update();
39 39
40#ifdef HAVE_LCD_ENABLE
40 lcd_enable(true); 41 lcd_enable(true);
42#endif
41 43
42 show_logo(); 44 show_logo();
43 45
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 65bb2eb5b5..4407b0e8b9 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -327,10 +327,6 @@ target/arm/pnx0101/system-pnx0101.c
327 327
328#if CONFIG_CPU == AS3525 328#if CONFIG_CPU == AS3525
329target/arm/as3525/system-as3525.c 329target/arm/as3525/system-as3525.c
330#ifdef SANSA_CLIP
331target/arm/as3525/sansa-clip/lcd-ssd1303.c
332target/arm/as3525/sansa-clip/button-clip.c
333#endif
334#endif 330#endif
335 331
336#if defined(CPU_PP) 332#if defined(CPU_PP)
@@ -978,9 +974,9 @@ target/arm/pnx0101/pcm-pnx0101.c
978#ifndef SIMULATOR 974#ifndef SIMULATOR
979drivers/nand_id.c 975drivers/nand_id.c
980target/arm/ata-nand-telechips.c 976target/arm/ata-nand-telechips.c
977target/arm/lcd-ssd1815.c
981target/arm/tcc77x/adc-tcc77x.c 978target/arm/tcc77x/adc-tcc77x.c
982target/arm/tcc77x/kernel-tcc77x.c 979target/arm/tcc77x/kernel-tcc77x.c
983target/arm/tcc77x/lcd-ssd1815.c
984target/arm/tcc77x/powermgmt-tcc77x.c 980target/arm/tcc77x/powermgmt-tcc77x.c
985target/arm/tcc77x/system-tcc77x.c 981target/arm/tcc77x/system-tcc77x.c
986target/arm/tcc77x/timer-tcc77x.c 982target/arm/tcc77x/timer-tcc77x.c
@@ -999,10 +995,10 @@ target/arm/tcc77x/logikdax/audio-logikdax.c
999#ifdef SANSA_M200 995#ifdef SANSA_M200
1000#ifndef SIMULATOR 996#ifndef SIMULATOR
1001drivers/nand_id.c 997drivers/nand_id.c
998target/arm/lcd-ssd1815.c
1002target/arm/ata-nand-telechips.c 999target/arm/ata-nand-telechips.c
1003target/arm/tcc77x/adc-tcc77x.c 1000target/arm/tcc77x/adc-tcc77x.c
1004target/arm/tcc77x/kernel-tcc77x.c 1001target/arm/tcc77x/kernel-tcc77x.c
1005target/arm/tcc77x/lcd-ssd1815.c
1006target/arm/tcc77x/powermgmt-tcc77x.c 1002target/arm/tcc77x/powermgmt-tcc77x.c
1007target/arm/tcc77x/system-tcc77x.c 1003target/arm/tcc77x/system-tcc77x.c
1008target/arm/tcc77x/timer-tcc77x.c 1004target/arm/tcc77x/timer-tcc77x.c
@@ -1038,6 +1034,27 @@ target/arm/pcm-telechips.c
1038#endif /* SIMULATOR */ 1034#endif /* SIMULATOR */
1039#endif /* SANSA_C100 */ 1035#endif /* SANSA_C100 */
1040 1036
1037#ifdef SANSA_CLIP
1038#ifndef SIMULATOR
1039target/arm/as3525/sansa-clip/lcd-ssd1303.c
1040target/arm/as3525/sansa-clip/button-clip.c
1041#endif /* !SIMULATOR */
1042#endif /* SANSA_CLIP */
1043
1044#ifdef SANSA_E200V2
1045#ifndef SIMULATOR
1046target/arm/as3525/sansa-e200v2/lcd-e200v2.c
1047target/arm/as3525/sansa-e200v2/button-e200v2.c
1048#endif /* !SIMULATOR */
1049#endif /* SANSA_E200V2 */
1050
1051#ifdef SANSA_M200V2
1052#ifndef SIMULATOR
1053target/arm/lcd-ssd1815.c
1054target/arm/as3525/sansa-m200v2/button-m200v2.c
1055#endif /* !SIMULATOR */
1056#endif /* SANSA_M200V2 */
1057
1041#ifdef IAUDIO_7 1058#ifdef IAUDIO_7
1042#ifndef SIMULATOR 1059#ifndef SIMULATOR
1043drivers/nand_id.c 1060drivers/nand_id.c
diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h
index 0685e45fd9..d2c2b51d18 100644
--- a/firmware/export/config-clip.h
+++ b/firmware/export/config-clip.h
@@ -4,7 +4,7 @@
4#define TARGET_TREE /* this target is using the target tree system */ 4#define TARGET_TREE /* this target is using the target tree system */
5 5
6/* For Rolo and boot loader */ 6/* For Rolo and boot loader */
7#define MODEL_NUMBER 50 7#define MODEL_NUMBER 40
8#define MODEL_NAME "Sandisk Sansa Clip" 8#define MODEL_NAME "Sandisk Sansa Clip"
9#define FIRMWARE_OFFSET_FILE_DATA 0 9#define FIRMWARE_OFFSET_FILE_DATA 0
10#define FIRMWARE_OFFSET_FILE_CRC 0 10#define FIRMWARE_OFFSET_FILE_CRC 0
@@ -69,11 +69,9 @@
69/* There is no hardware tone control */ 69/* There is no hardware tone control */
70#define HAVE_SW_TONE_CONTROLS 70#define HAVE_SW_TONE_CONTROLS
71 71
72#define HAVE_AS3525
73
74/* define this if you have a real-time clock */ 72/* define this if you have a real-time clock */
75#ifndef BOOTLOADER 73#ifndef BOOTLOADER
76//#define CONFIG_RTC RTC_AS3525 74#define CONFIG_RTC RTC_AS3525
77#endif 75#endif
78 76
79/* Define this if you have a software controlled poweroff */ 77/* Define this if you have a software controlled poweroff */
@@ -148,7 +146,7 @@
148/* enable these for the experimental usb stack */ 146/* enable these for the experimental usb stack */
149#define HAVE_USBSTACK 147#define HAVE_USBSTACK
150#define USB_VENDOR_ID 0x0781 148#define USB_VENDOR_ID 0x0781
151#define USB_PRODUCT_ID 0x7421 149#define USB_PRODUCT_ID 0x7433
152#endif /* BOOTLOADER */ 150#endif /* BOOTLOADER */
153 151
154/* Virtual LED (icon) */ 152/* Virtual LED (icon) */
@@ -157,6 +155,11 @@
157/* Define this if you have adjustable CPU frequency */ 155/* Define this if you have adjustable CPU frequency */
158#define HAVE_ADJUSTABLE_CPU_FREQ 156#define HAVE_ADJUSTABLE_CPU_FREQ
159 157
158#define MI4_FORMAT
159#define BOOTFILE_EXT "sansa"
160#define BOOTFILE "rockbox." BOOTFILE_EXT
161#define BOOTDIR "/.rockbox"
162
160#define ICODE_ATTR_TREMOR_NOT_MDCT 163#define ICODE_ATTR_TREMOR_NOT_MDCT
161 164
162#define INCLUDE_TIMEOUT_API 165#define INCLUDE_TIMEOUT_API
diff --git a/firmware/export/config-e200v2.h b/firmware/export/config-e200v2.h
new file mode 100644
index 0000000000..ac41cd33c4
--- /dev/null
+++ b/firmware/export/config-e200v2.h
@@ -0,0 +1,202 @@
1/*
2 * This config file is for the Sandisk Sansa e200v2
3 */
4#define TARGET_TREE /* this target is using the target tree system */
5
6/* For Rolo and boot loader */
7#define MODEL_NUMBER 41
8#define MODEL_NAME "Sandisk Sansa e200v2 series"
9
10#define HW_SAMPR_CAPS (SAMPR_CAP_44)
11
12/* define this if you have recording possibility */
13#define HAVE_RECORDING
14
15#define REC_SAMPR_CAPS (SAMPR_CAP_22)
16#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
17#define REC_SAMPR_DEFAULT SAMPR_22
18
19/* Define bitmask of input sources - recordable bitmask can be defined
20 explicitly if different */
21#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
22
23/* define this if you have a bitmap LCD display */
24#define HAVE_LCD_BITMAP
25
26/* define this if you have a colour LCD */
27#define HAVE_LCD_COLOR
28
29/* define this if you want album art for this target */
30#define HAVE_ALBUMART
31
32/* define this if you have a light associated with the buttons */
33#define HAVE_BUTTON_LIGHT
34
35/* define this if you have access to the quickscreen */
36#define HAVE_QUICKSCREEN
37
38/* define this if you have access to the pitchscreen */
39#define HAVE_PITCHSCREEN
40
41/* define this if you would like tagcache to build on this target */
42#define HAVE_TAGCACHE
43
44/* LCD dimensions */
45#define LCD_WIDTH 176
46#define LCD_HEIGHT 220
47#define LCD_DEPTH 16 /* 65536 colours */
48#define LCD_PIXELFORMAT RGB565 /* rgb565 */
49
50/* define this if you have LCD enable function */
51#define HAVE_LCD_ENABLE
52
53/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE
54 should be defined as well. */
55#define HAVE_LCD_SLEEP
56#define HAVE_LCD_SLEEP_SETTING
57
58/* define this if you can flip your LCD */
59#define HAVE_LCD_FLIP
60
61/* define this if you can invert the colours on your LCD */
62#define HAVE_LCD_INVERT
63
64/* #define IRAM_LCDFRAMEBUFFER IDATA_ATTR *//* put the lcd frame buffer in IRAM */
65
66#define CONFIG_KEYPAD SANSA_E200_PAD
67
68/* Define this if you do software codec */
69#define CONFIG_CODEC SWCODEC
70/* There is no hardware tone control */
71#define HAVE_SW_TONE_CONTROLS
72
73/* Define this if you have an AMS AS3525 */
74#define HAVE_AS3525
75
76/* define this if you have a real-time clock */
77#ifndef BOOTLOADER
78#define CONFIG_RTC RTC_AS3525
79#endif
80
81/* Define this if you have a software controlled poweroff */
82#define HAVE_SW_POWEROFF
83
84/* Some Sansa E200s seem to be FAT16 formatted */
85#define HAVE_FAT16SUPPORT
86
87/* The number of bytes reserved for loadable codecs */
88#define CODEC_SIZE 0x100000
89
90/* The number of bytes reserved for loadable plugins */
91#define PLUGIN_BUFFER_SIZE 0x80000
92
93#define AB_REPEAT_ENABLE 1
94
95/* FM Tuner */
96/* #define CONFIG_TUNER LV24020LP */
97/* #define HAVE_TUNER_PWR_CTRL */
98
99/* Define this for LCD backlight available */
100#define HAVE_BACKLIGHT
101#define HAVE_BACKLIGHT_BRIGHTNESS
102
103/* define this if the unit uses a scrollwheel for navigation */
104#define HAVE_SCROLLWHEEL
105/* define from which rotation speed [degree/sec] on the acceleration starts */
106#define WHEEL_ACCEL_START 540
107/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */
108#define WHEEL_ACCELERATION 1
109
110/* define this if you have a flash memory storage */
111#define HAVE_FLASH_STORAGE
112
113/* define this if the flash memory uses the SecureDigital Memory Card protocol */
114#define HAVE_ATA_SD
115
116#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */
117#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */
118#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */
119#define BATTERY_CAPACITY_INC 0 /* capacity increment */
120#define BATTERY_TYPES_COUNT 1 /* only one type */
121
122/* Hardware controlled charging? FIXME */
123#define CONFIG_CHARGING CHARGING_SIMPLE
124
125/* define this if the unit can be powered or charged via USB */
126#define HAVE_USB_POWER
127
128/** Non-simulator section **/
129#ifndef SIMULATOR
130
131/* Define this if you have an AMS AS3525*/
132#define CONFIG_CPU AS3525
133
134/* Define this if you want to use the AS2525 i2c interface */
135#define CONFIG_I2C I2C_AS3525
136
137/* define this if the hardware can be powered off while charging */
138/* Sansa can't be powered off while charging */
139/* #define HAVE_POWEROFF_WHILE_CHARGING */
140
141/* The start address index for ROM builds */
142#define ROM_START 0x00000000
143
144/* Define this to the CPU frequency */
145#define CPU_FREQ 75000000
146
147/* Type of LCD TODO: hopefully the same as the x5 but check this*/
148#define CONFIG_LCD LCD_X5
149
150/* Offset ( in the firmware file's header ) to the file CRC and data. These are
151 only used when loading the old format rockbox.e200 file */
152#define FIRMWARE_OFFSET_FILE_CRC 0x0
153#define FIRMWARE_OFFSET_FILE_DATA 0x8
154
155#ifndef BOOTLOADER
156#define HAVE_MULTIVOLUME
157#define HAVE_HOTSWAP
158#endif
159
160/* #define USB_IPODSTYLE */
161
162/* USB On-the-go */
163#define CONFIG_USBOTG USBOTG_AS3525
164
165/* enable these for the experimental usb stack */
166#define HAVE_USBSTACK
167#define USB_VENDOR_ID 0x0781
168#define USB_PRODUCT_ID 0x7423
169
170/* Virtual LED (icon) */
171#define CONFIG_LED LED_VIRTUAL
172
173/* Define this if you have adjustable CPU frequency */
174#define HAVE_ADJUSTABLE_CPU_FREQ
175
176#define MI4_FORMAT
177#define BOOTFILE_EXT "sansa"
178#define BOOTFILE "rockbox." BOOTFILE_EXT
179#define BOOTDIR "/.rockbox"
180
181#define ICODE_ATTR_TREMOR_NOT_MDCT
182
183#define INCLUDE_TIMEOUT_API
184
185#endif /* SIMULATOR */
186
187/** Port-specific settings **/
188
189/* Main LCD backlight brightness range and defaults */
190#define MIN_BRIGHTNESS_SETTING 1
191#define MAX_BRIGHTNESS_SETTING 12
192#define DEFAULT_BRIGHTNESS_SETTING 6
193
194/* Default recording levels */
195#define DEFAULT_REC_MIC_GAIN 23
196#define DEFAULT_REC_LEFT_GAIN 23
197#define DEFAULT_REC_RIGHT_GAIN 23
198
199#ifdef E200R_INSTALLER
200#define IRAMORIG 0x40004000
201#endif
202
diff --git a/firmware/export/config-m200v2.h b/firmware/export/config-m200v2.h
new file mode 100644
index 0000000000..9386a157f6
--- /dev/null
+++ b/firmware/export/config-m200v2.h
@@ -0,0 +1,127 @@
1/*
2 * This config file is for the Sansa M200 series
3 */
4#define TARGET_TREE /* this target is using the target tree system */
5
6/* For Rolo and boot loader */
7#define MODEL_NUMBER 42
8
9#define MODEL_NAME "Sandisk Sansa m200 series"
10
11/* Enable FAT16 support */
12#define HAVE_FAT16SUPPORT
13
14/* define this if you have recording possibility */
15//#define HAVE_RECORDING
16
17/* Define bitmask of input sources - recordable bitmask can be defined
18 explicitly if different */
19//#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
20
21/* define this if you have a bitmap LCD display */
22#define HAVE_LCD_BITMAP
23
24/* define this if you can flip your LCD */
25#define HAVE_LCD_FLIP
26
27/* define this if you can invert the colours on your LCD */
28#define HAVE_LCD_INVERT
29
30/* define this if you have access to the quickscreen */
31#define HAVE_QUICKSCREEN
32/* define this if you have access to the pitchscreen */
33#define HAVE_PITCHSCREEN
34
35/* define this if you would like tagcache to build on this target */
36#define HAVE_TAGCACHE
37
38/* define this if you have a flash memory storage */
39#define HAVE_FLASH_STORAGE
40
41/* LCD dimensions */
42#define LCD_WIDTH 128
43#define LCD_HEIGHT 64
44#define LCD_DEPTH 1
45
46#define LCD_PIXELFORMAT VERTICAL_PACKING
47
48/* define this to indicate your device's keypad */
49#define CONFIG_KEYPAD SANSA_M200_PAD
50
51/* define this if you have a real-time clock */
52#define CONFIG_RTC RTC_AS3525
53
54/* define this if you have RTC RAM available for settings */
55//#define HAVE_RTC_RAM
56
57/* Define this if you have a software controlled poweroff */
58#define HAVE_SW_POWEROFF
59
60/* The number of bytes reserved for loadable codecs */
61#define CODEC_SIZE 0x38000
62
63/* The number of bytes reserved for loadable plugins */
64#define PLUGIN_BUFFER_SIZE 0x10000
65
66#define AB_REPEAT_ENABLE 1
67
68/* Define this if you do software codec */
69#define CONFIG_CODEC SWCODEC
70
71/* Define this if you have the TLV320 audio codec */
72/*#define HAVE_TLV320*/
73
74/* TLV320 has no tone controls, so we use the software ones */
75#define HAVE_SW_TONE_CONTROLS
76
77/* Define this for LCD backlight available */
78#define HAVE_BACKLIGHT
79
80#define CONFIG_I2C I2C_AS3525
81
82#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */
83#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
84#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
85#define BATTERY_CAPACITY_INC 50 /* capacity increment */
86#define BATTERY_TYPES_COUNT 1 /* only one type */
87
88/* define this if the unit should not shut down on low battery. */
89#define NO_LOW_BATTERY_SHUTDOWN
90
91#ifndef SIMULATOR
92
93/* Define this if you have an AMS AS3525 */
94#define CONFIG_CPU AS3525
95
96/* Define this if you have ATA power-off control */
97#define HAVE_ATA_POWER_OFF
98
99/* Define this to the CPU frequency */
100#define CPU_FREQ 120000000
101
102/* Offset ( in the firmware file's header ) to the file CRC */
103#define FIRMWARE_OFFSET_FILE_CRC 0
104
105/* Offset ( in the firmware file's header ) to the real data */
106#define FIRMWARE_OFFSET_FILE_DATA 8
107
108/* Software controlled LED */
109#define CONFIG_LED LED_VIRTUAL
110
111#define CONFIG_LCD LCD_SSD1815
112
113#define BOOTFILE_EXT "sansa"
114#define BOOTFILE "rockbox." BOOTFILE_EXT
115#define BOOTDIR "/"
116
117#define IBSS_ATTR_VOICE_STACK
118#define ICODE_ATTR_TREMOR_NOT_MDCT
119#define ICODE_ATTR_TREMOR_MDCT
120#define ICODE_ATTR_FLAC
121#define IBSS_ATTR_FLAC_DECODED0
122#define ICONST_ATTR_MPA_HUFFMAN
123#define IBSS_ATTR_MPC_SAMPLE_BUF
124#define ICODE_ATTR_ALAC
125#define IBSS_ATTR_SHORTEN_DECODED0
126
127#endif /* SIMULATOR */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 7d36289ff2..73ecca1495 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -173,6 +173,7 @@
173#define I2C_DM320 12 /* DM320 style */ 173#define I2C_DM320 12 /* DM320 style */
174#define I2C_S5L8700 13 174#define I2C_S5L8700 13
175#define I2C_JZ47XX 14 /* Ingenic Jz47XX style */ 175#define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
176#define I2C_AS3525 15
176 177
177/* CONFIG_LED */ 178/* CONFIG_LED */
178#define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */ 179#define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
@@ -199,6 +200,7 @@
199#define RTC_S5L8700 14 200#define RTC_S5L8700 14
200#define RTC_S35390A 15 201#define RTC_S35390A 15
201#define RTC_JZ47XX 16 /* Ingenic Jz47XX */ 202#define RTC_JZ47XX 16 /* Ingenic Jz47XX */
203#define RTC_AS3525 17
202 204
203/* USB On-the-go */ 205/* USB On-the-go */
204#define USBOTG_ISP1362 1362 /* iriver H300 */ 206#define USBOTG_ISP1362 1362 /* iriver H300 */
@@ -206,6 +208,7 @@
206#define USBOTG_M5636 5636 /* iAudio X5 */ 208#define USBOTG_M5636 5636 /* iAudio X5 */
207#define USBOTG_ARC 5020 /* PortalPlayer 502x */ 209#define USBOTG_ARC 5020 /* PortalPlayer 502x */
208#define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */ 210#define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
211#define USBOTG_AS3525 3525 /* AMS AS3525 */
209 212
210/* Multiple cores */ 213/* Multiple cores */
211#define CPU 0 214#define CPU 0
@@ -306,6 +309,10 @@
306#include "config-ondavx767.h" 309#include "config-ondavx767.h"
307#elif defined(SANSA_CLIP) 310#elif defined(SANSA_CLIP)
308#include "config-clip.h" 311#include "config-clip.h"
312#elif defined(SANSA_E200V2)
313#include "config-e200v2.h"
314#elif defined(SANSA_M200V2)
315#include "config-m200v2.h"
309#else 316#else
310/* no known platform */ 317/* no known platform */
311#endif 318#endif
diff --git a/firmware/target/arm/as3525/sansa-e200v2/adc-target.h b/firmware/target/arm/as3525/sansa-e200v2/adc-target.h
new file mode 100644
index 0000000000..bea0272496
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/adc-target.h
@@ -0,0 +1,24 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
new file mode 100644
index 0000000000..9533d0a6b5
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/backlight-target.h
@@ -0,0 +1,37 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24static inline bool _backlight_init(void)
25{
26 return true;
27}
28
29static inline void _backlight_on(void)
30{
31}
32
33static inline void _backlight_off(void)
34{
35}
36
37#endif
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c
new file mode 100644
index 0000000000..fc2715216c
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c
@@ -0,0 +1,98 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
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/* Taken from button-h10.c by Barry Wardell and reverse engineering by MrH. */
23
24#include "system.h"
25#include "button.h"
26#include "backlight.h"
27#include "powermgmt.h"
28
29#define WHEEL_REPEAT_INTERVAL 300000
30#define WHEEL_FAST_ON_INTERVAL 20000
31#define WHEEL_FAST_OFF_INTERVAL 60000
32#define WHEELCLICKS_PER_ROTATION 48 /* wheelclicks per full rotation */
33
34/* Clickwheel */
35#ifndef BOOTLOADER
36static unsigned int old_wheel_value = 0;
37static unsigned int wheel_repeat = BUTTON_NONE;
38static unsigned int wheel_click_count = 0;
39static unsigned int wheel_delta = 0;
40static int wheel_fast_mode = 0;
41static unsigned long last_wheel_usec = 0;
42static unsigned long wheel_velocity = 0;
43static long last_wheel_post = 0;
44static long next_backlight_on = 0;
45/* Buttons */
46static bool hold_button = false;
47static bool hold_button_old = false;
48#define _button_hold() hold_button
49#else
50#define _button_hold() false /* FIXME */
51#endif /* BOOTLOADER */
52static int int_btn = BUTTON_NONE;
53
54void button_init_device(void)
55{
56}
57
58bool button_hold(void)
59{
60 return _button_hold();
61}
62
63/* clickwheel */
64#ifndef BOOTLOADER
65void clickwheel_int(void)
66{
67}
68#endif /* BOOTLOADER */
69
70/* device buttons */
71void button_int(void)
72{
73 unsigned char state;
74
75 int_btn = BUTTON_NONE;
76
77}
78
79/*
80 * Get button pressed from hardware
81 */
82int button_read_device(void)
83{
84#ifdef BOOTLOADER
85 /* Read buttons directly in the bootloader */
86 button_int();
87#else
88 /* light handling */
89 if (hold_button != hold_button_old)
90 {
91 hold_button_old = hold_button;
92 backlight_hold_changed(hold_button);
93 }
94#endif /* BOOTLOADER */
95
96 /* The int_btn variable is set in the button interrupt handler */
97 return int_btn;
98}
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-target.h b/firmware/target/arm/as3525/sansa-e200v2/button-target.h
new file mode 100644
index 0000000000..969f91b143
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/button-target.h
@@ -0,0 +1,60 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
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 _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#include <stdbool.h>
26#include "config.h"
27
28#define HAS_BUTTON_HOLD
29
30bool button_hold(void);
31void button_init_device(void);
32int button_read_device(void);
33#ifndef BOOTLOADER
34void clickwheel_int(void);
35#endif
36void button_int(void);
37
38/* Sandisk Sansa E200 button codes */
39
40/* Main unit's buttons */
41#define BUTTON_REC 0x00000001
42#define BUTTON_DOWN 0x00000002
43#define BUTTON_RIGHT 0x00000004
44#define BUTTON_LEFT 0x00000008
45#define BUTTON_SELECT 0x00000010
46#define BUTTON_UP 0x00000020
47#define BUTTON_POWER 0x00000040
48
49#define BUTTON_SCROLL_BACK 0x00000080
50#define BUTTON_SCROLL_FWD 0x00000100
51
52#define BUTTON_MAIN 0x00000fff
53
54/* No Remote control */
55#define BUTTON_REMOTE 0
56
57#define POWEROFF_BUTTON BUTTON_POWER
58#define POWEROFF_COUNT 10
59
60#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
new file mode 100644
index 0000000000..e14ad21681
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -0,0 +1,385 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Linus Nielsen Feltzing
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#include "config.h"
22
23#include "cpu.h"
24#include "lcd.h"
25#include "kernel.h"
26#include "thread.h"
27#include <string.h>
28#include <stdlib.h>
29#include "file.h"
30#include "debug.h"
31#include "system.h"
32#include "font.h"
33#include "bidi.h"
34
35static bool display_on = false; /* is the display turned on? */
36static bool display_flipped = false;
37static int xoffset = 0; /* needed for flip */
38
39/* register defines */
40#define R_START_OSC 0x00
41#define R_DRV_OUTPUT_CONTROL 0x01
42#define R_DRV_WAVEFORM_CONTROL 0x02
43#define R_ENTRY_MODE 0x03
44#define R_COMPARE_REG1 0x04
45#define R_COMPARE_REG2 0x05
46
47#define R_DISP_CONTROL1 0x07
48#define R_DISP_CONTROL2 0x08
49#define R_DISP_CONTROL3 0x09
50
51#define R_FRAME_CYCLE_CONTROL 0x0b
52#define R_EXT_DISP_IF_CONTROL 0x0c
53
54#define R_POWER_CONTROL1 0x10
55#define R_POWER_CONTROL2 0x11
56#define R_POWER_CONTROL3 0x12
57#define R_POWER_CONTROL4 0x13
58
59#define R_RAM_ADDR_SET 0x21
60#define R_WRITE_DATA_2_GRAM 0x22
61
62#define R_GAMMA_FINE_ADJ_POS1 0x30
63#define R_GAMMA_FINE_ADJ_POS2 0x31
64#define R_GAMMA_FINE_ADJ_POS3 0x32
65#define R_GAMMA_GRAD_ADJ_POS 0x33
66
67#define R_GAMMA_FINE_ADJ_NEG1 0x34
68#define R_GAMMA_FINE_ADJ_NEG2 0x35
69#define R_GAMMA_FINE_ADJ_NEG3 0x36
70#define R_GAMMA_GRAD_ADJ_NEG 0x37
71
72#define R_GAMMA_AMP_ADJ_RES_POS 0x38
73#define R_GAMMA_AMP_AVG_ADJ_RES_NEG 0x39
74
75#define R_GATE_SCAN_POS 0x40
76#define R_VERT_SCROLL_CONTROL 0x41
77#define R_1ST_SCR_DRV_POS 0x42
78#define R_2ND_SCR_DRV_POS 0x43
79#define R_HORIZ_RAM_ADDR_POS 0x44
80#define R_VERT_RAM_ADDR_POS 0x45
81
82#define LCD_CMD (*(volatile unsigned short *)0xf0000000)
83#define LCD_DATA (*(volatile unsigned short *)0xf0000002)
84
85#define R_ENTRY_MODE_HORZ 0x7030
86#define R_ENTRY_MODE_VERT 0x7038
87
88/* TODO: Implement this function */
89static void lcd_delay(int x)
90{
91 (void)x;
92}
93
94/* DBOP initialisation, do what OF does */
95static void ams3525_dbop_init(void)
96{
97
98 /* TODO: More... */
99
100 DBOP_TIMPOL_01 = 0xe167e167;
101 DBOP_TIMPOL_23 = 0xe167006e;
102 DBOP_CTRL = 0x41008;
103
104 GPIOB_AFSEL = 0xfc;
105 GPIOC_AFSEL = 0xff;
106
107 DBOP_TIMPOL_23 = 0x6000e;
108 DBOP_CTRL = 0x51008;
109 DBOP_TIMPOL_01 = 0x6e167;
110 DBOP_TIMPOL_23 = 0xa167e06f;
111
112 /* TODO: More... */
113}
114
115static void lcd_write_reg(int reg, int value)
116{
117 DBOP_CTRL &= ~(1<<14);
118
119 DBOP_TIMPOL_23 = 0xa167006e;
120
121 DBOP_DOUT = reg;
122
123 /* Wait for fifo to empty */
124 while ((DBOP_STAT & (1<<10)) == 0);
125
126 DBOP_TIMPOL_23 = 0xa167e06f;
127
128
129 DBOP_DOUT = value;
130
131 /* Wait for fifo to empty */
132 while ((DBOP_STAT & (1<<10)) == 0);
133}
134
135void lcd_write_data(const fb_data* p_bytes, int count)
136{
137 (void)p_bytes;
138 (void)count;
139}
140
141
142/*** hardware configuration ***/
143
144void lcd_set_contrast(int val)
145{
146 (void)val;
147}
148
149void lcd_set_invert_display(bool yesno)
150{
151 (void)yesno;
152}
153
154static void flip_lcd(bool yesno)
155{
156 (void)yesno;
157}
158
159
160/* turn the display upside down (call lcd_update() afterwards) */
161void lcd_set_flip(bool yesno)
162{
163 display_flipped = yesno;
164 xoffset = yesno ? 4 : 0;
165
166 if (display_on)
167 flip_lcd(yesno);
168}
169
170static void _display_on(void)
171{
172 /* Initialisation the display the same way as the original firmware */
173
174 lcd_write_reg(R_START_OSC, 0x0001); /* Start Oscilation */
175
176 lcd_write_reg(R_DRV_OUTPUT_CONTROL, 0x011b); /* 220 lines, GS=0, SS=1 */
177
178 /* B/C = 1: n-line inversion form
179 * EOR = 1: polarity inversion occurs by applying an EOR to odd/even
180 * frame select signal and an n-line inversion signal.
181 * FLD = 01b: 1 field interlaced scan, external display iface */
182 lcd_write_reg(R_DRV_WAVEFORM_CONTROL, 0x0700);
183
184 /* Address counter updated in horizontal direction; left to right;
185 * vertical increment horizontal increment.
186 * data format for 8bit transfer or spi = 65k (5,6,5) */
187 lcd_write_reg(R_ENTRY_MODE, 0x0030);
188
189 /* Replace data on writing to GRAM */
190 lcd_write_reg(R_COMPARE_REG1, 0);
191 lcd_write_reg(R_COMPARE_REG2, 0);
192
193 lcd_write_reg(R_DISP_CONTROL1, 0x0000); /* GON = 0, DTE = 0, D1-0 = 00b */
194
195 /* Front porch lines: 2; Back porch lines: 2; */
196 lcd_write_reg(R_DISP_CONTROL2, 0x0203);
197
198 /* Scan cycle = 0 frames */
199 lcd_write_reg(R_DISP_CONTROL3, 0x0000);
200
201 /* 16 clocks */
202 lcd_write_reg(R_FRAME_CYCLE_CONTROL, 0x0000);
203
204 /* 18-bit RGB interface (one transfer/pixel)
205 * internal clock operation;
206 * System interface/VSYNC interface */
207 lcd_write_reg(R_EXT_DISP_IF_CONTROL, 0x0000);
208
209
210 /* zero everything*/
211 lcd_write_reg(R_POWER_CONTROL1, 0x0000); /* STB = 0, SLP = 0 */
212
213 lcd_delay(10);
214
215 /* initialise power supply */
216
217 /* DC12-10 = 000b: Step-up1 = clock/8,
218 * DC02-00 = 000b: Step-up2 = clock/16,
219 * VC2-0 = 010b: VciOUT = 0.87 * VciLVL */
220 lcd_write_reg(R_POWER_CONTROL2, 0x0002);
221
222 /* VRH3-0 = 1000b: Vreg1OUT = REGP * 1.90 */
223 lcd_write_reg(R_POWER_CONTROL3, 0x0008);
224
225 lcd_delay(40);
226
227 lcd_write_reg(R_POWER_CONTROL4, 0x0000); /* VCOMG = 0 */
228
229 /* This register is unknown */
230 lcd_write_reg(0x56, 0x80f);
231
232
233 lcd_write_reg(R_POWER_CONTROL1, 0x4140);
234
235 lcd_delay(10);
236
237 lcd_write_reg(R_POWER_CONTROL2, 0x0000);
238 lcd_write_reg(R_POWER_CONTROL3, 0x0013);
239
240 lcd_delay(20);
241
242 lcd_write_reg(R_POWER_CONTROL4, 0x6d0e);
243
244 lcd_delay(20);
245
246 lcd_write_reg(R_POWER_CONTROL4, 0x6d0e);
247
248 lcd_write_reg(R_GAMMA_FINE_ADJ_POS1, 0x0002);
249 lcd_write_reg(R_GAMMA_FINE_ADJ_POS2, 0x0707);
250 lcd_write_reg(R_GAMMA_FINE_ADJ_POS3, 0x0182);
251 lcd_write_reg(R_GAMMA_GRAD_ADJ_POS, 0x0203);
252 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG1, 0x0706);
253 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG2, 0x0006);
254 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG3, 0x0706);
255 lcd_write_reg(R_GAMMA_GRAD_ADJ_NEG, 0x0000);
256 lcd_write_reg(R_GAMMA_AMP_ADJ_RES_POS, 0x030f);
257 lcd_write_reg(R_GAMMA_AMP_AVG_ADJ_RES_NEG, 0x0f08);
258
259
260 lcd_write_reg(R_RAM_ADDR_SET, 0);
261 lcd_write_reg(R_GATE_SCAN_POS, 0);
262 lcd_write_reg(R_VERT_SCROLL_CONTROL, 0);
263
264 lcd_write_reg(R_1ST_SCR_DRV_POS, 219 << 8);
265 lcd_write_reg(R_2ND_SCR_DRV_POS, 219 << 8);
266
267 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 175 << 8);
268 lcd_write_reg(R_VERT_RAM_ADDR_POS, 219 << 8);
269
270
271 lcd_write_reg(R_DISP_CONTROL1, 0x0037);
272
273 display_on=true; /* must be done before calling lcd_update() */
274 lcd_update();
275}
276
277/* LCD init */
278void lcd_init_device(void)
279{
280 ams3525_dbop_init();
281
282 /* Init GPIOs the same as the OF */
283
284 GPIOA_DIR |= (1<<5);
285 GPIOA_PIN(5) = 0;
286
287 GPIOA_PIN(3) = (1<<3);
288
289 GPIOA_DIR |= (3<<3);
290
291 GPIOA_PIN(3) = (1<<3);
292
293 GPIOA_PIN(4) = 0; //c80b0040 := 0;
294
295 GPIOA_DIR |= (1<<7);
296 GPIOA_PIN(7) = 0;
297
298 CCU_IO &= ~(1<<2);
299 CCU_IO &= ~(1<<3);
300
301 GPIOD_DIR |= (1<<7);
302
303#if 0
304 /* TODO: This code is conditional on a variable in the OF init, we need to
305 work out what it means */
306
307 GPIOD_PIN(7) = (1<<7);
308 GPIOD_DIR |= (1<<7);
309#endif
310
311 lcd_delay(1);
312
313 GPIOA_PIN(5) = (1<<5);
314
315 lcd_delay(1);
316
317 _display_on();
318}
319
320void lcd_enable(bool on)
321{
322 if(display_on!=on)
323 {
324 if(on)
325 {
326 _display_on();
327 lcd_call_enable_hook();
328 }
329 else
330 {
331 /* TODO: Implement off sequence */
332 display_on=false;
333 }
334 }
335}
336
337bool lcd_enabled(void)
338{
339 return display_on;
340}
341
342/*** update functions ***/
343
344/* Performance function to blit a YUV bitmap directly to the LCD
345 * src_x, src_y, width and height should be even
346 * x, y, width and height have to be within LCD bounds
347 */
348void lcd_blit_yuv(unsigned char * const src[3],
349 int src_x, int src_y, int stride,
350 int x, int y, int width, int height)
351{
352 (void)src;
353 (void)src_x;
354 (void)src_y;
355 (void)stride;
356 (void)x;
357 (void)y;
358 (void)width;
359 (void)height;
360}
361
362/* Update the display.
363 This must be called after all other LCD functions that change the display. */
364void lcd_update(void) ICODE_ATTR;
365void lcd_update(void)
366{
367 if(display_on){
368 /* TODO */
369 }
370}
371
372
373/* Update a fraction of the display. */
374void lcd_update_rect(int, int, int, int) ICODE_ATTR;
375void lcd_update_rect(int x, int y, int width, int height)
376{
377 (void)x;
378 (void)y;
379 (void)width;
380 (void)height;
381
382 if(display_on) {
383 /* TODO */
384 }
385}
diff --git a/firmware/target/arm/as3525/sansa-e200v2/system-target.h b/firmware/target/arm/as3525/sansa-e200v2/system-target.h
new file mode 100644
index 0000000000..b712d1c124
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/system-target.h
@@ -0,0 +1,28 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef SYSTEM_TARGET_H
22#define SYSTEM_TARGET_H
23
24#include "system-arm.h"
25
26#define CPUFREQ_MAX 250000000
27
28#endif /* SYSTEM_TARGET_H */
diff --git a/firmware/target/arm/as3525/sansa-e200v2/timer-target.h b/firmware/target/arm/as3525/sansa-e200v2/timer-target.h
new file mode 100644
index 0000000000..b81da57885
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-e200v2/timer-target.h
@@ -0,0 +1,38 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2008 ??
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#ifndef TIMER_TARGET_H
22#define TIMER_TARGET_H
23
24bool __timer_set(long cycles, bool set);
25bool __timer_register(void);
26void __timer_unregister(void);
27
28#define __TIMER_SET(cycles, set) \
29 __timer_set(cycles, set)
30
31#define __TIMER_REGISTER(reg_prio, unregister_callback, cycles, \
32 int_prio, timer_callback) \
33 __timer_register()
34
35#define __TIMER_UNREGISTER(...) \
36 __timer_unregister()
37
38#endif /* TIMER_TARGET_H */
diff --git a/firmware/target/arm/as3525/sansa-m200v2/adc-target.h b/firmware/target/arm/as3525/sansa-m200v2/adc-target.h
new file mode 100644
index 0000000000..bea0272496
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/adc-target.h
@@ -0,0 +1,24 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/arm/as3525/sansa-m200v2/backlight-target.h b/firmware/target/arm/as3525/sansa-m200v2/backlight-target.h
new file mode 100644
index 0000000000..9533d0a6b5
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/backlight-target.h
@@ -0,0 +1,37 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24static inline bool _backlight_init(void)
25{
26 return true;
27}
28
29static inline void _backlight_on(void)
30{
31}
32
33static inline void _backlight_off(void)
34{
35}
36
37#endif
diff --git a/firmware/target/arm/as3525/sansa-m200v2/button-m200v2.c b/firmware/target/arm/as3525/sansa-m200v2/button-m200v2.c
new file mode 100644
index 0000000000..cd31d06720
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/button-m200v2.c
@@ -0,0 +1,43 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 by ??
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#include "cpu.h"
24#include "button.h"
25#include "adc.h"
26
27void button_init_device(void)
28{
29
30}
31
32int button_read_device(void)
33{
34 int btn = BUTTON_NONE;
35
36 return btn;
37}
38
39bool button_hold(void)
40{
41 /* TODO */
42 return false;
43}
diff --git a/firmware/target/arm/as3525/sansa-m200v2/button-target.h b/firmware/target/arm/as3525/sansa-m200v2/button-target.h
new file mode 100644
index 0000000000..acf80b2ed7
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/button-target.h
@@ -0,0 +1,54 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Dave Chapman
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 _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#include <stdbool.h>
26#include "config.h"
27
28#define HAS_BUTTON_HOLD
29
30void button_init_device(void);
31int button_read_device(void);
32bool button_hold(void);
33
34/* Main unit's buttons */
35#define BUTTON_MENU 0x00000001
36#define BUTTON_VOLUP 0x00000002
37#define BUTTON_VOLDOWN 0x00000004
38#define BUTTON_PLAYPAUSE 0x00000008
39#define BUTTON_REPEATAB 0x00000010
40#define BUTTON_LEFT 0x00000020
41#define BUTTON_RIGHT 0x00000040
42#define BUTTON_SELECT 0x00000080
43
44#define BUTTON_MAIN (BUTTON_MENU|BUTTON_VOLUP|BUTTON_VOLDOWN\
45 |BUTTON_PLAYPAUSE|BUTTON_REPEATAB|BUTTON_LEFT\
46 |BUTTON_RIGHT|BUTTON_SELECT)
47
48#define BUTTON_REMOTE 0
49
50/* Software power-off */
51#define POWEROFF_BUTTON BUTTON_MENU
52#define POWEROFF_COUNT 40
53
54#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/arm/as3525/sansa-m200v2/system-target.h b/firmware/target/arm/as3525/sansa-m200v2/system-target.h
new file mode 100644
index 0000000000..b712d1c124
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/system-target.h
@@ -0,0 +1,28 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 ??
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#ifndef SYSTEM_TARGET_H
22#define SYSTEM_TARGET_H
23
24#include "system-arm.h"
25
26#define CPUFREQ_MAX 250000000
27
28#endif /* SYSTEM_TARGET_H */
diff --git a/firmware/target/arm/as3525/sansa-m200v2/timer-target.h b/firmware/target/arm/as3525/sansa-m200v2/timer-target.h
new file mode 100644
index 0000000000..b81da57885
--- /dev/null
+++ b/firmware/target/arm/as3525/sansa-m200v2/timer-target.h
@@ -0,0 +1,38 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2008 ??
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#ifndef TIMER_TARGET_H
22#define TIMER_TARGET_H
23
24bool __timer_set(long cycles, bool set);
25bool __timer_register(void);
26void __timer_unregister(void);
27
28#define __TIMER_SET(cycles, set) \
29 __timer_set(cycles, set)
30
31#define __TIMER_REGISTER(reg_prio, unregister_callback, cycles, \
32 int_prio, timer_callback) \
33 __timer_register()
34
35#define __TIMER_UNREGISTER(...) \
36 __timer_unregister()
37
38#endif /* TIMER_TARGET_H */
diff --git a/firmware/target/arm/tcc77x/lcd-ssd1815.c b/firmware/target/arm/lcd-ssd1815.c
index b41c8d26ef..fc3db940ba 100644
--- a/firmware/target/arm/tcc77x/lcd-ssd1815.c
+++ b/firmware/target/arm/lcd-ssd1815.c
@@ -68,6 +68,82 @@
68#define LCD_CNTL_HIGHCOL 0x10 /* Upper column address */ 68#define LCD_CNTL_HIGHCOL 0x10 /* Upper column address */
69#define LCD_CNTL_LOWCOL 0x00 /* Lower column address */ 69#define LCD_CNTL_LOWCOL 0x00 /* Lower column address */
70 70
71
72#if CONFIG_CPU == AS3525
73#include "as3525.h"
74
75void lcd_write_command(int byte)
76{
77 DBOP_TIMPOL_23 = 0x6006E;
78 DBOP_DOUT = byte;
79
80 /* While push fifo is not empty */
81 while ((DBOP_STAT & (1<<10)) == 0)
82 ;
83
84 DBOP_TIMPOL_23 = 0x6E06F;
85}
86
87void lcd_write_data(const fb_data* p_bytes, int count)
88{
89 while (count--)
90 {
91 /* Write pixels */
92 DBOP_DOUT = *p_bytes++;
93
94 /* While push fifo is not empty */
95 while ((DBOP_STAT & (1<<10)) == 0)
96 ;
97 }
98}
99
100static inline void ams3525_dbop_init(void)
101{
102 int clkdiv = 4 - 1;
103
104 CGU_DBOP |= (1<<3) /* clk enable */ | clkdiv /* clkdiv: 3 bits */ ;
105
106 GPIOB_AFSEL = 0x0f; /* DBOP on pin 3:0 */
107 GPIOC_AFSEL = 0xff; /* DBOP on pins 7:0 */
108
109 DBOP_CTRL = 0x50008;
110 DBOP_TIMPOL_01 = 0xA167E167;
111 DBOP_TIMPOL_23 = 0x6E06F; /* this value is used for data (pixels) write */
112}
113
114
115/* LCD init, largely based on what OF does */
116void lcd_init_device(void)
117{
118 int delay;
119
120 ams3525_dbop_init();
121
122 GPIOB_DIR |= (1<<4);
123 GPIOD_DIR |= (1<<1)|(1<<3);
124
125 GPIOD_PIN(1) = (1<<1); /* backlight on */
126
127 GPIOD_PIN(3) = (1<<3);
128 delay = 10; while(delay--) ;
129
130 GPIOB_PIN(4) = (1<<4);
131 delay = 10; while(delay--) ;
132
133 lcd_write_command(LCD_SET_LCD_BIAS);
134 lcd_write_command(LCD_SET_SEGMENT_REMAP);
135 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION);
136 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO|0x5);
137 lcd_set_contrast(lcd_default_contrast());
138 lcd_write_command(LCD_SET_REVERSE_DISPLAY);
139 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER|0x7);
140 lcd_write_command(LCD_SET_DISPLAY_ON);
141 lcd_write_command(LCD_SET_DISPLAY_START_LINE);
142}
143
144
145#elif defined(CPU_TCC77X)
146
71/* TCC77x specific defines */ 147/* TCC77x specific defines */
72#define LCD_BASE 0x50000000 148#define LCD_BASE 0x50000000
73#define LCD_CMD *(volatile unsigned char*)(LCD_BASE) 149#define LCD_CMD *(volatile unsigned char*)(LCD_BASE)
@@ -98,42 +174,6 @@ void lcd_write_data(const fb_data* p_bytes, int count)
98 } 174 }
99} 175}
100 176
101/* End of TCC77x specific defines */
102
103
104/** globals **/
105
106static int xoffset; /* needed for flip */
107
108/*** hardware configuration ***/
109
110int lcd_default_contrast(void)
111{
112 return 0x1f;
113}
114
115void lcd_set_contrast(int val)
116{
117 lcd_write_command(LCD_CNTL_CONTRAST);
118 lcd_write_command(val);
119}
120
121void lcd_set_invert_display(bool yesno)
122{
123 if (yesno)
124 lcd_write_command(LCD_SET_REVERSE_DISPLAY);
125 else
126 lcd_write_command(LCD_SET_NORMAL_DISPLAY);
127}
128
129/* turn the display upside down (call lcd_update() afterwards) */
130void lcd_set_flip(bool yesno)
131{
132 (void)yesno;
133 /* TODO */
134}
135
136
137/* LCD init */ 177/* LCD init */
138void lcd_init_device(void) 178void lcd_init_device(void)
139{ 179{
@@ -175,6 +215,43 @@ void lcd_init_device(void)
175 lcd_update(); 215 lcd_update();
176} 216}
177 217
218/* End of TCC77x specific defines */
219#endif
220
221
222/** globals **/
223
224static int xoffset; /* needed for flip */
225
226/*** hardware configuration ***/
227
228int lcd_default_contrast(void)
229{
230 return 0x1f;
231}
232
233void lcd_set_contrast(int val)
234{
235 lcd_write_command(LCD_CNTL_CONTRAST);
236 lcd_write_command(val);
237}
238
239void lcd_set_invert_display(bool yesno)
240{
241 if (yesno)
242 lcd_write_command(LCD_SET_REVERSE_DISPLAY);
243 else
244 lcd_write_command(LCD_SET_NORMAL_DISPLAY);
245}
246
247/* turn the display upside down (call lcd_update() afterwards) */
248void lcd_set_flip(bool yesno)
249{
250 (void)yesno;
251 /* TODO */
252}
253
254
178/*** Update functions ***/ 255/*** Update functions ***/
179 256
180/* Performance function that works with an external buffer 257/* Performance function that works with an external buffer
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index 17f894d77f..8f3da63b92 100644
--- a/rbutil/mkamsboot/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
@@ -148,7 +148,7 @@ static const char* rb_model_names[] =
148 "clip", 148 "clip",
149 NULL, 149 NULL,
150 "e2v2", 150 "e2v2",
151 NULL, 151 "m2v2",
152 NULL 152 NULL
153}; 153};
154 154
@@ -157,10 +157,10 @@ static const char* rb_model_names[] =
157static const int rb_model_num[] = 157static const int rb_model_num[] =
158{ 158{
159 0, 159 0,
160 50, 160 40,
161 0,
162 51,
163 0, 161 0,
162 41,
163 42,
164 0 164 0
165}; 165};
166 166
diff --git a/tools/configure b/tools/configure
index c34ecec382..36597f524b 100755
--- a/tools/configure
+++ b/tools/configure
@@ -694,6 +694,8 @@ cat <<EOF
694 33) Cowon D2 53) Sansa m200 694 33) Cowon D2 53) Sansa m200
695 34) M3/M3L 54) Sansa c100 695 34) M3/M3L 54) Sansa c100
696 55) Sansa Clip 696 55) Sansa Clip
697 56) Sansa e200v2
698 57) Sansa m200v2
697 699
698 ==Tatung== ==Olympus== ==Logik== 700 ==Tatung== ==Olympus== ==Logik==
699 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB 701 60) Elio TPJ-1022 70) M:Robe 500 80) DAX 1GB MP3/DAB
@@ -1698,6 +1700,46 @@ fi
1698 ;; 1700 ;;
1699 1701
1700 1702
1703 56|e200v2)
1704 target_id=51
1705 modelname="e200v2"
1706 target="-DSANSA_E200V2"
1707 memory=2 # FIXME - a guess
1708 arm9tdmicc
1709 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1710 bmp2rb_native="$bmp2rb_mono"
1711 tool="$rootdir/tools/scramble -add=e2v2"
1712 output="rockbox.sansa"
1713 bootoutput="bootloader-e200v2.sansa"
1714 appextra="recorder:gui"
1715 plugins=""
1716 toolset=$scramblebitmaptools
1717 t_cpu="arm"
1718 t_manufacturer="as3525"
1719 t_model="sansa-clip"
1720 ;;
1721
1722
1723 57|m200v2)
1724 target_id=52
1725 modelname="m200v2"
1726 target="-DSANSA_M200V2"
1727 memory=2 # FIXME - A guess
1728 arm9tdmicc
1729 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1730 bmp2rb_native="$bmp2rb_mono"
1731 tool="$rootdir/tools/scramble -add=m2v2"
1732 output="rockbox.sansa"
1733 bootoutput="bootloader-m200v2.sansa"
1734 appextra="recorder:gui"
1735 plugins=""
1736 toolset=$scramblebitmaptools
1737 t_cpu="arm"
1738 t_manufacturer="as3525"
1739 t_model="sansa-m200v2"
1740 ;;
1741
1742
1701 60|tpj1022) 1743 60|tpj1022)
1702 target_id=25 1744 target_id=25
1703 modelname="tpj1022" 1745 modelname="tpj1022"
diff --git a/tools/scramble.c b/tools/scramble.c
index 429823aaa7..aaf3b9d232 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -122,7 +122,7 @@ void usage(void)
122 "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n" 122 "\t (X values: h100, h120, h140, h300, ipco, nano, ipvd, mn2g\n"
123 "\t ip3g, ip4g, mini, iax5, iam5, iam3, h10, h10_5gb,\n" 123 "\t ip3g, ip4g, mini, iax5, iam5, iam3, h10, h10_5gb,\n"
124 "\t tpj2, c200, e200, giga, gigs, m100, m500, d2,\n"); 124 "\t tpj2, c200, e200, giga, gigs, m100, m500, d2,\n");
125 printf("\t 9200, 1630, ldax, m200, clip, e2v2)\n"); 125 printf("\t 9200, 1630, ldax, m200, clip, e2v2, m2v2)\n");
126 printf("\nNo option results in Archos standard player/recorder format.\n"); 126 printf("\nNo option results in Archos standard player/recorder format.\n");
127 127
128 exit(1); 128 exit(1);
@@ -289,6 +289,8 @@ int main (int argc, char** argv)
289 modelnum = 50; 289 modelnum = 50;
290 else if (!strcmp(&argv[1][5], "e2v2")) 290 else if (!strcmp(&argv[1][5], "e2v2"))
291 modelnum = 51; 291 modelnum = 51;
292 else if (!strcmp(&argv[1][5], "m2v2"))
293 modelnum = 52;
292 else { 294 else {
293 fprintf(stderr, "unsupported model: %s\n", &argv[1][5]); 295 fprintf(stderr, "unsupported model: %s\n", &argv[1][5]);
294 return 2; 296 return 2;