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