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