spi is shared between the rtc and tsc2100
[Rockbox.git] / firmware / export / config.h
blob7c55ee88a3c8e8835ef4ac7db6da948f38e6ab20
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 TMS320DSC25 25
52 #define DM320 320
53 #define IMX31L 31
55 /* CONFIG_KEYPAD */
56 #define PLAYER_PAD 1
57 #define RECORDER_PAD 2
58 #define ONDIO_PAD 3
59 #define IRIVER_H100_PAD 4
60 #define IRIVER_H300_PAD 5
61 #define IAUDIO_X5M5_PAD 6
62 #define IPOD_4G_PAD 7
63 #define IPOD_3G_PAD 8
64 #define IPOD_1G2G_PAD 9
65 #define IRIVER_IFP7XX_PAD 10
66 #define GIGABEAT_PAD 11
67 #define IRIVER_H10_PAD 12
68 #define SANSA_E200_PAD 13
69 #define SANSA_C200_PAD 14
70 #define ELIO_TPJ1022_PAD 15
71 #define ARCHOS_AV300_PAD 16
72 #define MROBE500_PAD 17
73 #define GIGABEAT_S_PAD 18
75 /* CONFIG_REMOTE_KEYPAD */
76 #define H100_REMOTE 1
77 #define H300_REMOTE 2
78 #define X5_REMOTE 3
80 /* CONFIG_CHARGING */
81 #define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging */
82 #define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring */
83 #define CHARGING_CONTROL 3 /* Software controlled charging */
85 /* CONFIG_LCD */
86 #define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
87 #define LCD_SSD1801 2 /* as used by Archos Player/Studio */
88 #define LCD_S1D15E06 3 /* as used by iRiver H100 series */
89 #define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
90 unknown at the time of this writing */
91 #define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
92 unknown at the time of this writing */
93 #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
94 #define LCD_IPODNANO 7 /* as used by iPod Nano */
95 #define LCD_IPODVIDEO 8 /* as used by iPod Video */
96 #define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
97 #define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
98 #define LCD_IFP7XX 11 /* as used by iRiver iFP 7xx/8xx */
99 #define LCD_GIGABEAT 12
100 #define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
101 #define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
102 #define LCD_TPJ1022 15 /* as used by Tatung Elio TPJ-1022 */
103 #define LCD_DSC25 16 /* as used by Archos AV300 */
104 #define LCD_C200 17 /* as used by Sandisk Sansa c200 */
105 #define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
107 /* LCD_PIXELFORMAT */
108 #define HORIZONTAL_PACKING 1
109 #define VERTICAL_PACKING 2
110 #define HORIZONTAL_INTERLEAVED 3
111 #define VERTICAL_INTERLEAVED 4
112 #define RGB565 565
113 #define RGB565SWAPPED 3553
115 /* CONFIG_I2C */
116 #define I2C_PLAYREC 1 /* Archos Player/Recorder style */
117 #define I2C_ONDIO 2 /* Ondio style */
118 #define I2C_COLDFIRE 3 /* Coldfire style */
119 #define I2C_PP5002 4 /* PP5002 style */
120 #define I2C_PP5020 5 /* PP5020 style */
121 #define I2C_PNX0101 6 /* PNX0101 style */
122 #define I2C_S3C2440 7
123 #define I2C_PP5024 8 /* PP5024 style */
124 #define I2C_IMX31L 9
126 /* CONFIG_LED */
127 #define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
128 #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
129 /* else HW controlled LED (iRiver H1x0) */
131 /* CONFIG_FLASH */
132 #define FLASH_IFP7XX 1
134 /* CONFIG_RTC */
135 #define RTC_M41ST84W 1 /* Archos Recorder */
136 #define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
137 #define RTC_PCF50606 3 /* iriver H300 */
138 #define RTC_S3C2440 4
139 #define RTC_E8564 5 /* iriver H10 */
140 #define RTC_AS3514 6 /* Sandisk Sansa e200 series */
141 #define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
142 #define RTC_IMX31L 8
143 #define RTC_RX5X348AB 9
145 /* USB On-the-go */
146 #define USBOTG_ISP1362 1362 /* iriver H300 */
147 #define USBOTG_M5636 5636 /* iAudio X5 */
148 #define USBOTG_ARC 5020 /* PortalPlayer 502x */
150 /* Multiple cores */
151 #define CPU 0
152 #define COP 1
154 /* now go and pick yours */
155 #if defined(ARCHOS_PLAYER)
156 #include "config-player.h"
157 #elif defined(ARCHOS_RECORDER)
158 #include "config-recorder.h"
159 #elif defined(ARCHOS_FMRECORDER)
160 #include "config-fmrecorder.h"
161 #elif defined(ARCHOS_RECORDERV2)
162 #include "config-recorderv2.h"
163 #elif defined(ARCHOS_ONDIOSP)
164 #include "config-ondiosp.h"
165 #elif defined(ARCHOS_ONDIOFM)
166 #include "config-ondiofm.h"
167 #elif defined(ARCHOS_AV300)
168 #include "config-av300.h"
169 #elif defined(IRIVER_H100)
170 #include "config-h100.h"
171 #elif defined(IRIVER_H120)
172 #include "config-h120.h"
173 #elif defined(IRIVER_H300)
174 #include "config-h300.h"
175 #elif defined(IAUDIO_X5)
176 #include "config-iaudiox5.h"
177 #elif defined(IAUDIO_M5)
178 #include "config-iaudiom5.h"
179 #elif defined(IPOD_COLOR)
180 #include "config-ipodcolor.h"
181 #elif defined(IPOD_NANO)
182 #include "config-ipodnano.h"
183 #elif defined(IPOD_VIDEO)
184 #include "config-ipodvideo.h"
185 #elif defined(IPOD_1G2G)
186 #include "config-ipod1g2g.h"
187 #elif defined(IPOD_3G)
188 #include "config-ipod3g.h"
189 #elif defined(IPOD_4G)
190 #include "config-ipod4g.h"
191 #elif defined(IRIVER_IFP7XX)
192 #include "config-ifp7xx.h"
193 #elif defined(GIGABEAT_F)
194 #include "config-gigabeat.h"
195 #elif defined(GIGABEAT_S)
196 #include "config-gigabeat-s.h"
197 #elif defined(IPOD_MINI)
198 #include "config-ipodmini.h"
199 #elif defined(IPOD_MINI2G)
200 #include "config-ipodmini2g.h"
201 #elif defined(IRIVER_H10)
202 #include "config-h10.h"
203 #elif defined(IRIVER_H10_5GB)
204 #include "config-h10_5gb.h"
205 #elif defined(SANSA_E200)
206 #include "config-e200.h"
207 #elif defined(SANSA_C200)
208 #include "config-c200.h"
209 #elif defined(ELIO_TPJ1022)
210 #include "config-tpj1022.h"
211 #elif defined(MROBE_500)
212 #include "config-mrobe500.h"
213 #else
214 /* no known platform */
215 #endif
217 /* setup basic macros from capability masks */
218 #include "config_caps.h"
220 /* now set any CONFIG_ defines correctly if they are not used,
221 No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
222 #ifndef CONFIG_TUNER
223 #define CONFIG_TUNER 0
224 #endif
226 #ifndef CONFIG_USBOTG
227 #define CONFIG_USBOTG 0
228 #endif
230 #ifndef CONFIG_LED
231 #define CONFIG_LED 0
232 #endif
234 #ifndef CONFIG_CHARGING
235 #define CONFIG_CHARGING 0
236 #endif
238 #ifndef CONFIG_RTC
239 #define CONFIG_RTC 0
240 #endif
242 /* define this in the target config.h to use a different size */
243 #ifndef CONFIG_DEFAULT_ICON_HEIGHT
244 #define CONFIG_DEFAULT_ICON_HEIGHT 8
245 #endif
246 #ifndef CONFIG_DEFAULT_ICON_WIDTH
247 #define CONFIG_DEFAULT_ICON_WIDTH 6
248 #endif
249 #ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
250 #define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
251 #endif
252 #ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
253 #define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
254 #endif
256 #if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
257 /* Multiple possible tuners */
258 #define CONFIG_TUNER_MULTI
259 #endif
261 #if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
262 /* Bootloaders don't use CPU frequency adjustment */
263 #undef HAVE_ADJUSTABLE_CPU_FREQ
264 #endif
266 /* Enable the directory cache and tagcache in RAM if we have
267 * plenty of RAM. Both features can be enabled independently. */
268 #if ((defined(MEMORYSIZE) && (MEMORYSIZE > 8)) || MEM > 8) && \
269 !defined(BOOTLOADER) && !defined(SANSA_E200) && !defined(SANSA_C200)
270 #define HAVE_DIRCACHE
271 #ifdef HAVE_TAGCACHE
272 #define HAVE_TC_RAMCACHE
273 #endif
274 #endif
276 /* Add one HAVE_ define for all mas35xx targets */
277 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
278 #define HAVE_MAS35XX
279 #endif
281 #if CONFIG_CODEC == SWCODEC && !defined(BOOTLOADER)
282 #define HAVE_EXTENDED_MESSAGING_AND_NAME
283 #endif
285 #if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR) && !defined(BOOTLOADER)
286 #define HAVE_PRIORITY_SCHEDULING
287 #define HAVE_SCHEDULER_BOOSTCTRL
288 #endif
290 /* define for all cpus from SH family */
291 #if (CONFIG_CPU == SH7034)
292 #define CPU_SH
293 #endif
295 /* define for all cpus from coldfire family */
296 #if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)
297 #define CPU_COLDFIRE
298 #endif
300 /* define for all cpus from PP family */
301 #if (CONFIG_CPU == PP5002)
302 #define CPU_PP
303 #elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
304 #define CPU_PP
305 #define CPU_PP502x
306 #endif
308 /* define for all cpus from ARM family */
309 #if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == S3C2440) \
310 || (CONFIG_CPU == TMS320DSC25) || (CONFIG_CPU == DM320) \
311 || (CONFIG_CPU == IMX31L)
312 #define CPU_ARM
313 #endif
315 /* Determine if accesses should be strictly long aligned. */
316 #if (CONFIG_CPU == SH7034) || defined(CPU_ARM)
317 #define ROCKBOX_STRICT_ALIGN 1
318 #endif
320 #ifndef CODEC_SIZE
321 #define CODEC_SIZE 0
322 #endif
324 /* This attribute can be used to ensure that certain symbols are never profiled
325 * which can be important as profiling a function de-inlines it */
326 #ifdef RB_PROFILE
327 #define NO_PROF_ATTR __attribute__ ((no_instrument_function))
328 #else
329 #define NO_PROF_ATTR
330 #endif
332 /* IRAM usage */
333 #if !defined(SIMULATOR) && /* Not for simulators */ \
334 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
335 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
336 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
337 (CONFIG_CPU == PNX0101))
338 #define ICODE_ATTR __attribute__ ((section(".icode")))
339 #define ICONST_ATTR __attribute__ ((section(".irodata")))
340 #define IDATA_ATTR __attribute__ ((section(".idata")))
341 #define IBSS_ATTR __attribute__ ((section(".ibss")))
342 #define USE_IRAM
343 #if CONFIG_CPU != SH7034
344 #define IRAM_STEAL
345 #endif
346 #if defined(CPU_ARM)
347 /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call
348 * when not compiling with -ffunction-sections, even when the function has
349 * a section attribute. */
350 #define STATICIRAM
351 #else
352 #define STATICIRAM static
353 #endif
354 #else
355 #define ICODE_ATTR
356 #define ICONST_ATTR
357 #define IDATA_ATTR
358 #define IBSS_ATTR
359 #define STATICIRAM static
360 #endif
362 #ifndef IRAM_LCDFRAMEBUFFER
363 /* if the LCD framebuffer has not been moved to IRAM, define it empty here */
364 #define IRAM_LCDFRAMEBUFFER
365 #endif
367 /* Dual core support - not yet working on the 1G/2G and 3G iPod */
368 #if defined(CPU_PP)
369 #define IDLE_STACK_SIZE 0x80
370 #define IDLE_STACK_WORDS 0x20
372 #if !defined(BOOTLOADER) && CONFIG_CPU != PP5002
373 #define NUM_CORES 2
374 #define CURRENT_CORE current_core()
375 /* Hopefully at some point we will learn how to mark areas of main memory as
376 * not to be cached. Until then, use IRAM for variables shared across cores */
377 #define NOCACHEBSS_ATTR IBSS_ATTR
378 #define NOCACHEDATA_ATTR IDATA_ATTR
380 #define IF_COP(...) __VA_ARGS__
381 #endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
382 #endif /* CPU_PP */
384 #ifndef NUM_CORES
385 /* Default to single core */
386 #define NUM_CORES 1
387 #define CURRENT_CORE CPU
388 #define NOCACHEBSS_ATTR
389 #define NOCACHEDATA_ATTR
391 #define IF_COP(...)
392 #endif /* NUM_CORES */
394 #endif /* __CONFIG_H__ */