A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Daniel Stenberg
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef __CONFIG_H__
23#define __CONFIG_H__
24
25#include "autoconf.h"
26
27/* symbolic names for multiple choice configurations: */
28
29/* CONFIG_STORAGE (note these are combineable bit-flags) */
30#define STORAGE_ATA_NUM 0
31#define STORAGE_MMC_NUM 1
32#define STORAGE_SD_NUM 2
33#define STORAGE_NAND_NUM 3
34#define STORAGE_RAMDISK_NUM 4
35#define STORAGE_USB_NUM 5
36#define STORAGE_HOSTFS_NUM 6
37#define STORAGE_NUM_TYPES 7
38
39#define STORAGE_ATA (1 << STORAGE_ATA_NUM)
40#define STORAGE_MMC (1 << STORAGE_MMC_NUM)
41#define STORAGE_SD (1 << STORAGE_SD_NUM)
42#define STORAGE_NAND (1 << STORAGE_NAND_NUM)
43#define STORAGE_RAMDISK (1 << STORAGE_RAMDISK_NUM)
44#define STORAGE_USB (1 << STORAGE_USB_NUM)
45 /* meant for APPLICATION targets (implicit for SIMULATOR) */
46#define STORAGE_HOSTFS (1 << STORAGE_HOSTFS_NUM)
47
48/* CONFIG_TUNER (note these are combineable bit-flags) */
49#define TEA5767 0x02 /* Philips */
50#define LV24020LP 0x04 /* Sanyo */
51#define SI4700 0x08 /* Silicon Labs */
52#define TEA5760 0x10 /* Philips */
53#define LV240000 0x20 /* Sanyo */
54#define IPOD_REMOTE_TUNER 0x40 /* Apple */
55#define RDA5802 0x80 /* RDA Microelectronics */
56#define STFM1000 0x100 /* Sigmatel */
57
58/* CONFIG_CPU */
59#define MCF5249 5249
60#define MCF5250 5250
61#define PP5002 5002
62#define PP5020 5020
63#define PP5022 5022
64#define PP5024 5024
65#define PP6100 6100
66#define PNX0101 101
67#define S3C2440 2440
68#define DSC25 25
69#define DM320 320
70#define IMX31L 31
71#define TCC7801 7801
72#define S5L8700 8700
73#define S5L8701 8701
74#define S5L8702 8702
75#define S5L8720 8720
76#define S5L8723 8723
77#define S5L8730 8730
78#define S5L8740 8740
79#define JZ4732 4732
80#define JZ4760B 47602
81#define AS3525 3525
82#define AT91SAM9260 9260
83#define AS3525v2 35252
84#define IMX233 233
85#define RK27XX 2700
86#define X1000 1000
87#define STM32H743 32743
88#define N10480H 10480
89
90/* platforms
91 * bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
92 * possible future PLATFORM_ANDROID (some OSes might need totally different
93 * handling to run on them than a stand-alone application) */
94#define PLATFORM_NATIVE (1<<0)
95#define PLATFORM_HOSTED (1<<1)
96#define PLATFORM_ANDROID (1<<2)
97#define PLATFORM_SDL (1<<3)
98#define PLATFORM_MAEMO4 (1<<4)
99#define PLATFORM_MAEMO5 (1<<5)
100#define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5)
101#define PLATFORM_PANDORA (1<<6)
102#define PLATFORM_CTRU (1<<7)
103
104/* CONFIG_KEYPAD */
105#define IRIVER_H100_PAD 4
106#define IRIVER_H300_PAD 5
107#define IAUDIO_X5M5_PAD 6
108#define IPOD_4G_PAD 7
109#define IPOD_3G_PAD 8
110#define IPOD_1G2G_PAD 9
111#define GIGABEAT_PAD 11
112#define IRIVER_H10_PAD 12
113#define SANSA_E200_PAD 13
114#define SANSA_C200_PAD 14
115#define MROBE100_PAD 17
116#define MROBE500_PAD 18
117#define GIGABEAT_S_PAD 19
118#define COWON_D2_PAD 22
119#define IAUDIO_M3_PAD 23
120#define CREATIVEZVM_PAD 24
121#define SANSA_M200_PAD 25
122#define CREATIVEZV_PAD 26
123#define PHILIPS_SA9200_PAD 27
124#define PHILIPS_HDD1630_PAD 29
125#define MEIZU_M6SL_PAD 30
126#define ONDAVX747_PAD 31
127#define ONDAVX767_PAD 32
128#define MEIZU_M6SP_PAD 33
129#define MEIZU_M3_PAD 34
130#define SANSA_CLIP_PAD 35
131#define SANSA_FUZE_PAD 36
132#define LYRE_PROTO1_PAD 37
133#define SAMSUNG_YH820_PAD 38
134#define ONDAVX777_PAD 39
135#define SAMSUNG_YPS3_PAD 40
136#define MINI2440_PAD 41
137#define PHILIPS_HDD6330_PAD 42
138#define PBELL_VIBE500_PAD 43
139#define MPIO_HD200_PAD 44
140#define ANDROID_PAD 45
141#define SDL_PAD 46
142#define MPIO_HD300_PAD 47
143#define SANSA_FUZEPLUS_PAD 48
144#define RK27XX_GENERIC_PAD 49
145#define HM60X_PAD 50
146#define HM801_PAD 51
147#define SANSA_CONNECT_PAD 52
148#define SAMSUNG_YPR0_PAD 53
149#define CREATIVE_ZENXFI2_PAD 54
150#define CREATIVE_ZENXFI3_PAD 55
151#define MA_PAD 56
152#define SONY_NWZ_PAD 57
153#define CREATIVE_ZEN_PAD 58
154#define IHIFI_PAD 60
155#define SAMSUNG_YPR1_PAD 61
156#define SAMSUNG_YH92X_PAD 62
157#define DX50_PAD 63
158#define SONY_NWZA860_PAD 64 /* The NWZ-A860 is too different (touchscreen) */
159#define AGPTEK_ROCKER_PAD 65
160#define XDUOO_X3_PAD 66
161#define IHIFI_770_PAD 67
162#define IHIFI_800_PAD 68
163#define XDUOO_X3II_PAD 69
164#define XDUOO_X20_PAD 70
165#define FIIO_M3K_LINUX_PAD 71
166#define EROSQ_PAD 72
167#define FIIO_M3K_PAD 73
168#define SHANLING_Q1_PAD 74
169#define ECHO_R1_PAD 75
170#define SURFANS_F28_PAD 76
171#define RG_NANO_PAD 77
172#define CTRU_PAD 78
173
174/* CONFIG_REMOTE_KEYPAD */
175#define H100_REMOTE 1
176#define H300_REMOTE 2
177#define IAUDIO_REMOTE 3
178#define MROBE_REMOTE 4
179
180/* CONFIG_BACKLIGHT_FADING */
181/* No fading capabilities at all (yet) */
182#define BACKLIGHT_NO_FADING 0x0
183/* Backlight fading is controlled using a hardware PWM mechanism */
184#define BACKLIGHT_FADING_PWM 0x1
185/* Backlight is controlled using a software implementation
186 * BACKLIGHT_FADING_SW_SETTING means that backlight is turned on by only setting
187 * the brightness (i.e. no real difference between backlight_on and
188 * backlight_set_brightness)
189 * BACKLIGHT_FADING_SW_HW_REG means that backlight brightness is restored
190 * "in hardware", from a hardware register upon backlight_on
191 * Both types need to have minor adjustments in the software fading code */
192#define BACKLIGHT_FADING_SW_SETTING 0x2
193#define BACKLIGHT_FADING_SW_HW_REG 0x4
194/* Backlight fading is done in a target specific way
195 * for example in hardware, but not controllable*/
196#define BACKLIGHT_FADING_TARGET 0x8
197
198/* CONFIG_CHARGING */
199
200/* Generic types */
201#define CHARGING_SIMPLE 1 /* Simple, hardware controlled charging
202 * (CPU cannot read charger state but may read
203 * when power is plugged-in). */
204#define CHARGING_MONITOR 2 /* Hardware controlled charging with monitoring
205 * (CPU is able to read HW charging state and
206 * when power is plugged-in). */
207
208/* Mostly target-specific code in the /target tree */
209#define CHARGING_TARGET 3 /* Any algorithm - usually software controlled
210 * charging or specific programming is required to
211 * use the charging hardware. */
212
213/* CONFIG_BATTERY_MEASURE bits */
214/* If both VOLTAGE_MEASURE and PERCENTAGE_MEASURE are defined,
215 * _battery_level() (percentage) will be preferred, unless _battery_level()
216 * returns -1, then voltage will be used from _voltage_level(). */
217#define VOLTAGE_MEASURE 1 /* Target can report battery voltage
218 * Usually native ports */
219#define PERCENTAGE_MEASURE 2 /* Target can report remaining capacity in %
220 * Usually application/hosted ports */
221#define TIME_MEASURE 4 /* Target can report remaining time estimation
222 Usually application ports, and only
223 if the estimation is better that ours
224 (which it probably is) */
225#define CURRENT_MEASURE 8 /* Target can report battery charge and/or
226 * discharge current */
227/* CONFIG_LCD */
228#define LCD_SSD1815 1 /* as used by Sansa M200 and others */
229#define LCD_S1D15E06 3 /* as used by iRiver H100 series */
230#define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
231 unknown at the time of this writing */
232#define LCD_X5 5 /* as used by iAudio X5 series, exact model name is
233 unknown at the time of this writing */
234#define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */
235#define LCD_IPODNANO 7 /* as used by iPod Nano */
236#define LCD_IPODVIDEO 8 /* as used by iPod Video */
237#define LCD_IPOD2BPP 9 /* as used by all fullsize greyscale iPods */
238#define LCD_IPODMINI 10 /* as used by iPod Mini g1/g2 */
239#define LCD_GIGABEAT 12
240#define LCD_H10_20GB 13 /* as used by iriver H10 20Gb */
241#define LCD_H10_5GB 14 /* as used by iriver H10 5Gb */
242#define LCD_C200 17 /* as used by Sandisk Sansa c200 */
243#define LCD_MROBE500 18 /* as used by Olympus M:Robe 500i */
244#define LCD_MROBE100 19 /* as used by Olympus M:Robe 100 */
245#define LCD_CREATIVEZVM 22 /* as used by Creative Zen Vision:M */
246#define LCD_TL0350A 23 /* as used by the iAudio M3 remote, treated as main LCD */
247#define LCD_COWOND2 24 /* as used by Cowon D2 - LTV250QV, TCC7801 driver */
248#define LCD_SA9200 25 /* as used by the Philips SA9200 */
249#define LCD_S6B33B2 26 /* as used by the Samsumg YH820 */
250#define LCD_HDD1630 27 /* as used by the Philips HDD1630 */
251#define LCD_MEIZUM6 28 /* as used by the Meizu M6SP and M6SL (various models) */
252#define LCD_ONDAVX747 29 /* as used by the Onda VX747 */
253#define LCD_ONDAVX767 30 /* as used by the Onda VX767 */
254#define LCD_SSD1303 31 /* as used by the Sansa Clip */
255#define LCD_FUZE 32 /* as used by the Sansa Fuze */
256#define LCD_LYRE_PROTO1 33 /* as used by the Lyre prototype 1 */
257#define LCD_YH925 34 /* as used by Samsung YH-925 (similar to the H10 20GB) */
258#define LCD_VIEW 35 /* as used by the Sansa View */
259#define LCD_NANO2G 36 /* as used by the iPod Nano 2nd Generation */
260#define LCD_MINI2440 37 /* as used by the Mini2440 */
261#define LCD_HDD6330 38 /* as used by the Philips HDD6330 */
262#define LCD_VIBE500 39 /* as used by the Packard Bell Vibe 500 */
263#define LCD_IPOD6GNANO3G4G 40 /* as used by the iPod Classic, Nano 3G and Nano 4G */
264#define LCD_FUZEPLUS 41
265#define LCD_SPFD5420A 42 /* rk27xx */
266#define LCD_CLIPZIP 43 /* as used by the Sandisk Sansa Clip Zip */
267#define LCD_HX8340B 44 /* as used by the HiFiMAN HM-601/HM-602/HM-801 */
268#define LCD_CONNECT 45 /* as used by the Sandisk Sansa Connect */
269#define LCD_GIGABEATS 46
270#define LCD_YPR0 47
271#define LCD_CREATIVEZXFI2 48 /* as used by the Creative Zen X-Fi2 */
272#define LCD_CREATIVEZXFI3 49 /* as used by the Creative Zen X-Fi3 */
273#define LCD_ILI9342 50 /* as used by HiFi E.T MA9/MA8 */
274#define LCD_NWZE370 51 /* as used by Sony NWZ-E370 series */
275#define LCD_NWZE360 52 /* as used by Sony NWZ-E360 series */
276#define LCD_CREATIVEZEN 55 /* as used by the Creative ZEN (X-Fi) (LMS250GF03-001(S6D0139)) */
277#define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */
278#define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */
279#define LCD_CREATIVEZENV 58 /* as used by the Creative Zen V (Plus) */
280#define LCD_IHIFI 60 /* as used by IHIFI 760/960 */
281#define LCD_CREATIVEZENXFISTYLE 61 /* as used by Creative Zen X-Fi Style */
282#define LCD_SAMSUNGYPR1 62 /* as used by Samsung YP-R1 */
283#define LCD_NWZ_LINUX 63 /* as used in the Linux-based NWZ series */
284#define LCD_INGENIC_LINUX 64
285#define LCD_XDUOOX3 65 /* as used by the xDuoo X3 */
286#define LCD_IHIFI770 66 /* as used by IHIFI 770 */
287#define LCD_IHIFI770C 67 /* as used by IHIFI 770C */
288#define LCD_IHIFI800 68 /* as used by IHIFI 800 */
289#define LCD_FIIOM3K 69 /* as used by the FiiO M3K */
290#define LCD_SHANLING_Q1 70 /* as used by the Shanling Q1 */
291#define LCD_EROSQ 71 /* as used by the ErosQ (native) */
292#define LCD_ECHO_R1 72 /* ILI9342, as used by the Echo R1 */
293
294/* LCD_PIXELFORMAT */
295#define HORIZONTAL_PACKING 1
296#define VERTICAL_PACKING 2
297#define HORIZONTAL_INTERLEAVED 3
298#define VERTICAL_INTERLEAVED 4
299#define RGB565 565
300#define RGB565SWAPPED 3553
301#define RGB888 888
302#define XRGB8888 8888
303
304/* LCD_STRIDEFORMAT */
305#define VERTICAL_STRIDE 1
306#define HORIZONTAL_STRIDE 2
307
308/* CONFIG_ORIENTATION */
309#define SCREEN_PORTRAIT 0
310#define SCREEN_LANDSCAPE 1
311#define SCREEN_SQUARE 2
312
313/* CONFIG_I2C */
314#define I2C_NONE 0 /* For targets that do not use I2C - as the
315Lyre prototype 1 */
316#define I2C_COLDFIRE 3 /* Coldfire style */
317#define I2C_PP5002 4 /* PP5002 style */
318#define I2C_PP5020 5 /* PP5020 style */
319#define I2C_PNX0101 6 /* PNX0101 style */
320#define I2C_S3C2440 7
321#define I2C_PP5024 8 /* PP5024 style */
322#define I2C_IMX31L 9
323#define I2C_TCC780X 11
324#define I2C_DM320 12 /* DM320 style */
325#define I2C_S5L8700 13
326#define I2C_JZ47XX 14 /* Ingenic Jz47XX style */
327#define I2C_AS3525 15
328#define I2C_S5L8702 16 /* Same as S5L8700, but with two channels */
329#define I2C_IMX233 17
330#define I2C_RK27XX 18
331#define I2C_X1000 19
332
333/* CONFIG_LED */
334#define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
335#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
336/* else HW controlled LED (iRiver H1x0) */
337
338/* CONFIG_NAND */
339#define NAND_TCC 2
340#define NAND_SAMSUNG 3
341#define NAND_CC 4 /* ChinaChip */
342#define NAND_RK27XX 5
343#define NAND_IMX233 6
344
345/* CONFIG_RTC */
346#define RTC_HOSTED 1 /* Generic hosted */
347#define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
348#define RTC_PCF50606 3 /* iriver H300 */
349#define RTC_S3C2440 4
350#define RTC_E8564 5 /* iriver H10 */
351#define RTC_AS3514 6 /* Sandisk Sansa series */
352#define RTC_DS1339_DS3231 7 /* h1x0 RTC mod */
353#define RTC_IMX31L 8
354#define RTC_RX5X348AB 9
355#define RTC_TCC780X 11
356#define RTC_MR100 12
357#define RTC_MC13783 13 /* Freescale MC13783 PMIC */
358#define RTC_S5L8700 14
359#define RTC_S35390A 15
360#define RTC_JZ4740 16 /* Ingenic Jz4740 */
361#define RTC_NANO2G 17 /* This seems to be a PCF5063x */
362#define RTC_D2 18 /* Either PCF50606 or PCF50635 */
363#define RTC_S35380A 19
364#define RTC_IMX233 20
365#define RTC_STM41T62 21 /* ST M41T62 */
366#define RTC_JZ4760 22 /* Ingenic Jz4760 */
367#define RTC_X1000 23 /* Ingenic X1000 */
368#define RTC_CONNECT 24 /* Sansa Connect AVR */
369#define RTC_NANO3G 25 /* Dialog Semiconductor D1671 ??? */
370#define RTC_NANO4G 26 /* Dialog Semiconductor D1759 ??? */
371#define RTC_STM32H743 27
372
373/* USB On-the-go */
374#define USBOTG_M66591 6591 /* M:Robe 500 */
375#define USBOTG_ISP1362 1362 /* iriver H300 */
376#define USBOTG_ISP1583 1583 /* Creative Zen Vision:M */
377#define USBOTG_M5636 5636 /* iAudio X5 */
378#define USBOTG_ARC 5020 /* PortalPlayer 502x and IMX233 */
379#define USBOTG_JZ4740 4740 /* Ingenic Jz4740/Jz4732 */
380#define USBOTG_JZ4760 4760 /* Ingenic Jz4760/Jz4760B */
381#define USBOTG_AS3525 3525 /* AMS AS3525 */
382#define USBOTG_S3C6400X 6400 /* Samsung S3C6400X, also used in the S5L8701/S5L8702/S5L8720 */
383#define USBOTG_DESIGNWARE 6401 /* Synopsys DesignWare OTG, used in S5L8701/S5L8702/S5L8720/AS3252v2 */
384#define USBOTG_RK27XX 2700 /* Rockchip rk27xx */
385#define USBOTG_TNETV105 105 /* TI TNETV105 */
386
387/* Multiple cores */
388#define CPU 0
389#define COP 1
390
391/* imx233 specific: IMX233_PACKAGE */
392#define IMX233_BGA100 0
393#define IMX233_BGA169 1
394#define IMX233_TQFP100 2
395#define IMX233_TQFP128 3
396#define IMX233_LQFP100 4
397
398/* IMX233_PARTITIONS */
399#define IMX233_FREESCALE (1 << 0) /* Freescale I.MX233 nonstandard two-level MBR */
400#define IMX233_CREATIVE (1 << 1) /* Creative MBLK windowing */
401
402/* CONFIG_BUFLIB_BACKEND */
403#define BUFLIB_BACKEND_MEMPOOL 0 /* Default memory pool backed buflib */
404#define BUFLIB_BACKEND_MALLOC 1 /* malloc() buflib (for debugging) */
405
406/* now go and pick yours */
407#if defined(IRIVER_H100)
408#include "config/iriverh100.h"
409#elif defined(IRIVER_H120)
410#include "config/iriverh120.h"
411#elif defined(IRIVER_H300)
412#include "config/iriverh300.h"
413#elif defined(IAUDIO_X5)
414#include "config/iaudiox5.h"
415#elif defined(IAUDIO_M5)
416#include "config/iaudiom5.h"
417#elif defined(IAUDIO_M3)
418#include "config/iaudiom3.h"
419#elif defined(IPOD_COLOR)
420#include "config/ipodcolor.h"
421#elif defined(IPOD_NANO)
422#include "config/ipodnano1g.h"
423#elif defined(IPOD_VIDEO)
424#include "config/ipodvideo.h"
425#elif defined(IPOD_1G2G)
426#include "config/ipod1g2g.h"
427#elif defined(IPOD_3G)
428#include "config/ipod3g.h"
429#elif defined(IPOD_4G)
430#include "config/ipod4g.h"
431#elif defined(IPOD_NANO2G)
432#include "config/ipodnano2g.h"
433#elif defined(IPOD_NANO3G)
434#include "config/ipodnano3g.h"
435#elif defined(IPOD_NANO4G)
436#include "config/ipodnano4g.h"
437#elif defined(IPOD_6G)
438#include "config/ipod6g.h"
439#elif defined(GIGABEAT_F)
440#include "config/gigabeatfx.h"
441#elif defined(GIGABEAT_S)
442#include "config/gigabeats.h"
443#elif defined(IPOD_MINI)
444#include "config/ipodmini1g.h"
445#elif defined(IPOD_MINI2G)
446#include "config/ipodmini2g.h"
447#elif defined(IRIVER_H10)
448#include "config/iriverh10.h"
449#elif defined(IRIVER_H10_5GB)
450#include "config/iriverh10_5gb.h"
451#elif defined(SANSA_E200)
452#include "config/sansae200.h"
453#elif defined(SANSA_C200)
454#include "config/sansac200.h"
455#elif defined(MROBE_100)
456#include "config/mrobe100.h"
457#elif defined(MROBE_500)
458#include "config/mrobe500.h"
459#elif defined(COWON_D2)
460#include "config/cowond2.h"
461#elif defined(CREATIVE_ZVM)
462#include "config/zenvisionm30gb.h"
463#elif defined(CREATIVE_ZVM60GB)
464#include "config/zenvisionm60gb.h"
465#elif defined(CREATIVE_ZV)
466#include "config/zenvision.h"
467#elif defined(CREATIVE_ZENXFI2)
468#include "config/creativezenxfi2.h"
469#elif defined(CREATIVE_ZENXFI3)
470#include "config/creativezenxfi3.h"
471#elif defined(PHILIPS_SA9200)
472#include "config/gogearsa9200.h"
473#elif defined(PHILIPS_HDD1630)
474#include "config/gogearhdd1630.h"
475#elif defined(PHILIPS_HDD6330)
476#include "config/gogearhdd6330.h"
477#elif defined(MEIZU_M6SL)
478#include "config/meizum6sl.h"
479#elif defined(MEIZU_M6SP)
480#include "config/meizum6sp.h"
481#elif defined(MEIZU_M3)
482#include "config/meizum3.h"
483#elif defined(ONDA_VX747) || defined(ONDA_VX747P)
484#include "config/ondavx747.h"
485#elif defined(ONDA_VX777)
486#include "config/ondavx777.h"
487#elif defined(ONDA_VX767)
488#include "config/ondavx767.h"
489#elif defined(SANSA_CLIP)
490#include "config/sansaclip.h"
491#elif defined(SANSA_CLIPV2)
492#include "config/sansaclipv2.h"
493#elif defined(SANSA_CLIPPLUS)
494#include "config/sansaclipplus.h"
495#elif defined(SANSA_E200V2)
496#include "config/sansae200v2.h"
497#elif defined(SANSA_M200V4)
498#include "config/sansam200v4.h"
499#elif defined(SANSA_FUZE)
500#include "config/sansafuze.h"
501#elif defined(SANSA_FUZEV2)
502#include "config/sansafuzev2.h"
503#elif defined(SANSA_FUZEPLUS)
504#include "config/sansafuzeplus.h"
505#elif defined(SANSA_CLIPZIP)
506#include "config/sansaclipzip.h"
507#elif defined(SANSA_C200V2)
508#include "config/sansac200v2.h"
509#elif defined(SANSA_VIEW)
510#include "config/sansaview.h"
511#elif defined(LYRE_PROTO1)
512#include "config/lyreproto1.h"
513#elif defined(MINI2440)
514#include "config/mini2440.h"
515#elif defined(SAMSUNG_YH820)
516#include "config/samsungyh820.h"
517#elif defined(SAMSUNG_YH920)
518#include "config/samsungyh920.h"
519#elif defined(SAMSUNG_YH925)
520#include "config/samsungyh925.h"
521#elif defined(SAMSUNG_YPS3)
522#include "config/samsungyps3.h"
523#elif defined(PBELL_VIBE500)
524#include "config/vibe500.h"
525#elif defined(MPIO_HD200)
526#include "config/mpiohd200.h"
527#elif defined(MPIO_HD300)
528#include "config/mpiohd300.h"
529#elif defined(RK27_GENERIC)
530#include "config/rk27generic.h"
531#elif defined(HM60X)
532#include "config/hifimanhm60x.h"
533#elif defined(HM801)
534#include "config/hifimanhm801.h"
535#elif defined(SANSA_CONNECT)
536#include "config/sansaconnect.h"
537#elif defined(SDLAPP)
538#include "config/sdlapp.h"
539#elif defined(ANDROID)
540#include "config/android.h"
541#elif defined(NOKIAN8XX)
542#include "config/nokian8xx.h"
543#elif defined(NOKIAN900)
544#include "config/nokian900.h"
545#elif defined(PANDORA)
546#include "config/pandora.h"
547#elif defined(SAMSUNG_YPR0)
548#include "config/samsungypr0.h"
549#elif defined(CREATIVE_ZENXFI)
550#include "config/creativezenxfi.h"
551#elif defined(CREATIVE_ZENMOZAIC)
552#include "config/creativezenmozaic.h"
553#elif defined(CREATIVE_ZEN)
554#include "config/creativezen.h"
555#elif defined(CREATIVE_ZENV)
556#include "config/creativezenv.h"
557#elif defined(MA9)
558#include "config/hifietma9.h"
559#elif defined(MA9C)
560#include "config/hifietma9c.h"
561#elif defined(MA8)
562#include "config/hifietma8.h"
563#elif defined(MA8C)
564#include "config/hifietma8c.h"
565#elif defined(SONY_NWZE370)
566#include "config/sonynwze370.h"
567#elif defined(SONY_NWZE360)
568#include "config/sonynwze360.h"
569#elif defined(IHIFI760)
570#include "config/ihifi760.h"
571#elif defined(IHIFI770)
572#include "config/ihifi770.h"
573#elif defined(IHIFI770C)
574#include "config/ihifi770c.h"
575#elif defined(IHIFI800)
576#include "config/ihifi800.h"
577#elif defined(IHIFI960)
578#include "config/ihifi960.h"
579#elif defined(CREATIVE_ZENXFISTYLE)
580#include "config/creativezenxfistyle.h"
581#elif defined(SAMSUNG_YPR1)
582#include "config/samsungypr1.h"
583#elif defined(DX50)
584#include "config/ibassodx50.h"
585#elif defined(DX90)
586#include "config/ibassodx90.h"
587#elif defined(SONY_NWZE460)
588#include "config/sonynwze460.h"
589#elif defined(SONY_NWZE450)
590#include "config/sonynwze450.h"
591#elif defined(SONY_NWZE580)
592#include "config/sonynwze580.h"
593#elif defined(SONY_NWZA10)
594#include "config/sonynwza10.h"
595#elif defined(SONY_NWA20)
596#include "config/sonynwa20.h"
597#elif defined(SONY_NWZE470)
598#include "config/sonynwze470.h"
599#elif defined(SONY_NWZA860)
600#include "config/sonynwza860.h"
601#elif defined(SONY_NWZS750)
602#include "config/sonynwzs750.h"
603#elif defined(SONY_NWZE350)
604#include "config/sonynwze350.h"
605#elif defined(AGPTEK_ROCKER)
606#include "config/agptekrocker.h"
607#elif defined(XDUOO_X3)
608#include "config/xduoox3.h"
609#elif defined(XDUOO_X3II)
610#include "config/xduoox3ii.h"
611#elif defined(XDUOO_X20)
612#include "config/xduoox20.h"
613#elif defined(FIIO_M3K_LINUX)
614#include "config/fiiom3klinux.h"
615#elif defined(FIIO_M3K)
616#include "config/fiiom3k.h"
617#elif defined(EROS_Q)
618#include "config/aigoerosq.h"
619#elif defined(SHANLING_Q1)
620#include "config/shanlingq1.h"
621#elif defined(EROS_QN)
622#include "config/erosqnative.h"
623#elif defined(ECHO_R1)
624#include "config/echor1.h"
625#elif defined(SURFANS_F28)
626#include "config/surfansf28.h"
627#elif defined(RG_NANO)
628#include "config/rgnano.h"
629#elif defined(CTRU)
630#include "config/ctru.h"
631#else
632#error "unknown hardware platform!"
633#endif
634
635#ifndef CONFIG_CPU
636#define CONFIG_CPU 0
637#endif
638
639// NOTE: should be placed before sim.h (where CONFIG_CPU is undefined)
640#if !(CONFIG_CPU >= PP5002 && CONFIG_CPU <= PP5022) && CODEC_SIZE >= 0x80000
641#define CODEC_AAC_SBR_DEC
642#endif
643
644#ifdef __PCTOOL__
645#undef CONFIG_CPU
646#define CONFIG_CPU 0
647#undef HAVE_MULTIVOLUME
648#undef HAVE_MULTIDRIVE
649#undef CONFIG_STORAGE_MULTI
650#undef CONFIG_STORAGE
651#define CONFIG_STORAGE 0
652#endif
653
654#ifndef CONFIG_BUFLIB_BACKEND
655# define CONFIG_BUFLIB_BACKEND BUFLIB_BACKEND_MEMPOOL
656#endif
657
658#if defined(APPLICATION)
659#ifndef CONFIG_CPU
660#define CONFIG_CPU 0
661#endif
662#endif
663
664/* keep this include after the target configs */
665#ifdef SIMULATOR
666#include "config/sim.h"
667#ifndef HAVE_POWEROFF_WHILE_CHARGING
668 #define HAVE_POWEROFF_WHILE_CHARGING
669#endif
670#endif
671
672#if defined(__PCTOOL__) || defined(SIMULATOR)
673#ifndef CONFIG_PLATFORM
674#define CONFIG_PLATFORM PLATFORM_HOSTED
675#endif
676#endif
677
678#ifndef CONFIG_PLATFORM
679#define CONFIG_PLATFORM PLATFORM_NATIVE
680#endif
681
682/* setup basic macros from capability masks */
683#include "config_caps.h"
684
685/* setup CPU-specific defines */
686
687#ifndef __PCTOOL__
688
689/* define for all cpus from coldfire family */
690#if (ARCH == ARCH_M68K) && ((CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250))
691#define CPU_COLDFIRE
692#endif
693
694/* define for all cpus from PP family */
695#if (CONFIG_CPU == PP5002)
696#define CPU_PP
697#elif (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5022) \
698 || (CONFIG_CPU == PP5024) || (CONFIG_CPU == PP6100)
699#define CPU_PP
700#define CPU_PP502x
701#endif
702
703/* define for all cpus from S5L87XX family */
704#if (CONFIG_CPU == S5L8700) || (CONFIG_CPU == S5L8701) \
705 || (CONFIG_CPU == S5L8702) || (CONFIG_CPU == S5L8720) \
706 || (CONFIG_CPU == S5L8723) || (CONFIG_CPU == S5L8730) \
707 || (CONFIG_CPU == S5L8740)
708#define CPU_S5L87XX
709#endif
710
711/* define for all cpus from TCC780 family */
712#if (CONFIG_CPU == TCC7801)
713#define CPU_TCC780X
714#endif
715
716/* define for all cpus from ARM7TDMI family (for specific optimisations) */
717#if defined(CPU_PP) || (CONFIG_CPU == PNX0101) || (CONFIG_CPU == DSC25)
718#define CPU_ARM7TDMI
719#endif
720
721/* define for all cpus from ARM family */
722#if ARCH == ARCH_ARM
723#define CPU_ARM
724#define ARM_ARCH ARCH_VERSION /* ARMv{4,5,6,7} */
725#define ARM_PROFILE ARCH_PROFILE /* Classic, Microcontroller */
726# if ARM_PROFILE == ARM_PROFILE_MICRO
727# define CPU_ARM_MICRO
728# if (ARM_ARCH >= 7)
729# define ARM_HAVE_HW_DIV
730# endif
731# elif ARM_PROFILE == ARM_PROFILE_CLASSIC
732# define CPU_ARM_CLASSIC
733# endif
734# if (CONFIG_PLATFORM & PLATFORM_NATIVE)
735# define ARM_NEED_DIV0
736# endif
737#endif
738
739#if ARCH == ARCH_MIPS
740#define CPU_MIPS ARCH_VERSION /* 32, 64 */
741#endif
742
743#endif /*__PCTOOL__*/
744
745/* now set any CONFIG_ defines correctly if they are not used,
746 No need to do this on CONFIG_'s which are compulsory (e.g CONFIG_CODEC ) */
747
748#if !defined(CONFIG_BACKLIGHT_FADING)
749#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
750#endif
751
752#ifndef CONFIG_I2C
753#define CONFIG_I2C I2C_NONE
754#endif
755
756#ifndef CONFIG_TUNER
757#define CONFIG_TUNER 0
758#endif
759
760#ifndef CONFIG_USBOTG
761#define CONFIG_USBOTG 0
762#endif
763
764#ifndef CONFIG_LED
765#define CONFIG_LED LED_VIRTUAL
766#endif
767
768#ifndef CONFIG_CHARGING
769#define CONFIG_CHARGING 0
770#endif
771
772#ifndef CONFIG_BATTERY_MEASURE
773#define CONFIG_BATTERY_MEASURE 0
774#define NO_LOW_BATTERY_SHUTDOWN
775#endif
776
777#ifndef CONFIG_RTC
778#define CONFIG_RTC 0
779#endif
780
781#ifndef BATTERY_CAPACITY_DEFAULT
782#define BATTERY_CAPACITY_DEFAULT 0
783#endif
784
785#ifndef BATTERY_CAPACITY_MIN
786#define BATTERY_CAPACITY_MIN BATTERY_CAPACITY_DEFAULT
787#endif
788
789#ifndef BATTERY_CAPACITY_MAX
790#define BATTERY_CAPACITY_MAX BATTERY_CAPACITY_DEFAULT
791#endif
792
793#ifndef BATTERY_CAPACITY_INC
794#define BATTERY_CAPACITY_INC 0
795#endif
796
797#ifdef HAVE_RDS_CAP
798/* combinable bitflags */
799/* 0x01 can be reused, was RDS_CFG_ISR */
800#define RDS_CFG_PROCESS 0x2 /* uses raw packet processing */
801#define RDS_CFG_PUSH 0x4 /* pushes processed information */
802#define RDS_CFG_POLL 0x8 /* tuner driver provides a polling function */
803#ifndef CONFIG_RDS
804#define CONFIG_RDS RDS_CFG_PROCESS /* thread processing+raw processing */
805#endif /* CONFIG_RDS */
806#endif /* HAVE_RDS_CAP */
807
808#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
809#if CONFIG_RTC == RTC_AS3514
810#if CONFIG_CPU == AS3525 || CONFIG_CPU == AS3525v2
811#define HAVE_RTC_IRQ
812#endif
813#elif CONFIG_RTC == RTC_MC13783
814#define HAVE_RTC_IRQ
815#endif
816#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) */
817
818#ifndef CONFIG_ORIENTATION
819#if LCD_HEIGHT > LCD_WIDTH
820#define CONFIG_ORIENTATION SCREEN_PORTRAIT
821#elif LCD_HEIGHT < LCD_WIDTH
822#define CONFIG_ORIENTATION SCREEN_LANDSCAPE
823#else
824#define CONFIG_ORIENTATION SCREEN_SQUARE
825#endif
826#endif
827
828/* Pixel aspect ratio is defined in terms of a multiplier for pixel width and
829 * height, and is set to 1:1 if the target does not set a value
830 */
831#ifndef LCD_PIXEL_ASPECT_HEIGHT
832#define LCD_PIXEL_ASPECT_HEIGHT 1
833#endif
834#ifndef LCD_PIXEL_ASPECT_WIDTH
835#define LCD_PIXEL_ASPECT_WIDTH 1
836#endif
837
838/* Used for split displays (Sansa Clip). Set to 0 otherwise */
839#ifndef LCD_SPLIT_LINES
840#define LCD_SPLIT_LINES 0
841#endif
842
843/* Most displays have a horizontal stride */
844#ifndef LCD_STRIDEFORMAT
845# define LCD_STRIDEFORMAT HORIZONTAL_STRIDE
846#endif
847
848/* Simulator LCD dimensions. Set to standard dimensions if undefined */
849#ifndef SIM_LCD_WIDTH
850#define SIM_LCD_WIDTH LCD_WIDTH
851#endif
852#ifndef SIM_LCD_HEIGHT
853#define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES)
854#endif
855
856#ifdef HAVE_REMOTE_LCD
857#ifndef SIM_REMOTE_WIDTH
858#define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH
859#endif
860#ifndef SIM_REMOTE_HEIGHT
861#define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT
862#endif
863#endif /* HAVE_REMOTE_LCD */
864
865/* define this in the target config.h to use a different size */
866#ifndef CONFIG_DEFAULT_ICON_HEIGHT
867#define CONFIG_DEFAULT_ICON_HEIGHT 8
868#endif
869#ifndef CONFIG_DEFAULT_ICON_WIDTH
870#define CONFIG_DEFAULT_ICON_WIDTH 6
871#endif
872#ifndef CONFIG_REMOTE_DEFAULT_ICON_HEIGHT
873#define CONFIG_REMOTE_DEFAULT_ICON_HEIGHT 8
874#endif
875#ifndef CONFIG_REMOTE_DEFAULT_ICON_WIDTH
876#define CONFIG_REMOTE_DEFAULT_ICON_WIDTH 6
877#endif
878
879#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
880#define HAVE_BACKDROP_IMAGE
881#endif
882
883#if (CONFIG_TUNER & (CONFIG_TUNER - 1)) != 0
884/* Multiple possible tuners */
885#define CONFIG_TUNER_MULTI
886#endif
887
888/* deactivate fading in bootloader */
889#if defined(BOOTLOADER)
890#undef CONFIG_BACKLIGHT_FADING
891#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
892#endif
893
894/* determine which setting/manual text to use */
895#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
896
897/* possibly overridden in target config */
898#if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
899 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
900#define HAVE_BACKLIGHT_FADING_INT_SETTING
901#endif
902
903#elif (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
904 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) \
905 || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_TARGET)
906
907/* possibly overridden in target config */
908#if !defined(HAVE_BACKLIGHT_FADING_BOOL_SETTING) \
909 && !defined(HAVE_BACKLIGHT_FADING_INT_SETTING)
910#define HAVE_BACKLIGHT_FADING_BOOL_SETTING
911#endif
912
913#endif /* CONFIG_BACKLIGHT_FADING */
914
915/* Storage related config handling */
916
917#if (CONFIG_STORAGE & (CONFIG_STORAGE - 1)) != 0
918/* Multiple storage drivers */
919#define CONFIG_STORAGE_MULTI
920#endif
921
922#if defined(CONFIG_STORAGE_MULTI) && !defined(HAVE_MULTIDRIVE)
923#define HAVE_MULTIDRIVE
924#endif
925
926#if defined(HAVE_MULTIDRIVE) && !defined(NUM_DRIVES)
927#error HAVE_MULTIDRIVE needs to have an explicit NUM_DRIVES
928#endif
929
930#ifndef NUM_DRIVES
931#define NUM_DRIVES 1
932#endif
933
934#if !defined(HAVE_MULTIVOLUME)
935#if defined(HAVE_MULTIDRIVE)
936/* Multidrive strongly implies multivolume */
937#define HAVE_MULTIVOLUME
938#elif (CONFIG_STORAGE & STORAGE_SD)
939/* SD routinely have multiple partitions */
940#elif (CONFIG_STORAGE & STORAGE_ATA) && defined(HAVE_LBA48)
941/* ATA routinely haves multiple partitions, but don't bother if we can't do LBA48 */
942#define HAVE_MULTIVOLUME
943#endif
944#endif
945
946/* Bootloaders don't need multivolume awareness */
947#if defined(BOOTLOADER) && defined(HAVE_MULTIVOLUME) \
948 && !(CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(BOOT_REDIR)
949#undef HAVE_MULTIVOLUME
950#endif
951
952/* Number of volumes per drive */
953#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR) && !(CONFIG_PLATFORM & PLATFORM_HOSTED)
954#define NUM_VOLUMES_PER_DRIVE 4
955#else
956#define NUM_VOLUMES_PER_DRIVE 1
957#endif
958
959/* note to remove multi-partition booting this could be changed to MULTIDRIVE */
960#if defined(HAVE_BOOTDATA) && defined(BOOT_REDIR) && defined(HAVE_MULTIVOLUME)
961#define HAVE_MULTIBOOT
962#endif
963
964/* The lowest numbered volume to read a multiboot redirect from; default is to
965 * allow any volume but some targets may wish to exclude the internal drive. */
966#if defined(HAVE_MULTIBOOT) && !defined(MULTIBOOT_MIN_VOLUME)
967# define MULTIBOOT_MIN_VOLUME 0
968#endif
969
970#define NUM_VOLUMES (NUM_DRIVES * NUM_VOLUMES_PER_DRIVE)
971
972/* Sanity check sector size options */
973#if defined(MAX_VARIABLE_LOG_SECTOR) && defined(MAX_VIRT_SECTOR_SIZE)
974#if (MAX_VIRT_SECTOR_SIZE < MAX_VARIABLE_LOG_SECTOR)
975#error "optional MAX_VIRT_SECTOR_SIZE must be at least as large as MAX_VARIABLE_LOG_SECTOR"
976#endif
977#endif
978
979#if defined(BOOTLOADER) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
980/* Bootloaders don't use CPU frequency adjustment */
981#undef HAVE_ADJUSTABLE_CPU_FREQ
982#endif
983
984#if defined(__PCTOOL__) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
985/* PCTOOLs don't use CPU frequency adjustment */
986#undef HAVE_ADJUSTABLE_CPU_FREQ
987#endif
988
989/* Enable the directory cache and tagcache in RAM if we have
990 * plenty of RAM. Both features can be enabled independently. */
991#if (MEMORYSIZE >= 8) && !defined(BOOTLOADER) && (defined(CHECKWPS) || !defined(__PCTOOL__)) \
992 && !defined(APPLICATION)
993#ifndef SIMULATOR
994#define HAVE_DIRCACHE
995#endif
996#ifdef HAVE_TAGCACHE
997#define HAVE_TC_RAMCACHE
998#endif
999#endif
1000
1001#if defined(HAVE_TAGCACHE)
1002#define HAVE_PICTUREFLOW_INTEGRATION
1003#endif
1004
1005#ifdef BOOTLOADER
1006
1007#ifdef HAVE_BOOTLOADER_USB_MODE
1008/* Priority in bootloader is wanted */
1009#define HAVE_PRIORITY_SCHEDULING
1010
1011#if (CONFIG_CPU == S5L8702) || (CONFIG_CPU == S5L8720)
1012#define USB_DRIVER_CLOSE
1013#else
1014#define USB_STATUS_BY_EVENT
1015#define USB_DETECT_BY_REQUEST
1016#endif
1017
1018#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
1019#define INCLUDE_TIMEOUT_API
1020#define USB_DRIVER_CLOSE
1021#endif
1022
1023#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_TNETV105
1024#define INCLUDE_TIMEOUT_API
1025#define USB_DRIVER_CLOSE
1026#endif
1027
1028#if CONFIG_CPU == X1000
1029#define USB_DRIVER_CLOSE
1030#endif
1031
1032#endif /* BOOTLOADER_USB_MODE */
1033
1034#else /* !BOOTLOADER */
1035
1036#define HAVE_EXTENDED_MESSAGING_AND_NAME
1037#define HAVE_WAKEUP_EXT_CB
1038
1039#if defined(ASSEMBLER_THREADS) \
1040 || defined(HAVE_WIN32_FIBER_THREADS) \
1041 || defined(HAVE_SIGALTSTACK_THREADS) \
1042 || defined(CTRU)
1043#define HAVE_PRIORITY_SCHEDULING
1044#endif
1045
1046#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
1047#define HAVE_PRIORITY_SCHEDULING
1048#define HAVE_SCHEDULER_BOOSTCTRL
1049#endif /* PLATFORM_NATIVE */
1050
1051
1052#ifdef HAVE_USBSTACK
1053#if CONFIG_USBOTG == USBOTG_ARC
1054#define USB_STATUS_BY_EVENT
1055#define USB_DETECT_BY_REQUEST
1056#define INCLUDE_TIMEOUT_API
1057#elif CONFIG_USBOTG == USBOTG_AS3525
1058#define USB_STATUS_BY_EVENT
1059#define USB_DETECT_BY_REQUEST
1060#elif CONFIG_USBOTG == USBOTG_S3C6400X /* FIXME */ && CONFIG_CPU != S5L8701
1061#define USB_STATUS_BY_EVENT
1062#define USB_DETECT_BY_REQUEST
1063#elif CONFIG_USBOTG == USBOTG_DESIGNWARE /* FIXME */ && CONFIG_CPU != S5L8701
1064#define USB_STATUS_BY_EVENT
1065#define USB_DETECT_BY_REQUEST
1066#elif CONFIG_USBOTG == USBOTG_RK27XX
1067#define USB_DETECT_BY_REQUEST
1068#elif CONFIG_USBOTG == USBOTG_TNETV105
1069#define USB_STATUS_BY_EVENT
1070#define USB_DETECT_BY_REQUEST
1071#endif /* CONFIG_USB == */
1072#endif /* HAVE_USBSTACK */
1073
1074#endif /* !BOOTLOADER */
1075
1076#if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) || (CONFIG_CPU == JZ4760B) \
1077 || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) \
1078 || defined(CPU_S5L87XX) || (CONFIG_CPU == S3C2440) \
1079 || defined(APPLICATION) || (CONFIG_CPU == PP5002) \
1080 || (CONFIG_CPU == RK27XX) || (CONFIG_CPU == IMX233) || \
1081 (defined(HAVE_LCD_COLOR) && (LCD_STRIDEFORMAT == HORIZONTAL_STRIDE))
1082#define HAVE_SEMAPHORE_OBJECTS
1083#endif
1084
1085/*include support for crossfading - requires significant PCM buffer space*/
1086#if MEMORYSIZE > 2
1087#define HAVE_CROSSFADE
1088#endif
1089
1090/* Determine if accesses should be strictly long aligned. */
1091#if defined(CPU_ARM) || defined(CPU_MIPS)
1092#define ROCKBOX_STRICT_ALIGN 1
1093#endif
1094
1095/* -Wunterminates-string-initialization will complain if we try to shove
1096 a "string" into an array that is too small. Sometimes this actually
1097 intentional, where you are merely using "string" as a standin for
1098 "non-terminated sequence of bytes" -- in which case we need to mark
1099 the "string" as "not actually a string" with an attribute. Applies to
1100 GCC >=8, but this warning isn't pulled in by -Wextra until >= 15.
1101*/
1102#if __GNUC__ >= 8
1103#define __NONSTRING __attribute__((__nonstring__))
1104#else
1105#define __NONSTRING
1106#endif
1107
1108/*
1109 * These macros are for switching on unified syntax in inline assembly.
1110 * Older versions of GCC emit assembly in divided syntax with no option
1111 * to enable unified syntax.
1112 */
1113#if (__GNUC__ < 8) && defined(CPU_ARM_CLASSIC) || defined(CTRU)
1114#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n"
1115#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n"
1116#else
1117#define BEGIN_ARM_ASM_SYNTAX_UNIFIED
1118#define END_ARM_ASM_SYNTAX_UNIFIED
1119#endif
1120
1121#if defined(CPU_ARM) && defined(__ASSEMBLER__)
1122#if (__GNUC__ < 8)
1123.syntax unified
1124#endif
1125/* ARMv4T doesn't switch the T bit when popping pc directly, we must use BX */
1126.macro ldmpc cond="", order="ia", regs
1127#if ARM_ARCH == 4 && defined(USE_THUMB)
1128 ldm\order\cond sp!, { \regs, lr }
1129 bx\cond lr
1130#else
1131 ldm\order\cond sp!, { \regs, pc }
1132#endif
1133.endm
1134.macro ldrpc cond=""
1135#if ARM_ARCH == 4 && defined(USE_THUMB)
1136 ldr\cond lr, [sp], #4
1137 bx\cond lr
1138#else
1139 ldr\cond pc, [sp], #4
1140#endif
1141.endm
1142#if (__GNUC__ < 8)
1143.syntax divided
1144#endif
1145#endif
1146
1147#if defined(CPU_COLDFIRE) && defined(__ASSEMBLER__)
1148/* Assembler doesn't support these as mnemonics but does tpf */
1149.macro tpf.w
1150.word 0x51fa
1151.endm
1152
1153.macro tpf.l
1154.word 0x51fb
1155.endm
1156#endif
1157
1158#ifndef CODEC_SIZE
1159#define CODEC_SIZE 0
1160#endif
1161
1162/* This attribute can be used to ensure that certain symbols are never profiled
1163 * which can be important as profiling a function de-inlines it */
1164#ifdef RB_PROFILE
1165#define NO_PROF_ATTR __attribute__ ((no_instrument_function))
1166#else
1167#define NO_PROF_ATTR
1168#endif
1169
1170/* IRAM usage */
1171#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \
1172 (defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
1173 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
1174 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2 && !defined(BOOTLOADER)) || /* AS3525 +2MB: core, plugins, codecs */ \
1175 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525 2MB: core only */ \
1176 (CONFIG_CPU == AS3525v2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525v2: core only */ \
1177 (CONFIG_CPU == PNX0101) || \
1178 (CONFIG_CPU == TCC7801) || \
1179 (CONFIG_CPU == IMX233 && !defined(PLUGIN) && !defined(CODEC)) || /* IMX233: core only */ \
1180 defined(CPU_S5L87XX)) || /* Samsung S5L87XX: core, plugins, codecs */ \
1181 ((CONFIG_CPU == JZ4732 || CONFIG_CPU == JZ4760B) && !defined(PLUGIN) && !defined(CODEC)) /* Jz47XX: core only */
1182#define ICODE_ATTR __attribute__ ((section(".icode")))
1183#define ICONST_ATTR __attribute__ ((section(".irodata")))
1184#define IDATA_ATTR __attribute__ ((section(".idata")))
1185#define IBSS_ATTR __attribute__ ((section(".ibss")))
1186#define USE_IRAM
1187#if (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
1188 && CONFIG_CPU != JZ4732 && CONFIG_CPU != JZ4760B && CONFIG_CPU != AS3525v2 && CONFIG_CPU != IMX233
1189#define PLUGIN_USE_IRAM
1190#endif
1191#else
1192#define ICODE_ATTR
1193#define ICONST_ATTR
1194#define IDATA_ATTR
1195#define IBSS_ATTR
1196#endif
1197
1198#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
1199 (CONFIG_CPU == IMX31L) || (CONFIG_CPU == IMX233) || \
1200 (CONFIG_CPU == RK27XX) || defined(CPU_MIPS) || defined(CPU_COLDFIRE)) \
1201 && (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
1202/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
1203 * root_menu() has been called. Their code may be overwritten by other data or
1204 * code in order to save RAM, and references to them might point into
1205 * zombie area.
1206 *
1207 * It is critical that you make sure these functions are only called before
1208 * the final call to root_menu() (see apps/main.c) is called (i.e. basically
1209 * only while main() runs), otherwise things may go wild,
1210 * from crashes to freezes to exploding daps.
1211 */
1212
1213
1214#if defined(__APPLE__) && defined(__MACH__)
1215 #define INIT_ATTR __attribute__((section ("__INIT,.init")))
1216 #define INITDATA_ATTR __attribute__((section ("__INITDATA,.initdata")))
1217#else
1218 #define INIT_ATTR __attribute__ ((section(".init")))
1219 #define INITDATA_ATTR __attribute__ ((section(".initdata")))
1220#endif
1221
1222#define HAVE_INIT_ATTR
1223#else
1224#define INIT_ATTR
1225#define INITDATA_ATTR
1226#endif
1227
1228/* We need to call storage_init more than once only if USB storage mode is
1229 * handled in hardware:
1230 * Deinit storage -> let hardware handle USB mode -> storage_init() again
1231 */
1232#if defined(HAVE_USBSTACK) || defined(USB_NONE)
1233#define STORAGE_INIT_ATTR INIT_ATTR
1234#else
1235#define STORAGE_INIT_ATTR
1236#endif
1237
1238#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
1239#define DATA_ATTR __attribute__ ((section("__DATA, .data")))
1240#else
1241#define DATA_ATTR __attribute__ ((section(".data")))
1242#endif
1243
1244#ifndef IRAM_LCDFRAMEBUFFER
1245/* if the LCD framebuffer has not been moved to IRAM, define it empty here */
1246#define IRAM_LCDFRAMEBUFFER
1247#endif
1248
1249/* Change this if you want to build a single-core firmware for a multicore
1250 * target for debugging */
1251#if defined(BOOTLOADER) || (CONFIG_CPU == PP6100)
1252#define FORCE_SINGLE_CORE
1253#endif
1254
1255#if defined(CPU_PP)
1256#define IDLE_STACK_SIZE 0x80
1257#define IDLE_STACK_WORDS 0x20
1258
1259/* Attributes to place data in uncached DRAM */
1260/* These are useful beyond dual-core and ultimately beyond PP since they may
1261 * be used for DMA buffers and such without cache maintenence calls. */
1262#define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
1263#define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
1264
1265#if !defined(FORCE_SINGLE_CORE)
1266
1267#define NUM_CORES 2
1268#define HAVE_CORELOCK_OBJECT
1269#define CURRENT_CORE current_core()
1270/* Attributes for core-shared data in DRAM where IRAM is better used for other
1271 * purposes. */
1272#define SHAREDBSS_ATTR NOCACHEBSS_ATTR
1273#define SHAREDDATA_ATTR NOCACHEDATA_ATTR
1274
1275#define IF_COP(...) __VA_ARGS__
1276#define IF_COP_VOID(...) __VA_ARGS__
1277#define IF_COP_CORE(core) core
1278
1279#endif /* !defined(FORCE_SINGLE_CORE) */
1280
1281#endif /* CPU_PP */
1282
1283#if CONFIG_CPU == IMX31L || CONFIG_CPU == IMX233
1284#define NOCACHEBSS_ATTR __attribute__((section(".ncbss"),nocommon))
1285#define NOCACHEDATA_ATTR __attribute__((section(".ncdata"),nocommon))
1286#endif
1287
1288#ifndef NUM_CORES
1289/* Default to single core */
1290#define NUM_CORES 1
1291#define CURRENT_CORE CPU
1292/* Attributes for core-shared data in DRAM - no caching considerations */
1293#define SHAREDBSS_ATTR
1294#define SHAREDDATA_ATTR
1295#ifndef NOCACHEBSS_ATTR
1296#define NOCACHEBSS_ATTR
1297#define NOCACHEDATA_ATTR
1298#endif
1299
1300#define IF_COP(...)
1301#define IF_COP_VOID(...) void
1302#define IF_COP_CORE(core) CURRENT_CORE
1303
1304#endif /* NUM_CORES */
1305
1306#ifdef HAVE_HEADPHONE_DETECTION
1307/* Timeout objects required if headphone detection is enabled */
1308#define INCLUDE_TIMEOUT_API
1309#endif /* HAVE_HEADPHONE_DETECTION */
1310
1311#ifdef HAVE_TOUCHSCREEN
1312/* Timeout objects required for kinetic list scrolling */
1313#define INCLUDE_TIMEOUT_API
1314/* Enable skin variable system, may not be the best place for this #define. */
1315#define HAVE_SKIN_VARIABLES
1316#endif /* HAVE_TOUCHSCREEN */
1317
1318#if defined(HAVE_USB_CHARGING_ENABLE) && defined(HAVE_USBSTACK)
1319/* USB charging support in the USB stack requires timeout objects */
1320#define INCLUDE_TIMEOUT_API
1321#endif /* HAVE_USB_CHARGING_ENABLE && HAVE_USBSTACK */
1322
1323#if defined(USB_STATUS_BY_EVENT) && defined(HAVE_USBSTACK)
1324/* Status by event requires timeout for debouncing */
1325# define INCLUDE_TIMEOUT_API
1326#endif
1327
1328#if (!defined(SIMULATOR) && !defined(HAVE_HOSTFS) && !(CONFIG_STORAGE & STORAGE_HOSTFS))
1329#define STORAGE_GET_INFO
1330#endif
1331
1332#if defined(HAVE_SIGALTSTACK_THREADS)
1333#ifndef _XOPEN_SOURCE
1334#define _XOPEN_SOURCE 600 /* For sigaltstack */
1335#endif
1336#endif
1337
1338#ifdef CPU_MIPS
1339#include <stdbool.h> /* MIPS GCC fix? */
1340#endif
1341
1342#if defined(HAVE_USBSTACK)
1343/* Define the implemented USB transport classes */
1344#if CONFIG_USBOTG == USBOTG_ISP1583
1345#define USB_HAS_BULK
1346#define USB_LEGACY_CONTROL_API
1347#elif (CONFIG_USBOTG == USBOTG_DESIGNWARE)
1348#define USB_HAS_BULK
1349#define USB_HAS_INTERRUPT
1350#define USB_HAS_ISOCHRONOUS
1351#elif (CONFIG_USBOTG == USBOTG_ARC) || \
1352 (CONFIG_USBOTG == USBOTG_JZ4740) || \
1353 (CONFIG_USBOTG == USBOTG_JZ4760) || \
1354 (CONFIG_USBOTG == USBOTG_M66591) || \
1355 (CONFIG_USBOTG == USBOTG_AS3525) || \
1356 (CONFIG_USBOTG == USBOTG_RK27XX) || \
1357 (CONFIG_USBOTG == USBOTG_TNETV105)
1358#define USB_HAS_BULK
1359#define USB_HAS_INTERRUPT
1360#if (CONFIG_USBOTG == USBOTG_ARC)
1361#define USB_HAS_ISOCHRONOUS
1362#endif
1363#define USB_LEGACY_CONTROL_API
1364#elif defined(CPU_TCC780X)
1365#define USB_HAS_BULK
1366#define USB_LEGACY_CONTROL_API
1367#elif CONFIG_USBOTG == USBOTG_S3C6400X
1368#define USB_HAS_BULK
1369#define USB_LEGACY_CONTROL_API
1370//#define USB_HAS_INTERRUPT -- seems to be broken
1371#endif /* CONFIG_USBOTG */
1372
1373/* define the class drivers to enable */
1374#ifdef BOOTLOADER
1375
1376/* enable usb storage for targets that do bootloader usb */
1377#if defined(HAVE_BOOTLOADER_USB_MODE) || \
1378 defined(CREATIVE_ZVx) || defined(CPU_TCC780X) || \
1379 CONFIG_USBOTG == USBOTG_JZ4740 || CONFIG_USBOTG == USBOTG_AS3525 || \
1380 CONFIG_USBOTG == USBOTG_S3C6400X || CONFIG_USBOTG == USBOTG_DESIGNWARE || \
1381 CONFIG_USBOTG == USBOTG_JZ4760
1382#define USB_ENABLE_STORAGE
1383#endif
1384
1385#else /* BOOTLOADER */
1386
1387#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
1388#ifdef USB_HAS_BULK
1389//#define USB_ENABLE_SERIAL
1390#define USB_ENABLE_STORAGE
1391#endif /* USB_HAS_BULK */
1392
1393#ifdef USB_HAS_INTERRUPT
1394#define USB_ENABLE_HID
1395#else
1396#define USB_ENABLE_CHARGING_ONLY
1397#endif
1398#endif
1399
1400#ifdef USB_HAS_ISOCHRONOUS
1401#define USB_ENABLE_AUDIO
1402#endif
1403
1404#endif /* BOOTLOADER */
1405
1406#endif /* HAVE_USBSTACK */
1407
1408/* This attribute can be used to enable to detection of plugin file handles leaks.
1409 * When enabled, the plugin core will monitor open/close/creat and when the plugin exits
1410 * will display an error message if the plugin leaked some file handles */
1411#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined (SIMULATOR)
1412#define HAVE_PLUGIN_CHECK_OPEN_CLOSE
1413#endif
1414
1415#if defined(CPU_COLDIRE) || CONFIG_CPU == IMX31L
1416/* Can record and play simultaneously */
1417#define HAVE_PCM_FULL_DUPLEX
1418#endif
1419
1420#if !defined(BOOTLOADER)
1421#define HAVE_PITCHCONTROL
1422#endif
1423
1424/* enable logging messages to disk*/
1425#if !defined(BOOTLOADER) && !defined(__PCTOOL__)
1426#define ROCKBOX_HAS_LOGDISKF
1427#endif
1428
1429#if defined(HAVE_SDL_AUDIO) \
1430 && !(CONFIG_PLATFORM & PLATFORM_MAEMO5) \
1431 && !defined(HAVE_SW_VOLUME_CONTROL)
1432/* SW volume is needed for accurate control and no double buffering should be
1433 * required. If target uses SW volume, then its definitions are used instead
1434 * so things are as on target. */
1435#define HAVE_SW_VOLUME_CONTROL
1436#define PCM_SW_VOLUME_UNBUFFERED /* pcm driver itself is buffered */
1437#ifdef SIMULATOR
1438/* For sim, nice res for ~ -127dB..+36dB that so far covers all targets */
1439#define PCM_SW_VOLUME_FRACBITS (24)
1440#else
1441/* For app, use fractional-only setup for -79..+0, no large-integer math */
1442#define PCM_SW_VOLUME_FRACBITS (16)
1443#endif /* SIMULATOR */
1444#endif /* default SDL SW volume conditions */
1445
1446#if !defined(BOOTLOADER) || defined(HAVE_BOOTLOADER_SCREENDUMP)
1447# define HAVE_SCREENDUMP
1448#endif
1449
1450#if !defined(BOOTLOADER) && MEMORYSIZE > 2
1451# define HAVE_PERCEPTUAL_VOLUME
1452#endif
1453
1454/*
1455 * Turn off legacy codepage handling in the filesystem code for bootloaders,
1456 * and support ISO-8859-1 (Latin-1) only. This only affects DOS 8.3 filename
1457 * parsing when FAT32 long names are unavailable; long names are Unicode and
1458 * can always be decoded properly regardless of this setting.
1459 *
1460 * In reality, bootloaders never supported codepages other than Latin-1 in
1461 * the first place. They did contain the code to load codepages from disk,
1462 * but had no way to actually change the codepage away from Latin-1.
1463 */
1464#if !defined(BOOTLOADER)
1465# define HAVE_FILESYSTEM_CODEPAGE
1466#endif
1467
1468/* null audiohw setting macro for when codec header is included for reasons
1469 other than audio support */
1470#define AUDIOHW_SETTING(name, us, nd, st, minv, maxv, defv, expr...)
1471
1472/* Trying to enable the setting without the underlying functions doesn't work */
1473#if defined(HAVE_LCD_SLEEP_SETTING) && !defined(HAVE_LCD_SLEEP)
1474#error "HAVE_LCD_SLEEP_SETTING requires HAVE_LCD_SLEEP"
1475#endif
1476
1477/* Support for unicode codepoints > U+FFFF */
1478#if (MEMORYSIZE > 2) && !defined(BOOTLOADER)
1479#define UNICODE32
1480#endif
1481
1482#ifdef UNICODE32
1483#define ucschar_t unsigned int
1484#else
1485#define ucschar_t unsigned short
1486#endif
1487
1488#endif /* __CONFIG_H__ */
1489