summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/button.h23
-rw-r--r--firmware/export/config-gmini120.h86
-rw-r--r--firmware/export/config-gminisp.h77
-rw-r--r--firmware/export/config.h32
-rw-r--r--firmware/export/cpu.h3
-rw-r--r--firmware/export/system.h66
-rw-r--r--firmware/export/tcc730.h107
-rw-r--r--firmware/export/thread.h7
8 files changed, 12 insertions, 389 deletions
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 240ec08d9b..9c0fe639a6 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -151,27 +151,6 @@ void wheel_send_events(bool send);
151 151
152#define BUTTON_REMOTE 0 152#define BUTTON_REMOTE 0
153 153
154#elif CONFIG_KEYPAD == GMINI100_PAD
155
156 /* Gmini specific button codes */
157
158#define BUTTON_ON 0x00000001
159#define BUTTON_OFF 0x00000002
160
161#define BUTTON_LEFT 0x00000004
162#define BUTTON_RIGHT 0x00000008
163#define BUTTON_UP 0x00000010
164#define BUTTON_DOWN 0x00000020
165
166#define BUTTON_PLAY 0x00000040
167#define BUTTON_MENU 0x00000080
168
169#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
170 |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY|BUTTON_MENU)
171
172#define BUTTON_REMOTE 0
173
174
175#elif 0 154#elif 0
176 155
177/* 156/*
@@ -186,7 +165,7 @@ void wheel_send_events(bool send);
186 165
187 166
188 167
189#endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ 168#endif /* RECORDER/PLAYER/ONDIO KEYPAD */
190 169
191#endif /* TARGET_TREE */ 170#endif /* TARGET_TREE */
192 171
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
deleted file mode 100644
index a393b17a8a..0000000000
--- a/firmware/export/config-gmini120.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/* Note: this is just a basic early version that needs attention and
2 corrections! */
3
4/* define this if you have recording possibility */
5#define HAVE_RECORDING 1
6
7/* define this if you have a bitmap LCD display */
8#define HAVE_LCD_BITMAP 1
9
10/* define this if you can invert the colours on your LCD */
11#define HAVE_LCD_INVERT
12
13/* define this if you have a real-time clock */
14#define CONFIG_RTC RTC_M41ST84W
15
16/* define this if you have RTC RAM available for settings */
17#define HAVE_RTC_RAM 1
18
19/* define this if you would like tagcache to build on this target */
20#define HAVE_TAGCACHE
21
22/* LCD dimensions */
23#define LCD_WIDTH 128
24#define LCD_HEIGHT 64
25#define LCD_DEPTH 1
26
27#define CONFIG_KEYPAD GMINI100_PAD
28
29/* Define this if you have a software controlled poweroff */
30#define HAVE_SW_POWEROFF
31
32/* The number of bytes reserved for loadable codecs. Although in this case
33 the codec won't be loadable... */
34#define CODEC_SIZE 0x40000
35
36/* The number of bytes reserved for loadable plugins */
37#define PLUGIN_BUFFER_SIZE 0x80000
38
39#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
40
41#ifndef SIMULATOR
42
43/* Define this if you have a TCC730 (CalmRISC16) */
44#define CONFIG_CPU TCC730
45
46/* Define this if you have a gmini 100 style LCD */
47#define CONFIG_LCD LCD_GMINI100
48
49#define CONFIG_I2C I2C_GMINI
50
51/* Define this if you do software codec */
52#define CONFIG_CODEC SWCODEC
53
54/* Type of mobile power, FIXME: probably different, make new type */
55#define CONFIG_BATTERY BATT_LIION2200
56#define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */
57#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
58#define BATTERY_CAPACITY_INC 50 /* capacity increment */
59#define BATTERY_TYPES_COUNT 1 /* only one type */
60#define BATTERY_SCALE_FACTOR 6465
61/* chosen values at random -- jyp */
62
63/* Hardware controlled charging? FIXME */
64#define CONFIG_CHARGING CHARGING_SIMPLE
65
66#define CPU_FREQ 30000000
67/* approximate value (and false in general since freq is variable) */
68
69/* Always enable debug till we stabilize */
70#define EMULATOR
71
72#define USB_GMINISTYLE
73
74#define CONFIG_I2C I2C_GMINI
75
76#define CONFIG_BACKLIGHT BL_GMINI
77
78#define GMINI_ARCH
79
80/* Software controlled LED */
81#define CONFIG_LED LED_REAL
82
83/* Define this if you have adjustable CPU frequency */
84#define HAVE_ADJUSTABLE_CPU_FREQ
85
86#endif
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h
deleted file mode 100644
index 1c1f299afa..0000000000
--- a/firmware/export/config-gminisp.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/* Note: this is just a basic early version that needs attention and
2 corrections! */
3
4/* define this if you have a bitmap LCD display */
5#define HAVE_LCD_BITMAP 1
6
7/* define this if you can invert the colours on your LCD */
8#define HAVE_LCD_INVERT
9
10/* define this if you would like tagcache to build on this target */
11#define HAVE_TAGCACHE
12
13/* LCD dimensions */
14#define LCD_WIDTH 128
15#define LCD_HEIGHT 64
16#define LCD_DEPTH 1
17
18#define CONFIG_KEYPAD GMINI100_PAD
19
20/* Define this if you have a software controlled poweroff */
21#define HAVE_SW_POWEROFF
22
23/* The number of bytes reserved for loadable codecs. Although in this case
24 the codec won't be loadable... */
25#define CODEC_SIZE 0x40000
26
27/* The number of bytes reserved for loadable plugins */
28#define PLUGIN_BUFFER_SIZE 0x80000
29
30#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
31
32#ifndef SIMULATOR
33
34/* Define this if you have a TCC730 (CalmRISC16) */
35#define CONFIG_CPU TCC730
36
37/* Define this if you have a gmini 100 style LCD */
38#define CONFIG_LCD LCD_GMINI100
39
40#define CONFIG_I2C I2C_GMINI
41
42/* Define this if you do software codec */
43#define CONFIG_CODEC SWCODEC
44
45/* Type of mobile power, FIXME: probably different, make new type */
46#define CONFIG_BATTERY BATT_LIION2200
47#define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */
48#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
49#define BATTERY_CAPACITY_INC 50 /* capacity increment */
50#define BATTERY_TYPES_COUNT 1 /* only one type */
51#define BATTERY_SCALE_FACTOR 6465
52/* chosen values at random -- jyp */
53
54/* Hardware controlled charging? FIXME */
55#define CONFIG_CHARGING CHARGING_SIMPLE
56
57#define CPU_FREQ 30000000
58/* approximate value (and false in general since freq is variable) */
59
60/* Always enable debug till we stabilize */
61#define EMULATOR
62
63#define USB_GMINISTYLE
64
65#define CONFIG_I2C I2C_GMINI
66
67#define CONFIG_BACKLIGHT BL_GMINI
68
69#define GMINI_ARCH
70
71/* Software controlled LED */
72#define CONFIG_LED LED_REAL
73
74/* Define this if you have adjustable CPU frequency */
75#define HAVE_ADJUSTABLE_CPU_FREQ
76
77#endif
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 45d974a96f..440c0faef3 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -40,7 +40,6 @@
40#define SH7034 7034 40#define SH7034 7034
41#define MCF5249 5249 41#define MCF5249 5249
42#define MCF5250 5250 42#define MCF5250 5250
43#define TCC730 730 /* lacking a proper abbrivation */
44#define PP5002 5002 43#define PP5002 5002
45#define PP5020 5020 44#define PP5020 5020
46#define PNX0101 101 45#define PNX0101 101
@@ -48,11 +47,10 @@
48#define PP5024 5024 47#define PP5024 5024
49 48
50/* CONFIG_KEYPAD */ 49/* CONFIG_KEYPAD */
51#define PLAYER_PAD 0 50#define PLAYER_PAD 1
52#define RECORDER_PAD 1 51#define RECORDER_PAD 2
53#define ONDIO_PAD 2 52#define ONDIO_PAD 3
54#define IRIVER_H100_PAD 3 53#define IRIVER_H100_PAD 4
55#define GMINI100_PAD 4
56#define IRIVER_H300_PAD 5 54#define IRIVER_H300_PAD 5
57#define IAUDIO_X5_PAD 6 55#define IAUDIO_X5_PAD 6
58#define IPOD_4G_PAD 7 56#define IPOD_4G_PAD 7
@@ -83,7 +81,6 @@
83#define CHARGING_CONTROL 3 /* Software controlled charging */ 81#define CHARGING_CONTROL 3 /* Software controlled charging */
84 82
85/* CONFIG_LCD */ 83/* CONFIG_LCD */
86#define LCD_GMINI100 0
87#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */ 84#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */
88#define LCD_SSD1801 2 /* as used by Archos Player/Studio */ 85#define LCD_SSD1801 2 /* as used by Archos Player/Studio */
89#define LCD_S1D15E06 3 /* as used by iRiver H100 series */ 86#define LCD_S1D15E06 3 /* as used by iRiver H100 series */
@@ -111,11 +108,10 @@
111#define RGB565SWAPPED 3553 108#define RGB565SWAPPED 3553
112 109
113/* CONFIG_BACKLIGHT */ 110/* CONFIG_BACKLIGHT */
114#define BL_PA14_LO 0 /* Player, PA14 low active */ 111#define BL_PA14_LO 1 /* Player, PA14 low active */
115#define BL_RTC 1 /* Recorder, RTC square wave output */ 112#define BL_RTC 2 /* Recorder, RTC square wave output */
116#define BL_PA14_HI 2 /* Ondio, PA14 high active */ 113#define BL_PA14_HI 3 /* Ondio, PA14 high active */
117#define BL_IRIVER_H100 3 /* IRiver GPIO */ 114#define BL_IRIVER_H100 4 /* IRiver GPIO */
118#define BL_GMINI 4 /* Archos GMini */
119#define BL_IPOD4G 5 /* Apple iPod 4G */ 115#define BL_IPOD4G 5 /* Apple iPod 4G */
120#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ 116#define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/
121#define BL_IPOD3G 7 /* Apple iPod 3g with dock */ 117#define BL_IPOD3G 7 /* Apple iPod 3g with dock */
@@ -129,9 +125,8 @@
129#define BL_TPJ1022 15 /* Tatung Elio TPJ-1022 */ 125#define BL_TPJ1022 15 /* Tatung Elio TPJ-1022 */
130 126
131/* CONFIG_I2C */ 127/* CONFIG_I2C */
132#define I2C_PLAYREC 0 /* Archos Player/Recorder style */ 128#define I2C_PLAYREC 1 /* Archos Player/Recorder style */
133#define I2C_ONDIO 1 /* Ondio style */ 129#define I2C_ONDIO 2 /* Ondio style */
134#define I2C_GMINI 2 /* Gmini style */
135#define I2C_COLDFIRE 3 /* Coldfire style */ 130#define I2C_COLDFIRE 3 /* Coldfire style */
136#define I2C_PP5002 4 /* PP5002 style */ 131#define I2C_PP5002 4 /* PP5002 style */
137#define I2C_PP5020 5 /* PP5020 style */ 132#define I2C_PP5020 5 /* PP5020 style */
@@ -139,7 +134,7 @@
139#define I2C_S3C2440 7 134#define I2C_S3C2440 7
140 135
141/* CONFIG_LED */ 136/* CONFIG_LED */
142#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ 137#define LED_REAL 1 /* SW controlled LED (Archos recorders, player) */
143#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ 138#define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */
144/* else HW controlled LED (iRiver H1x0) */ 139/* else HW controlled LED (iRiver H1x0) */
145 140
@@ -180,10 +175,6 @@
180#include "config-h120.h" 175#include "config-h120.h"
181#elif defined(IRIVER_H300) 176#elif defined(IRIVER_H300)
182#include "config-h300.h" 177#include "config-h300.h"
183#elif defined(ARCHOS_GMINI120)
184#include "config-gmini120.h"
185#elif defined(ARCHOS_GMINISP)
186#include "config-gminisp.h"
187#elif defined(IAUDIO_X5) 178#elif defined(IAUDIO_X5)
188#include "config-iaudiox5.h" 179#include "config-iaudiox5.h"
189#elif defined(IPOD_COLOR) 180#elif defined(IPOD_COLOR)
@@ -286,7 +277,6 @@
286 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ 277 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
287 (CONFIG_CPU == PP5020) || /* iPod and H10: core, plugins, codecs */ \ 278 (CONFIG_CPU == PP5020) || /* iPod and H10: core, plugins, codecs */ \
288 (CONFIG_CPU == PP5002) || /* iPod: core, plugins, codecs */ \ 279 (CONFIG_CPU == PP5002) || /* iPod: core, plugins, codecs */ \
289 (CONFIG_CPU == TCC730) || /* CalmRISC16: core, (plugins, codecs) */ \
290 (CONFIG_CPU == PNX0101)) 280 (CONFIG_CPU == PNX0101))
291#define ICODE_ATTR __attribute__ ((section(".icode"))) 281#define ICODE_ATTR __attribute__ ((section(".icode")))
292#define ICONST_ATTR __attribute__ ((section(".irodata"))) 282#define ICONST_ATTR __attribute__ ((section(".irodata")))
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h
index 93b66aac52..6adf52ba5e 100644
--- a/firmware/export/cpu.h
+++ b/firmware/export/cpu.h
@@ -27,9 +27,6 @@
27#if CONFIG_CPU == MCF5250 27#if CONFIG_CPU == MCF5250
28#include "mcf5250.h" 28#include "mcf5250.h"
29#endif 29#endif
30#if CONFIG_CPU == TCC730
31#include "tcc730.h"
32#endif
33#if CONFIG_CPU == PP5020 30#if CONFIG_CPU == PP5020
34#include "pp5020.h" 31#include "pp5020.h"
35#endif 32#endif
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 9b90a6e80c..3ec599d62b 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -371,72 +371,6 @@ void irq_set_int_handler(int n, interrupt_handler_t handler);
371void irq_enable_int(int n); 371void irq_enable_int(int n);
372#endif 372#endif
373 373
374#elif CONFIG_CPU == TCC730
375
376extern int smsc_version(void);
377
378extern void smsc_delay(void);
379
380extern void set_pll_freq(int pll_index, long freq_out);
381
382
383extern void* volatile interrupt_vector[16] __attribute__ ((section(".idata")));
384
385extern void ddma_transfer(int dir, int mem, void* intAddr, long extAddr,
386 int num);
387
388
389#define HIGHEST_IRQ_LEVEL (1)
390static inline int set_irq_level(int level)
391{
392 int result;
393 __asm__ ("ld %0, 0\n\t"
394 "tstsr ie\n\t"
395 "incc %0" : "=r"(result));
396 if (level > 0)
397 __asm__ volatile ("clrsr ie");
398 else
399 __asm__ volatile ("setsr ie");
400
401 return result;
402}
403
404static inline unsigned short swap16(unsigned short value)
405 /*
406 result[15..8] = value[ 7..0];
407 result[ 7..0] = value[15..8];
408 */
409{
410 return (value >> 8) | (value << 8);
411}
412
413static inline unsigned long swap32(unsigned long value)
414 /*
415 result[31..24] = value[ 7.. 0];
416 result[23..16] = value[15.. 8];
417 result[15.. 8] = value[23..16];
418 result[ 7.. 0] = value[31..24];
419 */
420{
421 unsigned long hi = swap16(value >> 16);
422 unsigned long lo = swap16(value & 0xffff);
423 return (lo << 16) | hi;
424}
425
426/* Archos uses:
427
42822MHz: busy wait on dma
42932MHz: normal
43080Mhz: heavy load
431
432*/
433
434#define CPUFREQ_DEFAULT CPU_FREQ
435#define CPUFREQ_NORMAL (32000000)
436#define CPUFREQ_MAX (80000000)
437
438#define invalidate_icache()
439
440#endif 374#endif
441 375
442#ifndef CPU_COLDFIRE 376#ifndef CPU_COLDFIRE
diff --git a/firmware/export/tcc730.h b/firmware/export/tcc730.h
deleted file mode 100644
index c1208ecc28..0000000000
--- a/firmware/export/tcc730.h
+++ /dev/null
@@ -1,107 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Jean-Philippe Bernardy
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef TCC730_H
21#define TCC730_H
22
23/* int is 16 bit
24 long is 32 bit */
25
26#define IOBASE (0x3f0000)
27#define MMIO(t, x) (*(volatile t*)(IOBASE+(x)))
28
29#define OSCCON MMIO(unsigned char, 0x01)
30#define WTCON MMIO(unsigned char, 0x02)
31#define BTCON MMIO(unsigned char, 0x04)
32#define BTCNT MMIO(unsigned char, 0x05)
33#define WDTEN MMIO(unsigned char, 0x06)
34#define WDTCON MMIO(unsigned char, 0x07)
35
36#define TACON MMIO(unsigned char, 0x08)
37#define TAPRE MMIO(unsigned char, 0x09)
38#define TADATA MMIO(unsigned int, 0x0A)
39#define TACNT MMIO(unsigned int, 0x0C)
40
41#define IMR0 MMIO(unsigned int, 0x22)
42#define IMR1 MMIO(unsigned int, 0x2A)
43
44#define P0 MMIO(unsigned char, 0x30)
45#define P1 MMIO(unsigned char, 0x31)
46#define P2 MMIO(unsigned char, 0x32)
47#define P3 MMIO(unsigned char, 0x33)
48#define P4 MMIO(unsigned char, 0x34)
49#define P5 MMIO(unsigned char, 0x35)
50#define P6 MMIO(unsigned char, 0x36)
51#define P7 MMIO(unsigned char, 0x37)
52#define P8 MMIO(unsigned char, 0x38)
53#define P9 MMIO(unsigned char, 0x39)
54#define P10 MMIO(unsigned char, 0x3A)
55
56#define P0CON MMIO(unsigned char,0x40)
57#define P1CON MMIO(unsigned char,0x41)
58#define P2CON MMIO(unsigned int,0x42)
59#define P2CONH MMIO(unsigned char,0x42)
60#define P2CONL MMIO(unsigned char,0x43)
61#define P3CON MMIO(unsigned int,0x44)
62#define P3CONH MMIO(unsigned char,0x44)
63#define P3CONL MMIO(unsigned char,0x45)
64#define P3PUR MMIO(unsigned char,0x46)
65#define P5CON MMIO(unsigned char,0x48)
66#define P5PUR MMIO(unsigned char,0x49)
67#define P5INTMOD MMIO(unsigned int,0x4A)
68#define P5INTCON MMIO(unsigned char,0x4C)
69#define P4CON MMIO(unsigned char,0x50)
70#define P4INTCON MMIO(unsigned char,0x51)
71#define P4INTMOD MMIO(unsigned char,0x52)
72#define P6CON MMIO(unsigned char,0x53)
73#define P7CON MMIO(unsigned char,0x54)
74#define P8CON MMIO(unsigned char,0x55)
75#define P9CON MMIO(unsigned char,0x56)
76#define P10CON MMIO(unsigned char,0x57)
77
78#define IISCON0 MMIO(unsigned char, 0x0a0)
79#define IISMODE0 MMIO(unsigned char, 0x0a1)
80#define IISPTR0 MMIO(unsigned char, 0x0a2)
81#define IISCON1 MMIO(unsigned char, 0x0a3)
82#define IISMODE1 MMIO(unsigned char, 0x0a4)
83#define IISPTR1 MMIO(unsigned char, 0x0a5)
84
85#define ADDATA MMIO(unsigned int, 0x74)
86#define ADCON MMIO(unsigned char, 0x76)
87
88#define PLL0DATA MMIO(unsigned int, 0xA8)
89#define PLL0CON MMIO(unsigned char, 0xAA)
90#define PLL1DATA MMIO(unsigned int, 0xAC)
91#define PLL1CON MMIO(unsigned char, 0xAE)
92
93#define IISBUF ((volatile unsigned int*)(IOBASE+(0x0c0)))
94
95#define MIUSCFG MMIO(unsigned char, 0x110)
96#define MIUDCOM MMIO(unsigned char, 0x111)
97#define MIUDCFG MMIO(unsigned int, 0x112)
98#define MIUDCNT MMIO(unsigned int, 0x114)
99
100#define DDMACOM MMIO(unsigned char, 0x120)
101#define DDMACFG MMIO(unsigned char, 0x121)
102#define DDMAIADR MMIO(unsigned long, 0x122)
103#define DDMAEADR MMIO(unsigned long, 0x126)
104#define DDMANUM MMIO(unsigned int, 0x12A)
105#define DDMACNT MMIO(unsigned int, 0x12C)
106
107#endif
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index 72c692ec3b..8bb9ae2608 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -74,13 +74,6 @@ struct regs
74 unsigned int lr; /* r14 (lr) */ 74 unsigned int lr; /* r14 (lr) */
75 void *start; /* Thread start address, or NULL when started */ 75 void *start; /* Thread start address, or NULL when started */
76}; 76};
77# elif CONFIG_CPU == TCC730
78struct regs
79{
80 void *sp; /* Stack pointer (a15) */
81 void *start; /* Thread start address */
82 int started; /* 0 when not started */
83};
84# endif 77# endif
85 78
86#endif /* !SIMULATOR */ 79#endif /* !SIMULATOR */