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