D2: Fix IRAM usage, but disable it for now as Tremor does not fit ('make zip' works...
[Rockbox.git] / firmware / export / config.h
blobc2033dfe233cc3c6bb74842cb30faaad0d4c4c5d
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 #if !defined(SANSA_E200) && !defined(SANSA_C200)
317 #define HAVE_DIRCACHE
318 #endif
319 #ifdef HAVE_TAGCACHE
320 #define HAVE_TC_RAMCACHE
321 #endif
322 #endif
324 /* Add one HAVE_ define for all mas35xx targets */
325 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
326 #define HAVE_MAS35XX
327 #endif
329 #if CONFIG_CODEC == SWCODEC && !defined(BOOTLOADER)
330 #define HAVE_EXTENDED_MESSAGING_AND_NAME
331 #endif
333 #if (CONFIG_CODEC == SWCODEC) && !defined(BOOTLOADER)
334 #ifndef SIMULATOR
335 #define HAVE_PRIORITY_SCHEDULING
336 #define HAVE_SCHEDULER_BOOSTCTRL
337 #endif /* SIMULATOR */
338 #define HAVE_SEMAPHORE_OBJECTS
339 #define HAVE_EVENT_OBJECTS
340 #endif
342 /* define for all cpus from SH family */
343 #if (CONFIG_CPU == SH7034)
344 #define CPU_SH
345 #endif
347 /* define for all cpus from coldfire family */
348 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
349 #define CPU_COLDFIRE
350 #endif
352 /* define for all cpus from PP family */
353 #if (CONFIG_CPU == PP5002)
354 #define CPU_PP
355 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
356 #define CPU_PP
357 #define CPU_PP502x
358 #endif
360 /* define for all cpus from TCC77X family */
361 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L)
362 #define CPU_TCC77X
363 #endif
365 /* define for all cpus from TCC780 family */
366 #if (CONFIG_CPU == TCC7801)
367 #define CPU_TCC780X
368 #endif
370 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
371 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
372 #define CPU_ARM7TDMI
373 #endif
375 /* define for all cpus from ARM family */
376 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
377 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == IMX31L) || (CONFIG_CPU == DM320) \
378 || defined(CPU_TCC77X) || defined(CPU_TCC780X)
379 #define CPU_ARM
380 #endif
382 /* Determine if accesses should be strictly long aligned. */
383 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
384 #define ROCKBOX_STRICT_ALIGN 1
385 #endif
387 #ifndef CODEC_SIZE
388 #define CODEC_SIZE 0
389 #endif
391 /* This attribute can be used to ensure that certain symbols are never profiled
392 * which can be important as profiling a function de-inlines it */
393 #ifdef RB_PROFILE
394 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
395 #else
396 #define NO_PROF_ATTR
397 #endif
399 /* IRAM usage */
400 #if !defined(SIMULATOR) && /* Not for simulators */ \
401 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
402 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
403 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
404 defined(CPU_TCC77X) || /* Telechips: core, plugins, codecs */ \
405 /*defined(CPU_TCC780X) || /. Telechips: core, plugins, codecs */ \
406 (CONFIG_CPU == PNX0101))
407 #define ICODE_ATTR __attribute__ ((section(".icode")))
408 #define ICONST_ATTR __attribute__ ((section(".irodata")))
409 #define IDATA_ATTR __attribute__ ((section(".idata")))
410 #define IBSS_ATTR __attribute__ ((section(".ibss")))
411 #define USE_IRAM
412 #if CONFIG_CPU != SH7034
413 #define PLUGIN_USE_IRAM
414 #endif
415 #if defined(CPU_ARM)
416 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
417 * when not compiling with -ffunction-sections, even when the function has
418 * a section attribute. */
419 #define STATICIRAM
420 #else
421 #define STATICIRAM static
422 #endif
423 #else
424 #define ICODE_ATTR
425 #define ICONST_ATTR
426 #define IDATA_ATTR
427 #define IBSS_ATTR
428 #define STATICIRAM static
429 #endif
431 #ifndef IRAM_LCDFRAMEBUFFER
432 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
433 #define IRAM_LCDFRAMEBUFFER
434 #endif
436 /* Change this if you want to build a single-core firmware for a multicore
437 * target for debugging */
438 #if defined(BOOTLOADER)
439 #define FORCE_SINGLE_CORE
440 #endif
442 /* Core locking types - specifies type of atomic operation */
443 #define CORELOCK_NONE 0
444 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
445 and not a special semaphore instruction */
446 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
448 /* Dual core support - not yet working on the 1G/2G and 3G iPod */
449 #if defined(CPU_PP)
450 #define IDLE_STACK_SIZE 0x80
451 #define IDLE_STACK_WORDS 0x20
453 #if !defined(FORCE_SINGLE_CORE)
455 #define NUM_CORES 2
456 #define CURRENT_CORE current_core()
457 /* Use IRAM for variables shared across cores - large memory buffers should
458 * use UNCACHED_ADDR(a) and be appropriately aligned and padded */
459 #define NOCACHEBSS_ATTR IBSS_ATTR
460 #define NOCACHEDATA_ATTR IDATA_ATTR
462 #define IF_COP(...) __VA_ARGS__
463 #define IF_COP_VOID(...) __VA_ARGS__
464 #define IF_COP_CORE(core) core
466 #if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002
467 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
468 #else
469 #define CONFIG_CORELOCK CORELOCK_SWAP
470 #endif
472 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
474 #endif /* CPU_PP */
476 #ifndef CONFIG_CORELOCK
477 #define CONFIG_CORELOCK CORELOCK_NONE
478 #endif
480 #if CONFIG_CORELOCK == SW_CORELOCK
481 #define IF_SWCL(...) __VA_ARGS__
482 #define IFN_SWCL(...)
483 #else
484 #define IF_SWCL(...)
485 #define IFN_SWCL(...) __VA_ARGS__
486 #endif /* CONFIG_CORELOCK == */
488 #ifndef NUM_CORES
489 /* Default to single core */
490 #define NUM_CORES 1
491 #define CURRENT_CORE CPU
492 #define NOCACHEBSS_ATTR
493 #define NOCACHEDATA_ATTR
494 #define CONFIG_CORELOCK CORELOCK_NONE
496 #define IF_COP(...)
497 #define IF_COP_VOID(...) void
498 #define IF_COP_CORE(core) CURRENT_CORE
500 #endif /* NUM_CORES */
502 #ifdef HAVE_HEADPHONE_DETECTION
503 /* Timeout objects required if headphone detection is enabled */
504 #ifndef INCLUDE_TIMEOUT_API
505 #define INCLUDE_TIMEOUT_API
506 #endif
507 #endif /* HAVE_HEADPHONE_DETECTION */
509 #endif /* __CONFIG_H__ */