1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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 ****************************************************************************/
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 RDA5802 0x80 /* RDA Microelectronics */
50 #define SWCODEC 1 /* if codec is done by SW */
74 #define AT91SAM9260 9260
75 #define AS3525v2 35252
78 * bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
79 * possible future PLATFORM_ANDROID (some OSes might need totally different
80 * handling to run on them than a stand-alone application) */
81 #define PLATFORM_NATIVE (1<<0)
82 #define PLATFORM_HOSTED (1<<1)
83 #define PLATFORM_ANDROID (1<<2)
84 #define PLATFORM_SDL (1<<3)
88 #define RECORDER_PAD 2
90 #define IRIVER_H100_PAD 4
91 #define IRIVER_H300_PAD 5
92 #define IAUDIO_X5M5_PAD 6
95 #define IPOD_1G2G_PAD 9
96 #define IRIVER_IFP7XX_PAD 10
97 #define GIGABEAT_PAD 11
98 #define IRIVER_H10_PAD 12
99 #define SANSA_E200_PAD 13
100 #define SANSA_C200_PAD 14
101 #define TATUNG_TPJ1022_PAD 15
102 #define ARCHOS_AV300_PAD 16
103 #define MROBE100_PAD 17
104 #define MROBE500_PAD 18
105 #define GIGABEAT_S_PAD 19
106 #define LOGIK_DAX_PAD 20
107 #define IAUDIO67_PAD 21
108 #define COWON_D2_PAD 22
109 #define IAUDIO_M3_PAD 23
110 #define CREATIVEZVM_PAD 24
111 #define SANSA_M200_PAD 25
112 #define CREATIVEZV_PAD 26
113 #define PHILIPS_SA9200_PAD 27
114 #define SANSA_C100_PAD 28
115 #define PHILIPS_HDD1630_PAD 29
116 #define MEIZU_M6SL_PAD 30
117 #define ONDAVX747_PAD 31
118 #define ONDAVX767_PAD 32
119 #define MEIZU_M6SP_PAD 33
120 #define MEIZU_M3_PAD 34
121 #define SANSA_CLIP_PAD 35
122 #define SANSA_FUZE_PAD 36
123 #define LYRE_PROTO1_PAD 37
124 #define SAMSUNG_YH_PAD 38
125 #define ONDAVX777_PAD 39
126 #define SAMSUNG_YPS3_PAD 40
127 #define MINI2440_PAD 41
128 #define PHILIPS_HDD6330_PAD 42
129 #define PBELL_VIBE500_PAD 43
130 #define MPIO_HD200_PAD 44
132 /* CONFIG_REMOTE_KEYPAD */
133 #define H100_REMOTE 1
134 #define H300_REMOTE 2
135 #define IAUDIO_REMOTE 3
136 #define MROBE_REMOTE 4
138 /* CONFIG_BACKLIGHT_FADING */
139 /* No fading capabilities at all (yet) */
140 #define BACKLIGHT_NO_FADING 0x0
141 /* Backlight fading is controlled using a hardware PWM mechanism */
142 #define BACKLIGHT_FADING_PWM 0x1
143 /* Backlight is controlled using a software implementation
144 * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting
145 * the brightness (i.e. no real difference between backlight_on and
146 * backlight_set_brightness)
147 * BACKLIGHT_FADING_SW_HW_REG means that backlight brightness is restored
148 * "in hardware", from a hardware register upon backlight_on
149 * Both types need to have minor adjustments in the software fading code */
150 #define BACKLIGHT_FADING_SW_SETTING 0x2
151 #define BACKLIGHT_FADING_SW_HW_REG 0x4
152 /* Backlight fading is done in a target specific way
153 * for example in hardware, but not controllable*/
154 #define BACKLIGHT_FADING_TARGET 0x8
156 /* CONFIG_CHARGING */
159 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging
160 * (CPU cannot read charger state but may read
161 * when power is plugged-in). */
162 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring
163 * (CPU is able to read HW charging state and
164 * when power is plugged-in). */
166 /* Mostly target-specific code in the /target tree */
167 #define CHARGING_TARGET 3 /* Any algorithm - usually software controlled
168 * charging or specific programming is required to
169 * use the charging hardware. */
172 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
173 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
174 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
175 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
176 unknown at the time of this writing */
177 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
178 unknown at the time of this writing */
179 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
180 #define LCD_IPODNANO 7 /* as used by iPod Nano */
181 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
182 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
183 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
184 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
185 #define LCD_GIGABEAT 12
186 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
187 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
188 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
189 #define LCD_DSC25 16 /* as used by Archos AV300 */
190 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
191 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
192 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
193 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
194 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
195 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
196 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
197 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
198 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
199 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
200 #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
201 #define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
202 #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
203 #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
204 #define LCD_SSD1303 31 /* as used by the Sansa Clip */
205 #define LCD_FUZE 32 /* as used by the Sansa Fuze */
206 #define LCD_LYRE_PROTO1 33 /* as used by the Lyre prototype 1 */
207 #define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */
208 #define LCD_VIEW 35 /* as used by the Sansa View */
209 #define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */
210 #define LCD_MINI2440 37 /* as used by the Mini2440 */
211 #define LCD_HDD6330 38 /* as used by the Philips HDD6330 */
212 #define LCD_VIBE500 39 /* as used by the Packard Bell Vibe 500 */
214 /* LCD_PIXELFORMAT */
215 #define HORIZONTAL_PACKING 1
216 #define VERTICAL_PACKING 2
217 #define HORIZONTAL_INTERLEAVED 3
218 #define VERTICAL_INTERLEAVED 4
220 #define RGB565SWAPPED 3553
222 /* LCD_STRIDEFORMAT */
223 #define VERTICAL_STRIDE 1
224 #define HORIZONTAL_STRIDE 2
226 /* CONFIG_ORIENTATION */
227 #define SCREEN_PORTRAIT 0
228 #define SCREEN_LANDSCAPE 1
229 #define SCREEN_SQUARE 2
232 #define I2C_NONE 0 /* For targets that do not use I2C - as the
234 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
235 #define I2C_ONDIO 2 /* Ondio style */
236 #define I2C_COLDFIRE 3 /* Coldfire style */
237 #define I2C_PP5002 4 /* PP5002 style */
238 #define I2C_PP5020 5 /* PP5020 style */
239 #define I2C_PNX0101 6 /* PNX0101 style */
240 #define I2C_S3C2440 7
241 #define I2C_PP5024 8 /* PP5024 style */
243 #define I2C_TCC77X 10
244 #define I2C_TCC780X 11
245 #define I2C_DM320 12 /* DM320 style */
246 #define I2C_S5L8700 13
247 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
248 #define I2C_AS3525 15
251 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
252 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
253 /* else HW controlled LED (iRiver H1x0) */
256 #define NAND_IFP7XX 1
258 #define NAND_SAMSUNG 3
259 #define NAND_CC 4 /* ChinaChip */
262 #define RTC_M41ST84W 1 /* Archos Recorder */
263 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
264 #define RTC_PCF50606 3 /* iriver H300 */
265 #define RTC_S3C2440 4
266 #define RTC_E8564 5 /* iriver H10 */
267 #define RTC_AS3514 6 /* Sandisk Sansa series */
268 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
270 #define RTC_RX5X348AB 9
271 #define RTC_TCC77X 10
272 #define RTC_TCC780X 11
274 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
275 #define RTC_S5L8700 14
276 #define RTC_S35390A 15
277 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
278 #define RTC_NANO2G 17 /* This seems to be a PCF5063x */
279 #define RTC_D2 18 /* Either PCF50606 or PCF50635 */
282 #define USBOTG_M66591 6591 /* M:Robe 500 */
283 #define USBOTG_ISP1362 1362 /* iriver H300 */
284 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
285 #define USBOTG_M5636 5636 /* iAudio X5 */
286 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
287 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
288 #define USBOTG_AS3525 3525 /* AMS AS3525 */
289 #define USBOTG_AS3525v2 3535 /* AMS AS3525v2 */
290 #define USBOTG_S3C6400X 6400 /* Samsung S3C6400X, also used in the S5L8701 */
296 /* now go and pick yours */
297 #if defined(ARCHOS_PLAYER)
298 #include "config/archosplayer.h"
299 #elif defined(ARCHOS_RECORDER)
300 #include "config/archosrecorder.h"
301 #elif defined(ARCHOS_FMRECORDER)
302 #include "config/archosfmrecorder.h"
303 #elif defined(ARCHOS_RECORDERV2)
304 #include "config/archosrecorderv2.h"
305 #elif defined(ARCHOS_ONDIOSP)
306 #include "config/archosondiosp.h"
307 #elif defined(ARCHOS_ONDIOFM)
308 #include "config/archosondiofm.h"
309 #elif defined(ARCHOS_AV300)
310 #include "config/archosav300.h"
311 #elif defined(IRIVER_H100)
312 #include "config/iriverh100.h"
313 #elif defined(IRIVER_H120)
314 #include "config/iriverh120.h"
315 #elif defined(IRIVER_H300)
316 #include "config/iriverh300.h"
317 #elif defined(IAUDIO_X5)
318 #include "config/iaudiox5.h"
319 #elif defined(IAUDIO_M5)
320 #include "config/iaudiom5.h"
321 #elif defined(IAUDIO_M3)
322 #include "config/iaudiom3.h"
323 #elif defined(IPOD_COLOR)
324 #include "config/ipodcolor.h"
325 #elif defined(IPOD_NANO)
326 #include "config/ipodnano1g.h"
327 #elif defined(IPOD_VIDEO)
328 #include "config/ipodvideo.h"
329 #elif defined(IPOD_1G2G)
330 #include "config/ipod1g2g.h"
331 #elif defined(IPOD_3G)
332 #include "config/ipod3g.h"
333 #elif defined(IPOD_4G)
334 #include "config/ipod4g.h"
335 #elif defined(IPOD_NANO2G)
336 #include "config/ipodnano2g.h"
337 #elif defined(IRIVER_IFP7XX)
338 #include "config/iriverifp7xx.h"
339 #elif defined(GIGABEAT_F)
340 #include "config/gigabeatfx.h"
341 #elif defined(GIGABEAT_S)
342 #include "config/gigabeats.h"
343 #elif defined(IPOD_MINI)
344 #include "config/ipodmini1g.h"
345 #elif defined(IPOD_MINI2G)
346 #include "config/ipodmini2g.h"
347 #elif defined(IRIVER_H10)
348 #include "config/iriverh10.h"
349 #elif defined(IRIVER_H10_5GB)
350 #include "config/iriverh10_5gb.h"
351 #elif defined(SANSA_E200)
352 #include "config/sansae200.h"
353 #elif defined(SANSA_C200)
354 #include "config/sansac200.h"
355 #elif defined(SANSA_M200)
356 #include "config/sansam200.h"
357 #elif defined(TATUNG_TPJ1022)
358 #include "config/tatungtpj1022.h"
359 #elif defined(MROBE_100)
360 #include "config/mrobe100.h"
361 #elif defined(MROBE_500)
362 #include "config/mrobe500.h"
363 #elif defined(LOGIK_DAX)
364 #include "config/logikdax.h"
365 #elif defined(IAUDIO_7)
366 #include "config/iaudio7.h"
367 #elif defined(COWON_D2)
368 #include "config/cowond2.h"
369 #elif defined(CREATIVE_ZVM)
370 #include "config/zenvisionm30gb.h"
371 #elif defined(CREATIVE_ZVM60GB)
372 #include "config/zenvisionm60gb.h"
373 #elif defined(CREATIVE_ZV)
374 #include "config/zenvision.h"
375 #elif defined(PHILIPS_SA9200)
376 #include "config/gogearsa9200.h"
377 #elif defined(PHILIPS_HDD1630)
378 #include "config/gogearhdd1630.h"
379 #elif defined(PHILIPS_HDD6330)
380 #include "config/gogearhdd6330.h"
381 #elif defined(SANSA_C100)
382 #include "config/sansac100.h"
383 #elif defined(MEIZU_M6SL)
384 #include "config/meizum6sl.h"
385 #elif defined(MEIZU_M6SP)
386 #include "config/meizum6sp.h"
387 #elif defined(MEIZU_M3)
388 #include "config/meizum3.h"
389 #elif defined(ONDA_VX747) || defined(ONDA_VX747P)
390 #include "config/ondavx747.h"
391 #elif defined(ONDA_VX777)
392 #include "config/ondavx777.h"
393 #elif defined(ONDA_VX767)
394 #include "config/ondavx767.h"
395 #elif defined(SANSA_CLIP)
396 #include "config/sansaclip.h"
397 #elif defined(SANSA_CLIPV2)
398 #include "config/sansaclipv2.h"
399 #elif defined(SANSA_CLIPPLUS)
400 #include "config/sansaclipplus.h"
401 #elif defined(SANSA_E200V2)
402 #include "config/sansae200v2.h"
403 #elif defined(SANSA_M200V4)
404 #include "config/sansam200v4.h"
405 #elif defined(SANSA_FUZE)
406 #include "config/sansafuze.h"
407 #elif defined(SANSA_FUZEV2)
408 #include "config/sansafuzev2.h"
409 #elif defined(SANSA_C200V2)
410 #include "config/sansac200v2.h"
411 #elif defined(SANSA_VIEW)
412 #include "config/sansaview.h"
413 #elif defined(LYRE_PROTO1)
414 #include "config/lyreproto1.h"
415 #elif defined(MINI2440)
416 #include "config/mini2440.h"
417 #elif defined(SAMSUNG_YH820)
418 #include "config/samsungyh820.h"
419 #elif defined(SAMSUNG_YH920)
420 #include "config/samsungyh920.h"
421 #elif defined(SAMSUNG_YH925)
422 #include "config/samsungyh925.h"
423 #elif defined(SAMSUNG_YPS3)
424 #include "config/samsungyps3.h"
425 #elif defined(PBELL_VIBE500)
426 #include "config/vibe500.h"
427 #elif defined(MPIO_HD200)
428 #include "config/mpiohd200.h"
430 #elif defined(APPLICATION)
431 #include "config/application.h"
433 #define CONFIG_STORAGE 0
435 /* no known platform */
438 /* keep this include after the target configs */
440 #include "config/sim.h"
443 /* setup basic macros from capability masks */
444 #include "config_caps.h"
446 /* setup CPU-specific defines */
448 /* define for all cpus from SH family */
449 #if (CONFIG_CPU == SH7034)
453 /* define for all cpus from coldfire family */
454 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
458 /* define for all cpus from PP family */
459 #if (CONFIG_CPU == PP5002)
461 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) \
462 || (CONFIG_CPU == PP5024) || (CONFIG_CPU == PP6100)
467 /* define for all cpus from S5L870X family */
468 #if (CONFIG_CPU == S5L8700) || (CONFIG_CPU == S5L8701)
472 /* define for all cpus from TCC77X family */
473 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
477 /* define for all cpus from TCC780 family */
478 #if (CONFIG_CPU == TCC7801)
482 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
483 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
487 /* define for all cpus from ARM family */
488 #if (CONFIG_CPU == IMX31L)
490 #define ARM_ARCH 6 /* ARMv6 */
492 #elif defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \
493 || (CONFIG_CPU == AT91SAM9260) || (CONFIG_CPU == AS3525v2)
495 #define ARM_ARCH 5 /* ARMv5 */
497 #elif defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
498 || (CONFIG_CPU == DSC25) || defined(CPU_S5L870X) || (CONFIG_CPU == AS3525)
500 #define ARM_ARCH 4 /* ARMv4 */
503 #if (CONFIG_CPU == JZ4732)
507 /* now set any CONFIG_ defines correctly if they are not used,
508 No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */
510 #if !defined(CONFIG_BACKLIGHT_FADING)
511 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
514 #ifndef CONFIG_PLATFORM
515 #define CONFIG_PLATFORM PLATFORM_NATIVE
519 #define CONFIG_TUNER 0
522 #ifndef CONFIG_USBOTG
523 #define CONFIG_USBOTG 0
527 #define CONFIG_LED LED_VIRTUAL
530 #ifndef CONFIG_CHARGING
531 #define CONFIG_CHARGING 0
538 #ifndef CONFIG_ORIENTATION
539 #if LCD_HEIGHT > LCD_WIDTH
540 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
541 #elif LCD_HEIGHT < LCD_WIDTH
542 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
544 #define CONFIG_ORIENTATION SCREEN_SQUARE
548 /* Pixel aspect ratio is defined in terms of a multiplier for pixel width and
549 * height, and is set to 1:1 if the target does not set a value
551 #ifndef LCD_PIXEL_ASPECT_HEIGHT
552 #define LCD_PIXEL_ASPECT_HEIGHT 1
554 #ifndef LCD_PIXEL_ASPECT_WIDTH
555 #define LCD_PIXEL_ASPECT_WIDTH 1
558 /* Used for split displays (Sansa Clip). Set to 0 otherwise */
559 #ifndef LCD_SPLIT_LINES
560 #define LCD_SPLIT_LINES 0
563 /* Simulator LCD dimensions. Set to standard dimensions if undefined */
564 #ifndef SIM_LCD_WIDTH
565 #define SIM_LCD_WIDTH LCD_WIDTH
567 #ifndef SIM_LCD_HEIGHT
568 #define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES)
571 #ifdef HAVE_REMOTE_LCD
572 #ifndef SIM_REMOTE_WIDTH
573 #define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH
575 #ifndef SIM_REMOTE_HEIGHT
576 #define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT
578 #endif /* HAVE_REMOTE_LCD */
580 /* define this in the target config.h to use a different size */
581 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
582 #define CONFIG_DEFAULT_ICON_HEIGHT 8
584 #ifndef CONFIG_DEFAULT_ICON_WIDTH
585 #define CONFIG_DEFAULT_ICON_WIDTH 6
587 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
588 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
590 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
591 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
594 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
595 /* Multiple possible tuners */
596 #define CONFIG_TUNER_MULTI
599 /* deactivate fading in bootloader */
600 #if defined(BOOTLOADER)
601 #undef CONFIG_BACKLIGHT_FADING
602 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
605 /* determine which setting/manual text to use */
606 #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
608 /* possibly overridden in target config */
609 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
610 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
611 #define HAVE_BACKLIGHT_FADING_INT_SETTING
614 #elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
615 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \
616 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET)
618 /* possibly overridden in target config */
619 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
620 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
621 #define HAVE_BACKLIGHT_FADING_BOOL_SETTING
624 #endif /* CONFIG_BACKLIGHT_FADING */
626 /* Storage related config handling */
628 #if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
629 /* Multiple storage drivers */
630 #define CONFIG_STORAGE_MULTI
633 /* Explicit HAVE_MULTIVOLUME in the config file. Allow the maximum number */
634 #ifdef HAVE_MULTIVOLUME
635 #define NUM_VOLUMES_PER_DRIVE 4
637 #define NUM_VOLUMES_PER_DRIVE 1
639 #if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE)
640 #define HAVE_MULTIDRIVE
643 #if defined(HAVE_MULTIDRIVE) && !defined(HAVE_MULTIVOLUME)
644 #define HAVE_MULTIVOLUME
647 #if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES)
648 #error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES
655 #define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE)
657 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
658 /* Bootloaders don't use CPU frequency adjustment */
659 #undef HAVE_ADJUSTABLE_CPU_FREQ
662 /* Enable the directory cache and tagcache in RAM if we have
663 * plenty of RAM. Both features can be enabled independently. */
664 #if ((defined(MEMORYSIZE) && (MEMORYSIZE >= 8)) || MEM >= 8) && \
665 !defined(BOOTLOADER) && !defined(__PCTOOL__)
666 #define HAVE_DIRCACHE
668 #define HAVE_TC_RAMCACHE
672 #if defined(HAVE_TAGCACHE) && defined(HAVE_LCD_BITMAP)
673 #define HAVE_PICTUREFLOW_INTEGRATION
676 /* Add one HAVE_ define for all mas35xx targets */
677 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
681 #if (CONFIG_CODEC == SWCODEC)
684 #if CONFIG_CPU == IMX31L
685 /* Priority in bootloader is wanted */
686 #define HAVE_PRIORITY_SCHEDULING
687 #define USB_STATUS_BY_EVENT
688 #define USB_DETECT_BY_DRV
691 #else /* !BOOTLOADER */
693 #define HAVE_EXTENDED_MESSAGING_AND_NAME
694 #define HAVE_WAKEUP_EXT_CB
697 #if (CONFIG_PLATFORM & PLATFORM_ANDROID)
698 #define HAVE_PRIORITY_SCHEDULING
701 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
702 #define HAVE_PRIORITY_SCHEDULING
703 #define HAVE_SCHEDULER_BOOSTCTRL
704 #endif /* PLATFORM_NATIVE */
707 #define HAVE_SEMAPHORE_OBJECTS
709 #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
710 #define USB_STATUS_BY_EVENT
711 #define USB_DETECT_BY_DRV
712 #if CONFIG_CPU != IMX31L
713 #define INCLUDE_TIMEOUT_API
715 #endif /* HAVE_USBSTACK */
718 #endif /* BOOTLOADER */
720 #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \
721 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \
722 || defined(CPU_S5L870X) || (CONFIG_CPU == S3C2440)
723 #define HAVE_WAKEUP_OBJECTS
726 /*include support for crossfading - requires significant PCM buffer space*/
728 #define HAVE_CROSSFADE
731 #endif /* (CONFIG_CODEC == SWCODEC) */
733 /* Determine if accesses should be strictly long aligned. */
734 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM) || defined(CPU_MIPS)
735 #define ROCKBOX_STRICT_ALIGN 1
738 #if defined(CPU_ARM) && defined(__ASSEMBLER__)
739 /* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */
740 .macro ldmpc cond
="", order
="ia", regs
741 #if ARM_ARCH == 4 && defined(USE_THUMB)
742 ldm\cond\order sp
!, { \regs
, lr
}
745 ldm\cond\order sp
!, { \regs
, pc
}
749 #if ARM_ARCH == 4 && defined(USE_THUMB)
750 ldr\cond lr
, [sp
], #4
753 ldr\cond pc
, [sp
], #4
762 /* This attribute can be used to ensure that certain symbols are never profiled
763 * which can be important as profiling a function de-inlines it */
765 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
771 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \
772 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
773 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
774 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
775 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2 && !defined(BOOTLOADER)) || /* AS3525 +2MB: core, plugins, codecs */ \
776 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525 2MB: core only */ \
777 (CONFIG_CPU == AS3525v2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525v2: core only */ \
778 (CONFIG_CPU == PNX0101) || \
779 (CONFIG_CPU == TCC7801) || \
780 defined(CPU_S5L870X)) || /* Samsung S5L8700: core, plugins, codecs */ \
781 (CONFIG_CPU == JZ4732 && !defined(PLUGIN) && !defined(CODEC)) /* Jz4740: core only */
782 #define ICODE_ATTR __attribute__ ((section(".icode")))
783 #define ICONST_ATTR __attribute__ ((section(".irodata")))
784 #define IDATA_ATTR __attribute__ ((section(".idata")))
785 #define IBSS_ATTR __attribute__ ((section(".ibss")))
787 #if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
788 && CONFIG_CPU != JZ4732 && CONFIG_CPU != AS3525v2
789 #define PLUGIN_USE_IRAM
791 #if defined(CPU_ARM) && !defined(__ARM_EABI__)
792 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
793 * when not compiling with -ffunction-sections, even when the function has
794 * a section attribute.
795 * This is fixed with eabi since all calls are short ones by default */
798 #define STATICIRAM static
805 #define STATICIRAM static
808 #if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
809 (CONFIG_CPU == IMX31L)) \
810 && (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
811 /* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
812 * root_menu() has been called. Their code may be overwritten by other data or
813 * code in order to save RAM, and references to them might point into
816 * It is critical that you make sure these functions are only called before
817 * the final call to root_menu() (see apps/main.c) is called (i.e. basically
818 * only while main() runs), otherwise things may go wild,
819 * from crashes to freezes to exploding daps.
821 #define INIT_ATTR __attribute__ ((section(".init")))
822 #define HAVE_INIT_ATTR
827 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
828 #define DATA_ATTR __attribute__ ((section("__DATA, .data")))
830 #define DATA_ATTR __attribute__ ((section(".data")))
833 #ifndef IRAM_LCDFRAMEBUFFER
834 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
835 #define IRAM_LCDFRAMEBUFFER
838 /* Change this if you want to build a single-core firmware for a multicore
839 * target for debugging */
840 #if defined(BOOTLOADER) || (CONFIG_CPU == PP6100)
841 #define FORCE_SINGLE_CORE
845 #define IDLE_STACK_SIZE 0x80
846 #define IDLE_STACK_WORDS 0x20
848 /* Attributes to place data in uncached DRAM */
849 /* These are useful beyond dual-core and ultimately beyond PP since they may
850 * be used for DMA buffers and such without cache maintenence calls. */
851 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
852 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
854 #if !defined(FORCE_SINGLE_CORE)
857 #define HAVE_CORELOCK_OBJECT
858 #define CURRENT_CORE current_core()
859 /* Attributes for core-shared data in DRAM where IRAM is better used for other
861 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
862 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
864 #define IF_COP(...) __VA_ARGS__
865 #define IF_COP_VOID(...) __VA_ARGS__
866 #define IF_COP_CORE(core) core
868 #endif /* !defined(FORCE_SINGLE_CORE) */
872 #if CONFIG_CPU == IMX31L
873 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
874 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
878 /* Default to single core */
880 #define CURRENT_CORE CPU
881 /* Attributes for core-shared data in DRAM - no caching considerations */
882 #define SHAREDBSS_ATTR
883 #define SHAREDDATA_ATTR
884 #ifndef NOCACHEBSS_ATTR
885 #define NOCACHEBSS_ATTR
886 #define NOCACHEDATA_ATTR
890 #define IF_COP_VOID(...) void
891 #define IF_COP_CORE(core) CURRENT_CORE
893 #endif /* NUM_CORES */
895 #ifdef HAVE_HEADPHONE_DETECTION
896 /* Timeout objects required if headphone detection is enabled */
897 #ifndef INCLUDE_TIMEOUT_API
898 #define INCLUDE_TIMEOUT_API
900 #endif /* HAVE_HEADPHONE_DETECTION */
902 #if defined(HAVE_USB_CHARGING_ENABLE) && defined(HAVE_USBSTACK)
903 /* USB charging support in the USB stack requires timeout objects */
904 #ifndef INCLUDE_TIMEOUT_API
905 #define INCLUDE_TIMEOUT_API
907 #endif /* HAVE_USB_CHARGING_ENABLE && HAVE_USBSTACK */
909 #if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
910 #define STORAGE_GET_INFO
914 #include <stdbool.h> /* MIPS GCC fix? */
917 #if defined(HAVE_USBSTACK)
918 /* Define the implemented USB transport classes */
919 #if CONFIG_USBOTG == USBOTG_ISP1583
921 #elif (CONFIG_USBOTG == USBOTG_ARC) || \
922 (CONFIG_USBOTG == USBOTG_JZ4740) || \
923 (CONFIG_USBOTG == USBOTG_M66591) || \
924 (CONFIG_USBOTG == USBOTG_AS3525)
926 #define USB_HAS_INTERRUPT
927 #elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
929 #elif CONFIG_USBOTG == USBOTG_S3C6400X
931 //#define USB_HAS_INTERRUPT -- seems to be broken
932 #endif /* CONFIG_USBOTG */
934 #if (CONFIG_USBOTG == USBOTG_ARC) || \
935 (CONFIG_USBOTG == USBOTG_AS3525)
936 #define USB_HAS_ISOCHRONOUS
939 /* define the class drivers to enable */
942 /* enable usb storage for targets that do bootloader usb */
943 #if (defined(TOSHIBA_GIGABEAT_S) || \
944 (defined(CREATIVE_ZVx) || \
945 defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \
946 (CONFIG_USBOTG == USBOTG_JZ4740) || defined(IPOD_NANO2G) || \
947 CONFIG_USBOTG == USBOTG_AS3525
948 #define USB_ENABLE_STORAGE
951 #else /* BOOTLOADER */
953 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
954 //#define USB_ENABLE_SERIAL
955 #define USB_ENABLE_STORAGE
957 #ifdef USB_HAS_INTERRUPT
958 #define USB_ENABLE_HID
960 #define USB_ENABLE_CHARGING_ONLY
964 #endif /* BOOTLOADER */
966 #endif /* HAVE_USBSTACK */
968 /* This attribute can be used to enable to detection of plugin file handles leaks.
969 * When enabled, the plugin core will monitor open/close/creat and when the plugin exits
970 * will display an error message if the plugin leaked some file handles */
971 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
972 #define HAVE_PLUGIN_CHECK_OPEN_CLOSE
975 #if defined(HAVE_DIRCACHE) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
976 #define HAVE_IO_PRIORITY
979 #endif /* __CONFIG_H__ */