diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-02-05 12:40:25 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-02-05 12:40:25 +0000 |
commit | 12af2926e50450fe8a5aacbc1d4477b68fdd3e63 (patch) | |
tree | e761118345fc8640ba181999e8575964f3975587 | |
parent | a9ab407f8460017d3c7189f0cbf4bd464e7a90ce (diff) | |
download | rockbox-12af2926e50450fe8a5aacbc1d4477b68fdd3e63.tar.gz rockbox-12af2926e50450fe8a5aacbc1d4477b68fdd3e63.zip |
Make Clip+ bootloader build
Now making the Fuzev2 bootloader build should be pretty easy
TODO:
- write button driver (FlynDice found all buttons already)
- find button light
- decide if lcd-ssd1303.c must be modified for Clip+ using SSP or forked
- check if backlight code works (I copied Clipv2 code)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24520 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | bootloader/sansa_as3525.c | 3 | ||||
-rw-r--r-- | bootloader/show_logo.c | 2 | ||||
-rw-r--r-- | firmware/SOURCES | 13 | ||||
-rw-r--r-- | firmware/export/config.h | 2 | ||||
-rw-r--r-- | firmware/export/config/sansaclipplus.h | 215 | ||||
-rw-r--r-- | firmware/target/arm/as3525/boot.lds | 2 | ||||
-rw-r--r-- | firmware/target/arm/as3525/clock-target.h | 8 | ||||
-rw-r--r-- | firmware/target/arm/as3525/powermgmt-target.h | 4 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c | 53 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipplus/backlight-target.h | 32 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipplus/button-clip.c | 33 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipplus/button-target.h | 57 | ||||
-rw-r--r-- | firmware/target/arm/as3525/system-as3525.c | 9 |
13 files changed, 421 insertions, 12 deletions
diff --git a/bootloader/sansa_as3525.c b/bootloader/sansa_as3525.c index 8d6090ed17..9248921eed 100644 --- a/bootloader/sansa_as3525.c +++ b/bootloader/sansa_as3525.c | |||
@@ -58,7 +58,8 @@ void main(void) | |||
58 | button_init_device(); | 58 | button_init_device(); |
59 | int btn = button_read_device(); | 59 | int btn = button_read_device(); |
60 | 60 | ||
61 | #if !defined(SANSA_FUZE) && !defined(SANSA_CLIP) && !defined(SANSA_CLIPV2) | 61 | #if !defined(SANSA_FUZE) && !defined(SANSA_CLIP) && !defined(SANSA_CLIPV2) \ |
62 | && !defined(SANSA_CLIPPLUS) | ||
62 | if (button_hold()) | 63 | if (button_hold()) |
63 | { | 64 | { |
64 | verbose = true; | 65 | verbose = true; |
diff --git a/bootloader/show_logo.c b/bootloader/show_logo.c index 90cf222067..09c6dbd4aa 100644 --- a/bootloader/show_logo.c +++ b/bootloader/show_logo.c | |||
@@ -41,7 +41,7 @@ int show_logo( void ) | |||
41 | lcd_clear_display(); | 41 | lcd_clear_display(); |
42 | lcd_setfont(FONT_SYSFIXED); | 42 | lcd_setfont(FONT_SYSFIXED); |
43 | 43 | ||
44 | #if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) | 44 | #if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS) |
45 | /* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48 | 45 | /* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48 |
46 | are blue, so we reverse the usual positioning */ | 46 | are blue, so we reverse the usual positioning */ |
47 | lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION); | 47 | lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION); |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 768ab49acb..eb3e88fd8b 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1204,6 +1204,19 @@ target/arm/tcc77x/c100/audio-c100.c | |||
1204 | #endif /* SIMULATOR */ | 1204 | #endif /* SIMULATOR */ |
1205 | #endif /* SANSA_C100 */ | 1205 | #endif /* SANSA_C100 */ |
1206 | 1206 | ||
1207 | #ifdef SANSA_CLIPPLUS | ||
1208 | #ifndef SIMULATOR | ||
1209 | target/arm/as3525/sansa-clip/lcd-ssd1303.c /* FIXME */ | ||
1210 | target/arm/as3525/sansa-clip/lcd-as-clip.S | ||
1211 | target/arm/as3525/sansa-clipplus/button-clip.c | ||
1212 | target/arm/as3525/sansa-clipplus/backlight-clip.c | ||
1213 | #ifndef BOOTLOADER | ||
1214 | target/arm/powermgmt-ascodec.c | ||
1215 | target/arm/as3525/sansa-clip/powermgmt-clip.c | ||
1216 | #endif /* !BOOTLOADER */ | ||
1217 | #endif /* !SIMULATOR */ | ||
1218 | #endif /* SANSA_CLIPV2 */ | ||
1219 | |||
1207 | #ifdef SANSA_CLIPV2 | 1220 | #ifdef SANSA_CLIPV2 |
1208 | #ifndef SIMULATOR | 1221 | #ifndef SIMULATOR |
1209 | target/arm/as3525/sansa-clip/lcd-ssd1303.c | 1222 | target/arm/as3525/sansa-clip/lcd-ssd1303.c |
diff --git a/firmware/export/config.h b/firmware/export/config.h index 96fec57d7b..516161191b 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -384,6 +384,8 @@ Lyre prototype 1 */ | |||
384 | #include "config/sansaclip.h" | 384 | #include "config/sansaclip.h" |
385 | #elif defined(SANSA_CLIPV2) | 385 | #elif defined(SANSA_CLIPV2) |
386 | #include "config/sansaclipv2.h" | 386 | #include "config/sansaclipv2.h" |
387 | #elif defined(SANSA_CLIPPLUS) | ||
388 | #include "config/sansaclipplus.h" | ||
387 | #elif defined(SANSA_E200V2) | 389 | #elif defined(SANSA_E200V2) |
388 | #include "config/sansae200v2.h" | 390 | #include "config/sansae200v2.h" |
389 | #elif defined(SANSA_M200V4) | 391 | #elif defined(SANSA_M200V4) |
diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h new file mode 100644 index 0000000000..758f2679d0 --- /dev/null +++ b/firmware/export/config/sansaclipplus.h | |||
@@ -0,0 +1,215 @@ | |||
1 | /* | ||
2 | * This config file is for the Sandisk Sansa Clip+ | ||
3 | */ | ||
4 | #define TARGET_TREE /* this target is using the target tree system */ | ||
5 | |||
6 | /* For Rolo and boot loader */ | ||
7 | #define MODEL_NUMBER 68 | ||
8 | #define MODEL_NAME "Sandisk Sansa Clip+" | ||
9 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
10 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
11 | |||
12 | #if 0 /* disabled since there is no driver (yet) */ | ||
13 | |||
14 | #define HW_SAMPR_CAPS (SAMPR_CAP_44) | ||
15 | |||
16 | /* define this if you have recording possibility */ | ||
17 | #define HAVE_RECORDING | ||
18 | |||
19 | #define REC_SAMPR_CAPS (SAMPR_CAP_22) | ||
20 | #define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ | ||
21 | #define REC_SAMPR_DEFAULT SAMPR_22 | ||
22 | |||
23 | #endif | ||
24 | |||
25 | /* Define bitmask of input sources - recordable bitmask can be defined | ||
26 | explicitly if different */ | ||
27 | #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) | ||
28 | |||
29 | /* define this if you have a bitmap LCD display */ | ||
30 | #define HAVE_LCD_BITMAP | ||
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 128 | ||
46 | #define LCD_HEIGHT 64 | ||
47 | #define LCD_DEPTH 1 | ||
48 | |||
49 | #define LCD_PIXELFORMAT VERTICAL_PACKING | ||
50 | #define HAVE_NEGATIVE_LCD /* bright on dark */ | ||
51 | #define HAVE_LCD_SPLIT /* split display */ | ||
52 | |||
53 | /* Display colours, for screenshots and sim (0xRRGGBB) */ | ||
54 | #define LCD_DARKCOLOR 0x000000 | ||
55 | #define LCD_BRIGHTCOLOR 0x000000 | ||
56 | #define LCD_BL_DARKCOLOR 0x000000 | ||
57 | #define LCD_BL_BRIGHTCOLOR 0x0de2e5 | ||
58 | |||
59 | #define LCD_DARKCOLOR_2 0x000000 | ||
60 | #define LCD_BRIGHTCOLOR_2 0x000000 | ||
61 | #define LCD_BL_DARKCOLOR_2 0x000000 | ||
62 | #define LCD_BL_BRIGHTCOLOR_2 0xffe60f | ||
63 | |||
64 | #define LCD_SPLIT_POS 16 | ||
65 | #define LCD_SPLIT_LINES 2 | ||
66 | |||
67 | /* define this if you have LCD enable function */ | ||
68 | #define HAVE_LCD_ENABLE | ||
69 | |||
70 | #ifndef BOOTLOADER | ||
71 | /* Define this if your LCD can be put to sleep. | ||
72 | * HAVE_LCD_ENABLE should be defined as well. */ | ||
73 | //#define HAVE_LCD_SLEEP | ||
74 | //#define HAVE_LCD_SLEEP_SETTING | ||
75 | #endif | ||
76 | |||
77 | /* define this if you can flip your LCD */ | ||
78 | #define HAVE_LCD_FLIP | ||
79 | |||
80 | /* define this if you can invert the pixels */ | ||
81 | #define HAVE_LCD_INVERT | ||
82 | |||
83 | /* Define this if your LCD can set contrast */ | ||
84 | #define HAVE_LCD_CONTRAST | ||
85 | |||
86 | #define MIN_CONTRAST_SETTING 0 | ||
87 | #define MAX_CONTRAST_SETTING 50 | ||
88 | #define DEFAULT_CONTRAST_SETTING 30 | ||
89 | |||
90 | #define IRAM_LCDFRAMEBUFFER IDATA_ATTR /* put the lcd frame buffer in IRAM */ | ||
91 | |||
92 | #define CONFIG_KEYPAD SANSA_CLIP_PAD | ||
93 | |||
94 | /* define this if the target has volume keys which can be used in the lists */ | ||
95 | #define HAVE_VOLUME_IN_LIST | ||
96 | |||
97 | /* Define this if you do software codec */ | ||
98 | #define CONFIG_CODEC SWCODEC | ||
99 | /* There is no hardware tone control */ | ||
100 | #define HAVE_SW_TONE_CONTROLS | ||
101 | |||
102 | /* We're working on the assumption that the AS3525 has something | ||
103 | similar to the AS3514 for audio codec etc */ | ||
104 | #define HAVE_AS3514 | ||
105 | |||
106 | /* define this if you have a real-time clock */ | ||
107 | #ifndef BOOTLOADER | ||
108 | #define CONFIG_RTC RTC_AS3514 | ||
109 | #endif | ||
110 | |||
111 | /* Define this if you have a software controlled poweroff */ | ||
112 | #define HAVE_SW_POWEROFF | ||
113 | |||
114 | #define HAVE_FAT16SUPPORT | ||
115 | |||
116 | /* The number of bytes reserved for loadable codecs */ | ||
117 | #define CODEC_SIZE 0x100000 | ||
118 | |||
119 | /* The number of bytes reserved for loadable plugins */ | ||
120 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
121 | |||
122 | #define AB_REPEAT_ENABLE 1 | ||
123 | |||
124 | /* FM Tuner */ | ||
125 | #define CONFIG_TUNER SI4700 /* in fact SI4702 */ | ||
126 | //#define HAVE_TUNER_PWR_CTRL | ||
127 | |||
128 | /* Define this for LCD backlight available */ | ||
129 | #define HAVE_BACKLIGHT | ||
130 | |||
131 | /* define this if you have a flash memory storage */ | ||
132 | #define HAVE_FLASH_STORAGE | ||
133 | |||
134 | /* define this if the flash memory uses the SecureDigital Memory Card protocol */ | ||
135 | #define CONFIG_STORAGE STORAGE_SD | ||
136 | |||
137 | #define BATTERY_CAPACITY_DEFAULT 380 /* default battery capacity */ | ||
138 | #define BATTERY_CAPACITY_MIN 380 /* min. capacity selectable */ | ||
139 | #define BATTERY_CAPACITY_MAX 380 /* max. capacity selectable */ | ||
140 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ | ||
141 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | ||
142 | |||
143 | /* Charging implemented in a target-specific algorithm */ | ||
144 | #define CONFIG_CHARGING CHARGING_TARGET | ||
145 | |||
146 | /* define this if the unit can be powered or charged via USB */ | ||
147 | #define HAVE_USB_POWER | ||
148 | |||
149 | /** Non-simulator section **/ | ||
150 | #ifndef SIMULATOR | ||
151 | |||
152 | /* Define this if you have a AMS AS3525v2 SoC */ | ||
153 | #define CONFIG_CPU AS3525v2 | ||
154 | |||
155 | /* Define this if you want to use the AS3525 i2c interface */ | ||
156 | #define CONFIG_I2C I2C_AS3525 /* FIXME : looks similar to AS353x interface */ | ||
157 | |||
158 | /* define this if the hardware can be powered off while charging */ | ||
159 | /* Sansa can't be powered off while charging */ | ||
160 | /* #define HAVE_POWEROFF_WHILE_CHARGING */ | ||
161 | |||
162 | /* The start address index for ROM builds */ | ||
163 | #define ROM_START 0x00000000 | ||
164 | |||
165 | /* Define this to the CPU frequency */ | ||
166 | #define CPU_FREQ 250000000 | ||
167 | |||
168 | /* Type of LCD */ | ||
169 | #define CONFIG_LCD LCD_SSD1303 | ||
170 | |||
171 | #ifndef BOOTLOADER | ||
172 | |||
173 | #define USB_HANDLED_BY_OF | ||
174 | |||
175 | #if 0 /* disabled since there is no USB driver */ | ||
176 | |||
177 | /* USB On-the-go */ | ||
178 | #define CONFIG_USBOTG USBOTG_ARC | ||
179 | |||
180 | /* enable these for the experimental usb stack */ | ||
181 | #define HAVE_USBSTACK | ||
182 | #define USB_VENDOR_ID 0x0781 | ||
183 | #define USB_PRODUCT_ID 0x7433 | ||
184 | #endif /* BOOTLOADER */ | ||
185 | |||
186 | #endif | ||
187 | |||
188 | |||
189 | /* Virtual LED (icon) */ | ||
190 | #define CONFIG_LED LED_VIRTUAL | ||
191 | |||
192 | /* Define this if you have adjustable CPU frequency */ | ||
193 | #define HAVE_ADJUSTABLE_CPU_FREQ | ||
194 | |||
195 | #define BOOTFILE_EXT "sansa" | ||
196 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
197 | #define BOOTDIR "/.rockbox" | ||
198 | |||
199 | #define ICODE_ATTR_TREMOR_NOT_MDCT | ||
200 | |||
201 | #define INCLUDE_TIMEOUT_API | ||
202 | |||
203 | #endif /* SIMULATOR */ | ||
204 | |||
205 | /** Port-specific settings **/ | ||
206 | |||
207 | /* Main LCD backlight brightness range and defaults */ | ||
208 | #define MIN_BRIGHTNESS_SETTING 1 | ||
209 | #define MAX_BRIGHTNESS_SETTING 12 | ||
210 | #define DEFAULT_BRIGHTNESS_SETTING 6 | ||
211 | |||
212 | /* Default recording levels */ | ||
213 | #define DEFAULT_REC_MIC_GAIN 23 | ||
214 | #define DEFAULT_REC_LEFT_GAIN 23 | ||
215 | #define DEFAULT_REC_RIGHT_GAIN 23 | ||
diff --git a/firmware/target/arm/as3525/boot.lds b/firmware/target/arm/as3525/boot.lds index dcc291b54f..5bf75be789 100644 --- a/firmware/target/arm/as3525/boot.lds +++ b/firmware/target/arm/as3525/boot.lds | |||
@@ -6,7 +6,7 @@ OUTPUT_FORMAT(elf32-littlearm) | |||
6 | OUTPUT_ARCH(arm) | 6 | OUTPUT_ARCH(arm) |
7 | STARTUP(target/arm/crt0.o) | 7 | STARTUP(target/arm/crt0.o) |
8 | 8 | ||
9 | #ifdef SANSA_CLIPV2 | 9 | #if CONFIG_CPU == AS3525v2 |
10 | #define RAMORIG 0x0 /* DRAM */ | 10 | #define RAMORIG 0x0 /* DRAM */ |
11 | #define RAMSIZE (MEM*0x100000) | 11 | #define RAMSIZE (MEM*0x100000) |
12 | #else | 12 | #else |
diff --git a/firmware/target/arm/as3525/clock-target.h b/firmware/target/arm/as3525/clock-target.h index fd3a1c7bf4..16f28429b8 100644 --- a/firmware/target/arm/as3525/clock-target.h +++ b/firmware/target/arm/as3525/clock-target.h | |||
@@ -56,7 +56,7 @@ | |||
56 | #define AS3525_CLK_FCLK 3 /* Available as PCLK input only */ | 56 | #define AS3525_CLK_FCLK 3 /* Available as PCLK input only */ |
57 | 57 | ||
58 | /** ************ Change these to reconfigure clocking scheme *******************/ | 58 | /** ************ Change these to reconfigure clocking scheme *******************/ |
59 | #ifdef SANSA_CLIPV2 | 59 | #if CONFIG_CPU == AS3525v2 |
60 | 60 | ||
61 | /* PLL* registers differ from AS3525 */ | 61 | /* PLL* registers differ from AS3525 */ |
62 | #define AS3525_PLLA_FREQ 240000000 | 62 | #define AS3525_PLLA_FREQ 240000000 |
@@ -74,7 +74,7 @@ | |||
74 | #define AS3525_PLLB_FREQ 384000000 /* allows 44.1kHz with 0.04% error*/ | 74 | #define AS3525_PLLB_FREQ 384000000 /* allows 44.1kHz with 0.04% error*/ |
75 | #define AS3525_PLLB_SETTING 0x2630 | 75 | #define AS3525_PLLB_SETTING 0x2630 |
76 | 76 | ||
77 | #endif /* SANSA_CLIPV2 */ | 77 | #endif /* CONFIG_CPU == AS3525v2 */ |
78 | 78 | ||
79 | //#define AS3525_PLLA_FREQ 384000000 /*192,128,96,76.8,64,54.9,48,42.7,38.4*/ | 79 | //#define AS3525_PLLA_FREQ 384000000 /*192,128,96,76.8,64,54.9,48,42.7,38.4*/ |
80 | /* FCLK_PREDIV-> *7/8 = 336MHz 168, 112, 84, 67.2, 56, 48, 42, 37.3*/ | 80 | /* FCLK_PREDIV-> *7/8 = 336MHz 168, 112, 84, 67.2, 56, 48, 42, 37.3*/ |
@@ -142,12 +142,12 @@ | |||
142 | #define AS3525_IDE_SEL AS3525_CLK_PLLA /* Input Source */ | 142 | #define AS3525_IDE_SEL AS3525_CLK_PLLA /* Input Source */ |
143 | #define AS3525_IDE_DIV (CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1)/*div=1/(n+1)*/ | 143 | #define AS3525_IDE_DIV (CLK_DIV(AS3525_PLLA_FREQ, AS3525_IDE_FREQ) - 1)/*div=1/(n+1)*/ |
144 | 144 | ||
145 | #ifdef SANSA_CLIPV2 | 145 | #if CONFIG_CPU == AS3525v2 |
146 | #define AS3525_MS_FREQ 120000000 | 146 | #define AS3525_MS_FREQ 120000000 |
147 | #define AS3525_IDE_FREQ 80000000 | 147 | #define AS3525_IDE_FREQ 80000000 |
148 | #else | 148 | #else |
149 | #define AS3525_IDE_FREQ 50000000 /* The OF uses 66MHz maximal freq */ | 149 | #define AS3525_IDE_FREQ 50000000 /* The OF uses 66MHz maximal freq */ |
150 | #endif /* SANSA_CLIPV2 */ | 150 | #endif /* CONFIG_CPU == AS3525v2 */ |
151 | 151 | ||
152 | 152 | ||
153 | //#define AS3525_USB_SEL AS3525_CLK_PLLA /* Input Source */ | 153 | //#define AS3525_USB_SEL AS3525_CLK_PLLA /* Input Source */ |
diff --git a/firmware/target/arm/as3525/powermgmt-target.h b/firmware/target/arm/as3525/powermgmt-target.h index 159a051e70..3e9cdad243 100644 --- a/firmware/target/arm/as3525/powermgmt-target.h +++ b/firmware/target/arm/as3525/powermgmt-target.h | |||
@@ -22,7 +22,9 @@ | |||
22 | #ifndef POWERMGMT_TARGET_H | 22 | #ifndef POWERMGMT_TARGET_H |
23 | #define POWERMGMT_TARGET_H | 23 | #define POWERMGMT_TARGET_H |
24 | 24 | ||
25 | #if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) | 25 | #if defined(SANSA_CLIP) \ |
26 | || defined(SANSA_CLIPV2) /* FIXME */ \ | ||
27 | || defined(SANSA_CLIPPLUS) /* FIXME */ | ||
26 | 28 | ||
27 | /* Check if topped-off and monitor voltage while plugged. */ | 29 | /* Check if topped-off and monitor voltage while plugged. */ |
28 | #define BATT_FULL_VOLTAGE 4160 | 30 | #define BATT_FULL_VOLTAGE 4160 |
diff --git a/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c b/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c new file mode 100644 index 0000000000..c51d61231d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clipplus/backlight-clip.c | |||
@@ -0,0 +1,53 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2009 Rafaël Carré | ||
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 "backlight-target.h" | ||
23 | #include "lcd.h" | ||
24 | #include "as3525v2.h" | ||
25 | #include "ascodec-target.h" | ||
26 | |||
27 | /* FIXME : this is clipv2 code, not sure if it works the same on clip+ */ | ||
28 | |||
29 | void _backlight_on(void) | ||
30 | { | ||
31 | ascodec_write(0x25, ascodec_read(0x25) | 2); /* lcd power */ | ||
32 | ascodec_write(0x1c, 8|1); | ||
33 | ascodec_write(0x1b, 0x90); | ||
34 | lcd_enable(true); | ||
35 | } | ||
36 | |||
37 | void _backlight_off(void) | ||
38 | { | ||
39 | ascodec_write(0x25, ascodec_read(0x25) & ~2); /* lcd power */ | ||
40 | lcd_enable(false); | ||
41 | } | ||
42 | |||
43 | void _buttonlight_on(void) | ||
44 | { | ||
45 | GPIOA_DIR |= (1<<5); | ||
46 | GPIOA_PIN(5) = (1<<5); /* set pin a5 high */ | ||
47 | } | ||
48 | |||
49 | void _buttonlight_off(void) | ||
50 | { | ||
51 | GPIOA_DIR |= (1<<5); | ||
52 | GPIOA_PIN(5) = 0; /* set pin a5 low */ | ||
53 | } | ||
diff --git a/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h new file mode 100644 index 0000000000..d202408356 --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clipplus/backlight-target.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright © 2009 Rafaël Carré | ||
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 | |||
24 | #define _backlight_init() true | ||
25 | |||
26 | void _backlight_on(void); | ||
27 | void _backlight_off(void); | ||
28 | |||
29 | void _buttonlight_on(void); | ||
30 | void _buttonlight_off(void); | ||
31 | |||
32 | #endif | ||
diff --git a/firmware/target/arm/as3525/sansa-clipplus/button-clip.c b/firmware/target/arm/as3525/sansa-clipplus/button-clip.c new file mode 100644 index 0000000000..52917cca6f --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clipplus/button-clip.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 François Dinel | ||
11 | * Copyright © 2008-2009 Rafaël Carré | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #include "button-target.h" | ||
23 | #include "as3525v2.h" | ||
24 | #include "kernel.h" | ||
25 | |||
26 | void button_init_device(void) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | int button_read_device(void) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
diff --git a/firmware/target/arm/as3525/sansa-clipplus/button-target.h b/firmware/target/arm/as3525/sansa-clipplus/button-target.h new file mode 100644 index 0000000000..69f5d984ba --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clipplus/button-target.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 François Dinel | ||
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 | void button_init_device(void); | ||
29 | int button_read_device(void); | ||
30 | bool button_hold(void); | ||
31 | |||
32 | /* Main unit's buttons */ | ||
33 | #define BUTTON_HOME 0x00000001 | ||
34 | |||
35 | #define BUTTON_VOL_UP 0x00000002 | ||
36 | #define BUTTON_VOL_DOWN 0x00000004 | ||
37 | |||
38 | #define BUTTON_UP 0x00000008 | ||
39 | #define BUTTON_DOWN 0x00000010 | ||
40 | #define BUTTON_LEFT 0x00000020 | ||
41 | #define BUTTON_RIGHT 0x00000040 | ||
42 | |||
43 | #define BUTTON_SELECT 0x00000080 | ||
44 | |||
45 | #define BUTTON_POWER 0x00000100 | ||
46 | |||
47 | #define BUTTON_MAIN (BUTTON_HOME|BUTTON_VOL_UP|BUTTON_VOL_DOWN\ | ||
48 | |BUTTON_UP|BUTTON_DOWN|BUTTON_LEFT|BUTTON_RIGHT\ | ||
49 | |BUTTON_SELECT|BUTTON_POWER) | ||
50 | |||
51 | #define BUTTON_REMOTE 0 | ||
52 | |||
53 | /* Software power-off */ | ||
54 | #define POWEROFF_BUTTON BUTTON_POWER | ||
55 | #define POWEROFF_COUNT 10 | ||
56 | |||
57 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 2e6b6d4085..6c3299eea3 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c | |||
@@ -205,7 +205,8 @@ static void sdram_init(void) | |||
205 | /* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */ | 205 | /* 16 bits external bus, low power SDRAM, 16 Mbits = 2 Mbytes */ |
206 | #define MEMORY_MODEL 0x21 | 206 | #define MEMORY_MODEL 0x21 |
207 | 207 | ||
208 | #elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_CLIPV2) | 208 | #elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_CLIPV2) \ |
209 | || defined(SANSA_CLIPPLUS) | ||
209 | /* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */ | 210 | /* 16 bits external bus, high performance SDRAM, 64 Mbits = 8 Mbytes */ |
210 | #define MEMORY_MODEL 0x5 | 211 | #define MEMORY_MODEL 0x5 |
211 | 212 | ||
@@ -256,7 +257,7 @@ void memory_init(void) | |||
256 | 257 | ||
257 | void system_init(void) | 258 | void system_init(void) |
258 | { | 259 | { |
259 | #ifdef SANSA_CLIPV2 | 260 | #if CONFIG_CPU == AS3525v2 |
260 | /* Init procedure isn't fully understood yet | 261 | /* Init procedure isn't fully understood yet |
261 | * CCU_* registers differ from AS3525 | 262 | * CCU_* registers differ from AS3525 |
262 | */ | 263 | */ |
@@ -270,7 +271,7 @@ void system_init(void) | |||
270 | CGU_PERI &= ~0x7f; /* pclk 24 MHz */ | 271 | CGU_PERI &= ~0x7f; /* pclk 24 MHz */ |
271 | CGU_PERI |= ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_PCLK_FREQ) - 1) << 2) | 272 | CGU_PERI |= ((CLK_DIV(AS3525_PLLA_FREQ, AS3525_PCLK_FREQ) - 1) << 2) |
272 | | 1; /* clk_in = PLLA */ | 273 | | 1; /* clk_in = PLLA */ |
273 | #else /* SANSA_CLIPV2 */ | 274 | #else |
274 | unsigned int reset_loops = 640; | 275 | unsigned int reset_loops = 640; |
275 | 276 | ||
276 | CCU_SRC = 0x1fffff0 | 277 | CCU_SRC = 0x1fffff0 |
@@ -315,7 +316,7 @@ void system_init(void) | |||
315 | sdram_init(); | 316 | sdram_init(); |
316 | #endif /* BOOTLOADER */ | 317 | #endif /* BOOTLOADER */ |
317 | 318 | ||
318 | #endif /* SANSA_CLIPV2 */ | 319 | #endif /* CONFIG_CPU == AS3525v2 */ |
319 | 320 | ||
320 | #if 0 /* the GPIO clock is already enabled by the dualboot function */ | 321 | #if 0 /* the GPIO clock is already enabled by the dualboot function */ |
321 | CGU_PERI |= CGU_GPIO_CLOCK_ENABLE; | 322 | CGU_PERI |= CGU_GPIO_CLOCK_ENABLE; |