1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Daniel Stenberg
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
29 /* symbolic names for multiple choice configurations: */
31 /* CONFIG_TUNER (note these are combineable bit-flags) */
32 #define S1A0903X01 0x01 /* Samsung */
33 #define TEA5767 0x02 /* Philips */
34 #define LV24020LP 0x04 /* Sanyo */
35 #define SI4700 0x08 /* Silicon Labs */
36 #define TEA5760 0x10 /* Philips */
37 #define LV240000 0x20 /* Sanyo */
43 #define SWCODEC 1 /* if codec is done by SW */
68 #define RECORDER_PAD 2
70 #define IRIVER_H100_PAD 4
71 #define IRIVER_H300_PAD 5
72 #define IAUDIO_X5M5_PAD 6
75 #define IPOD_1G2G_PAD 9
76 #define IRIVER_IFP7XX_PAD 10
77 #define GIGABEAT_PAD 11
78 #define IRIVER_H10_PAD 12
79 #define SANSA_E200_PAD 13
80 #define SANSA_C200_PAD 14
81 #define ELIO_TPJ1022_PAD 15
82 #define ARCHOS_AV300_PAD 16
83 #define MROBE100_PAD 17
84 #define MROBE500_PAD 18
85 #define GIGABEAT_S_PAD 19
86 #define LOGIK_DAX_PAD 20
87 #define IAUDIO67_PAD 21
88 #define COWOND2_PAD 22
89 #define IAUDIO_M3_PAD 23
90 #define CREATIVEZVM_PAD 24
91 #define SANSA_M200_PAD 25
92 #define CREATIVEZV_PAD 26
93 #define PHILIPS_SA9200_PAD 27
94 #define SANSA_C100_PAD 28
95 #define PHILIPS_HDD1630_PAD 29
96 #define MEIZU_M6SL_PAD 30
97 #define ONDAVX747_PAD 31
98 #define ONDAVX767_PAD 32
99 #define MEIZU_M6SP_PAD 33
100 #define MEIZU_M3_PAD 34
101 #define SANSA_CLIP_PAD 35
103 /* CONFIG_REMOTE_KEYPAD */
104 #define H100_REMOTE 1
105 #define H300_REMOTE 2
108 /* CONFIG_CHARGING */
109 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
110 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
111 #define CHARGING_CONTROL 3 /* Software controlled charging */
114 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
115 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
116 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
117 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
118 unknown at the time of this writing */
119 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
120 unknown at the time of this writing */
121 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
122 #define LCD_IPODNANO 7 /* as used by iPod Nano */
123 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
124 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
125 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
126 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
127 #define LCD_GIGABEAT 12
128 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
129 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
130 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
131 #define LCD_DSC25 16 /* as used by Archos AV300 */
132 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
133 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
134 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
135 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
136 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
137 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
138 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
139 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
140 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
141 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
142 #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
143 #define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
144 #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
145 #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
146 #define LCD_SSD1303 31 /* as used by the Sansa Clip */
148 /* LCD_PIXELFORMAT */
149 #define HORIZONTAL_PACKING 1
150 #define VERTICAL_PACKING 2
151 #define HORIZONTAL_INTERLEAVED 3
152 #define VERTICAL_INTERLEAVED 4
154 #define RGB565SWAPPED 3553
156 /* CONFIG_ORIENTATION */
157 #define SCREEN_PORTRAIT 0
158 #define SCREEN_LANDSCAPE 1
159 #define SCREEN_SQUARE 2
162 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
163 #define I2C_ONDIO 2 /* Ondio style */
164 #define I2C_COLDFIRE 3 /* Coldfire style */
165 #define I2C_PP5002 4 /* PP5002 style */
166 #define I2C_PP5020 5 /* PP5020 style */
167 #define I2C_PNX0101 6 /* PNX0101 style */
168 #define I2C_S3C2440 7
169 #define I2C_PP5024 8 /* PP5024 style */
171 #define I2C_TCC77X 10
172 #define I2C_TCC780X 11
173 #define I2C_DM320 12 /* DM320 style */
174 #define I2C_S5L8700 13
175 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
178 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
179 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
180 /* else HW controlled LED (iRiver H1x0) */
183 #define FLASH_IFP7XX 1
186 #define RTC_M41ST84W 1 /* Archos Recorder */
187 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
188 #define RTC_PCF50606 3 /* iriver H300 */
189 #define RTC_S3C2440 4
190 #define RTC_E8564 5 /* iriver H10 */
191 #define RTC_AS3514 6 /* Sandisk Sansa e200 series */
192 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
194 #define RTC_RX5X348AB 9
195 #define RTC_TCC77X 10
196 #define RTC_TCC780X 11
198 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
199 #define RTC_S5L8700 14
200 #define RTC_S35390A 15
201 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
204 #define USBOTG_ISP1362 1362 /* iriver H300 */
205 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
206 #define USBOTG_M5636 5636 /* iAudio X5 */
207 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
208 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
214 /* now go and pick yours */
215 #if defined(ARCHOS_PLAYER)
216 #include "config-player.h"
217 #elif defined(ARCHOS_RECORDER)
218 #include "config-recorder.h"
219 #elif defined(ARCHOS_FMRECORDER)
220 #include "config-fmrecorder.h"
221 #elif defined(ARCHOS_RECORDERV2)
222 #include "config-recorderv2.h"
223 #elif defined(ARCHOS_ONDIOSP)
224 #include "config-ondiosp.h"
225 #elif defined(ARCHOS_ONDIOFM)
226 #include "config-ondiofm.h"
227 #elif defined(ARCHOS_AV300)
228 #include "config-av300.h"
229 #elif defined(IRIVER_H100)
230 #include "config-h100.h"
231 #elif defined(IRIVER_H120)
232 #include "config-h120.h"
233 #elif defined(IRIVER_H300)
234 #include "config-h300.h"
235 #elif defined(IAUDIO_X5)
236 #include "config-iaudiox5.h"
237 #elif defined(IAUDIO_M5)
238 #include "config-iaudiom5.h"
239 #elif defined(IAUDIO_M3)
240 #include "config-iaudiom3.h"
241 #elif defined(IPOD_COLOR)
242 #include "config-ipodcolor.h"
243 #elif defined(IPOD_NANO)
244 #include "config-ipodnano.h"
245 #elif defined(IPOD_VIDEO)
246 #include "config-ipodvideo.h"
247 #elif defined(IPOD_1G2G)
248 #include "config-ipod1g2g.h"
249 #elif defined(IPOD_3G)
250 #include "config-ipod3g.h"
251 #elif defined(IPOD_4G)
252 #include "config-ipod4g.h"
253 #elif defined(IRIVER_IFP7XX)
254 #include "config-ifp7xx.h"
255 #elif defined(GIGABEAT_F)
256 #include "config-gigabeat.h"
257 #elif defined(GIGABEAT_S)
258 #include "config-gigabeat-s.h"
259 #elif defined(IPOD_MINI)
260 #include "config-ipodmini.h"
261 #elif defined(IPOD_MINI2G)
262 #include "config-ipodmini2g.h"
263 #elif defined(IRIVER_H10)
264 #include "config-h10.h"
265 #elif defined(IRIVER_H10_5GB)
266 #include "config-h10_5gb.h"
267 #elif defined(SANSA_E200)
268 #include "config-e200.h"
269 #elif defined(SANSA_C200)
270 #include "config-c200.h"
271 #elif defined(SANSA_M200)
272 #include "config-m200.h"
273 #elif defined(ELIO_TPJ1022)
274 #include "config-tpj1022.h"
275 #elif defined(MROBE_100)
276 #include "config-mrobe100.h"
277 #elif defined(MROBE_500)
278 #include "config-mrobe500.h"
279 #elif defined(LOGIK_DAX)
280 #include "config-logikdax.h"
281 #elif defined(IAUDIO_7)
282 #include "config-iaudio7.h"
283 #elif defined(COWON_D2)
284 #include "config-cowond2.h"
285 #elif defined(CREATIVE_ZVM)
286 #include "config-creativezvm.h"
287 #elif defined(CREATIVE_ZVM60GB)
288 #include "config-creativezvm60gb.h"
289 #elif defined(CREATIVE_ZV)
290 #include "config-creativezv.h"
291 #elif defined(PHILIPS_SA9200)
292 #include "config-sa9200.h"
293 #elif defined(PHILIPS_HDD1630)
294 #include "config-hdd1630.h"
295 #elif defined(SANSA_C100)
296 #include "config-c100.h"
297 #elif defined(MEIZU_M6SL)
298 #include "config-meizu-m6sl.h"
299 #elif defined(MEIZU_M6SP)
300 #include "config-meizu-m6sp.h"
301 #elif defined(MEIZU_M3)
302 #include "config-meizu-m3.h"
303 #elif defined(ONDA_VX747)
304 #include "config-ondavx747.h"
305 #elif defined(ONDA_VX767)
306 #include "config-ondavx767.h"
307 #elif defined(SANSA_CLIP)
308 #include "config-clip.h"
310 /* no known platform */
313 /* setup basic macros from capability masks */
314 #include "config_caps.h"
316 /* now set any CONFIG_ defines correctly if they are not used,
317 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
319 #define CONFIG_TUNER 0
322 #ifndef CONFIG_USBOTG
323 #define CONFIG_USBOTG 0
330 #ifndef CONFIG_CHARGING
331 #define CONFIG_CHARGING 0
338 #ifndef CONFIG_ORIENTATION
339 #if LCD_HEIGHT > LCD_WIDTH
340 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
341 #elif LCD_HEIGHT < LCD_WIDTH
342 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
344 #define CONFIG_ORIENTATION SCREEN_SQUARE
348 /* define this in the target config.h to use a different size */
349 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
350 #define CONFIG_DEFAULT_ICON_HEIGHT 8
352 #ifndef CONFIG_DEFAULT_ICON_WIDTH
353 #define CONFIG_DEFAULT_ICON_WIDTH 6
355 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
356 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
358 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
359 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
362 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
363 /* Multiple possible tuners */
364 #define CONFIG_TUNER_MULTI
367 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
368 /* Bootloaders don't use CPU frequency adjustment */
369 #undef HAVE_ADJUSTABLE_CPU_FREQ
372 /* Enable the directory cache and tagcache in RAM if we have
373 * plenty of RAM. Both features can be enabled independently. */
374 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
376 #define HAVE_DIRCACHE
378 #define HAVE_TC_RAMCACHE
382 /* Add one HAVE_ define for all mas35xx targets */
383 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
387 #if (CONFIG_CODEC == SWCODEC)
390 #if CONFIG_CPU == IMX31L
391 /* Priority in bootloader is wanted */
392 #define HAVE_PRIORITY_SCHEDULING
395 #else /* !BOOTLOADER */
397 #define HAVE_EXTENDED_MESSAGING_AND_NAME
400 #define HAVE_PRIORITY_SCHEDULING
401 #define HAVE_SCHEDULER_BOOSTCTRL
402 #endif /* SIMULATOR */
404 #define HAVE_SEMAPHORE_OBJECTS
405 #define HAVE_EVENT_OBJECTS
407 #ifdef TOSHIBA_GIGABEAT_F
408 #define HAVE_WAKEUP_OBJECTS
411 #endif /* BOOTLOADER */
414 #define HAVE_WAKEUP_OBJECTS
417 #endif /* (CONFIG_CODEC == SWCODEC) */
419 /* define for all cpus from SH family */
420 #if (CONFIG_CPU == SH7034)
424 /* define for all cpus from coldfire family */
425 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
429 /* define for all cpus from PP family */
430 #if (CONFIG_CPU == PP5002)
432 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
437 /* define for all cpus from TCC77X family */
438 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
442 /* define for all cpus from TCC780 family */
443 #if (CONFIG_CPU == TCC7801)
447 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
448 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
452 /* define for all cpus from ARM family */
453 #if (CONFIG_CPU == IMX31L)
455 #define ARM_ARCH 6 /* ARMv6 */
458 #if defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320) || (CONFIG_CPU == AS3525)
460 #define ARM_ARCH 5 /* ARMv5 */
463 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
464 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == S5L8700)
466 #define ARM_ARCH 4 /* ARMv4 */
469 /* Determine if accesses should be strictly long aligned. */
470 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
471 #define ROCKBOX_STRICT_ALIGN 1
474 #if (CONFIG_CPU == JZ4732)
482 /* This attribute can be used to ensure that certain symbols are never profiled
483 * which can be important as profiling a function de-inlines it */
485 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
491 #if !defined(SIMULATOR) && /* Not for simulators */ \
492 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
493 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
494 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
495 (CONFIG_CPU == PNX0101) || \
496 (CONFIG_CPU == S5L8700)) /* Samsung S5L8700: core, plugins, codecs */
497 #define ICODE_ATTR __attribute__ ((section(".icode")))
498 #define ICONST_ATTR __attribute__ ((section(".irodata")))
499 #define IDATA_ATTR __attribute__ ((section(".idata")))
500 #define IBSS_ATTR __attribute__ ((section(".ibss")))
502 #if CONFIG_CPU != SH7034
503 #define PLUGIN_USE_IRAM
506 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
507 * when not compiling with -ffunction-sections, even when the function has
508 * a section attribute. */
511 #define STATICIRAM static
518 #define STATICIRAM static
521 #ifndef IRAM_LCDFRAMEBUFFER
522 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
523 #define IRAM_LCDFRAMEBUFFER
526 /* Change this if you want to build a single-core firmware for a multicore
527 * target for debugging */
528 #if defined(BOOTLOADER)
529 #define FORCE_SINGLE_CORE
532 /* Core locking types - specifies type of atomic operation */
533 #define CORELOCK_NONE 0
534 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
535 and not a special semaphore instruction */
536 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
539 #define IDLE_STACK_SIZE 0x80
540 #define IDLE_STACK_WORDS 0x20
542 /* Attributes to place data in uncached DRAM */
543 /* These are useful beyond dual-core and ultimately beyond PP since they may
544 * be used for DMA buffers and such without cache maintenence calls. */
545 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
546 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
548 #if !defined(FORCE_SINGLE_CORE)
551 #define CURRENT_CORE current_core()
552 /* Attributes for core-shared data in DRAM where IRAM is better used for other
554 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
555 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
557 #define IF_COP(...) __VA_ARGS__
558 #define IF_COP_VOID(...) __VA_ARGS__
559 #define IF_COP_CORE(core) core
562 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
564 #define CONFIG_CORELOCK CORELOCK_SWAP
567 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
571 #ifndef CONFIG_CORELOCK
572 #define CONFIG_CORELOCK CORELOCK_NONE
575 #if CONFIG_CORELOCK == SW_CORELOCK
576 #define IF_SWCL(...) __VA_ARGS__
577 #define IFN_SWCL(...)
580 #define IFN_SWCL(...) __VA_ARGS__
581 #endif /* CONFIG_CORELOCK == */
584 /* Default to single core */
586 #define CURRENT_CORE CPU
587 /* Attributes for core-shared data in DRAM - no caching considerations */
588 #define SHAREDBSS_ATTR
589 #define SHAREDDATA_ATTR
590 #ifndef NOCACHEBSS_ATTR
591 #define NOCACHEBSS_ATTR
592 #define NOCACHEDATA_ATTR
594 #define CONFIG_CORELOCK CORELOCK_NONE
597 #define IF_COP_VOID(...) void
598 #define IF_COP_CORE(core) CURRENT_CORE
600 #endif /* NUM_CORES */
602 #ifdef HAVE_HEADPHONE_DETECTION
603 /* Timeout objects required if headphone detection is enabled */
604 #ifndef INCLUDE_TIMEOUT_API
605 #define INCLUDE_TIMEOUT_API
607 #endif /* HAVE_HEADPHONE_DETECTION */
609 #endif /* __CONFIG_H__ */