Support for mystery FM chip in some Sansa Clip+, FS #11403 by me
[kugel-rb.git] / firmware / export / config.h
blob7f775141160f2c63ac54f496980acd975190c9c9
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Daniel Stenberg
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef __CONFIG_H__
23 #define __CONFIG_H__
25 #include "autoconf.h"
27 /* symbolic names for multiple choice configurations: */
29 /* CONFIG_STORAGE (note these are combineable bit-flags) */
30 #define STORAGE_ATA 0x01
31 #define STORAGE_MMC 0x02
32 #define STORAGE_SD 0x04
33 #define STORAGE_NAND 0x08
34 #define STORAGE_RAMDISK 0x10
36 /* CONFIG_TUNER (note these are combineable bit-flags) */
37 #define S1A0903X01 0x01 /* Samsung */
38 #define TEA5767 0x02 /* Philips */
39 #define LV24020LP 0x04 /* Sanyo */
40 #define SI4700 0x08 /* Silicon Labs */
41 #define TEA5760 0x10 /* Philips */
42 #define LV240000 0x20 /* Sanyo */
43 #define IPOD_REMOTE_TUNER 0x40 /* Apple */
44 #define FMCLIPPLUS 0x80 /* Mystery SiLabs FM tuner in some clip+ */
46 /* CONFIG_CODEC */
47 #define MAS3587F 3587
48 #define MAS3507D 3507
49 #define MAS3539F 3539
50 #define SWCODEC 1 /* if codec is done by SW */
52 /* CONFIG_CPU */
53 #define SH7034 7034
54 #define MCF5249 5249
55 #define MCF5250 5250
56 #define PP5002 5002
57 #define PP5020 5020
58 #define PP5022 5022
59 #define PP5024 5024
60 #define PP6100 6100
61 #define PNX0101 101
62 #define S3C2440 2440
63 #define DSC25 25
64 #define DM320 320
65 #define IMX31L 31
66 #define TCC770 770
67 #define TCC771L 771
68 #define TCC773L 773
69 #define TCC7801 7801
70 #define S5L8700 8700
71 #define S5L8701 8701
72 #define JZ4732 4732
73 #define AS3525 3525
74 #define AT91SAM9260 9260
75 #define AS3525v2 35252
77 /* CONFIG_KEYPAD */
78 #define PLAYER_PAD 1
79 #define RECORDER_PAD 2
80 #define ONDIO_PAD 3
81 #define IRIVER_H100_PAD 4
82 #define IRIVER_H300_PAD 5
83 #define IAUDIO_X5M5_PAD 6
84 #define IPOD_4G_PAD 7
85 #define IPOD_3G_PAD 8
86 #define IPOD_1G2G_PAD 9
87 #define IRIVER_IFP7XX_PAD 10
88 #define GIGABEAT_PAD 11
89 #define IRIVER_H10_PAD 12
90 #define SANSA_E200_PAD 13
91 #define SANSA_C200_PAD 14
92 #define TATUNG_TPJ1022_PAD 15
93 #define ARCHOS_AV300_PAD 16
94 #define MROBE100_PAD 17
95 #define MROBE500_PAD 18
96 #define GIGABEAT_S_PAD 19
97 #define LOGIK_DAX_PAD 20
98 #define IAUDIO67_PAD 21
99 #define COWON_D2_PAD 22
100 #define IAUDIO_M3_PAD 23
101 #define CREATIVEZVM_PAD 24
102 #define SANSA_M200_PAD 25
103 #define CREATIVEZV_PAD 26
104 #define PHILIPS_SA9200_PAD 27
105 #define SANSA_C100_PAD 28
106 #define PHILIPS_HDD1630_PAD 29
107 #define MEIZU_M6SL_PAD 30
108 #define ONDAVX747_PAD 31
109 #define ONDAVX767_PAD 32
110 #define MEIZU_M6SP_PAD 33
111 #define MEIZU_M3_PAD 34
112 #define SANSA_CLIP_PAD 35
113 #define SANSA_FUZE_PAD 36
114 #define LYRE_PROTO1_PAD 37
115 #define SAMSUNG_YH_PAD 38
116 #define ONDAVX777_PAD 39
117 #define SAMSUNG_YPS3_PAD 40
118 #define MINI2440_PAD 41
119 #define PHILIPS_HDD6330_PAD 42
120 #define PBELL_VIBE500_PAD 43
121 #define MPIO_HD200_PAD 44
123 /* CONFIG_REMOTE_KEYPAD */
124 #define H100_REMOTE 1
125 #define H300_REMOTE 2
126 #define X5_REMOTE 3
127 #define MROBE_REMOTE 4
129 /* CONFIG_BACKLIGHT_FADING */
130 /* No fading capabilities at all (yet) */
131 #define BACKLIGHT_NO_FADING 0x0
132 /* Backlight fading is controlled using a hardware PWM mechanism */
133 #define BACKLIGHT_FADING_PWM 0x1
134 /* Backlight is controlled using a software implementation
135 * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting
136 * the brightness (i.e. no real difference between backlight_on and
137 * backlight_set_brightness)
138 * BACKLIGHT_FADING_SW_HW_REG means that backlight brightness is restored
139 * "in hardware", from a hardware register upon backlight_on
140 * Both types need to have minor adjustments in the software fading code */
141 #define BACKLIGHT_FADING_SW_SETTING 0x2
142 #define BACKLIGHT_FADING_SW_HW_REG 0x4
143 /* Backlight fading is done in a target specific way
144 * for example in hardware, but not controllable*/
145 #define BACKLIGHT_FADING_TARGET 0x8
147 /* CONFIG_CHARGING */
149 /* Generic types */
150 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging
151 * (CPU cannot read charger state but may read
152 * when power is plugged-in). */
153 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring
154 * (CPU is able to read HW charging state and
155 * when power is plugged-in). */
157 /* Mostly target-specific code in the /target tree */
158 #define CHARGING_TARGET 3 /* Any algorithm - usually software controlled
159 * charging or specific programming is required to
160 * use the charging hardware. */
162 /* CONFIG_LCD */
163 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
164 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
165 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
166 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
167 unknown at the time of this writing */
168 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
169 unknown at the time of this writing */
170 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
171 #define LCD_IPODNANO 7 /* as used by iPod Nano */
172 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
173 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
174 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
175 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
176 #define LCD_GIGABEAT 12
177 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
178 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
179 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
180 #define LCD_DSC25 16 /* as used by Archos AV300 */
181 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
182 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
183 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
184 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
185 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
186 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
187 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
188 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
189 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
190 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
191 #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
192 #define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
193 #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
194 #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
195 #define LCD_SSD1303 31 /* as used by the Sansa Clip */
196 #define LCD_FUZE 32 /* as used by the Sansa Fuze */
197 #define LCD_LYRE_PROTO1 33 /* as used by the Lyre prototype 1 */
198 #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */
199 #define LCD_VIEW 35 /* as used by the Sansa View */
200 #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */
201 #define LCD_MINI2440 37 /* as used by the Mini2440 */
202 #define LCD_HDD6330 38 /* as used by the Philips HDD6330 */
203 #define LCD_VIBE500 39 /* as used by the Packard Bell Vibe 500 */
205 /* LCD_PIXELFORMAT */
206 #define HORIZONTAL_PACKING 1
207 #define VERTICAL_PACKING 2
208 #define HORIZONTAL_INTERLEAVED 3
209 #define VERTICAL_INTERLEAVED 4
210 #define RGB565 565
211 #define RGB565SWAPPED 3553
213 /* LCD_STRIDEFORMAT */
214 #define VERTICAL_STRIDE 1
215 #define HORIZONTAL_STRIDE 2
217 /* CONFIG_ORIENTATION */
218 #define SCREEN_PORTRAIT 0
219 #define SCREEN_LANDSCAPE 1
220 #define SCREEN_SQUARE 2
222 /* CONFIG_I2C */
223 #define I2C_NONE 0 /* For targets that do not use I2C - as the
224 Lyre prototype 1 */
225 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
226 #define I2C_ONDIO 2 /* Ondio style */
227 #define I2C_COLDFIRE 3 /* Coldfire style */
228 #define I2C_PP5002 4 /* PP5002 style */
229 #define I2C_PP5020 5 /* PP5020 style */
230 #define I2C_PNX0101 6 /* PNX0101 style */
231 #define I2C_S3C2440 7
232 #define I2C_PP5024 8 /* PP5024 style */
233 #define I2C_IMX31L 9
234 #define I2C_TCC77X 10
235 #define I2C_TCC780X 11
236 #define I2C_DM320 12 /* DM320 style */
237 #define I2C_S5L8700 13
238 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
239 #define I2C_AS3525 15
241 /* CONFIG_LED */
242 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
243 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
244 /* else HW controlled LED (iRiver H1x0) */
246 /* CONFIG_NAND */
247 #define NAND_IFP7XX 1
248 #define NAND_TCC 2
249 #define NAND_SAMSUNG 3
250 #define NAND_CC 4 /* ChinaChip */
252 /* CONFIG_RTC */
253 #define RTC_M41ST84W 1 /* Archos Recorder */
254 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
255 #define RTC_PCF50606 3 /* iriver H300 */
256 #define RTC_S3C2440 4
257 #define RTC_E8564 5 /* iriver H10 */
258 #define RTC_AS3514 6 /* Sandisk Sansa series */
259 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
260 #define RTC_IMX31L 8
261 #define RTC_RX5X348AB 9
262 #define RTC_TCC77X 10
263 #define RTC_TCC780X 11
264 #define RTC_MR100 12
265 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
266 #define RTC_S5L8700 14
267 #define RTC_S35390A 15
268 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
269 #define RTC_NANO2G 17 /* This seems to be a PCF5063x */
270 #define RTC_D2 18 /* Either PCF50606 or PCF50635 */
272 /* USB On-the-go */
273 #define USBOTG_M66591 6591 /* M:Robe 500 */
274 #define USBOTG_ISP1362 1362 /* iriver H300 */
275 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
276 #define USBOTG_M5636 5636 /* iAudio X5 */
277 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
278 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
279 #define USBOTG_AS3525 3525 /* AMS AS3525 */
280 #define USBOTG_AS3525v2 3535 /* AMS AS3525v2 */
281 #define USBOTG_S3C6400X 6400 /* Samsung S3C6400X, also used in the S5L8701 */
283 /* Multiple cores */
284 #define CPU 0
285 #define COP 1
287 /* now go and pick yours */
288 #if defined(ARCHOS_PLAYER)
289 #include "config/archosplayer.h"
290 #elif defined(ARCHOS_RECORDER)
291 #include "config/archosrecorder.h"
292 #elif defined(ARCHOS_FMRECORDER)
293 #include "config/archosfmrecorder.h"
294 #elif defined(ARCHOS_RECORDERV2)
295 #include "config/archosrecorderv2.h"
296 #elif defined(ARCHOS_ONDIOSP)
297 #include "config/archosondiosp.h"
298 #elif defined(ARCHOS_ONDIOFM)
299 #include "config/archosondiofm.h"
300 #elif defined(ARCHOS_AV300)
301 #include "config/archosav300.h"
302 #elif defined(IRIVER_H100)
303 #include "config/iriverh100.h"
304 #elif defined(IRIVER_H120)
305 #include "config/iriverh120.h"
306 #elif defined(IRIVER_H300)
307 #include "config/iriverh300.h"
308 #elif defined(IAUDIO_X5)
309 #include "config/iaudiox5.h"
310 #elif defined(IAUDIO_M5)
311 #include "config/iaudiom5.h"
312 #elif defined(IAUDIO_M3)
313 #include "config/iaudiom3.h"
314 #elif defined(IPOD_COLOR)
315 #include "config/ipodcolor.h"
316 #elif defined(IPOD_NANO)
317 #include "config/ipodnano1g.h"
318 #elif defined(IPOD_VIDEO)
319 #include "config/ipodvideo.h"
320 #elif defined(IPOD_1G2G)
321 #include "config/ipod1g2g.h"
322 #elif defined(IPOD_3G)
323 #include "config/ipod3g.h"
324 #elif defined(IPOD_4G)
325 #include "config/ipod4g.h"
326 #elif defined(IPOD_NANO2G)
327 #include "config/ipodnano2g.h"
328 #elif defined(IRIVER_IFP7XX)
329 #include "config/iriverifp7xx.h"
330 #elif defined(GIGABEAT_F)
331 #include "config/gigabeatfx.h"
332 #elif defined(GIGABEAT_S)
333 #include "config/gigabeats.h"
334 #elif defined(IPOD_MINI)
335 #include "config/ipodmini1g.h"
336 #elif defined(IPOD_MINI2G)
337 #include "config/ipodmini2g.h"
338 #elif defined(IRIVER_H10)
339 #include "config/iriverh10.h"
340 #elif defined(IRIVER_H10_5GB)
341 #include "config/iriverh10_5gb.h"
342 #elif defined(SANSA_E200)
343 #include "config/sansae200.h"
344 #elif defined(SANSA_C200)
345 #include "config/sansac200.h"
346 #elif defined(SANSA_M200)
347 #include "config/sansam200.h"
348 #elif defined(TATUNG_TPJ1022)
349 #include "config/tatungtpj1022.h"
350 #elif defined(MROBE_100)
351 #include "config/mrobe100.h"
352 #elif defined(MROBE_500)
353 #include "config/mrobe500.h"
354 #elif defined(LOGIK_DAX)
355 #include "config/logikdax.h"
356 #elif defined(IAUDIO_7)
357 #include "config/iaudio7.h"
358 #elif defined(COWON_D2)
359 #include "config/cowond2.h"
360 #elif defined(CREATIVE_ZVM)
361 #include "config/zenvisionm30gb.h"
362 #elif defined(CREATIVE_ZVM60GB)
363 #include "config/zenvisionm60gb.h"
364 #elif defined(CREATIVE_ZV)
365 #include "config/zenvision.h"
366 #elif defined(PHILIPS_SA9200)
367 #include "config/gogearsa9200.h"
368 #elif defined(PHILIPS_HDD1630)
369 #include "config/gogearhdd1630.h"
370 #elif defined(PHILIPS_HDD6330)
371 #include "config/gogearhdd6330.h"
372 #elif defined(SANSA_C100)
373 #include "config/sansac100.h"
374 #elif defined(MEIZU_M6SL)
375 #include "config/meizum6sl.h"
376 #elif defined(MEIZU_M6SP)
377 #include "config/meizum6sp.h"
378 #elif defined(MEIZU_M3)
379 #include "config/meizum3.h"
380 #elif defined(ONDA_VX747) || defined(ONDA_VX747P)
381 #include "config/ondavx747.h"
382 #elif defined(ONDA_VX777)
383 #include "config/ondavx777.h"
384 #elif defined(ONDA_VX767)
385 #include "config/ondavx767.h"
386 #elif defined(SANSA_CLIP)
387 #include "config/sansaclip.h"
388 #elif defined(SANSA_CLIPV2)
389 #include "config/sansaclipv2.h"
390 #elif defined(SANSA_CLIPPLUS)
391 #include "config/sansaclipplus.h"
392 #elif defined(SANSA_E200V2)
393 #include "config/sansae200v2.h"
394 #elif defined(SANSA_M200V4)
395 #include "config/sansam200v4.h"
396 #elif defined(SANSA_FUZE)
397 #include "config/sansafuze.h"
398 #elif defined(SANSA_FUZEV2)
399 #include "config/sansafuzev2.h"
400 #elif defined(SANSA_C200V2)
401 #include "config/sansac200v2.h"
402 #elif defined(SANSA_VIEW)
403 #include "config/sansaview.h"
404 #elif defined(LYRE_PROTO1)
405 #include "config/lyreproto1.h"
406 #elif defined(MINI2440)
407 #include "config/mini2440.h"
408 #elif defined(SAMSUNG_YH820)
409 #include "config/samsungyh820.h"
410 #elif defined(SAMSUNG_YH920)
411 #include "config/samsungyh920.h"
412 #elif defined(SAMSUNG_YH925)
413 #include "config/samsungyh925.h"
414 #elif defined(SAMSUNG_YPS3)
415 #include "config/samsungyps3.h"
416 #elif defined(PBELL_VIBE500)
417 #include "config/vibe500.h"
418 #elif defined(MPIO_HD200)
419 #include "config/mpiohd200.h"
420 #else
421 /* no known platform */
422 #endif
424 /* keep this include after the target configs */
425 #ifdef SIMULATOR
426 #include "config/sim.h"
427 #endif
429 /* setup basic macros from capability masks */
430 #include "config_caps.h"
432 /* setup CPU-specific defines */
434 /* define for all cpus from SH family */
435 #if (CONFIG_CPU == SH7034)
436 #define CPU_SH
437 #endif
439 /* define for all cpus from coldfire family */
440 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
441 #define CPU_COLDFIRE
442 #endif
444 /* define for all cpus from PP family */
445 #if (CONFIG_CPU == PP5002)
446 #define CPU_PP
447 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) \
448 || (CONFIG_CPU == PP5024) || (CONFIG_CPU == PP6100)
449 #define CPU_PP
450 #define CPU_PP502x
451 #endif
453 /* define for all cpus from S5L870X family */
454 #if (CONFIG_CPU == S5L8700) || (CONFIG_CPU == S5L8701)
455 #define CPU_S5L870X
456 #endif
458 /* define for all cpus from TCC77X family */
459 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
460 #define CPU_TCC77X
461 #endif
463 /* define for all cpus from TCC780 family */
464 #if (CONFIG_CPU == TCC7801)
465 #define CPU_TCC780X
466 #endif
468 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
469 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
470 #define CPU_ARM7TDMI
471 #endif
473 /* define for all cpus from ARM family */
474 #if (CONFIG_CPU == IMX31L)
475 #define CPU_ARM
476 #define ARM_ARCH 6 /* ARMv6 */
478 #elif defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \
479 || (CONFIG_CPU == AT91SAM9260) || (CONFIG_CPU == AS3525v2)
480 #define CPU_ARM
481 #define ARM_ARCH 5 /* ARMv5 */
483 #elif defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
484 || (CONFIG_CPU == DSC25) || defined(CPU_S5L870X) || (CONFIG_CPU == AS3525)
485 #define CPU_ARM
486 #define ARM_ARCH 4 /* ARMv4 */
487 #endif
489 #if (CONFIG_CPU == JZ4732)
490 #define CPU_MIPS 32
491 #endif
493 /* now set any CONFIG_ defines correctly if they are not used,
494 No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */
496 #if !defined(CONFIG_BACKLIGHT_FADING)
497 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
498 #endif
500 #ifndef CONFIG_TUNER
501 #define CONFIG_TUNER 0
502 #endif
504 #ifndef CONFIG_USBOTG
505 #define CONFIG_USBOTG 0
506 #endif
508 #ifndef CONFIG_LED
509 #define CONFIG_LED LED_VIRTUAL
510 #endif
512 #ifndef CONFIG_CHARGING
513 #define CONFIG_CHARGING 0
514 #endif
516 #ifndef CONFIG_RTC
517 #define CONFIG_RTC 0
518 #endif
520 #ifndef CONFIG_ORIENTATION
521 #if LCD_HEIGHT > LCD_WIDTH
522 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
523 #elif LCD_HEIGHT < LCD_WIDTH
524 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
525 #else
526 #define CONFIG_ORIENTATION SCREEN_SQUARE
527 #endif
528 #endif
530 /* Pixel aspect ratio is defined in terms of a multiplier for pixel width and
531 * height, and is set to 1:1 if the target does not set a value
533 #ifndef LCD_PIXEL_ASPECT_HEIGHT
534 #define LCD_PIXEL_ASPECT_HEIGHT 1
535 #endif
536 #ifndef LCD_PIXEL_ASPECT_WIDTH
537 #define LCD_PIXEL_ASPECT_WIDTH 1
538 #endif
540 /* Used for split displays (Sansa Clip). Set to 0 otherwise */
541 #ifndef LCD_SPLIT_LINES
542 #define LCD_SPLIT_LINES 0
543 #endif
545 /* Simulator LCD dimensions. Set to standard dimensions if undefined */
546 #ifndef SIM_LCD_WIDTH
547 #define SIM_LCD_WIDTH LCD_WIDTH
548 #endif
549 #ifndef SIM_LCD_HEIGHT
550 #define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES)
551 #endif
553 #ifdef HAVE_REMOTE_LCD
554 #ifndef SIM_REMOTE_WIDTH
555 #define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH
556 #endif
557 #ifndef SIM_REMOTE_HEIGHT
558 #define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT
559 #endif
560 #endif /* HAVE_REMOTE_LCD */
562 /* define this in the target config.h to use a different size */
563 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
564 #define CONFIG_DEFAULT_ICON_HEIGHT 8
565 #endif
566 #ifndef CONFIG_DEFAULT_ICON_WIDTH
567 #define CONFIG_DEFAULT_ICON_WIDTH 6
568 #endif
569 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
570 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
571 #endif
572 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
573 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
574 #endif
576 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
577 /* Multiple possible tuners */
578 #define CONFIG_TUNER_MULTI
579 #endif
581 /* deactivate fading in bootloader */
582 #if defined(BOOTLOADER)
583 #undef CONFIG_BACKLIGHT_FADING
584 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
585 #endif
587 /* determine which setting/manual text to use */
588 #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
590 /* possibly overridden in target config */
591 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
592 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
593 #define HAVE_BACKLIGHT_FADING_INT_SETTING
594 #endif
596 #elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
597 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \
598 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET)
600 /* possibly overridden in target config */
601 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
602 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
603 #define HAVE_BACKLIGHT_FADING_BOOL_SETTING
604 #endif
606 #endif /* CONFIG_BACKLIGHT_FADING */
608 /* Storage related config handling */
610 #if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
611 /* Multiple storage drivers */
612 #define CONFIG_STORAGE_MULTI
613 #endif
615 /* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */
616 #ifdef HAVE_MULTIVOLUME
617 #define NUM_VOLUMES_PER_DRIVE 4
618 #else
619 #define NUM_VOLUMES_PER_DRIVE 1
620 #endif
621 #if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE)
622 #define HAVE_MULTIDRIVE
623 #endif
625 #if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME)
626 #define HAVE_MULTIVOLUME
627 #endif
629 #if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES)
630 #error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES
631 #endif
633 #ifndef NUM_DRIVES
634 #define NUM_DRIVES 1
635 #endif
637 #define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE)
639 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
640 /* Bootloaders don't use CPU frequency adjustment */
641 #undef HAVE_ADJUSTABLE_CPU_FREQ
642 #endif
644 /* Enable the directory cache and tagcache in RAM if we have
645 * plenty of RAM. Both features can be enabled independently. */
646 #if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \
647 !defined(BOOTLOADER) && !defined(__PCTOOL__)
648 #define HAVE_DIRCACHE
649 #ifdef HAVE_TAGCACHE
650 #define HAVE_TC_RAMCACHE
651 #endif
652 #endif
654 #if defined(HAVE_TAGCACHE) && defined(HAVE_LCD_BITMAP)
655 #define HAVE_PICTUREFLOW_INTEGRATION
656 #endif
658 /* Add one HAVE_ define for all mas35xx targets */
659 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
660 #define HAVE_MAS35XX
661 #endif
663 #if (CONFIG_CODEC == SWCODEC)
664 #ifdef BOOTLOADER
666 #if CONFIG_CPU == IMX31L
667 /* Priority in bootloader is wanted */
668 #define HAVE_PRIORITY_SCHEDULING
669 #define USB_STATUS_BY_EVENT
670 #define USB_DETECT_BY_DRV
671 #endif
673 #else /* !BOOTLOADER */
675 #define HAVE_EXTENDED_MESSAGING_AND_NAME
676 #define HAVE_WAKEUP_EXT_CB
678 #ifndef SIMULATOR
679 #define HAVE_PRIORITY_SCHEDULING
680 #define HAVE_SCHEDULER_BOOSTCTRL
681 #endif /* SIMULATOR */
683 #define HAVE_SEMAPHORE_OBJECTS
685 #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
686 #define USB_STATUS_BY_EVENT
687 #define USB_DETECT_BY_DRV
688 #if CONFIG_CPU != IMX31L
689 #define INCLUDE_TIMEOUT_API
690 #endif
691 #endif /* HAVE_USBSTACK */
694 #endif /* BOOTLOADER */
696 #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \
697 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \
698 || defined(CPU_S5L870X) || (CONFIG_CPU == S3C2440)
699 #define HAVE_WAKEUP_OBJECTS
700 #endif
702 /*include support for crossfading - requires significant PCM buffer space*/
703 #if MEMORYSIZE > 2
704 #define HAVE_CROSSFADE
705 #endif
707 #endif /* (CONFIG_CODEC == SWCODEC) */
709 /* Determine if accesses should be strictly long aligned. */
710 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM) || defined(CPU_MIPS)
711 #define ROCKBOX_STRICT_ALIGN 1
712 #endif
714 #if defined(CPU_ARM) && defined(__ASSEMBLER__)
715 /* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */
716 .macro ldmpc cond="", order="ia", regs
717 #if ARM_ARCH == 4 && defined(USE_THUMB)
718 ldm\cond\order sp!, { \regs, lr }
719 bx\cond lr
720 #else
721 ldm\cond\order sp!, { \regs, pc }
722 #endif
723 .endm
724 .macro ldrpc cond=""
725 #if ARM_ARCH == 4 && defined(USE_THUMB)
726 ldr\cond lr, [sp], #4
727 bx\cond lr
728 #else
729 ldr\cond pc, [sp], #4
730 #endif
731 .endm
732 #endif
734 #ifndef CODEC_SIZE
735 #define CODEC_SIZE 0
736 #endif
738 /* This attribute can be used to ensure that certain symbols are never profiled
739 * which can be important as profiling a function de-inlines it */
740 #ifdef RB_PROFILE
741 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
742 #else
743 #define NO_PROF_ATTR
744 #endif
746 /* IRAM usage */
747 #if !defined(SIMULATOR) && /* Not for simulators */ \
748 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
749 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
750 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
751 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \
752 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB: core only */ \
753 (CONFIG_CPU == AS3525v2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525v2: core only */ \
754 (CONFIG_CPU == PNX0101) || \
755 (CONFIG_CPU == TCC7801) || \
756 defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \
757 (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */
758 #define ICODE_ATTR __attribute__ ((section(".icode")))
759 #define ICONST_ATTR __attribute__ ((section(".irodata")))
760 #define IDATA_ATTR __attribute__ ((section(".idata")))
761 #define IBSS_ATTR __attribute__ ((section(".ibss")))
762 #define USE_IRAM
763 #if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
764 && CONFIG_CPU != JZ4732 && CONFIG_CPU != AS3525v2
765 #define PLUGIN_USE_IRAM
766 #endif
767 #if defined(CPU_ARM) && !defined(__ARM_EABI__)
768 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
769 * when not compiling with -ffunction-sections, even when the function has
770 * a section attribute.
771 * This is fixed with eabi since all calls are short ones by default */
772 #define STATICIRAM
773 #else
774 #define STATICIRAM static
775 #endif
776 #else
777 #define ICODE_ATTR
778 #define ICONST_ATTR
779 #define IDATA_ATTR
780 #define IBSS_ATTR
781 #define STATICIRAM static
782 #endif
783 #if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
784 (CONFIG_CPU == IMX31L)) \
785 && !defined(SIMULATOR) && !defined(BOOTLOADER)
786 /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
787 * root_menu() has been called. Their code may be overwritten by other data or
788 * code in order to save RAM, and references to them might point into
789 * zombie area.
791 * It is critical that you make sure these functions are only called before
792 * the final call to root_menu() (see apps/main.c) is called (i.e. basically
793 * only while main() runs), otherwise things may go wild,
794 * from crashes to freezes to exploding daps.
796 #define INIT_ATTR __attribute__ ((section(".init")))
797 #define HAVE_INIT_ATTR
798 #else
799 #define INIT_ATTR
800 #endif
802 #if defined(SIMULATOR) && defined(__APPLE__)
803 #define DATA_ATTR __attribute__ ((section("__DATA, .data")))
804 #else
805 #define DATA_ATTR __attribute__ ((section(".data")))
806 #endif
808 #ifndef IRAM_LCDFRAMEBUFFER
809 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
810 #define IRAM_LCDFRAMEBUFFER
811 #endif
813 /* Change this if you want to build a single-core firmware for a multicore
814 * target for debugging */
815 #if defined(BOOTLOADER) || (CONFIG_CPU == PP6100)
816 #define FORCE_SINGLE_CORE
817 #endif
819 #if defined(CPU_PP)
820 #define IDLE_STACK_SIZE 0x80
821 #define IDLE_STACK_WORDS 0x20
823 /* Attributes to place data in uncached DRAM */
824 /* These are useful beyond dual-core and ultimately beyond PP since they may
825 * be used for DMA buffers and such without cache maintenence calls. */
826 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
827 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
829 #if !defined(FORCE_SINGLE_CORE)
831 #define NUM_CORES 2
832 #define HAVE_CORELOCK_OBJECT
833 #define CURRENT_CORE current_core()
834 /* Attributes for core-shared data in DRAM where IRAM is better used for other
835 * purposes. */
836 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
837 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
839 #define IF_COP(...) __VA_ARGS__
840 #define IF_COP_VOID(...) __VA_ARGS__
841 #define IF_COP_CORE(core) core
843 #endif /* !defined(FORCE_SINGLE_CORE) */
845 #endif /* CPU_PP */
847 #if CONFIG_CPU == IMX31L
848 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
849 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
850 #endif
852 #ifndef NUM_CORES
853 /* Default to single core */
854 #define NUM_CORES 1
855 #define CURRENT_CORE CPU
856 /* Attributes for core-shared data in DRAM - no caching considerations */
857 #define SHAREDBSS_ATTR
858 #define SHAREDDATA_ATTR
859 #ifndef NOCACHEBSS_ATTR
860 #define NOCACHEBSS_ATTR
861 #define NOCACHEDATA_ATTR
862 #endif
864 #define IF_COP(...)
865 #define IF_COP_VOID(...) void
866 #define IF_COP_CORE(core) CURRENT_CORE
868 #endif /* NUM_CORES */
870 #ifdef HAVE_HEADPHONE_DETECTION
871 /* Timeout objects required if headphone detection is enabled */
872 #ifndef INCLUDE_TIMEOUT_API
873 #define INCLUDE_TIMEOUT_API
874 #endif
875 #endif /* HAVE_HEADPHONE_DETECTION */
877 #if defined(HAVE_USB_CHARGING_ENABLE) && defined(HAVE_USBSTACK)
878 /* USB charging support in the USB stack requires timeout objects */
879 #ifndef INCLUDE_TIMEOUT_API
880 #define INCLUDE_TIMEOUT_API
881 #endif
882 #endif /* HAVE_USB_CHARGING_ENABLE && HAVE_USBSTACK */
884 #if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
885 #define STORAGE_GET_INFO
886 #endif
888 #ifdef CPU_MIPS
889 #include <stdbool.h> /* MIPS GCC fix? */
890 #endif
892 #if defined(HAVE_USBSTACK)
893 /* Define the implemented USB transport classes */
894 #if CONFIG_USBOTG == USBOTG_ISP1583
895 #define USB_HAS_BULK
896 #elif (CONFIG_USBOTG == USBOTG_ARC) || \
897 (CONFIG_USBOTG == USBOTG_JZ4740) || \
898 (CONFIG_USBOTG == USBOTG_M66591)
899 #define USB_HAS_BULK
900 #define USB_HAS_INTERRUPT
901 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
902 #define USB_HAS_BULK
903 #elif CONFIG_USBOTG == USBOTG_S3C6400X
904 #define USB_HAS_BULK
905 //#define USB_HAS_INTERRUPT -- seems to be broken
906 #endif /* CONFIG_USBOTG */
908 #if CONFIG_USBOTG == USBOTG_ARC
909 #define USB_HAS_ISOCHRONOUS
910 #endif
912 /* define the class drivers to enable */
913 #ifdef BOOTLOADER
915 /* enable usb storage for targets that do bootloader usb */
916 #if (defined(TOSHIBA_GIGABEAT_S) || \
917 (defined(CREATIVE_ZVx) || \
918 defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \
919 (CONFIG_USBOTG == USBOTG_JZ4740) || defined(IPOD_NANO2G)
920 #define USB_ENABLE_STORAGE
921 #endif
923 #else /* BOOTLOADER */
925 #ifndef SIMULATOR
926 //#define USB_ENABLE_SERIAL
927 #define USB_ENABLE_STORAGE
929 #ifdef USB_HAS_INTERRUPT
930 #define USB_ENABLE_HID
931 #else
932 #define USB_ENABLE_CHARGING_ONLY
933 #endif
934 #endif
936 #endif /* BOOTLOADER */
938 #endif /* HAVE_USBSTACK */
940 /* This attribute can be used to enable to detection of plugin file handles leaks.
941 * When enabled, the plugin core will monitor open/close/creat and when the plugin exits
942 * will display an error message if the plugin leaked some file handles */
943 #ifndef SIMULATOR
944 #define HAVE_PLUGIN_CHECK_OPEN_CLOSE
945 #endif
947 #if defined(HAVE_DIRCACHE) && !defined(SIMULATOR)
948 #define HAVE_IO_PRIORITY
949 #endif
951 #endif /* __CONFIG_H__ */