Reworked iPod Nano 2G PMU code, added RTC and battery ADC.
[kugel-rb.git] / firmware / export / config.h
blob941ee5f9b4c667bb3d5eaa9a3947d8b776f82be8
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 #ifndef __PCTOOL__
26 #include "autoconf.h"
27 #endif
29 /* symbolic names for multiple choice configurations: */
31 /* CONFIG_STORAGE (note these are combineable bit-flags) */
32 #define STORAGE_ATA 0x01
33 #define STORAGE_MMC 0x02
34 #define STORAGE_SD 0x04
35 #define STORAGE_NAND 0x08
36 #define STORAGE_RAMDISK 0x10
38 /* CONFIG_TUNER (note these are combineable bit-flags) */
39 #define S1A0903X01 0x01 /* Samsung */
40 #define TEA5767 0x02 /* Philips */
41 #define LV24020LP 0x04 /* Sanyo */
42 #define SI4700 0x08 /* Silicon Labs */
43 #define TEA5760 0x10 /* Philips */
44 #define LV240000 0x20 /* Sanyo */
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
76 /* CONFIG_KEYPAD */
77 #define PLAYER_PAD 1
78 #define RECORDER_PAD 2
79 #define ONDIO_PAD 3
80 #define IRIVER_H100_PAD 4
81 #define IRIVER_H300_PAD 5
82 #define IAUDIO_X5M5_PAD 6
83 #define IPOD_4G_PAD 7
84 #define IPOD_3G_PAD 8
85 #define IPOD_1G2G_PAD 9
86 #define IRIVER_IFP7XX_PAD 10
87 #define GIGABEAT_PAD 11
88 #define IRIVER_H10_PAD 12
89 #define SANSA_E200_PAD 13
90 #define SANSA_C200_PAD 14
91 #define ELIO_TPJ1022_PAD 15
92 #define ARCHOS_AV300_PAD 16
93 #define MROBE100_PAD 17
94 #define MROBE500_PAD 18
95 #define GIGABEAT_S_PAD 19
96 #define LOGIK_DAX_PAD 20
97 #define IAUDIO67_PAD 21
98 #define COWOND2_PAD 22
99 #define IAUDIO_M3_PAD 23
100 #define CREATIVEZVM_PAD 24
101 #define SANSA_M200_PAD 25
102 #define CREATIVEZV_PAD 26
103 #define PHILIPS_SA9200_PAD 27
104 #define SANSA_C100_PAD 28
105 #define PHILIPS_HDD1630_PAD 29
106 #define MEIZU_M6SL_PAD 30
107 #define ONDAVX747_PAD 31
108 #define ONDAVX767_PAD 32
109 #define MEIZU_M6SP_PAD 33
110 #define MEIZU_M3_PAD 34
111 #define SANSA_CLIP_PAD 35
112 #define SANSA_FUZE_PAD 36
113 #define LYRE_PROTO1_PAD 37
114 #define SAMSUNG_YH_PAD 38
115 #define ONDAVX777_PAD 39
116 #define SAMSUNG_YPS3_PAD 40
118 /* CONFIG_REMOTE_KEYPAD */
119 #define H100_REMOTE 1
120 #define H300_REMOTE 2
121 #define X5_REMOTE 3
122 #define MROBE_REMOTE 4
124 /* CONFIG_BACKLIGHT_FADING */
125 /* No fading capabilities at all (yet) */
126 #define BACKLIGHT_NO_FADING 0x0
127 /* Backlight fading is controlled using a hardware PWM mechanism */
128 #define BACKLIGHT_FADING_PWM 0x1
129 /* Backlight is controlled using a software implementation
130 * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting
131 * the brightness (i.e. no real difference between backlight_on and
132 * backlight_set_brightness)
133 * BACKLIGHT_FADING_SW_SETTING means that backlight brightness is restored
134 * "in hardware", from a hardware register upon backlight_on
135 * Both types need to have minor adjustments in the software fading code */
136 #define BACKLIGHT_FADING_SW_SETTING 0x2
137 #define BACKLIGHT_FADING_SW_HW_REG 0x4
138 /* Backlight fading is done in a target specific way
139 * for example in hardware, but not controllable*/
140 #define BACKLIGHT_FADING_TARGET 0x8
142 /*include support for crossfading - requires significant PCM buffer space*/
143 #if MEMORYSIZE > 2
144 #define HAVE_CROSSFADE
145 #endif
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 */
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 */
202 /* LCD_PIXELFORMAT */
203 #define HORIZONTAL_PACKING 1
204 #define VERTICAL_PACKING 2
205 #define HORIZONTAL_INTERLEAVED 3
206 #define VERTICAL_INTERLEAVED 4
207 #define RGB565 565
208 #define RGB565SWAPPED 3553
210 /* LCD_STRIDEFORMAT */
211 #define VERTICAL_STRIDE 1
212 #define HORIZONTAL_STRIDE 2
214 /* CONFIG_ORIENTATION */
215 #define SCREEN_PORTRAIT 0
216 #define SCREEN_LANDSCAPE 1
217 #define SCREEN_SQUARE 2
219 /* CONFIG_I2C */
220 #define I2C_NONE 0 /* For targets that do not use I2C - as the
221 Lyre prototype 1*/
222 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
223 #define I2C_ONDIO 2 /* Ondio style */
224 #define I2C_COLDFIRE 3 /* Coldfire style */
225 #define I2C_PP5002 4 /* PP5002 style */
226 #define I2C_PP5020 5 /* PP5020 style */
227 #define I2C_PNX0101 6 /* PNX0101 style */
228 #define I2C_S3C2440 7
229 #define I2C_PP5024 8 /* PP5024 style */
230 #define I2C_IMX31L 9
231 #define I2C_TCC77X 10
232 #define I2C_TCC780X 11
233 #define I2C_DM320 12 /* DM320 style */
234 #define I2C_S5L8700 13
235 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
236 #define I2C_AS3525 15
238 /* CONFIG_LED */
239 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
240 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
241 /* else HW controlled LED (iRiver H1x0) */
243 /* CONFIG_NAND */
244 #define NAND_IFP7XX 1
245 #define NAND_TCC 2
246 #define NAND_SAMSUNG 3
247 #define NAND_CC 4 /* ChinaChip */
249 /* CONFIG_RTC */
250 #define RTC_M41ST84W 1 /* Archos Recorder */
251 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
252 #define RTC_PCF50606 3 /* iriver H300 */
253 #define RTC_S3C2440 4
254 #define RTC_E8564 5 /* iriver H10 */
255 #define RTC_AS3514 6 /* Sandisk Sansa series */
256 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
257 #define RTC_IMX31L 8
258 #define RTC_RX5X348AB 9
259 #define RTC_TCC77X 10
260 #define RTC_TCC780X 11
261 #define RTC_MR100 12
262 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
263 #define RTC_S5L8700 14
264 #define RTC_S35390A 15
265 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
266 #define RTC_NANO2G 17 /* This seems to be a PCFxxxxx,
267 but we don't know which one */
269 /* USB On-the-go */
270 #define USBOTG_M66591 6591 /* M:Robe 500 */
271 #define USBOTG_ISP1362 1362 /* iriver H300 */
272 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
273 #define USBOTG_M5636 5636 /* iAudio X5 */
274 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
275 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
276 #define USBOTG_AS3525 3525 /* AMS AS3525 */
278 /* Multiple cores */
279 #define CPU 0
280 #define COP 1
282 /* now go and pick yours */
283 #if defined(ARCHOS_PLAYER)
284 #include "config-player.h"
285 #elif defined(ARCHOS_RECORDER)
286 #include "config-recorder.h"
287 #elif defined(ARCHOS_FMRECORDER)
288 #include "config-fmrecorder.h"
289 #elif defined(ARCHOS_RECORDERV2)
290 #include "config-recorderv2.h"
291 #elif defined(ARCHOS_ONDIOSP)
292 #include "config-ondiosp.h"
293 #elif defined(ARCHOS_ONDIOFM)
294 #include "config-ondiofm.h"
295 #elif defined(ARCHOS_AV300)
296 #include "config-av300.h"
297 #elif defined(IRIVER_H100)
298 #include "config-h100.h"
299 #elif defined(IRIVER_H120)
300 #include "config-h120.h"
301 #elif defined(IRIVER_H300)
302 #include "config-h300.h"
303 #elif defined(IAUDIO_X5)
304 #include "config-iaudiox5.h"
305 #elif defined(IAUDIO_M5)
306 #include "config-iaudiom5.h"
307 #elif defined(IAUDIO_M3)
308 #include "config-iaudiom3.h"
309 #elif defined(IPOD_COLOR)
310 #include "config-ipodcolor.h"
311 #elif defined(IPOD_NANO)
312 #include "config-ipodnano.h"
313 #elif defined(IPOD_VIDEO)
314 #include "config-ipodvideo.h"
315 #elif defined(IPOD_1G2G)
316 #include "config-ipod1g2g.h"
317 #elif defined(IPOD_3G)
318 #include "config-ipod3g.h"
319 #elif defined(IPOD_4G)
320 #include "config-ipod4g.h"
321 #elif defined(IPOD_NANO2G)
322 #include "config-ipodnano2g.h"
323 #elif defined(IRIVER_IFP7XX)
324 #include "config-ifp7xx.h"
325 #elif defined(GIGABEAT_F)
326 #include "config-gigabeat.h"
327 #elif defined(GIGABEAT_S)
328 #include "config-gigabeat-s.h"
329 #elif defined(IPOD_MINI)
330 #include "config-ipodmini.h"
331 #elif defined(IPOD_MINI2G)
332 #include "config-ipodmini2g.h"
333 #elif defined(IRIVER_H10)
334 #include "config-h10.h"
335 #elif defined(IRIVER_H10_5GB)
336 #include "config-h10_5gb.h"
337 #elif defined(SANSA_E200)
338 #include "config-e200.h"
339 #elif defined(SANSA_C200)
340 #include "config-c200.h"
341 #elif defined(SANSA_M200)
342 #include "config-m200.h"
343 #elif defined(ELIO_TPJ1022)
344 #include "config-tpj1022.h"
345 #elif defined(MROBE_100)
346 #include "config-mrobe100.h"
347 #elif defined(MROBE_500)
348 #include "config-mrobe500.h"
349 #elif defined(LOGIK_DAX)
350 #include "config-logikdax.h"
351 #elif defined(IAUDIO_7)
352 #include "config-iaudio7.h"
353 #elif defined(COWON_D2)
354 #include "config-cowond2.h"
355 #elif defined(CREATIVE_ZVM)
356 #include "config-creativezvm.h"
357 #elif defined(CREATIVE_ZVM60GB)
358 #include "config-creativezvm60gb.h"
359 #elif defined(CREATIVE_ZV)
360 #include "config-creativezv.h"
361 #elif defined(PHILIPS_SA9200)
362 #include "config-sa9200.h"
363 #elif defined(PHILIPS_HDD1630)
364 #include "config-hdd1630.h"
365 #elif defined(SANSA_C100)
366 #include "config-c100.h"
367 #elif defined(MEIZU_M6SL)
368 #include "config-meizu-m6sl.h"
369 #elif defined(MEIZU_M6SP)
370 #include "config-meizu-m6sp.h"
371 #elif defined(MEIZU_M3)
372 #include "config-meizu-m3.h"
373 #elif defined(ONDA_VX747) || defined(ONDA_VX747P) || defined(ONDA_VX777)
374 #include "config-ondavx747.h"
375 #elif defined(ONDA_VX767)
376 #include "config-ondavx767.h"
377 #elif defined(SANSA_CLIP)
378 #include "config-clip.h"
379 #elif defined(SANSA_E200V2)
380 #include "config-e200v2.h"
381 #elif defined(SANSA_M200V4)
382 #include "config-m200v4.h"
383 #elif defined(SANSA_FUZE)
384 #include "config-fuze.h"
385 #elif defined(SANSA_C200V2)
386 #include "config-c200v2.h"
387 #elif defined(SANSA_VIEW)
388 #include "config-view.h"
389 #elif defined(LYRE_PROTO1)
390 #include "config-lyre_proto1.h"
391 #elif defined(SAMSUNG_YH820)
392 #include "config-yh820.h"
393 #elif defined(SAMSUNG_YH920)
394 #include "config-yh920.h"
395 #elif defined(SAMSUNG_YH925)
396 #include "config-yh925.h"
397 #elif defined(SAMSUNG_YPS3)
398 #include "config-yps3.h"
399 #else
400 /* no known platform */
401 #endif
403 /* setup basic macros from capability masks */
404 #include "config_caps.h"
406 /* setup CPU-specific defines */
408 /* define for all cpus from SH family */
409 #if (CONFIG_CPU == SH7034)
410 #define CPU_SH
411 #endif
413 /* define for all cpus from coldfire family */
414 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
415 #define CPU_COLDFIRE
416 #endif
418 /* define for all cpus from PP family */
419 #if (CONFIG_CPU == PP5002)
420 #define CPU_PP
421 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) \
422 || (CONFIG_CPU == PP5024) || (CONFIG_CPU == PP6100)
423 #define CPU_PP
424 #define CPU_PP502x
425 #endif
427 /* define for all cpus from S5L870X family */
428 #if (CONFIG_CPU == S5L8700) || (CONFIG_CPU == S5L8701)
429 #define CPU_S5L870X
430 #endif
432 /* define for all cpus from TCC77X family */
433 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
434 #define CPU_TCC77X
435 #endif
437 /* define for all cpus from TCC780 family */
438 #if (CONFIG_CPU == TCC7801)
439 #define CPU_TCC780X
440 #endif
442 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
443 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
444 #define CPU_ARM7TDMI
445 #endif
447 /* define for all cpus from ARM family */
448 #if (CONFIG_CPU == IMX31L)
449 #define CPU_ARM
450 #define ARM_ARCH 6 /* ARMv6 */
451 #endif
453 #if defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \
454 || (CONFIG_CPU == AT91SAM9260)
455 #define CPU_ARM
456 #define ARM_ARCH 5 /* ARMv5 */
457 #endif
459 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
460 || (CONFIG_CPU == DSC25) || defined(CPU_S5L870X) || (CONFIG_CPU == AS3525)
461 #define CPU_ARM
462 #define ARM_ARCH 4 /* ARMv4 */
463 #endif
465 #if (CONFIG_CPU == JZ4732)
466 #define CPU_MIPS 32
467 #endif
469 /* now set any CONFIG_ defines correctly if they are not used,
470 No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */
472 #if !defined(CONFIG_BACKLIGHT_FADING)
473 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
474 #endif
476 #ifndef CONFIG_TUNER
477 #define CONFIG_TUNER 0
478 #endif
480 #ifndef CONFIG_USBOTG
481 #define CONFIG_USBOTG 0
482 #endif
484 #ifndef CONFIG_LED
485 #define CONFIG_LED LED_VIRTUAL
486 #endif
488 #ifndef CONFIG_CHARGING
489 #define CONFIG_CHARGING 0
490 #endif
492 #ifndef CONFIG_RTC
493 #define CONFIG_RTC 0
494 #endif
496 #ifndef CONFIG_ORIENTATION
497 #if LCD_HEIGHT > LCD_WIDTH
498 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
499 #elif LCD_HEIGHT < LCD_WIDTH
500 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
501 #else
502 #define CONFIG_ORIENTATION SCREEN_SQUARE
503 #endif
504 #endif
506 /* Pixel aspect ratio is defined in terms of a multiplier for pixel width and
507 * height, and is set to 1:1 if the target does not set a value
509 #ifndef LCD_PIXEL_ASPECT_HEIGHT
510 #define LCD_PIXEL_ASPECT_HEIGHT 1
511 #endif
512 #ifndef LCD_PIXEL_ASPECT_WIDTH
513 #define LCD_PIXEL_ASPECT_WIDTH 1
514 #endif
516 /* Used for split displays (Sansa Clip). Set to 0 otherwise */
517 #ifndef LCD_SPLIT_LINES
518 #define LCD_SPLIT_LINES 0
519 #endif
521 /* Simulator LCD dimensions. Set to standard dimensions if undefined */
522 #ifndef SIM_LCD_WIDTH
523 #define SIM_LCD_WIDTH LCD_WIDTH
524 #endif
525 #ifndef SIM_LCD_HEIGHT
526 #define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES)
527 #endif
529 #ifdef HAVE_REMOTE_LCD
530 #ifndef SIM_REMOTE_WIDTH
531 #define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH
532 #endif
533 #ifndef SIM_REMOTE_HEIGHT
534 #define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT
535 #endif
536 #endif /* HAVE_REMOTE_LCD */
538 /* define this in the target config.h to use a different size */
539 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
540 #define CONFIG_DEFAULT_ICON_HEIGHT 8
541 #endif
542 #ifndef CONFIG_DEFAULT_ICON_WIDTH
543 #define CONFIG_DEFAULT_ICON_WIDTH 6
544 #endif
545 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
546 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
547 #endif
548 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
549 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
550 #endif
552 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
553 /* Multiple possible tuners */
554 #define CONFIG_TUNER_MULTI
555 #endif
557 /* deactivate fading in bootloader/sim */
558 #if defined(BOOTLOADER) || defined(SIMULATOR)
559 #undef CONFIG_BACKLIGHT_FADING
560 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
561 #endif
563 /* determine which setting/manual text to use */
564 #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
566 /* possibly overridden in target config */
567 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
568 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
569 #define HAVE_BACKLIGHT_FADING_INT_SETTING
570 #endif
572 #elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
573 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \
574 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET)
576 /* possibly overridden in target config */
577 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
578 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
579 #define HAVE_BACKLIGHT_FADING_BOOL_SETTING
580 #endif
582 #endif /* CONFIG_BACKLIGHT_FADING */
584 /* Storage related config handling */
586 #if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
587 /* Multiple storage drivers */
588 #define CONFIG_STORAGE_MULTI
589 #endif
591 /* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */
592 #ifdef HAVE_MULTIVOLUME
593 #define NUM_VOLUMES_PER_DRIVE 4
594 #else
595 #define NUM_VOLUMES_PER_DRIVE 1
596 #endif
597 #if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE)
598 #define HAVE_MULTIDRIVE
599 #endif
601 #if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME)
602 #define HAVE_MULTIVOLUME
603 #endif
605 #if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES)
606 #error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES
607 #endif
609 #ifndef NUM_DRIVES
610 #define NUM_DRIVES 1
611 #endif
613 #define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE)
615 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
616 /* Bootloaders don't use CPU frequency adjustment */
617 #undef HAVE_ADJUSTABLE_CPU_FREQ
618 #endif
620 /* Enable the directory cache and tagcache in RAM if we have
621 * plenty of RAM. Both features can be enabled independently. */
622 #if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \
623 !defined(BOOTLOADER)
624 #define HAVE_DIRCACHE
625 #ifdef HAVE_TAGCACHE
626 #define HAVE_TC_RAMCACHE
627 #endif
628 #endif
630 /* Add one HAVE_ define for all mas35xx targets */
631 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
632 #define HAVE_MAS35XX
633 #endif
635 #if (CONFIG_CODEC == SWCODEC)
636 #ifdef BOOTLOADER
638 #if CONFIG_CPU == IMX31L
639 /* Priority in bootloader is wanted */
640 #define HAVE_PRIORITY_SCHEDULING
641 #define USB_STATUS_BY_EVENT
642 #define USB_DETECT_BY_DRV
643 #endif
645 #else /* !BOOTLOADER */
647 #define HAVE_EXTENDED_MESSAGING_AND_NAME
649 #ifndef SIMULATOR
650 #define HAVE_PRIORITY_SCHEDULING
651 #define HAVE_SCHEDULER_BOOSTCTRL
652 #endif /* SIMULATOR */
654 #define HAVE_SEMAPHORE_OBJECTS
656 #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
657 #define USB_STATUS_BY_EVENT
658 #define USB_DETECT_BY_DRV
659 #if CONFIG_CPU != IMX31L
660 #define INCLUDE_TIMEOUT_API
661 #endif
662 #endif /* HAVE_USBSTACK */
665 #endif /* BOOTLOADER */
667 #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \
668 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == S3C2440) \
669 || defined(CPU_S5L870X)
670 #define HAVE_WAKEUP_OBJECTS
671 #endif
673 #endif /* (CONFIG_CODEC == SWCODEC) */
675 /* Determine if accesses should be strictly long aligned. */
676 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM) || defined(CPU_MIPS)
677 #define ROCKBOX_STRICT_ALIGN 1
678 #endif
680 #ifndef CODEC_SIZE
681 #define CODEC_SIZE 0
682 #endif
684 /* This attribute can be used to ensure that certain symbols are never profiled
685 * which can be important as profiling a function de-inlines it */
686 #ifdef RB_PROFILE
687 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
688 #else
689 #define NO_PROF_ATTR
690 #endif
692 /* IRAM usage */
693 #if !defined(SIMULATOR) && /* Not for simulators */ \
694 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
695 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
696 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
697 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \
698 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB:core only */ \
699 (CONFIG_CPU == PNX0101) || \
700 defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \
701 (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */
702 #define ICODE_ATTR __attribute__ ((section(".icode")))
703 #define ICONST_ATTR __attribute__ ((section(".irodata")))
704 #define IDATA_ATTR __attribute__ ((section(".idata")))
705 #define IBSS_ATTR __attribute__ ((section(".ibss")))
706 #define USE_IRAM
707 #if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) && CONFIG_CPU != JZ4732
708 #define PLUGIN_USE_IRAM
709 #endif
710 #if defined(CPU_ARM)
711 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
712 * when not compiling with -ffunction-sections, even when the function has
713 * a section attribute. */
714 #define STATICIRAM
715 #else
716 #define STATICIRAM static
717 #endif
718 #else
719 #define ICODE_ATTR
720 #define ICONST_ATTR
721 #define IDATA_ATTR
722 #define IBSS_ATTR
723 #define STATICIRAM static
724 #endif
726 #if defined(SIMULATOR) && defined(__APPLE__)
727 #define DATA_ATTR __attribute__ ((section(".section __DATA, __data")))
728 #else
729 #define DATA_ATTR __attribute__ ((section(".data")))
730 #endif
732 #ifndef IRAM_LCDFRAMEBUFFER
733 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
734 #define IRAM_LCDFRAMEBUFFER
735 #endif
737 /* Change this if you want to build a single-core firmware for a multicore
738 * target for debugging */
739 #if defined(BOOTLOADER) || (CONFIG_CPU == PP6100)
740 #define FORCE_SINGLE_CORE
741 #endif
743 /* Core locking types - specifies type of atomic operation */
744 #define CORELOCK_NONE 0
745 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
746 and not a special semaphore instruction */
747 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
749 #if defined(CPU_PP)
750 #define IDLE_STACK_SIZE 0x80
751 #define IDLE_STACK_WORDS 0x20
753 /* Attributes to place data in uncached DRAM */
754 /* These are useful beyond dual-core and ultimately beyond PP since they may
755 * be used for DMA buffers and such without cache maintenence calls. */
756 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
757 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
759 #if !defined(FORCE_SINGLE_CORE)
761 #define NUM_CORES 2
762 #define CURRENT_CORE current_core()
763 /* Attributes for core-shared data in DRAM where IRAM is better used for other
764 * purposes. */
765 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
766 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
768 #define IF_COP(...) __VA_ARGS__
769 #define IF_COP_VOID(...) __VA_ARGS__
770 #define IF_COP_CORE(core) core
772 #ifdef CPU_PP
773 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
774 #else
775 #define CONFIG_CORELOCK CORELOCK_SWAP
776 #endif
778 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
780 #endif /* CPU_PP */
782 #ifndef CONFIG_CORELOCK
783 #define CONFIG_CORELOCK CORELOCK_NONE
784 #endif
786 #if CONFIG_CORELOCK == SW_CORELOCK
787 #define IF_SWCL(...) __VA_ARGS__
788 #define IFN_SWCL(...)
789 #else
790 #define IF_SWCL(...)
791 #define IFN_SWCL(...) __VA_ARGS__
792 #endif /* CONFIG_CORELOCK == */
794 #ifndef NUM_CORES
795 /* Default to single core */
796 #define NUM_CORES 1
797 #define CURRENT_CORE CPU
798 /* Attributes for core-shared data in DRAM - no caching considerations */
799 #define SHAREDBSS_ATTR
800 #define SHAREDDATA_ATTR
801 #ifndef NOCACHEBSS_ATTR
802 #define NOCACHEBSS_ATTR
803 #define NOCACHEDATA_ATTR
804 #endif
805 #define CONFIG_CORELOCK CORELOCK_NONE
807 #define IF_COP(...)
808 #define IF_COP_VOID(...) void
809 #define IF_COP_CORE(core) CURRENT_CORE
811 #endif /* NUM_CORES */
813 #ifdef HAVE_HEADPHONE_DETECTION
814 /* Timeout objects required if headphone detection is enabled */
815 #ifndef INCLUDE_TIMEOUT_API
816 #define INCLUDE_TIMEOUT_API
817 #endif
818 #endif /* HAVE_HEADPHONE_DETECTION */
820 #if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
821 #define STORAGE_GET_INFO
822 #endif
824 #ifdef CPU_MIPS
825 #include <stdbool.h> /* MIPS GCC fix? */
826 #endif
828 #if defined(HAVE_USBSTACK)
829 /* Define the implemented USB transport classes */
830 #if CONFIG_USBOTG == USBOTG_ISP1583
831 #define USB_HAS_BULK
832 #elif (CONFIG_USBOTG == USBOTG_ARC) || \
833 (CONFIG_USBOTG == USBOTG_JZ4740) || \
834 (CONFIG_USBOTG == USBOTG_M66591)
835 #define USB_HAS_BULK
836 #define USB_HAS_INTERRUPT
837 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
838 #define USB_HAS_BULK
839 #endif /* CONFIG_USBOTG */
841 /* define the class drivers to enable */
842 #ifdef BOOTLOADER
844 /* enable usb storage for targets that do bootloader usb */
845 #if (defined(TOSHIBA_GIGABEAT_S) || \
846 (defined(CREATIVE_ZVx) || \
847 defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \
848 (CONFIG_USBOTG == USBOTG_JZ4740)
849 #define USB_ENABLE_STORAGE
850 #endif
852 #else /* BOOTLOADER */
854 //#define USB_ENABLE_SERIAL
855 #define USB_ENABLE_STORAGE
857 #ifdef USB_HAS_INTERRUPT
858 #define USB_ENABLE_HID
859 #else
860 #define USB_ENABLE_CHARGING_ONLY
861 #endif
863 #endif /* BOOTLOADER */
865 #endif /* HAVE_USBSTACK */
869 #endif /* __CONFIG_H__ */