D2: Make the nand driver's sanity checks a little more... sane. This should allow...
[kugel-rb.git] / firmware / export / config.h
blob34d0bf27c628f8ea272aaecb9d6be710eb9fcb13
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Daniel Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef __CONFIG_H__
21 #define __CONFIG_H__
23 #ifndef __PCTOOL__
24 #include "autoconf.h"
25 #endif
27 /* symbolic names for multiple choice configurations: */
29 /* CONFIG_TUNER (note these are combineable bit-flags) */
30 #define S1A0903X01 0x01 /* Samsung */
31 #define TEA5767 0x02 /* Philips */
32 #define LV24020LP 0x04 /* Sanyo */
33 #define SI4700 0x08 /* Silicon Labs */
35 /* CONFIG_CODEC */
36 #define MAS3587F 3587
37 #define MAS3507D 3507
38 #define MAS3539F 3539
39 #define SWCODEC 1 /* if codec is done by SW */
41 /* CONFIG_CPU */
42 #define SH7034 7034
43 #define MCF5249 5249
44 #define MCF5250 5250
45 #define PP5002 5002
46 #define PP5020 5020
47 #define PP5022 5022
48 #define PP5024 5024
49 #define PNX0101 101
50 #define S3C2440 2440
51 #define DSC25 25
52 #define DM320 320
53 #define IMX31L 31
54 #define TCC770 770
55 #define TCC771L 771
56 #define TCC773L 773
57 #define TCC7801 7801
59 /* CONFIG_KEYPAD */
60 #define PLAYER_PAD 1
61 #define RECORDER_PAD 2
62 #define ONDIO_PAD 3
63 #define IRIVER_H100_PAD 4
64 #define IRIVER_H300_PAD 5
65 #define IAUDIO_X5M5_PAD 6
66 #define IPOD_4G_PAD 7
67 #define IPOD_3G_PAD 8
68 #define IPOD_1G2G_PAD 9
69 #define IRIVER_IFP7XX_PAD 10
70 #define GIGABEAT_PAD 11
71 #define IRIVER_H10_PAD 12
72 #define SANSA_E200_PAD 13
73 #define SANSA_C200_PAD 14
74 #define ELIO_TPJ1022_PAD 15
75 #define ARCHOS_AV300_PAD 16
76 #define MROBE100_PAD 17
77 #define MROBE500_PAD 18
78 #define GIGABEAT_S_PAD 19
79 #define LOGIK_DAX_PAD 20
80 #define IAUDIO67_PAD 21
81 #define COWOND2_PAD 22
82 #define IAUDIO_M3_PAD 23
83 #define CREATIVEZVM_PAD 24
84 #define SANSA_M200_PAD 25
85 #define CREATIVEZV_PAD 26
86 #define PHILIPS_SA9200_PAD 27
87 #define SANSA_C100_PAD 28
89 /* CONFIG_REMOTE_KEYPAD */
90 #define H100_REMOTE 1
91 #define H300_REMOTE 2
92 #define X5_REMOTE 3
94 /* CONFIG_CHARGING */
95 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
96 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
97 #define CHARGING_CONTROL 3 /* Software controlled charging */
99 /* CONFIG_LCD */
100 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
101 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
102 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
103 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
104 unknown at the time of this writing */
105 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
106 unknown at the time of this writing */
107 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
108 #define LCD_IPODNANO 7 /* as used by iPod Nano */
109 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
110 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
111 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
112 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
113 #define LCD_GIGABEAT 12
114 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
115 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
116 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
117 #define LCD_DSC25 16 /* as used by Archos AV300 */
118 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
119 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
120 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
121 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
122 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
123 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
124 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
125 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
126 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
127 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
129 /* LCD_PIXELFORMAT */
130 #define HORIZONTAL_PACKING 1
131 #define VERTICAL_PACKING 2
132 #define HORIZONTAL_INTERLEAVED 3
133 #define VERTICAL_INTERLEAVED 4
134 #define RGB565 565
135 #define RGB565SWAPPED 3553
137 /* CONFIG_ORIENTATION */
138 #define SCREEN_PORTRAIT 0
139 #define SCREEN_LANDSCAPE 1
140 #define SCREEN_SQUARE 2
142 /* CONFIG_I2C */
143 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
144 #define I2C_ONDIO 2 /* Ondio style */
145 #define I2C_COLDFIRE 3 /* Coldfire style */
146 #define I2C_PP5002 4 /* PP5002 style */
147 #define I2C_PP5020 5 /* PP5020 style */
148 #define I2C_PNX0101 6 /* PNX0101 style */
149 #define I2C_S3C2440 7
150 #define I2C_PP5024 8 /* PP5024 style */
151 #define I2C_IMX31L 9
152 #define I2C_TCC77X 10
153 #define I2C_TCC780X 11
154 #define I2C_DM320 12 /* DM320 style */
156 /* CONFIG_LED */
157 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
158 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
159 /* else HW controlled LED (iRiver H1x0) */
161 /* CONFIG_FLASH */
162 #define FLASH_IFP7XX 1
164 /* CONFIG_RTC */
165 #define RTC_M41ST84W 1 /* Archos Recorder */
166 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
167 #define RTC_PCF50606 3 /* iriver H300 */
168 #define RTC_S3C2440 4
169 #define RTC_E8564 5 /* iriver H10 */
170 #define RTC_AS3514 6 /* Sandisk Sansa e200 series */
171 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
172 #define RTC_IMX31L 8
173 #define RTC_RX5X348AB 9
174 #define RTC_TCC77X 10
175 #define RTC_TCC780X 11
176 #define RTC_MR100 12
177 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
179 /* USB On-the-go */
180 #define USBOTG_ISP1362 1362 /* iriver H300 */
181 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
182 #define USBOTG_M5636 5636 /* iAudio X5 */
183 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
185 /* Multiple cores */
186 #define CPU 0
187 #define COP 1
189 /* now go and pick yours */
190 #if defined(ARCHOS_PLAYER)
191 #include "config-player.h"
192 #elif defined(ARCHOS_RECORDER)
193 #include "config-recorder.h"
194 #elif defined(ARCHOS_FMRECORDER)
195 #include "config-fmrecorder.h"
196 #elif defined(ARCHOS_RECORDERV2)
197 #include "config-recorderv2.h"
198 #elif defined(ARCHOS_ONDIOSP)
199 #include "config-ondiosp.h"
200 #elif defined(ARCHOS_ONDIOFM)
201 #include "config-ondiofm.h"
202 #elif defined(ARCHOS_AV300)
203 #include "config-av300.h"
204 #elif defined(IRIVER_H100)
205 #include "config-h100.h"
206 #elif defined(IRIVER_H120)
207 #include "config-h120.h"
208 #elif defined(IRIVER_H300)
209 #include "config-h300.h"
210 #elif defined(IAUDIO_X5)
211 #include "config-iaudiox5.h"
212 #elif defined(IAUDIO_M5)
213 #include "config-iaudiom5.h"
214 #elif defined(IAUDIO_M3)
215 #include "config-iaudiom3.h"
216 #elif defined(IPOD_COLOR)
217 #include "config-ipodcolor.h"
218 #elif defined(IPOD_NANO)
219 #include "config-ipodnano.h"
220 #elif defined(IPOD_VIDEO)
221 #include "config-ipodvideo.h"
222 #elif defined(IPOD_1G2G)
223 #include "config-ipod1g2g.h"
224 #elif defined(IPOD_3G)
225 #include "config-ipod3g.h"
226 #elif defined(IPOD_4G)
227 #include "config-ipod4g.h"
228 #elif defined(IRIVER_IFP7XX)
229 #include "config-ifp7xx.h"
230 #elif defined(GIGABEAT_F)
231 #include "config-gigabeat.h"
232 #elif defined(GIGABEAT_S)
233 #include "config-gigabeat-s.h"
234 #elif defined(IPOD_MINI)
235 #include "config-ipodmini.h"
236 #elif defined(IPOD_MINI2G)
237 #include "config-ipodmini2g.h"
238 #elif defined(IRIVER_H10)
239 #include "config-h10.h"
240 #elif defined(IRIVER_H10_5GB)
241 #include "config-h10_5gb.h"
242 #elif defined(SANSA_E200)
243 #include "config-e200.h"
244 #elif defined(SANSA_C200)
245 #include "config-c200.h"
246 #elif defined(SANSA_M200)
247 #include "config-m200.h"
248 #elif defined(ELIO_TPJ1022)
249 #include "config-tpj1022.h"
250 #elif defined(MROBE_100)
251 #include "config-mrobe100.h"
252 #elif defined(MROBE_500)
253 #include "config-mrobe500.h"
254 #elif defined(LOGIK_DAX)
255 #include "config-logikdax.h"
256 #elif defined(IAUDIO_7)
257 #include "config-iaudio7.h"
258 #elif defined(COWON_D2)
259 #include "config-cowond2.h"
260 #elif defined(CREATIVE_ZVM)
261 #include "config-creativezvm.h"
262 #elif defined(CREATIVE_ZVM60GB)
263 #include "config-creativezvm60gb.h"
264 #elif defined(CREATIVE_ZV)
265 #include "config-creativezv.h"
266 #elif defined(PHILIPS_SA9200)
267 #include "config-sa9200.h"
268 #elif defined(SANSA_C100)
269 #include "config-c100.h"
270 #else
271 /* no known platform */
272 #endif
274 /* setup basic macros from capability masks */
275 #include "config_caps.h"
277 /* now set any CONFIG_ defines correctly if they are not used,
278 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
279 #ifndef CONFIG_TUNER
280 #define CONFIG_TUNER 0
281 #endif
283 #ifndef CONFIG_USBOTG
284 #define CONFIG_USBOTG 0
285 #endif
287 #ifndef CONFIG_LED
288 #define CONFIG_LED 0
289 #endif
291 #ifndef CONFIG_CHARGING
292 #define CONFIG_CHARGING 0
293 #endif
295 #ifndef CONFIG_RTC
296 #define CONFIG_RTC 0
297 #endif
299 #ifndef CONFIG_ORIENTATION
300 #if LCD_HEIGHT > LCD_WIDTH
301 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
302 #elif LCD_HEIGHT < LCD_WIDTH
303 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
304 #else
305 #define CONFIG_ORIENTATION SCREEN_SQUARE
306 #endif
307 #endif
309 /* define this in the target config.h to use a different size */
310 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
311 #define CONFIG_DEFAULT_ICON_HEIGHT 8
312 #endif
313 #ifndef CONFIG_DEFAULT_ICON_WIDTH
314 #define CONFIG_DEFAULT_ICON_WIDTH 6
315 #endif
316 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
317 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
318 #endif
319 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
320 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
321 #endif
323 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
324 /* Multiple possible tuners */
325 #define CONFIG_TUNER_MULTI
326 #endif
328 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
329 /* Bootloaders don't use CPU frequency adjustment */
330 #undef HAVE_ADJUSTABLE_CPU_FREQ
331 #endif
333 /* Enable the directory cache and tagcache in RAM if we have
334 * plenty of RAM. Both features can be enabled independently. */
335 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
336 !defined(BOOTLOADER)
337 #define HAVE_DIRCACHE
338 #ifdef HAVE_TAGCACHE
339 #define HAVE_TC_RAMCACHE
340 #endif
341 #endif
343 /* Add one HAVE_ define for all mas35xx targets */
344 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
345 #define HAVE_MAS35XX
346 #endif
348 #if (CONFIG_CODEC == SWCODEC)
349 #ifdef BOOTLOADER
351 #if CONFIG_CPU == IMX31L
352 /* Priority in bootloader is wanted */
353 #define HAVE_PRIORITY_SCHEDULING
354 #endif
356 #else /* !BOOTLOADER */
358 #define HAVE_EXTENDED_MESSAGING_AND_NAME
360 #ifndef SIMULATOR
361 #define HAVE_PRIORITY_SCHEDULING
362 #define HAVE_SCHEDULER_BOOSTCTRL
363 #endif /* SIMULATOR */
365 #define HAVE_SEMAPHORE_OBJECTS
366 #define HAVE_EVENT_OBJECTS
368 #ifdef TOSHIBA_GIGABEAT_F
369 #define HAVE_WAKEUP_OBJECTS
370 #endif
372 #endif /* BOOTLOADER */
374 #ifdef HAVE_USBSTACK
375 #define HAVE_WAKEUP_OBJECTS
376 #endif
378 #endif /* (CONFIG_CODEC == SWCODEC) */
380 /* define for all cpus from SH family */
381 #if (CONFIG_CPU == SH7034)
382 #define CPU_SH
383 #endif
385 /* define for all cpus from coldfire family */
386 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
387 #define CPU_COLDFIRE
388 #endif
390 /* define for all cpus from PP family */
391 #if (CONFIG_CPU == PP5002)
392 #define CPU_PP
393 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
394 #define CPU_PP
395 #define CPU_PP502x
396 #endif
398 /* define for all cpus from TCC77X family */
399 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
400 #define CPU_TCC77X
401 #endif
403 /* define for all cpus from TCC780 family */
404 #if (CONFIG_CPU == TCC7801)
405 #define CPU_TCC780X
406 #endif
408 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
409 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
410 #define CPU_ARM7TDMI
411 #endif
413 /* define for all cpus from ARM family */
414 #if (CONFIG_CPU == IMX31L)
415 #define CPU_ARM
416 #define ARM_ARCH 6 /* ARMv6 */
417 #endif
419 #if defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320)
420 #define CPU_ARM
421 #define ARM_ARCH 5 /* ARMv5 */
422 #endif
424 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
425 || (CONFIG_CPU == DSC25)
426 #define CPU_ARM
427 #define ARM_ARCH 4 /* ARMv4 */
428 #endif
430 /* Determine if accesses should be strictly long aligned. */
431 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
432 #define ROCKBOX_STRICT_ALIGN 1
433 #endif
435 #ifndef CODEC_SIZE
436 #define CODEC_SIZE 0
437 #endif
439 /* This attribute can be used to ensure that certain symbols are never profiled
440 * which can be important as profiling a function de-inlines it */
441 #ifdef RB_PROFILE
442 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
443 #else
444 #define NO_PROF_ATTR
445 #endif
447 /* IRAM usage */
448 #if !defined(SIMULATOR) && /* Not for simulators */ \
449 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
450 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
451 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
452 defined(CPU_TCC77X) || /* Telechips: core, plugins, codecs */ \
453 (CONFIG_CPU == PNX0101))
454 #define ICODE_ATTR __attribute__ ((section(".icode")))
455 #define ICONST_ATTR __attribute__ ((section(".irodata")))
456 #define IDATA_ATTR __attribute__ ((section(".idata")))
457 #define IBSS_ATTR __attribute__ ((section(".ibss")))
458 #define USE_IRAM
459 #if CONFIG_CPU != SH7034
460 #define PLUGIN_USE_IRAM
461 #endif
462 #if defined(CPU_ARM)
463 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
464 * when not compiling with -ffunction-sections, even when the function has
465 * a section attribute. */
466 #define STATICIRAM
467 #else
468 #define STATICIRAM static
469 #endif
470 #else
471 #define ICODE_ATTR
472 #define ICONST_ATTR
473 #define IDATA_ATTR
474 #define IBSS_ATTR
475 #define STATICIRAM static
476 #endif
478 #ifndef IRAM_LCDFRAMEBUFFER
479 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
480 #define IRAM_LCDFRAMEBUFFER
481 #endif
483 /* Change this if you want to build a single-core firmware for a multicore
484 * target for debugging */
485 #if defined(BOOTLOADER)
486 #define FORCE_SINGLE_CORE
487 #endif
489 /* Core locking types - specifies type of atomic operation */
490 #define CORELOCK_NONE 0
491 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
492 and not a special semaphore instruction */
493 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
495 #if defined(CPU_PP)
496 #define IDLE_STACK_SIZE 0x80
497 #define IDLE_STACK_WORDS 0x20
499 /* Attributes to place data in uncached DRAM */
500 /* These are useful beyond dual-core and ultimately beyond PP since they may
501 * be used for DMA buffers and such without cache maintenence calls. */
502 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
503 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
505 #if !defined(FORCE_SINGLE_CORE)
507 #define NUM_CORES 2
508 #define CURRENT_CORE current_core()
509 /* Attributes for core-shared data in DRAM where IRAM is better used for other
510 * purposes. */
511 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
512 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
514 #define IF_COP(...) __VA_ARGS__
515 #define IF_COP_VOID(...) __VA_ARGS__
516 #define IF_COP_CORE(core) core
518 #ifdef CPU_PP
519 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
520 #else
521 #define CONFIG_CORELOCK CORELOCK_SWAP
522 #endif
524 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
526 #endif /* CPU_PP */
528 #ifndef CONFIG_CORELOCK
529 #define CONFIG_CORELOCK CORELOCK_NONE
530 #endif
532 #if CONFIG_CORELOCK == SW_CORELOCK
533 #define IF_SWCL(...) __VA_ARGS__
534 #define IFN_SWCL(...)
535 #else
536 #define IF_SWCL(...)
537 #define IFN_SWCL(...) __VA_ARGS__
538 #endif /* CONFIG_CORELOCK == */
540 #ifndef NUM_CORES
541 /* Default to single core */
542 #define NUM_CORES 1
543 #define CURRENT_CORE CPU
544 /* Attributes for core-shared data in DRAM - no caching considerations */
545 #define SHAREDBSS_ATTR
546 #define SHAREDDATA_ATTR
547 #ifndef NOCACHEBSS_ATTR
548 #define NOCACHEBSS_ATTR
549 #define NOCACHEDATA_ATTR
550 #endif
551 #define CONFIG_CORELOCK CORELOCK_NONE
553 #define IF_COP(...)
554 #define IF_COP_VOID(...) void
555 #define IF_COP_CORE(core) CURRENT_CORE
557 #endif /* NUM_CORES */
559 #ifdef HAVE_HEADPHONE_DETECTION
560 /* Timeout objects required if headphone detection is enabled */
561 #ifndef INCLUDE_TIMEOUT_API
562 #define INCLUDE_TIMEOUT_API
563 #endif
564 #endif /* HAVE_HEADPHONE_DETECTION */
566 #endif /* __CONFIG_H__ */