bulgarian update by Hristo Kovachev
[Rockbox.git] / firmware / export / config.h
blobc108171d37f97512d67a26f9f44c6f37e4a430f6
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 TCC771L 771
55 #define TCC773L 773
56 #define TCC7801 7801
58 /* CONFIG_KEYPAD */
59 #define PLAYER_PAD 1
60 #define RECORDER_PAD 2
61 #define ONDIO_PAD 3
62 #define IRIVER_H100_PAD 4
63 #define IRIVER_H300_PAD 5
64 #define IAUDIO_X5M5_PAD 6
65 #define IPOD_4G_PAD 7
66 #define IPOD_3G_PAD 8
67 #define IPOD_1G2G_PAD 9
68 #define IRIVER_IFP7XX_PAD 10
69 #define GIGABEAT_PAD 11
70 #define IRIVER_H10_PAD 12
71 #define SANSA_E200_PAD 13
72 #define SANSA_C200_PAD 14
73 #define ELIO_TPJ1022_PAD 15
74 #define ARCHOS_AV300_PAD 16
75 #define MROBE100_PAD 17
76 #define MROBE500_PAD 18
77 #define GIGABEAT_S_PAD 19
78 #define LOGIK_DAX_PAD 20
79 #define IAUDIO67_PAD 21
80 #define COWOND2_PAD 22
81 #define IAUDIO_M3_PAD 23
83 /* CONFIG_REMOTE_KEYPAD */
84 #define H100_REMOTE 1
85 #define H300_REMOTE 2
86 #define X5_REMOTE 3
88 /* CONFIG_CHARGING */
89 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
90 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
91 #define CHARGING_CONTROL 3 /* Software controlled charging */
93 /* CONFIG_LCD */
94 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
95 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
96 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
97 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
98 unknown at the time of this writing */
99 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
100 unknown at the time of this writing */
101 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
102 #define LCD_IPODNANO 7 /* as used by iPod Nano */
103 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
104 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
105 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
106 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
107 #define LCD_GIGABEAT 12
108 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
109 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
110 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
111 #define LCD_DSC25 16 /* as used by Archos AV300 */
112 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
113 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
114 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
115 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
116 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
117 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
118 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
119 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
121 /* LCD_PIXELFORMAT */
122 #define HORIZONTAL_PACKING 1
123 #define VERTICAL_PACKING 2
124 #define HORIZONTAL_INTERLEAVED 3
125 #define VERTICAL_INTERLEAVED 4
126 #define RGB565 565
127 #define RGB565SWAPPED 3553
129 /* CONFIG_ORIENTATION */
130 #define SCREEN_PORTAIT 0
131 #define SCREEN_LANDSCAPE 1
132 #define SCREEN_SQUARE 2
134 /* CONFIG_I2C */
135 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
136 #define I2C_ONDIO 2 /* Ondio style */
137 #define I2C_COLDFIRE 3 /* Coldfire style */
138 #define I2C_PP5002 4 /* PP5002 style */
139 #define I2C_PP5020 5 /* PP5020 style */
140 #define I2C_PNX0101 6 /* PNX0101 style */
141 #define I2C_S3C2440 7
142 #define I2C_PP5024 8 /* PP5024 style */
143 #define I2C_IMX31L 9
144 #define I2C_TCC77X 10
145 #define I2C_TCC780X 11
147 /* CONFIG_LED */
148 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
149 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
150 /* else HW controlled LED (iRiver H1x0) */
152 /* CONFIG_FLASH */
153 #define FLASH_IFP7XX 1
155 /* CONFIG_RTC */
156 #define RTC_M41ST84W 1 /* Archos Recorder */
157 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
158 #define RTC_PCF50606 3 /* iriver H300 */
159 #define RTC_S3C2440 4
160 #define RTC_E8564 5 /* iriver H10 */
161 #define RTC_AS3514 6 /* Sandisk Sansa e200 series */
162 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
163 #define RTC_IMX31L 8
164 #define RTC_RX5X348AB 9
165 #define RTC_TCC77X 10
166 #define RTC_TCC780X 11
167 #define RTC_MR100 12
169 /* USB On-the-go */
170 #define USBOTG_ISP1362 1362 /* iriver H300 */
171 #define USBOTG_M5636 5636 /* iAudio X5 */
172 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
174 /* Multiple cores */
175 #define CPU 0
176 #define COP 1
178 /* now go and pick yours */
179 #if defined(ARCHOS_PLAYER)
180 #include "config-player.h"
181 #elif defined(ARCHOS_RECORDER)
182 #include "config-recorder.h"
183 #elif defined(ARCHOS_FMRECORDER)
184 #include "config-fmrecorder.h"
185 #elif defined(ARCHOS_RECORDERV2)
186 #include "config-recorderv2.h"
187 #elif defined(ARCHOS_ONDIOSP)
188 #include "config-ondiosp.h"
189 #elif defined(ARCHOS_ONDIOFM)
190 #include "config-ondiofm.h"
191 #elif defined(ARCHOS_AV300)
192 #include "config-av300.h"
193 #elif defined(IRIVER_H100)
194 #include "config-h100.h"
195 #elif defined(IRIVER_H120)
196 #include "config-h120.h"
197 #elif defined(IRIVER_H300)
198 #include "config-h300.h"
199 #elif defined(IAUDIO_X5)
200 #include "config-iaudiox5.h"
201 #elif defined(IAUDIO_M5)
202 #include "config-iaudiom5.h"
203 #elif defined(IAUDIO_M3)
204 #include "config-iaudiom3.h"
205 #elif defined(IPOD_COLOR)
206 #include "config-ipodcolor.h"
207 #elif defined(IPOD_NANO)
208 #include "config-ipodnano.h"
209 #elif defined(IPOD_VIDEO)
210 #include "config-ipodvideo.h"
211 #elif defined(IPOD_1G2G)
212 #include "config-ipod1g2g.h"
213 #elif defined(IPOD_3G)
214 #include "config-ipod3g.h"
215 #elif defined(IPOD_4G)
216 #include "config-ipod4g.h"
217 #elif defined(IRIVER_IFP7XX)
218 #include "config-ifp7xx.h"
219 #elif defined(GIGABEAT_F)
220 #include "config-gigabeat.h"
221 #elif defined(GIGABEAT_S)
222 #include "config-gigabeat-s.h"
223 #elif defined(IPOD_MINI)
224 #include "config-ipodmini.h"
225 #elif defined(IPOD_MINI2G)
226 #include "config-ipodmini2g.h"
227 #elif defined(IRIVER_H10)
228 #include "config-h10.h"
229 #elif defined(IRIVER_H10_5GB)
230 #include "config-h10_5gb.h"
231 #elif defined(SANSA_E200)
232 #include "config-e200.h"
233 #elif defined(SANSA_C200)
234 #include "config-c200.h"
235 #elif defined(ELIO_TPJ1022)
236 #include "config-tpj1022.h"
237 #elif defined(MROBE_100)
238 #include "config-mrobe100.h"
239 #elif defined(MROBE_500)
240 #include "config-mrobe500.h"
241 #elif defined(LOGIK_DAX)
242 #include "config-logikdax.h"
243 #elif defined(IAUDIO_7)
244 #include "config-iaudio7.h"
245 #elif defined(COWON_D2)
246 #include "config-cowond2.h"
247 #elif defined(CREATIVE_ZVM)
248 #include "config-creativezvm.h"
249 #else
250 /* no known platform */
251 #endif
253 /* setup basic macros from capability masks */
254 #include "config_caps.h"
256 /* now set any CONFIG_ defines correctly if they are not used,
257 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
258 #ifndef CONFIG_TUNER
259 #define CONFIG_TUNER 0
260 #endif
262 #ifndef CONFIG_USBOTG
263 #define CONFIG_USBOTG 0
264 #endif
266 #ifndef CONFIG_LED
267 #define CONFIG_LED 0
268 #endif
270 #ifndef CONFIG_CHARGING
271 #define CONFIG_CHARGING 0
272 #endif
274 #ifndef CONFIG_RTC
275 #define CONFIG_RTC 0
276 #endif
278 #ifndef CONFIG_ORIENTATION
279 #if LCD_HEIGHT > LCD_WIDTH
280 #define CONFIG_ORIENTATION SCREEN_PORTAIT
281 #elif LCD_HEIGHT < LCD_WIDTH
282 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
283 #else
284 #define CONFIG_ORIENTATION SCREEN_SQUARE
285 #endif
286 #endif
288 /* define this in the target config.h to use a different size */
289 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
290 #define CONFIG_DEFAULT_ICON_HEIGHT 8
291 #endif
292 #ifndef CONFIG_DEFAULT_ICON_WIDTH
293 #define CONFIG_DEFAULT_ICON_WIDTH 6
294 #endif
295 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
296 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
297 #endif
298 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
299 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
300 #endif
302 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
303 /* Multiple possible tuners */
304 #define CONFIG_TUNER_MULTI
305 #endif
307 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
308 /* Bootloaders don't use CPU frequency adjustment */
309 #undef HAVE_ADJUSTABLE_CPU_FREQ
310 #endif
312 /* Enable the directory cache and tagcache in RAM if we have
313 * plenty of RAM. Both features can be enabled independently. */
314 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
315 !defined(BOOTLOADER)
316 #define HAVE_DIRCACHE
317 #ifdef HAVE_TAGCACHE
318 #define HAVE_TC_RAMCACHE
319 #endif
320 #endif
322 /* Add one HAVE_ define for all mas35xx targets */
323 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
324 #define HAVE_MAS35XX
325 #endif
327 #if (CONFIG_CODEC == SWCODEC)
328 #ifndef BOOTLOADER
330 #define HAVE_EXTENDED_MESSAGING_AND_NAME
332 #ifndef SIMULATOR
333 #define HAVE_PRIORITY_SCHEDULING
334 #define HAVE_SCHEDULER_BOOSTCTRL
335 #endif /* SIMULATOR */
337 #define HAVE_SEMAPHORE_OBJECTS
338 #define HAVE_EVENT_OBJECTS
340 #ifdef TOSHIBA_GIGABEAT_F
341 #define HAVE_WAKEUP_OBJECTS
342 #endif
344 #endif /* BOOTLOADER */
346 #ifdef HAVE_USBSTACK
347 #define HAVE_WAKEUP_OBJECTS
348 #endif
350 #endif /* (CONFIG_CODEC == SWCODEC) */
352 /* define for all cpus from SH family */
353 #if (CONFIG_CPU == SH7034)
354 #define CPU_SH
355 #endif
357 /* define for all cpus from coldfire family */
358 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
359 #define CPU_COLDFIRE
360 #endif
362 /* define for all cpus from PP family */
363 #if (CONFIG_CPU == PP5002)
364 #define CPU_PP
365 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
366 #define CPU_PP
367 #define CPU_PP502x
368 #endif
370 /* define for all cpus from TCC77X family */
371 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L)
372 #define CPU_TCC77X
373 #endif
375 /* define for all cpus from TCC780 family */
376 #if (CONFIG_CPU == TCC7801)
377 #define CPU_TCC780X
378 #endif
380 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
381 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
382 #define CPU_ARM7TDMI
383 #endif
385 /* define for all cpus from ARM family */
386 #if (CONFIG_CPU == IMX31L)
387 #define CPU_ARM
388 #define ARM_ARCH 6 /* ARMv6 */
389 #endif
391 #if defined(CPU_TCC77X) || defined(CPU_TCC780X)
392 #define CPU_ARM
393 #define ARM_ARCH 5 /* ARMv5 */
394 #endif
396 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
397 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == DM320)
398 #define CPU_ARM
399 #define ARM_ARCH 4 /* ARMv4 */
400 #endif
402 /* Determine if accesses should be strictly long aligned. */
403 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
404 #define ROCKBOX_STRICT_ALIGN 1
405 #endif
407 #ifndef CODEC_SIZE
408 #define CODEC_SIZE 0
409 #endif
411 /* This attribute can be used to ensure that certain symbols are never profiled
412 * which can be important as profiling a function de-inlines it */
413 #ifdef RB_PROFILE
414 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
415 #else
416 #define NO_PROF_ATTR
417 #endif
419 /* IRAM usage */
420 #if !defined(SIMULATOR) && /* Not for simulators */ \
421 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
422 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
423 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
424 defined(CPU_TCC77X) || /* Telechips: core, plugins, codecs */ \
425 defined(CPU_TCC780X) || /* Telechips: core, plugins, codecs */ \
426 (CONFIG_CPU == PNX0101))
427 #define ICODE_ATTR __attribute__ ((section(".icode")))
428 #define ICONST_ATTR __attribute__ ((section(".irodata")))
429 #define IDATA_ATTR __attribute__ ((section(".idata")))
430 #define IBSS_ATTR __attribute__ ((section(".ibss")))
431 #define USE_IRAM
432 #if CONFIG_CPU != SH7034
433 #define PLUGIN_USE_IRAM
434 #endif
435 #if defined(CPU_ARM)
436 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
437 * when not compiling with -ffunction-sections, even when the function has
438 * a section attribute. */
439 #define STATICIRAM
440 #else
441 #define STATICIRAM static
442 #endif
443 #else
444 #define ICODE_ATTR
445 #define ICONST_ATTR
446 #define IDATA_ATTR
447 #define IBSS_ATTR
448 #define STATICIRAM static
449 #endif
451 #ifndef IRAM_LCDFRAMEBUFFER
452 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
453 #define IRAM_LCDFRAMEBUFFER
454 #endif
456 /* Change this if you want to build a single-core firmware for a multicore
457 * target for debugging */
458 #if defined(BOOTLOADER)
459 #define FORCE_SINGLE_CORE
460 #endif
462 /* Core locking types - specifies type of atomic operation */
463 #define CORELOCK_NONE 0
464 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
465 and not a special semaphore instruction */
466 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
468 #if defined(CPU_PP)
469 #define IDLE_STACK_SIZE 0x80
470 #define IDLE_STACK_WORDS 0x20
472 /* Attributes to place data in uncached DRAM */
473 /* These are useful beyond dual-core and ultimately beyond PP since they may
474 * be used for DMA buffers and such without cache maintenence calls. */
475 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
476 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
478 #if !defined(FORCE_SINGLE_CORE)
480 #define NUM_CORES 2
481 #define CURRENT_CORE current_core()
482 /* Attributes for core-shared data in DRAM where IRAM is better used for other
483 * purposes. */
484 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
485 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
487 #define IF_COP(...) __VA_ARGS__
488 #define IF_COP_VOID(...) __VA_ARGS__
489 #define IF_COP_CORE(core) core
491 #ifdef CPU_PP
492 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
493 #else
494 #define CONFIG_CORELOCK CORELOCK_SWAP
495 #endif
497 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
499 #endif /* CPU_PP */
501 #ifndef CONFIG_CORELOCK
502 #define CONFIG_CORELOCK CORELOCK_NONE
503 #endif
505 #if CONFIG_CORELOCK == SW_CORELOCK
506 #define IF_SWCL(...) __VA_ARGS__
507 #define IFN_SWCL(...)
508 #else
509 #define IF_SWCL(...)
510 #define IFN_SWCL(...) __VA_ARGS__
511 #endif /* CONFIG_CORELOCK == */
513 #ifndef NUM_CORES
514 /* Default to single core */
515 #define NUM_CORES 1
516 #define CURRENT_CORE CPU
517 /* Attributes for core-shared data in DRAM - no caching considerations */
518 #define SHAREDBSS_ATTR
519 #define SHAREDDATA_ATTR
520 #ifndef NOCACHEBSS_ATTR
521 #define NOCACHEBSS_ATTR
522 #define NOCACHEDATA_ATTR
523 #endif
524 #define CONFIG_CORELOCK CORELOCK_NONE
526 #define IF_COP(...)
527 #define IF_COP_VOID(...) void
528 #define IF_COP_CORE(core) CURRENT_CORE
530 #endif /* NUM_CORES */
532 #ifdef HAVE_HEADPHONE_DETECTION
533 /* Timeout objects required if headphone detection is enabled */
534 #ifndef INCLUDE_TIMEOUT_API
535 #define INCLUDE_TIMEOUT_API
536 #endif
537 #endif /* HAVE_HEADPHONE_DETECTION */
539 #endif /* __CONFIG_H__ */