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