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