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