summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES11
-rw-r--r--firmware/export/config-c100.h37
-rw-r--r--firmware/target/arm/pcm-telechips.c2
-rw-r--r--firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c83
4 files changed, 37 insertions, 96 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 3a78f5540c..8ebdcb79bd 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1086,18 +1086,19 @@ target/arm/tcc77x/m200/audio-m200.c
1086#ifdef SANSA_C100 1086#ifdef SANSA_C100
1087#ifndef SIMULATOR 1087#ifndef SIMULATOR
1088drivers/nand_id.c 1088drivers/nand_id.c
1089target/arm/tcc77x/adc-tcc77x.c 1089target/arm/usb-tcc.c
1090target/arm/tcc77x/kernel-tcc77x.c
1091target/arm/tcc77x/c100/lcd-S6B33B2.c
1092target/arm/tcc77x/powermgmt-tcc77x.c
1093target/arm/tcc77x/system-tcc77x.c 1090target/arm/tcc77x/system-tcc77x.c
1091target/arm/tcc77x/kernel-tcc77x.c
1094target/arm/tcc77x/timer-tcc77x.c 1092target/arm/tcc77x/timer-tcc77x.c
1095target/arm/usb-tcc.c 1093target/arm/tcc77x/adc-tcc77x.c
1094target/arm/tcc77x/powermgmt-tcc77x.c
1095target/arm/tcc77x/c100/lcd-S6B33B2.c
1096target/arm/tcc77x/c100/button-c100.c 1096target/arm/tcc77x/c100/button-c100.c
1097target/arm/tcc77x/c100/power-c100.c 1097target/arm/tcc77x/c100/power-c100.c
1098#ifndef BOOTLOADER 1098#ifndef BOOTLOADER
1099target/arm/tcc77x/debug-tcc77x.c 1099target/arm/tcc77x/debug-tcc77x.c
1100target/arm/pcm-telechips.c 1100target/arm/pcm-telechips.c
1101target/arm/tcc77x/c100/audio-c100.c
1101#endif /* BOOTLOADER */ 1102#endif /* BOOTLOADER */
1102#endif /* SIMULATOR */ 1103#endif /* SIMULATOR */
1103#endif /* SANSA_C100 */ 1104#endif /* SANSA_C100 */
diff --git a/firmware/export/config-c100.h b/firmware/export/config-c100.h
index 1fe1a6ca64..c4e5ad5673 100644
--- a/firmware/export/config-c100.h
+++ b/firmware/export/config-c100.h
@@ -5,15 +5,11 @@
5 5
6#define MODEL_NAME "Sandisk Sansa c100 series" 6#define MODEL_NAME "Sandisk Sansa c100 series"
7 7
8/* For Rolo and boot loader */ 8/* For Rolo and bootloader */
9#define MODEL_NUMBER 30 9#define MODEL_NUMBER 30
10 10
11/* define this if you have recording possibility */ 11/* define hardware samples rate caps mask */
12//#define HAVE_RECORDING 12#define HW_SAMPR_CAPS (/*SAMPR_CAP_88 | */SAMPR_CAP_44/* | SAMPR_CAP_22 | SAMPR_CAP_11*/)
13
14/* Define bitmask of input sources - recordable bitmask can be defined
15 explicitly if different */
16//#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
17 13
18/* define this if you have a bitmap LCD display */ 14/* define this if you have a bitmap LCD display */
19#define HAVE_LCD_BITMAP 15#define HAVE_LCD_BITMAP
@@ -22,10 +18,10 @@
22#define HAVE_LCD_COLOR 18#define HAVE_LCD_COLOR
23 19
24/* define this if you can flip your LCD */ 20/* define this if you can flip your LCD */
25#define HAVE_LCD_FLIP 21/*#define HAVE_LCD_FLIP*/
26 22
27/* define this if you can invert the colours on your LCD */ 23/* define this if you can invert the colours on your LCD */
28#define HAVE_LCD_INVERT 24/*#define HAVE_LCD_INVERT*/
29 25
30/* define this if you have access to the quickscreen */ 26/* define this if you have access to the quickscreen */
31#define HAVE_QUICKSCREEN 27#define HAVE_QUICKSCREEN
@@ -39,10 +35,13 @@
39/* define this if you have a flash memory storage */ 35/* define this if you have a flash memory storage */
40#define HAVE_FLASH_STORAGE 36#define HAVE_FLASH_STORAGE
41 37
38/* Only v1 */
42#define CONFIG_STORAGE STORAGE_NAND 39#define CONFIG_STORAGE STORAGE_NAND
43
44#define CONFIG_NAND NAND_TCC 40#define CONFIG_NAND NAND_TCC
45 41
42/* c100's with direct-to-NAND access are FAT16 */
43#define HAVE_FAT16SUPPORT
44
46/* LCD dimensions */ 45/* LCD dimensions */
47#define LCD_WIDTH 128 46#define LCD_WIDTH 128
48#define LCD_HEIGHT 64 47#define LCD_HEIGHT 64
@@ -63,8 +62,11 @@
63/* Define this if you have a software controlled poweroff */ 62/* Define this if you have a software controlled poweroff */
64#define HAVE_SW_POWEROFF 63#define HAVE_SW_POWEROFF
65 64
65/* The number of bytes reserved for loadable codecs */
66#define CODEC_SIZE 0x50000
67
66/* The number of bytes reserved for loadable plugins */ 68/* The number of bytes reserved for loadable plugins */
67#define PLUGIN_BUFFER_SIZE 0x8000 69#define PLUGIN_BUFFER_SIZE 0x50000
68 70
69#define AB_REPEAT_ENABLE 1 71#define AB_REPEAT_ENABLE 1
70 72
@@ -74,6 +76,8 @@
74/* Define this if you have the TLV320 audio codec */ 76/* Define this if you have the TLV320 audio codec */
75#define HAVE_TLV320 77#define HAVE_TLV320
76 78
79/*#define CONFIG_TUNER TEA5767*/
80
77/* TLV320 has no tone controls, so we use the software ones */ 81/* TLV320 has no tone controls, so we use the software ones */
78#define HAVE_SW_TONE_CONTROLS 82#define HAVE_SW_TONE_CONTROLS
79 83
@@ -102,14 +106,11 @@
102/* Define this to the CPU frequency */ 106/* Define this to the CPU frequency */
103#define CPU_FREQ 120000000 107#define CPU_FREQ 120000000
104 108
105/* Offset ( in the firmware file's header ) to the file length */
106#define FIRMWARE_OFFSET_FILE_LENGTH 0
107
108/* Offset ( in the firmware file's header ) to the file CRC */ 109/* Offset ( in the firmware file's header ) to the file CRC */
109#define FIRMWARE_OFFSET_FILE_CRC 4 110#define FIRMWARE_OFFSET_FILE_CRC 0
110 111
111/* Offset ( in the firmware file's header ) to the real data */ 112/* Offset ( in the firmware file's header ) to the real data */
112#define FIRMWARE_OFFSET_FILE_DATA 6 113#define FIRMWARE_OFFSET_FILE_DATA 8
113 114
114/* The start address index for ROM builds */ 115/* The start address index for ROM builds */
115/* #define ROM_START 0x11010 for behind original Archos */ 116/* #define ROM_START 0x11010 for behind original Archos */
@@ -118,11 +119,11 @@
118/* Software controlled LED */ 119/* Software controlled LED */
119#define CONFIG_LED LED_VIRTUAL 120#define CONFIG_LED LED_VIRTUAL
120 121
121#define CONFIG_LCD LCD_S6B33B2 /* Not sure about this... same as C200? - MarcGuay */ 122#define CONFIG_LCD LCD_S6B33B2
122 123
123#define BOOTFILE_EXT "c100" 124#define BOOTFILE_EXT "c100"
124#define BOOTFILE "rockbox." BOOTFILE_EXT 125#define BOOTFILE "rockbox." BOOTFILE_EXT
125#define BOOTDIR "/" 126#define BOOTDIR "/.rockbox"
126 127
127#ifdef BOOTLOADER 128#ifdef BOOTLOADER
128#define TCCBOOT 129#define TCCBOOT
diff --git a/firmware/target/arm/pcm-telechips.c b/firmware/target/arm/pcm-telechips.c
index 06f6638e54..e172e62269 100644
--- a/firmware/target/arm/pcm-telechips.c
+++ b/firmware/target/arm/pcm-telechips.c
@@ -93,6 +93,8 @@ void pcm_play_dma_init(void)
93 /* TODO */ 93 /* TODO */
94#elif defined(SANSA_M200) 94#elif defined(SANSA_M200)
95 /* TODO */ 95 /* TODO */
96#elif defined(SANSA_C100)
97 /* TODO */
96#else 98#else
97#error "Target isn't supported" 99#error "Target isn't supported"
98#endif 100#endif
diff --git a/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c b/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
index c6ec9ee996..4f1ec2a1f2 100644
--- a/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
+++ b/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
@@ -28,7 +28,6 @@
28static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; 28static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
29 29
30/* LCD command set for Samsung S6B33B2 */ 30/* LCD command set for Samsung S6B33B2 */
31
32#define R_NOP 0x00 31#define R_NOP 0x00
33#define R_OSCILLATION_MODE 0x02 32#define R_OSCILLATION_MODE 0x02
34#define R_DRIVER_OUTPUT_MODE 0x10 33#define R_DRIVER_OUTPUT_MODE 0x10
@@ -179,7 +178,7 @@ void lcd_init_device(void)
179 178
180 lcd_send_command(R_SPEC_DISPLAY_PATTERN); 179 lcd_send_command(R_SPEC_DISPLAY_PATTERN);
181 lcd_send_command(0x0); 180 lcd_send_command(0x0);
182 181
183 /* Rockbox init */ 182 /* Rockbox init */
184 lcd_clear_display(); 183 lcd_clear_display();
185 lcd_update(); 184 lcd_update();
@@ -212,89 +211,27 @@ void lcd_set_flip(bool yesno)
212} 211}
213 212
214/*** update functions ***/ 213/*** update functions ***/
215
216void lcd_yuv_set_options(unsigned options) 214void lcd_yuv_set_options(unsigned options)
217{ 215{
218 lcd_yuv_options = options; 216 lcd_yuv_options = options;
219} 217}
220 218
221/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. */ 219/* TODO: implement me */
222extern void lcd_write_yuv420_lines(unsigned char const * const src[3], 220void lcd_blit_yuv(unsigned char *const src[3],
223 int width,
224 int stride);
225extern void lcd_write_yuv420_lines_odither(unsigned char const * const src[3],
226 int width,
227 int stride,
228 int x_screen, /* To align dither pattern */
229 int y_screen);
230/* Performance function to blit a YUV bitmap directly to the LCD */
231void lcd_blit_yuv(unsigned char * const src[3],
232 int src_x, int src_y, int stride, 221 int src_x, int src_y, int stride,
233 int x, int y, int width, int height) 222 int x, int y, int width, int height)
234{ 223{
235 unsigned char const * yuv_src[3]; 224 (void) src;
236 off_t z; 225 (void) src_x;
226 (void) src_y;
227 (void) stride;
228 (void) x;
229 (void) y;
237 230
238 /* Sorry, but width and height must be >= 2 or else */ 231 return;
239 width &= ~1;
240 height >>= 1;
241
242 y += 0x1a;
243
244 z = stride*src_y;
245 yuv_src[0] = src[0] + z + src_x;
246 yuv_src[1] = src[1] + (z >> 2) + (src_x >> 1);
247 yuv_src[2] = src[2] + (yuv_src[1] - src[1]);
248 232
249 lcd_send_command(R_ENTRY_MODE);
250 lcd_send_command(0x80);
251
252 lcd_send_command(R_X_ADDR_AREA);
253 lcd_send_command(x);
254 lcd_send_command(x + width - 1);
255
256 if (lcd_yuv_options & LCD_YUV_DITHER)
257 {
258 do
259 {
260 lcd_send_command(R_Y_ADDR_AREA);
261 lcd_send_command(y);
262 lcd_send_command(y + 1);
263
264 /* NOP needed because on some c200s, the previous lcd_send_command
265 is interpreted as a separate command instead of part of
266 R_Y_ADDR_AREA. */
267 lcd_send_command(R_NOP);
268
269 lcd_write_yuv420_lines_odither(yuv_src, width, stride, x, y);
270 yuv_src[0] += stride << 1; /* Skip down two luma lines */
271 yuv_src[1] += stride >> 1; /* Skip down one chroma line */
272 yuv_src[2] += stride >> 1;
273 y += 2;
274 }
275 while (--height > 0);
276 }
277 else
278 {
279 do
280 {
281 lcd_send_command(R_Y_ADDR_AREA);
282 lcd_send_command(y);
283 lcd_send_command(y + 1);
284
285 lcd_send_command(R_NOP);
286
287 lcd_write_yuv420_lines(yuv_src, width, stride);
288 yuv_src[0] += stride << 1; /* Skip down two luma lines */
289 yuv_src[1] += stride >> 1; /* Skip down one chroma line */
290 yuv_src[2] += stride >> 1;
291 y += 2;
292 }
293 while (--height > 0);
294 }
295} 233}
296 234
297
298/* Update the display. 235/* Update the display.
299 This must be called after all other LCD functions that change the display. */ 236 This must be called after all other LCD functions that change the display. */
300void lcd_update(void) 237void lcd_update(void)