don't disable usb storage by accident
[kugel-rb.git] / firmware / export / config.h
blobff9a8e9589de4420a69d866b56604b5c5c29762f
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 #ifndef __PCTOOL__
26 #include "autoconf.h"
27 #endif
29 /* symbolic names for multiple choice configurations: */
31 /* CONFIG_STORAGE (note these are combineable bit-flags) */
32 #define STORAGE_ATA 0x01
33 #define STORAGE_MMC 0x02
34 #define STORAGE_SD 0x04
35 #define STORAGE_NAND 0x08
36 #define STORAGE_RAMDISK 0x10
38 /* CONFIG_TUNER (note these are combineable bit-flags) */
39 #define S1A0903X01 0x01 /* Samsung */
40 #define TEA5767 0x02 /* Philips */
41 #define LV24020LP 0x04 /* Sanyo */
42 #define SI4700 0x08 /* Silicon Labs */
43 #define TEA5760 0x10 /* Philips */
44 #define LV240000 0x20 /* Sanyo */
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 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 JZ4732 4732
71 #define AS3525 3525
72 #define AT91SAM9260 9260
74 /* CONFIG_KEYPAD */
75 #define PLAYER_PAD 1
76 #define RECORDER_PAD 2
77 #define ONDIO_PAD 3
78 #define IRIVER_H100_PAD 4
79 #define IRIVER_H300_PAD 5
80 #define IAUDIO_X5M5_PAD 6
81 #define IPOD_4G_PAD 7
82 #define IPOD_3G_PAD 8
83 #define IPOD_1G2G_PAD 9
84 #define IRIVER_IFP7XX_PAD 10
85 #define GIGABEAT_PAD 11
86 #define IRIVER_H10_PAD 12
87 #define SANSA_E200_PAD 13
88 #define SANSA_C200_PAD 14
89 #define ELIO_TPJ1022_PAD 15
90 #define ARCHOS_AV300_PAD 16
91 #define MROBE100_PAD 17
92 #define MROBE500_PAD 18
93 #define GIGABEAT_S_PAD 19
94 #define LOGIK_DAX_PAD 20
95 #define IAUDIO67_PAD 21
96 #define COWOND2_PAD 22
97 #define IAUDIO_M3_PAD 23
98 #define CREATIVEZVM_PAD 24
99 #define SANSA_M200_PAD 25
100 #define CREATIVEZV_PAD 26
101 #define PHILIPS_SA9200_PAD 27
102 #define SANSA_C100_PAD 28
103 #define PHILIPS_HDD1630_PAD 29
104 #define MEIZU_M6SL_PAD 30
105 #define ONDAVX747_PAD 31
106 #define ONDAVX767_PAD 32
107 #define MEIZU_M6SP_PAD 33
108 #define MEIZU_M3_PAD 34
109 #define SANSA_CLIP_PAD 35
110 #define SANSA_FUZE_PAD 36
111 #define LYRE_PROTO1_PAD 37
113 /* CONFIG_REMOTE_KEYPAD */
114 #define H100_REMOTE 1
115 #define H300_REMOTE 2
116 #define X5_REMOTE 3
117 #define MROBE_REMOTE 4
119 /* CONFIG_BACKLIGHT_FADING */
120 /* No fading capabilities at all (yet) */
121 #define BACKLIGHT_NO_FADING 0x0
122 /* Backlight fading is controlled using a hardware PWM mechanism */
123 #define BACKLIGHT_FADING_PWM 0x1
124 /* Backlight is controlled using a software implementation
125 * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting
126 * the brightness (i.e. no real difference between backlight_on and
127 * backlight_set_brightness)
128 * BACKLIGHT_FADING_SW_SETTING means that backlight brightness is restored
129 * "in hardware", from a hardware register upon backlight_on
130 * Both types need to have minor adjustments in the software fading code */
131 #define BACKLIGHT_FADING_SW_SETTING 0x2
132 #define BACKLIGHT_FADING_SW_HW_REG 0x4
133 /* Backlight fading is done in a target specific way
134 * for example in hardware, but not controllable*/
135 #define BACKLIGHT_FADING_TARGET 0x8
137 /* CONFIG_CHARGING */
139 /* Generic types */
140 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging
141 * (CPU cannot read charger state but may read
142 * when power is plugged-in). */
143 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring
144 * (CPU is able to read HW charging state and
145 * when power is plugged-in). */
147 /* Mostly target-specific code in the /target tree */
148 #define CHARGING_TARGET 3 /* Any algorithm - usually software controlled
149 * charging or specific programming is required to
150 * use the charging hardware. */
152 /* CONFIG_LCD */
153 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
154 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
155 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
156 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
157 unknown at the time of this writing */
158 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
159 unknown at the time of this writing */
160 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
161 #define LCD_IPODNANO 7 /* as used by iPod Nano */
162 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
163 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
164 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
165 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
166 #define LCD_GIGABEAT 12
167 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
168 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
169 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
170 #define LCD_DSC25 16 /* as used by Archos AV300 */
171 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
172 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
173 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
174 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
175 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
176 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
177 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
178 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
179 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
180 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
181 #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
182 #define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
183 #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
184 #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
185 #define LCD_SSD1303 31 /* as used by the Sansa Clip */
186 #define LCD_FUZE 32 /* as used by the Sansa Fuze */
187 #define LCD_LYRE_PROTO1 33 /* as used by the Lyre */
189 /* LCD_PIXELFORMAT */
190 #define HORIZONTAL_PACKING 1
191 #define VERTICAL_PACKING 2
192 #define HORIZONTAL_INTERLEAVED 3
193 #define VERTICAL_INTERLEAVED 4
194 #define RGB565 565
195 #define RGB565SWAPPED 3553
197 /* CONFIG_ORIENTATION */
198 #define SCREEN_PORTRAIT 0
199 #define SCREEN_LANDSCAPE 1
200 #define SCREEN_SQUARE 2
202 /* CONFIG_I2C */
203 #define I2C_NONE 0 /* For targets that do not use I2C - as the
204 Lyre prototype 1*/
205 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
206 #define I2C_ONDIO 2 /* Ondio style */
207 #define I2C_COLDFIRE 3 /* Coldfire style */
208 #define I2C_PP5002 4 /* PP5002 style */
209 #define I2C_PP5020 5 /* PP5020 style */
210 #define I2C_PNX0101 6 /* PNX0101 style */
211 #define I2C_S3C2440 7
212 #define I2C_PP5024 8 /* PP5024 style */
213 #define I2C_IMX31L 9
214 #define I2C_TCC77X 10
215 #define I2C_TCC780X 11
216 #define I2C_DM320 12 /* DM320 style */
217 #define I2C_S5L8700 13
218 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
219 #define I2C_AS3525 15
221 /* CONFIG_LED */
222 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
223 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
224 /* else HW controlled LED (iRiver H1x0) */
226 /* CONFIG_NAND */
227 #define NAND_IFP7XX 1
228 #define NAND_TCC 2
229 #define NAND_SAMSUNG 3
230 #define NAND_CC 4 /* ChinaChip */
232 /* CONFIG_RTC */
233 #define RTC_M41ST84W 1 /* Archos Recorder */
234 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
235 #define RTC_PCF50606 3 /* iriver H300 */
236 #define RTC_S3C2440 4
237 #define RTC_E8564 5 /* iriver H10 */
238 #define RTC_AS3514 6 /* Sandisk Sansa series */
239 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
240 #define RTC_IMX31L 8
241 #define RTC_RX5X348AB 9
242 #define RTC_TCC77X 10
243 #define RTC_TCC780X 11
244 #define RTC_MR100 12
245 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
246 #define RTC_S5L8700 14
247 #define RTC_S35390A 15
248 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
250 /* USB On-the-go */
251 #define USBOTG_ISP1362 1362 /* iriver H300 */
252 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
253 #define USBOTG_M5636 5636 /* iAudio X5 */
254 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
255 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
256 #define USBOTG_AS3525 3525 /* AMS AS3525 */
258 /* Multiple cores */
259 #define CPU 0
260 #define COP 1
262 /* now go and pick yours */
263 #if defined(ARCHOS_PLAYER)
264 #include "config-player.h"
265 #elif defined(ARCHOS_RECORDER)
266 #include "config-recorder.h"
267 #elif defined(ARCHOS_FMRECORDER)
268 #include "config-fmrecorder.h"
269 #elif defined(ARCHOS_RECORDERV2)
270 #include "config-recorderv2.h"
271 #elif defined(ARCHOS_ONDIOSP)
272 #include "config-ondiosp.h"
273 #elif defined(ARCHOS_ONDIOFM)
274 #include "config-ondiofm.h"
275 #elif defined(ARCHOS_AV300)
276 #include "config-av300.h"
277 #elif defined(IRIVER_H100)
278 #include "config-h100.h"
279 #elif defined(IRIVER_H120)
280 #include "config-h120.h"
281 #elif defined(IRIVER_H300)
282 #include "config-h300.h"
283 #elif defined(IAUDIO_X5)
284 #include "config-iaudiox5.h"
285 #elif defined(IAUDIO_M5)
286 #include "config-iaudiom5.h"
287 #elif defined(IAUDIO_M3)
288 #include "config-iaudiom3.h"
289 #elif defined(IPOD_COLOR)
290 #include "config-ipodcolor.h"
291 #elif defined(IPOD_NANO)
292 #include "config-ipodnano.h"
293 #elif defined(IPOD_VIDEO)
294 #include "config-ipodvideo.h"
295 #elif defined(IPOD_1G2G)
296 #include "config-ipod1g2g.h"
297 #elif defined(IPOD_3G)
298 #include "config-ipod3g.h"
299 #elif defined(IPOD_4G)
300 #include "config-ipod4g.h"
301 #elif defined(IRIVER_IFP7XX)
302 #include "config-ifp7xx.h"
303 #elif defined(GIGABEAT_F)
304 #include "config-gigabeat.h"
305 #elif defined(GIGABEAT_S)
306 #include "config-gigabeat-s.h"
307 #elif defined(IPOD_MINI)
308 #include "config-ipodmini.h"
309 #elif defined(IPOD_MINI2G)
310 #include "config-ipodmini2g.h"
311 #elif defined(IRIVER_H10)
312 #include "config-h10.h"
313 #elif defined(IRIVER_H10_5GB)
314 #include "config-h10_5gb.h"
315 #elif defined(SANSA_E200)
316 #include "config-e200.h"
317 #elif defined(SANSA_C200)
318 #include "config-c200.h"
319 #elif defined(SANSA_M200)
320 #include "config-m200.h"
321 #elif defined(ELIO_TPJ1022)
322 #include "config-tpj1022.h"
323 #elif defined(MROBE_100)
324 #include "config-mrobe100.h"
325 #elif defined(MROBE_500)
326 #include "config-mrobe500.h"
327 #elif defined(LOGIK_DAX)
328 #include "config-logikdax.h"
329 #elif defined(IAUDIO_7)
330 #include "config-iaudio7.h"
331 #elif defined(COWON_D2)
332 #include "config-cowond2.h"
333 #elif defined(CREATIVE_ZVM)
334 #include "config-creativezvm.h"
335 #elif defined(CREATIVE_ZVM60GB)
336 #include "config-creativezvm60gb.h"
337 #elif defined(CREATIVE_ZV)
338 #include "config-creativezv.h"
339 #elif defined(PHILIPS_SA9200)
340 #include "config-sa9200.h"
341 #elif defined(PHILIPS_HDD1630)
342 #include "config-hdd1630.h"
343 #elif defined(SANSA_C100)
344 #include "config-c100.h"
345 #elif defined(MEIZU_M6SL)
346 #include "config-meizu-m6sl.h"
347 #elif defined(MEIZU_M6SP)
348 #include "config-meizu-m6sp.h"
349 #elif defined(MEIZU_M3)
350 #include "config-meizu-m3.h"
351 #elif defined(ONDA_VX747) || defined(ONDA_VX747P)
352 #include "config-ondavx747.h"
353 #elif defined(ONDA_VX767)
354 #include "config-ondavx767.h"
355 #elif defined(SANSA_CLIP)
356 #include "config-clip.h"
357 #elif defined(SANSA_E200V2)
358 #include "config-e200v2.h"
359 #elif defined(SANSA_M200V4)
360 #include "config-m200v4.h"
361 #elif defined(SANSA_FUZE)
362 #include "config-fuze.h"
363 #elif defined(SANSA_C200V2)
364 #include "config-c200v2.h"
365 #elif defined(LYRE_PROTO1)
366 #include "config-lyre_proto1.h"
367 #else
368 /* no known platform */
369 #endif
371 /* setup basic macros from capability masks */
372 #include "config_caps.h"
374 /* now set any CONFIG_ defines correctly if they are not used,
375 No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */
377 #if !defined(CONFIG_BACKLIGHT_FADING)
378 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
379 #endif
381 #ifndef CONFIG_TUNER
382 #define CONFIG_TUNER 0
383 #endif
385 #ifndef CONFIG_USBOTG
386 #define CONFIG_USBOTG 0
387 #endif
389 #ifndef CONFIG_LED
390 #define CONFIG_LED 0
391 #endif
393 #ifndef CONFIG_CHARGING
394 #define CONFIG_CHARGING 0
395 #endif
397 #ifndef CONFIG_RTC
398 #define CONFIG_RTC 0
399 #endif
401 #ifndef CONFIG_ORIENTATION
402 #if LCD_HEIGHT > LCD_WIDTH
403 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
404 #elif LCD_HEIGHT < LCD_WIDTH
405 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
406 #else
407 #define CONFIG_ORIENTATION SCREEN_SQUARE
408 #endif
409 #endif
411 /* Pixel aspect ratio is defined in terms of a multiplier for pixel width and
412 * height, and is set to 1:1 if the target does not set a value
414 #ifndef LCD_PIXEL_ASPECT_HEIGHT
415 #define LCD_PIXEL_ASPECT_HEIGHT 1
416 #endif
417 #ifndef LCD_PIXEL_ASPECT_WIDTH
418 #define LCD_PIXEL_ASPECT_WIDTH 1
419 #endif
421 /* Used for split displays (Sansa Clip). Set to 0 otherwise */
422 #ifndef LCD_SPLIT_LINES
423 #define LCD_SPLIT_LINES 0
424 #endif
426 /* Simulator LCD dimensions. Set to standard dimensions if undefined */
427 #ifndef SIM_LCD_WIDTH
428 #define SIM_LCD_WIDTH LCD_WIDTH
429 #endif
430 #ifndef SIM_LCD_HEIGHT
431 #define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES)
432 #endif
434 #ifdef HAVE_REMOTE_LCD
435 #ifndef SIM_REMOTE_WIDTH
436 #define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH
437 #endif
438 #ifndef SIM_REMOTE_HEIGHT
439 #define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT
440 #endif
441 #endif /* HAVE_REMOTE_LCD */
443 /* define this in the target config.h to use a different size */
444 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
445 #define CONFIG_DEFAULT_ICON_HEIGHT 8
446 #endif
447 #ifndef CONFIG_DEFAULT_ICON_WIDTH
448 #define CONFIG_DEFAULT_ICON_WIDTH 6
449 #endif
450 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
451 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
452 #endif
453 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
454 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
455 #endif
457 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
458 /* Multiple possible tuners */
459 #define CONFIG_TUNER_MULTI
460 #endif
462 #if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
463 /* Multiple storage drivers */
464 #define CONFIG_STORAGE_MULTI
465 #endif
467 /* deactivate fading in bootloader/sim */
468 #if defined(BOOTLOADER) || defined(SIMULATOR)
469 #undef CONFIG_BACKLIGHT_FADING
470 #define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
471 #endif
473 /* determine which setting/manual text to use */
474 #if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
476 /* possibly overridden in target config */
477 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
478 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
479 #define HAVE_BACKLIGHT_FADING_INT_SETTING
480 #endif
482 #elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
483 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \
484 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET)
486 /* possibly overridden in target config */
487 #if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
488 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
489 #define HAVE_BACKLIGHT_FADING_BOOL_SETTING
490 #endif
492 #endif /* CONFIG_BACKLIGHT_FADING */
494 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
495 /* Bootloaders don't use CPU frequency adjustment */
496 #undef HAVE_ADJUSTABLE_CPU_FREQ
497 #endif
499 /* Enable the directory cache and tagcache in RAM if we have
500 * plenty of RAM. Both features can be enabled independently. */
501 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
502 !defined(BOOTLOADER)
503 #define HAVE_DIRCACHE
504 #ifdef HAVE_TAGCACHE
505 #define HAVE_TC_RAMCACHE
506 #endif
507 #endif
509 /* Add one HAVE_ define for all mas35xx targets */
510 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
511 #define HAVE_MAS35XX
512 #endif
514 #if (CONFIG_CODEC == SWCODEC)
515 #ifdef BOOTLOADER
517 #if CONFIG_CPU == IMX31L
518 /* Priority in bootloader is wanted */
519 #define HAVE_PRIORITY_SCHEDULING
520 #define USB_STATUS_BY_EVENT
521 #define USB_DETECT_BY_DRV
522 #endif
524 #else /* !BOOTLOADER */
526 #define HAVE_EXTENDED_MESSAGING_AND_NAME
528 #ifndef SIMULATOR
529 #define HAVE_PRIORITY_SCHEDULING
530 #define HAVE_SCHEDULER_BOOSTCTRL
531 #endif /* SIMULATOR */
533 #define HAVE_SEMAPHORE_OBJECTS
535 #if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
536 #define USB_STATUS_BY_EVENT
537 #define USB_DETECT_BY_DRV
538 #if CONFIG_CPU != IMX31L
539 #define INCLUDE_TIMEOUT_API
540 #endif
541 #endif /* HAVE_USBSTACK */
544 #endif /* BOOTLOADER */
546 #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \
547 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == S3C2440)
548 #define HAVE_WAKEUP_OBJECTS
549 #endif
551 #endif /* (CONFIG_CODEC == SWCODEC) */
553 /* define for all cpus from SH family */
554 #if (CONFIG_CPU == SH7034)
555 #define CPU_SH
556 #endif
558 /* define for all cpus from coldfire family */
559 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
560 #define CPU_COLDFIRE
561 #endif
563 /* define for all cpus from PP family */
564 #if (CONFIG_CPU == PP5002)
565 #define CPU_PP
566 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
567 #define CPU_PP
568 #define CPU_PP502x
569 #endif
571 /* define for all cpus from TCC77X family */
572 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
573 #define CPU_TCC77X
574 #endif
576 /* define for all cpus from TCC780 family */
577 #if (CONFIG_CPU == TCC7801)
578 #define CPU_TCC780X
579 #endif
581 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
582 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
583 #define CPU_ARM7TDMI
584 #endif
586 /* define for all cpus from ARM family */
587 #if (CONFIG_CPU == IMX31L)
588 #define CPU_ARM
589 #define ARM_ARCH 6 /* ARMv6 */
590 #endif
592 #if defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) \
593 || (CONFIG_CPU == AT91SAM9260)
594 #define CPU_ARM
595 #define ARM_ARCH 5 /* ARMv5 */
596 #endif
598 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
599 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == S5L8700) || (CONFIG_CPU == AS3525)
600 #define CPU_ARM
601 #define ARM_ARCH 4 /* ARMv4 */
602 #endif
604 #if (CONFIG_CPU == JZ4732)
605 #define CPU_MIPS 32
606 #endif
608 /* Determine if accesses should be strictly long aligned. */
609 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM) || defined(CPU_MIPS)
610 #define ROCKBOX_STRICT_ALIGN 1
611 #endif
613 #ifndef CODEC_SIZE
614 #define CODEC_SIZE 0
615 #endif
617 /* This attribute can be used to ensure that certain symbols are never profiled
618 * which can be important as profiling a function de-inlines it */
619 #ifdef RB_PROFILE
620 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
621 #else
622 #define NO_PROF_ATTR
623 #endif
625 /* IRAM usage */
626 #if !defined(SIMULATOR) && /* Not for simulators */ \
627 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
628 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
629 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
630 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2) || /* AS3525 +2MB: core, plugins, codecs */ \
631 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC)) || /* AS3525 2MB:core only */ \
632 (CONFIG_CPU == PNX0101) || \
633 (CONFIG_CPU == S5L8700)) /* Samsung S5L8700: core, plugins, codecs */
634 #define ICODE_ATTR __attribute__ ((section(".icode")))
635 #define ICONST_ATTR __attribute__ ((section(".irodata")))
636 #define IDATA_ATTR __attribute__ ((section(".idata")))
637 #define IBSS_ATTR __attribute__ ((section(".ibss")))
638 #define USE_IRAM
639 #if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2)
640 #define PLUGIN_USE_IRAM
641 #endif
642 #if defined(CPU_ARM)
643 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
644 * when not compiling with -ffunction-sections, even when the function has
645 * a section attribute. */
646 #define STATICIRAM
647 #else
648 #define STATICIRAM static
649 #endif
650 #else
651 #define ICODE_ATTR
652 #define ICONST_ATTR
653 #define IDATA_ATTR
654 #define IBSS_ATTR
655 #define STATICIRAM static
656 #endif
658 #if defined(SIMULATOR) && defined(__APPLE__)
659 #define DATA_ATTR __attribute__ ((section(".section __DATA, __data")))
660 #else
661 #define DATA_ATTR __attribute__ ((section(".data")))
662 #endif
664 #ifndef IRAM_LCDFRAMEBUFFER
665 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
666 #define IRAM_LCDFRAMEBUFFER
667 #endif
669 /* Change this if you want to build a single-core firmware for a multicore
670 * target for debugging */
671 #if defined(BOOTLOADER)
672 #define FORCE_SINGLE_CORE
673 #endif
675 /* Core locking types - specifies type of atomic operation */
676 #define CORELOCK_NONE 0
677 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
678 and not a special semaphore instruction */
679 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
681 #if defined(CPU_PP)
682 #define IDLE_STACK_SIZE 0x80
683 #define IDLE_STACK_WORDS 0x20
685 /* Attributes to place data in uncached DRAM */
686 /* These are useful beyond dual-core and ultimately beyond PP since they may
687 * be used for DMA buffers and such without cache maintenence calls. */
688 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
689 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
691 #if !defined(FORCE_SINGLE_CORE)
693 #define NUM_CORES 2
694 #define CURRENT_CORE current_core()
695 /* Attributes for core-shared data in DRAM where IRAM is better used for other
696 * purposes. */
697 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
698 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
700 #define IF_COP(...) __VA_ARGS__
701 #define IF_COP_VOID(...) __VA_ARGS__
702 #define IF_COP_CORE(core) core
704 #ifdef CPU_PP
705 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
706 #else
707 #define CONFIG_CORELOCK CORELOCK_SWAP
708 #endif
710 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
712 #endif /* CPU_PP */
714 #ifndef CONFIG_CORELOCK
715 #define CONFIG_CORELOCK CORELOCK_NONE
716 #endif
718 #if CONFIG_CORELOCK == SW_CORELOCK
719 #define IF_SWCL(...) __VA_ARGS__
720 #define IFN_SWCL(...)
721 #else
722 #define IF_SWCL(...)
723 #define IFN_SWCL(...) __VA_ARGS__
724 #endif /* CONFIG_CORELOCK == */
726 #ifndef NUM_CORES
727 /* Default to single core */
728 #define NUM_CORES 1
729 #define CURRENT_CORE CPU
730 /* Attributes for core-shared data in DRAM - no caching considerations */
731 #define SHAREDBSS_ATTR
732 #define SHAREDDATA_ATTR
733 #ifndef NOCACHEBSS_ATTR
734 #define NOCACHEBSS_ATTR
735 #define NOCACHEDATA_ATTR
736 #endif
737 #define CONFIG_CORELOCK CORELOCK_NONE
739 #define IF_COP(...)
740 #define IF_COP_VOID(...) void
741 #define IF_COP_CORE(core) CURRENT_CORE
743 #endif /* NUM_CORES */
745 #ifdef HAVE_HEADPHONE_DETECTION
746 /* Timeout objects required if headphone detection is enabled */
747 #ifndef INCLUDE_TIMEOUT_API
748 #define INCLUDE_TIMEOUT_API
749 #endif
750 #endif /* HAVE_HEADPHONE_DETECTION */
752 #if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
753 #define STORAGE_GET_INFO
754 #endif
756 #ifdef CPU_MIPS
757 #include <stdbool.h> /* MIPS GCC fix? */
758 #endif
760 #if defined(HAVE_USBSTACK)
761 /* Define the implemented USB transport classes */
762 #if CONFIG_USBOTG == USBOTG_ISP1583
763 #define USB_HAS_BULK
764 #elif CONFIG_USBOTG == USBOTG_ARC
765 #define USB_HAS_BULK
766 #define USB_HAS_INTERRUPT
767 #elif CONFIG_USBOTG == USBOTG_JZ4740
768 #define USB_HAS_BULK
769 #define USB_HAS_INTERRUPT
770 #elif defined(CPU_TCC780X) || defined(define CPU_TCC77X)
771 #define USB_HAS_BULK
772 #endif /* CONFIG_USBOTG */
774 /* define the class drivers to enable */
775 #ifdef BOOTLOADER
777 /* enable usb storage for targets that do bootloader usb */
778 #if (defined(TOSHIBA_GIGABEAT_S) || \
779 (defined(CREATIVE_ZVx) || \
780 defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \
781 (CONFIG_USBOTG == USBOTG_JZ4740)
782 #define USB_ENABLE_STORAGE
783 #endif
785 #else /* BOOTLOADER */
787 //#define USB_ENABLE_SERIAL
788 #define USB_ENABLE_STORAGE
790 #ifdef USB_HAS_INTERRUPT
791 #define USB_ENABLE_HID
792 #else
793 #define USB_ENABLE_CHARGING_ONLY
794 #endif
796 #endif /* BOOTLOADER */
798 #endif /* HAVE_USBSTACK */
802 #endif /* __CONFIG_H__ */