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_STORAGE (note these are combineable bit-flags) */
32 #define STORAGE_ATA 0x01
33 #define STORAGE_MMC 0x02
34 #define STORAGE_SD 0x04
35 #define STORAGE_NAND 0x08
36 #define STORAGE_RAMDISK 0x10
38 /* CONFIG_TUNER (note these are combineable bit-flags) */
39 #define S1A0903X01 0x01 /* Samsung */
40 #define TEA5767 0x02 /* Philips */
41 #define LV24020LP 0x04 /* Sanyo */
42 #define SI4700 0x08 /* Silicon Labs */
43 #define TEA5760 0x10 /* Philips */
44 #define LV240000 0x20 /* Sanyo */
50 #define SWCODEC 1 /* if codec is done by SW */
75 #define RECORDER_PAD 2
77 #define IRIVER_H100_PAD 4
78 #define IRIVER_H300_PAD 5
79 #define IAUDIO_X5M5_PAD 6
82 #define IPOD_1G2G_PAD 9
83 #define IRIVER_IFP7XX_PAD 10
84 #define GIGABEAT_PAD 11
85 #define IRIVER_H10_PAD 12
86 #define SANSA_E200_PAD 13
87 #define SANSA_C200_PAD 14
88 #define ELIO_TPJ1022_PAD 15
89 #define ARCHOS_AV300_PAD 16
90 #define MROBE100_PAD 17
91 #define MROBE500_PAD 18
92 #define GIGABEAT_S_PAD 19
93 #define LOGIK_DAX_PAD 20
94 #define IAUDIO67_PAD 21
95 #define COWOND2_PAD 22
96 #define IAUDIO_M3_PAD 23
97 #define CREATIVEZVM_PAD 24
98 #define SANSA_M200_PAD 25
99 #define CREATIVEZV_PAD 26
100 #define PHILIPS_SA9200_PAD 27
101 #define SANSA_C100_PAD 28
102 #define PHILIPS_HDD1630_PAD 29
103 #define MEIZU_M6SL_PAD 30
104 #define ONDAVX747_PAD 31
105 #define ONDAVX767_PAD 32
106 #define MEIZU_M6SP_PAD 33
107 #define MEIZU_M3_PAD 34
108 #define SANSA_CLIP_PAD 35
109 #define SANSA_FUZE_PAD 36
111 /* CONFIG_REMOTE_KEYPAD */
112 #define H100_REMOTE 1
113 #define H300_REMOTE 2
116 /* CONFIG_CHARGING */
117 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
118 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
119 #define CHARGING_CONTROL 3 /* Software controlled charging */
122 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
123 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
124 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
125 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
126 unknown at the time of this writing */
127 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
128 unknown at the time of this writing */
129 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
130 #define LCD_IPODNANO 7 /* as used by iPod Nano */
131 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
132 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
133 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
134 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
135 #define LCD_GIGABEAT 12
136 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
137 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
138 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
139 #define LCD_DSC25 16 /* as used by Archos AV300 */
140 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
141 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
142 #define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
143 #define LCD_LOGIKDAX 20 /* as used by Logik DAX - SSD1815 */
144 #define LCD_IAUDIO67 21 /* as used by iAudio 6/7 - unknown */
145 #define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
146 #define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
147 #define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
148 #define LCD_SA9200 25 /* as used by the Philips SA9200 */
149 #define LCD_S6B33B2 26 /* as used by the Sansa c100 */
150 #define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
151 #define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
152 #define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
153 #define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
154 #define LCD_SSD1303 31 /* as used by the Sansa Clip */
155 #define LCD_FUZE 32 /* as used by the Sansa Fuze */
157 /* LCD_PIXELFORMAT */
158 #define HORIZONTAL_PACKING 1
159 #define VERTICAL_PACKING 2
160 #define HORIZONTAL_INTERLEAVED 3
161 #define VERTICAL_INTERLEAVED 4
163 #define RGB565SWAPPED 3553
165 /* CONFIG_ORIENTATION */
166 #define SCREEN_PORTRAIT 0
167 #define SCREEN_LANDSCAPE 1
168 #define SCREEN_SQUARE 2
171 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
172 #define I2C_ONDIO 2 /* Ondio style */
173 #define I2C_COLDFIRE 3 /* Coldfire style */
174 #define I2C_PP5002 4 /* PP5002 style */
175 #define I2C_PP5020 5 /* PP5020 style */
176 #define I2C_PNX0101 6 /* PNX0101 style */
177 #define I2C_S3C2440 7
178 #define I2C_PP5024 8 /* PP5024 style */
180 #define I2C_TCC77X 10
181 #define I2C_TCC780X 11
182 #define I2C_DM320 12 /* DM320 style */
183 #define I2C_S5L8700 13
184 #define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
185 #define I2C_AS3525 15
188 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
189 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
190 /* else HW controlled LED (iRiver H1x0) */
193 #define NAND_IFP7XX 1
195 #define NAND_SAMSUNG 3
196 #define NAND_CC 4 /* ChinaChip */
199 #define RTC_M41ST84W 1 /* Archos Recorder */
200 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
201 #define RTC_PCF50606 3 /* iriver H300 */
202 #define RTC_S3C2440 4
203 #define RTC_E8564 5 /* iriver H10 */
204 #define RTC_AS3514 6 /* Sandisk Sansa series */
205 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
207 #define RTC_RX5X348AB 9
208 #define RTC_TCC77X 10
209 #define RTC_TCC780X 11
211 #define RTC_MC13783 13 /* Freescale MC13783 PMIC */
212 #define RTC_S5L8700 14
213 #define RTC_S35390A 15
214 #define RTC_JZ47XX 16 /* Ingenic Jz47XX */
217 #define USBOTG_ISP1362 1362 /* iriver H300 */
218 #define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
219 #define USBOTG_M5636 5636 /* iAudio X5 */
220 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
221 #define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
222 #define USBOTG_AS3525 3525 /* AMS AS3525 */
228 /* now go and pick yours */
229 #if defined(ARCHOS_PLAYER)
230 #include "config-player.h"
231 #elif defined(ARCHOS_RECORDER)
232 #include "config-recorder.h"
233 #elif defined(ARCHOS_FMRECORDER)
234 #include "config-fmrecorder.h"
235 #elif defined(ARCHOS_RECORDERV2)
236 #include "config-recorderv2.h"
237 #elif defined(ARCHOS_ONDIOSP)
238 #include "config-ondiosp.h"
239 #elif defined(ARCHOS_ONDIOFM)
240 #include "config-ondiofm.h"
241 #elif defined(ARCHOS_AV300)
242 #include "config-av300.h"
243 #elif defined(IRIVER_H100)
244 #include "config-h100.h"
245 #elif defined(IRIVER_H120)
246 #include "config-h120.h"
247 #elif defined(IRIVER_H300)
248 #include "config-h300.h"
249 #elif defined(IAUDIO_X5)
250 #include "config-iaudiox5.h"
251 #elif defined(IAUDIO_M5)
252 #include "config-iaudiom5.h"
253 #elif defined(IAUDIO_M3)
254 #include "config-iaudiom3.h"
255 #elif defined(IPOD_COLOR)
256 #include "config-ipodcolor.h"
257 #elif defined(IPOD_NANO)
258 #include "config-ipodnano.h"
259 #elif defined(IPOD_VIDEO)
260 #include "config-ipodvideo.h"
261 #elif defined(IPOD_1G2G)
262 #include "config-ipod1g2g.h"
263 #elif defined(IPOD_3G)
264 #include "config-ipod3g.h"
265 #elif defined(IPOD_4G)
266 #include "config-ipod4g.h"
267 #elif defined(IRIVER_IFP7XX)
268 #include "config-ifp7xx.h"
269 #elif defined(GIGABEAT_F)
270 #include "config-gigabeat.h"
271 #elif defined(GIGABEAT_S)
272 #include "config-gigabeat-s.h"
273 #elif defined(IPOD_MINI)
274 #include "config-ipodmini.h"
275 #elif defined(IPOD_MINI2G)
276 #include "config-ipodmini2g.h"
277 #elif defined(IRIVER_H10)
278 #include "config-h10.h"
279 #elif defined(IRIVER_H10_5GB)
280 #include "config-h10_5gb.h"
281 #elif defined(SANSA_E200)
282 #include "config-e200.h"
283 #elif defined(SANSA_C200)
284 #include "config-c200.h"
285 #elif defined(SANSA_M200)
286 #include "config-m200.h"
287 #elif defined(ELIO_TPJ1022)
288 #include "config-tpj1022.h"
289 #elif defined(MROBE_100)
290 #include "config-mrobe100.h"
291 #elif defined(MROBE_500)
292 #include "config-mrobe500.h"
293 #elif defined(LOGIK_DAX)
294 #include "config-logikdax.h"
295 #elif defined(IAUDIO_7)
296 #include "config-iaudio7.h"
297 #elif defined(COWON_D2)
298 #include "config-cowond2.h"
299 #elif defined(CREATIVE_ZVM)
300 #include "config-creativezvm.h"
301 #elif defined(CREATIVE_ZVM60GB)
302 #include "config-creativezvm60gb.h"
303 #elif defined(CREATIVE_ZV)
304 #include "config-creativezv.h"
305 #elif defined(PHILIPS_SA9200)
306 #include "config-sa9200.h"
307 #elif defined(PHILIPS_HDD1630)
308 #include "config-hdd1630.h"
309 #elif defined(SANSA_C100)
310 #include "config-c100.h"
311 #elif defined(MEIZU_M6SL)
312 #include "config-meizu-m6sl.h"
313 #elif defined(MEIZU_M6SP)
314 #include "config-meizu-m6sp.h"
315 #elif defined(MEIZU_M3)
316 #include "config-meizu-m3.h"
317 #elif defined(ONDA_VX747)
318 #include "config-ondavx747.h"
319 #elif defined(ONDA_VX747P)
320 #include "config-ondavx747p.h"
321 #elif defined(ONDA_VX767)
322 #include "config-ondavx767.h"
323 #elif defined(SANSA_CLIP)
324 #include "config-clip.h"
325 #elif defined(SANSA_E200V2)
326 #include "config-e200v2.h"
327 #elif defined(SANSA_M200V4)
328 #include "config-m200v4.h"
329 #elif defined(SANSA_FUZE)
330 #include "config-fuze.h"
332 /* no known platform */
335 /* setup basic macros from capability masks */
336 #include "config_caps.h"
338 /* now set any CONFIG_ defines correctly if they are not used,
339 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
341 #define CONFIG_TUNER 0
344 #ifndef CONFIG_USBOTG
345 #define CONFIG_USBOTG 0
352 #ifndef CONFIG_CHARGING
353 #define CONFIG_CHARGING 0
360 #ifndef CONFIG_ORIENTATION
361 #if LCD_HEIGHT > LCD_WIDTH
362 #define CONFIG_ORIENTATION SCREEN_PORTRAIT
363 #elif LCD_HEIGHT < LCD_WIDTH
364 #define CONFIG_ORIENTATION SCREEN_LANDSCAPE
366 #define CONFIG_ORIENTATION SCREEN_SQUARE
370 /* define this in the target config.h to use a different size */
371 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
372 #define CONFIG_DEFAULT_ICON_HEIGHT 8
374 #ifndef CONFIG_DEFAULT_ICON_WIDTH
375 #define CONFIG_DEFAULT_ICON_WIDTH 6
377 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
378 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
380 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
381 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
384 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
385 /* Multiple possible tuners */
386 #define CONFIG_TUNER_MULTI
389 #if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
390 /* Multiple storage drivers */
391 #define CONFIG_STORAGE_MULTI
394 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
395 /* Bootloaders don't use CPU frequency adjustment */
396 #undef HAVE_ADJUSTABLE_CPU_FREQ
399 /* Enable the directory cache and tagcache in RAM if we have
400 * plenty of RAM. Both features can be enabled independently. */
401 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
403 #define HAVE_DIRCACHE
405 #define HAVE_TC_RAMCACHE
409 /* Add one HAVE_ define for all mas35xx targets */
410 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
414 #if (CONFIG_CODEC == SWCODEC)
417 #if CONFIG_CPU == IMX31L
418 /* Priority in bootloader is wanted */
419 #define HAVE_PRIORITY_SCHEDULING
422 #else /* !BOOTLOADER */
424 #define HAVE_EXTENDED_MESSAGING_AND_NAME
427 #define HAVE_PRIORITY_SCHEDULING
428 #define HAVE_SCHEDULER_BOOSTCTRL
429 #endif /* SIMULATOR */
431 #define HAVE_SEMAPHORE_OBJECTS
433 #ifdef TOSHIBA_GIGABEAT_F
434 #define HAVE_WAKEUP_OBJECTS
437 #endif /* BOOTLOADER */
439 #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == AS3525)
440 #define HAVE_WAKEUP_OBJECTS
443 #endif /* (CONFIG_CODEC == SWCODEC) */
445 /* define for all cpus from SH family */
446 #if (CONFIG_CPU == SH7034)
450 /* define for all cpus from coldfire family */
451 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
455 /* define for all cpus from PP family */
456 #if (CONFIG_CPU == PP5002)
458 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
463 /* define for all cpus from TCC77X family */
464 #if (CONFIG_CPU == TCC771L) || (CONFIG_CPU == TCC773L) || (CONFIG_CPU == TCC770)
468 /* define for all cpus from TCC780 family */
469 #if (CONFIG_CPU == TCC7801)
473 /* define for all cpus from ARM7TDMI family (for specific optimisations) */
474 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
478 /* define for all cpus from ARM family */
479 #if (CONFIG_CPU == IMX31L)
481 #define ARM_ARCH 6 /* ARMv6 */
484 #if defined(CPU_TCC77X) || defined(CPU_TCC780X) || (CONFIG_CPU == DM320)
486 #define ARM_ARCH 5 /* ARMv5 */
489 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
490 || (CONFIG_CPU == DSC25) || (CONFIG_CPU == S5L8700) || (CONFIG_CPU == AS3525)
492 #define ARM_ARCH 4 /* ARMv4 */
495 /* Determine if accesses should be strictly long aligned. */
496 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
497 #define ROCKBOX_STRICT_ALIGN 1
500 #if (CONFIG_CPU == JZ4732)
508 /* This attribute can be used to ensure that certain symbols are never profiled
509 * which can be important as profiling a function de-inlines it */
511 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
517 #if !defined(SIMULATOR) && /* Not for simulators */ \
518 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
519 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
520 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
521 (CONFIG_CPU == PNX0101) || \
522 (CONFIG_CPU == S5L8700)) /* Samsung S5L8700: core, plugins, codecs */
523 #define ICODE_ATTR __attribute__ ((section(".icode")))
524 #define ICONST_ATTR __attribute__ ((section(".irodata")))
525 #define IDATA_ATTR __attribute__ ((section(".idata")))
526 #define IBSS_ATTR __attribute__ ((section(".ibss")))
528 #if CONFIG_CPU != SH7034
529 #define PLUGIN_USE_IRAM
532 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
533 * when not compiling with -ffunction-sections, even when the function has
534 * a section attribute. */
537 #define STATICIRAM static
544 #define STATICIRAM static
547 #ifndef IRAM_LCDFRAMEBUFFER
548 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
549 #define IRAM_LCDFRAMEBUFFER
552 /* Change this if you want to build a single-core firmware for a multicore
553 * target for debugging */
554 #if defined(BOOTLOADER)
555 #define FORCE_SINGLE_CORE
558 /* Core locking types - specifies type of atomic operation */
559 #define CORELOCK_NONE 0
560 #define SW_CORELOCK 1 /* Mutual exclusion provided by a software algorithm
561 and not a special semaphore instruction */
562 #define CORELOCK_SWAP 2 /* A swap (exchange) instruction */
565 #define IDLE_STACK_SIZE 0x80
566 #define IDLE_STACK_WORDS 0x20
568 /* Attributes to place data in uncached DRAM */
569 /* These are useful beyond dual-core and ultimately beyond PP since they may
570 * be used for DMA buffers and such without cache maintenence calls. */
571 #define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
572 #define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
574 #if !defined(FORCE_SINGLE_CORE)
577 #define CURRENT_CORE current_core()
578 /* Attributes for core-shared data in DRAM where IRAM is better used for other
580 #define SHAREDBSS_ATTR NOCACHEBSS_ATTR
581 #define SHAREDDATA_ATTR NOCACHEDATA_ATTR
583 #define IF_COP(...) __VA_ARGS__
584 #define IF_COP_VOID(...) __VA_ARGS__
585 #define IF_COP_CORE(core) core
588 #define CONFIG_CORELOCK SW_CORELOCK /* SWP(B) is broken */
590 #define CONFIG_CORELOCK CORELOCK_SWAP
593 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
597 #ifndef CONFIG_CORELOCK
598 #define CONFIG_CORELOCK CORELOCK_NONE
601 #if CONFIG_CORELOCK == SW_CORELOCK
602 #define IF_SWCL(...) __VA_ARGS__
603 #define IFN_SWCL(...)
606 #define IFN_SWCL(...) __VA_ARGS__
607 #endif /* CONFIG_CORELOCK == */
610 /* Default to single core */
612 #define CURRENT_CORE CPU
613 /* Attributes for core-shared data in DRAM - no caching considerations */
614 #define SHAREDBSS_ATTR
615 #define SHAREDDATA_ATTR
616 #ifndef NOCACHEBSS_ATTR
617 #define NOCACHEBSS_ATTR
618 #define NOCACHEDATA_ATTR
620 #define CONFIG_CORELOCK CORELOCK_NONE
623 #define IF_COP_VOID(...) void
624 #define IF_COP_CORE(core) CURRENT_CORE
626 #endif /* NUM_CORES */
628 #ifdef HAVE_HEADPHONE_DETECTION
629 /* Timeout objects required if headphone detection is enabled */
630 #ifndef INCLUDE_TIMEOUT_API
631 #define INCLUDE_TIMEOUT_API
633 #endif /* HAVE_HEADPHONE_DETECTION */
635 #if defined(HAVE_USBSTACK) || (CONFIG_STORAGE & STORAGE_NAND)
636 #define STORAGE_GET_INFO
640 #include <stdbool.h> /* MIPS GCC fix? */
643 #endif /* __CONFIG_H__ */