Improve insert of playlists. Decode M3U files using current code page and strip any...
[kugel-rb.git] / firmware / export / config.h
blob48dc3f5693272c4fd89d5a11d916200ebe29c4fd
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
57 /* CONFIG_KEYPAD */
58 #define PLAYER_PAD 1
59 #define RECORDER_PAD 2
60 #define ONDIO_PAD 3
61 #define IRIVER_H100_PAD 4
62 #define IRIVER_H300_PAD 5
63 #define IAUDIO_X5M5_PAD 6
64 #define IPOD_4G_PAD 7
65 #define IPOD_3G_PAD 8
66 #define IPOD_1G2G_PAD 9
67 #define IRIVER_IFP7XX_PAD 10
68 #define GIGABEAT_PAD 11
69 #define IRIVER_H10_PAD 12
70 #define SANSA_E200_PAD 13
71 #define SANSA_C200_PAD 14
72 #define ELIO_TPJ1022_PAD 15
73 #define ARCHOS_AV300_PAD 16
74 #define MROBE500_PAD 17
75 #define GIGABEAT_S_PAD 18
76 #define LOGIK_DAX_PAD 19
77 #define IAUDIO67_PAD 20
79 /* CONFIG_REMOTE_KEYPAD */
80 #define H100_REMOTE 1
81 #define H300_REMOTE 2
82 #define X5_REMOTE 3
84 /* CONFIG_CHARGING */
85 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
86 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
87 #define CHARGING_CONTROL 3 /* Software controlled charging */
89 /* CONFIG_LCD */
90 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
91 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
92 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
93 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
94 unknown at the time of this writing */
95 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
96 unknown at the time of this writing */
97 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
98 #define LCD_IPODNANO 7 /* as used by iPod Nano */
99 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
100 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
101 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
102 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
103 #define LCD_GIGABEAT 12
104 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
105 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
106 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
107 #define LCD_DSC25 16 /* as used by Archos AV300 */
108 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
109 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
110 #define LCD_LOGIKDAX 19 /* as used by Logik DAX - SSD1815 */
111 #define LCD_IAUDIO67 20 /* as used by iAudio 6/7 - unknown */
113 /* LCD_PIXELFORMAT */
114 #define HORIZONTAL_PACKING 1
115 #define VERTICAL_PACKING 2
116 #define HORIZONTAL_INTERLEAVED 3
117 #define VERTICAL_INTERLEAVED 4
118 #define RGB565 565
119 #define RGB565SWAPPED 3553
121 /* CONFIG_ORIENTATION */
122 #define SCREEN_PORTAIT 0
123 #define SCREEN_LANDSCAPE 1
124 #define SCREEN_SQUARE 2
126 /* CONFIG_I2C */
127 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
128 #define I2C_ONDIO 2 /* Ondio style */
129 #define I2C_COLDFIRE 3 /* Coldfire style */
130 #define I2C_PP5002 4 /* PP5002 style */
131 #define I2C_PP5020 5 /* PP5020 style */
132 #define I2C_PNX0101 6 /* PNX0101 style */
133 #define I2C_S3C2440 7
134 #define I2C_PP5024 8 /* PP5024 style */
135 #define I2C_IMX31L 9
136 #define I2C_TCC77X 10
138 /* CONFIG_LED */
139 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
140 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
141 /* else HW controlled LED (iRiver H1x0) */
143 /* CONFIG_FLASH */
144 #define FLASH_IFP7XX 1
146 /* CONFIG_RTC */
147 #define RTC_M41ST84W 1 /* Archos Recorder */
148 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
149 #define RTC_PCF50606 3 /* iriver H300 */
150 #define RTC_S3C2440 4
151 #define RTC_E8564 5 /* iriver H10 */
152 #define RTC_AS3514 6 /* Sandisk Sansa e200 series */
153 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
154 #define RTC_IMX31L 8
155 #define RTC_RX5X348AB 9
156 #define RTC_TCC77X 10
158 /* USB On-the-go */
159 #define USBOTG_ISP1362 1362 /* iriver H300 */
160 #define USBOTG_M5636 5636 /* iAudio X5 */
161 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
163 /* Multiple cores */
164 #define CPU 0
165 #define COP 1
167 /* now go and pick yours */
168 #if defined(ARCHOS_PLAYER)
169 #include "config-player.h"
170 #elif defined(ARCHOS_RECORDER)
171 #include "config-recorder.h"
172 #elif defined(ARCHOS_FMRECORDER)
173 #include "config-fmrecorder.h"
174 #elif defined(ARCHOS_RECORDERV2)
175 #include "config-recorderv2.h"
176 #elif defined(ARCHOS_ONDIOSP)
177 #include "config-ondiosp.h"
178 #elif defined(ARCHOS_ONDIOFM)
179 #include "config-ondiofm.h"
180 #elif defined(ARCHOS_AV300)
181 #include "config-av300.h"
182 #elif defined(IRIVER_H100)
183 #include "config-h100.h"
184 #elif defined(IRIVER_H120)
185 #include "config-h120.h"
186 #elif defined(IRIVER_H300)
187 #include "config-h300.h"
188 #elif defined(IAUDIO_X5)
189 #include "config-iaudiox5.h"
190 #elif defined(IAUDIO_M5)
191 #include "config-iaudiom5.h"
192 #elif defined(IPOD_COLOR)
193 #include "config-ipodcolor.h"
194 #elif defined(IPOD_NANO)
195 #include "config-ipodnano.h"
196 #elif defined(IPOD_VIDEO)
197 #include "config-ipodvideo.h"
198 #elif defined(IPOD_1G2G)
199 #include "config-ipod1g2g.h"
200 #elif defined(IPOD_3G)
201 #include "config-ipod3g.h"
202 #elif defined(IPOD_4G)
203 #include "config-ipod4g.h"
204 #elif defined(IRIVER_IFP7XX)
205 #include "config-ifp7xx.h"
206 #elif defined(GIGABEAT_F)
207 #include "config-gigabeat.h"
208 #elif defined(GIGABEAT_S)
209 #include "config-gigabeat-s.h"
210 #elif defined(IPOD_MINI)
211 #include "config-ipodmini.h"
212 #elif defined(IPOD_MINI2G)
213 #include "config-ipodmini2g.h"
214 #elif defined(IRIVER_H10)
215 #include "config-h10.h"
216 #elif defined(IRIVER_H10_5GB)
217 #include "config-h10_5gb.h"
218 #elif defined(SANSA_E200)
219 #include "config-e200.h"
220 #elif defined(SANSA_C200)
221 #include "config-c200.h"
222 #elif defined(ELIO_TPJ1022)
223 #include "config-tpj1022.h"
224 #elif defined(MROBE_500)
225 #include "config-mrobe500.h"
226 #elif defined(LOGIK_DAX)
227 #include "config-logikdax.h"
228 #elif defined(IAUDIO_7)
229 #include "config-iaudio7.h"
230 #else
231 /* no known platform */
232 #endif
234 /* setup basic macros from capability masks */
235 #include "config_caps.h"
237 /* now set any CONFIG_ defines correctly if they are not used,
238 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
239 #ifndef CONFIG_TUNER
240 #define CONFIG_TUNER 0
241 #endif
243 #ifndef CONFIG_USBOTG
244 #define CONFIG_USBOTG 0
245 #endif
247 #ifndef CONFIG_LED
248 #define CONFIG_LED 0
249 #endif
251 #ifndef CONFIG_CHARGING
252 #define CONFIG_CHARGING 0
253 #endif
255 #ifndef CONFIG_RTC
256 #define CONFIG_RTC 0
257 #endif
259 #ifndef CONFIG_ORIENTATION
260 #if LCD_HEIGHT > LCD_WIDTH
261 #define CONFIG_ORIENTATION SCREEN_PORTAIT
262 #elif LCD_HEIGHT < LCD_WIDTH
263 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
264 #else
265 #define CONFIG_ORIENTATION SCREEN_SQUARE
266 #endif
267 #endif
269 /* define this in the target config.h to use a different size */
270 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
271 #define CONFIG_DEFAULT_ICON_HEIGHT 8
272 #endif
273 #ifndef CONFIG_DEFAULT_ICON_WIDTH
274 #define CONFIG_DEFAULT_ICON_WIDTH 6
275 #endif
276 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
277 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
278 #endif
279 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
280 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
281 #endif
283 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
284 /* Multiple possible tuners */
285 #define CONFIG_TUNER_MULTI
286 #endif
288 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
289 /* Bootloaders don't use CPU frequency adjustment */
290 #undef HAVE_ADJUSTABLE_CPU_FREQ
291 #endif
293 /* Enable the directory cache and tagcache in RAM if we have
294 * plenty of RAM. Both features can be enabled independently. */
295 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
296 !defined(BOOTLOADER) && !defined(SANSA_E200) && !defined(SANSA_C200)
297 #define HAVE_DIRCACHE
298 #ifdef HAVE_TAGCACHE
299 #define HAVE_TC_RAMCACHE
300 #endif
301 #endif
303 /* Add one HAVE_ define for all mas35xx targets */
304 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
305 #define HAVE_MAS35XX
306 #endif
308 #if CONFIG_CODEC == SWCODEC && !defined(BOOTLOADER)
309 #define HAVE_EXTENDED_MESSAGING_AND_NAME
310 #endif
312 #if (CONFIG_CODEC == SWCODEC) && !defined(BOOTLOADER)
313 #ifndef SIMULATOR
314 #define HAVE_PRIORITY_SCHEDULING
315 #define HAVE_SCHEDULER_BOOSTCTRL
316 #endif /* SIMULATOR */
317 #define HAVE_SEMAPHORE_OBJECTS
318 #define HAVE_EVENT_OBJECTS
319 #endif
321 /* define for all cpus from SH family */
322 #if (CONFIG_CPU == SH7034)
323 #define CPU_SH
324 #endif
326 /* define for all cpus from coldfire family */
327 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
328 #define CPU_COLDFIRE
329 #endif
331 /* define for all cpus from PP family */
332 #if (CONFIG_CPU == PP5002)
333 #define CPU_PP
334 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
335 #define CPU_PP
336 #define CPU_PP502x
337 #endif
339 /* define for all cpus from TCC77X family */
340 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L)
341 #define CPU_TCC77X
342 #endif
344 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
345 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
346 #define CPU_ARM7TDMI
347 #endif
349 /* define for all cpus from ARM family */
350 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
351 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == IMX31L) || (CONFIG_CPU == DM320) \
352 || defined(CPU_TCC77X)
353 #define CPU_ARM
354 #endif
356 /* Determine if accesses should be strictly long aligned. */
357 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
358 #define ROCKBOX_STRICT_ALIGN 1
359 #endif
361 #ifndef CODEC_SIZE
362 #define CODEC_SIZE 0
363 #endif
365 /* This attribute can be used to ensure that certain symbols are never profiled
366 * which can be important as profiling a function de-inlines it */
367 #ifdef RB_PROFILE
368 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
369 #else
370 #define NO_PROF_ATTR
371 #endif
373 /* IRAM usage */
374 #if !defined(SIMULATOR) && /* Not for simulators */ \
375 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
376 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
377 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
378 defined(CPU_TCC77X) || /* Telechips: core, plugins, codecs */ \
379 (CONFIG_CPU == PNX0101))
380 #define ICODE_ATTR __attribute__ ((section(".icode")))
381 #define ICONST_ATTR __attribute__ ((section(".irodata")))
382 #define IDATA_ATTR __attribute__ ((section(".idata")))
383 #define IBSS_ATTR __attribute__ ((section(".ibss")))
384 #define USE_IRAM
385 #if CONFIG_CPU != SH7034
386 #define IRAM_STEAL
387 #endif
388 #if defined(CPU_ARM)
389 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
390 * when not compiling with -ffunction-sections, even when the function has
391 * a section attribute. */
392 #define STATICIRAM
393 #else
394 #define STATICIRAM static
395 #endif
396 #else
397 #define ICODE_ATTR
398 #define ICONST_ATTR
399 #define IDATA_ATTR
400 #define IBSS_ATTR
401 #define STATICIRAM static
402 #endif
404 #ifndef IRAM_LCDFRAMEBUFFER
405 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
406 #define IRAM_LCDFRAMEBUFFER
407 #endif
409 /* Change this if you want to build a single-core firmware for a multicore
410 * target for debugging */
411 #if defined(BOOTLOADER)
412 #define FORCE_SINGLE_CORE
413 #endif
415 /* Core locking types - specifies type of atomic operation */
416 #define CORELOCK_NONE 0
417 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
418 and not a special semaphore instruction */
419 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
421 /* Dual core support - not yet working on the 1G/2G and 3G iPod */
422 #if defined(CPU_PP)
423 #define IDLE_STACK_SIZE 0x80
424 #define IDLE_STACK_WORDS 0x20
426 #if !defined(FORCE_SINGLE_CORE) && CONFIG_CPU != PP5002
428 #define NUM_CORES 2
429 #define CURRENT_CORE current_core()
430 /* Use IRAM for variables shared across cores - large memory buffers should
431 * use UNCACHED_ADDR(a) and be appropriately aligned and padded */
432 #define NOCACHEBSS_ATTR IBSS_ATTR
433 #define NOCACHEDATA_ATTR IDATA_ATTR
435 #define IF_COP(...) __VA_ARGS__
436 #define IF_COP_VOID(...) __VA_ARGS__
437 #define IF_COP_CORE(core) core
439 #if CONFIG_CPU == PP5020
440 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
441 #else
442 #define CONFIG_CORELOCK CORELOCK_SWAP
443 #endif
445 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
447 #endif /* CPU_PP */
449 #ifndef CONFIG_CORELOCK
450 #define CONFIG_CORELOCK CORELOCK_NONE
451 #endif
453 #if CONFIG_CORELOCK == SW_CORELOCK
454 #define IF_SWCL(...) __VA_ARGS__
455 #define IFN_SWCL(...)
456 #else
457 #define IF_SWCL(...)
458 #define IFN_SWCL(...) __VA_ARGS__
459 #endif /* CONFIG_CORELOCK == */
461 #ifndef NUM_CORES
462 /* Default to single core */
463 #define NUM_CORES 1
464 #define CURRENT_CORE CPU
465 #define NOCACHEBSS_ATTR
466 #define NOCACHEDATA_ATTR
467 #define CONFIG_CORELOCK CORELOCK_NONE
469 #define IF_COP(...)
470 #define IF_COP_VOID(...) void
471 #define IF_COP_CORE(core) CURRENT_CORE
473 #endif /* NUM_CORES */
475 #endif /* __CONFIG_H__ */