diff options
author | Dave Chapman <dave@dchapman.com> | 2006-02-05 16:52:22 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-02-05 16:52:22 +0000 |
commit | d16a8b8845ed496e9375c5dfac6da2011c9eb362 (patch) | |
tree | 9adc8e92f61a58bdb02e9c59af8dfd7ddd3eff61 /firmware | |
parent | e8048cefed2715dcecb82ae49549ed619cf3104b (diff) | |
download | rockbox-d16a8b8845ed496e9375c5dfac6da2011c9eb362.tar.gz rockbox-d16a8b8845ed496e9375c5dfac6da2011c9eb362.zip |
More iPod 3G changes from Seven Le Mesle, and some unification of the iPod code from me
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8581 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/button.h | 11 | ||||
-rw-r--r-- | firmware/export/config-ipod3g.h | 95 | ||||
-rw-r--r-- | firmware/export/config.h | 47 | ||||
-rw-r--r-- | firmware/export/cpu.h | 3 | ||||
-rw-r--r-- | firmware/export/i2c-pp5002.h | 34 | ||||
-rw-r--r-- | firmware/export/kernel.h | 4 | ||||
-rw-r--r-- | firmware/export/lcd.h | 4 | ||||
-rw-r--r-- | firmware/export/pp5002.h | 103 | ||||
-rw-r--r-- | firmware/export/system.h | 6 | ||||
-rw-r--r-- | firmware/export/wm8731l.h | 54 |
10 files changed, 335 insertions, 26 deletions
diff --git a/firmware/export/button.h b/firmware/export/button.h index 158cf41a84..0ee8d67845 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -163,6 +163,17 @@ bool button_hold(void); | |||
163 | #define BUTTON_SCROLL_FWD 0x0010 | 163 | #define BUTTON_SCROLL_FWD 0x0010 |
164 | #define BUTTON_SCROLL_BACK 0x0020 | 164 | #define BUTTON_SCROLL_BACK 0x0020 |
165 | 165 | ||
166 | #elif CONFIG_KEYPAD == IPOD_3G_PAD | ||
167 | |||
168 | /* TODO: These codes should relate to the hardware */ | ||
169 | |||
170 | #define BUTTON_MENU 0x0002 | ||
171 | #define BUTTON_PLAY 0x0004 | ||
172 | #define BUTTON_SELECT 0x0008 | ||
173 | #define BUTTON_SCROLL_FWD 0x0010 | ||
174 | #define BUTTON_SCROLL_BACK 0x0020 | ||
175 | #define BUTTON_HOLD 0x0100 | ||
176 | |||
166 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | 177 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD |
167 | 178 | ||
168 | #define BUTTON_PLAY 0x0001 | 179 | #define BUTTON_PLAY 0x0001 |
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h new file mode 100644 index 0000000000..0da104d38b --- /dev/null +++ b/firmware/export/config-ipod3g.h | |||
@@ -0,0 +1,95 @@ | |||
1 | /* | ||
2 | * This config file is for the Apple iPod 3g | ||
3 | */ | ||
4 | #define APPLE_IPOD3G 1 | ||
5 | |||
6 | /* For Rolo and boot loader */ | ||
7 | #define MODEL_NUMBER 7 | ||
8 | |||
9 | /* define this if you have recording possibility */ | ||
10 | /*#define HAVE_RECORDING 1*/ | ||
11 | |||
12 | /* define this if you have a bitmap LCD display */ | ||
13 | #define HAVE_LCD_BITMAP 1 | ||
14 | |||
15 | /* LCD dimensions */ | ||
16 | #define LCD_WIDTH 160 | ||
17 | #define LCD_HEIGHT 128 | ||
18 | #define LCD_DEPTH 2 /* 4 colours - 2bpp */ | ||
19 | |||
20 | #define CONFIG_KEYPAD IPOD_3G_PAD | ||
21 | |||
22 | /* Define this if you do software codec */ | ||
23 | #define CONFIG_CODEC SWCODEC | ||
24 | |||
25 | /* define this if you have a real-time clock */ | ||
26 | #ifndef BOOTLOADER | ||
27 | #define CONFIG_RTC RTC_PCF50605 | ||
28 | #endif | ||
29 | |||
30 | /* Define this if you have a software controlled poweroff */ | ||
31 | #define HAVE_SW_POWEROFF | ||
32 | |||
33 | /* The number of bytes reserved for loadable codecs */ | ||
34 | #define CODEC_SIZE 0x80000 | ||
35 | |||
36 | /* The number of bytes reserved for loadable plugins */ | ||
37 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
38 | |||
39 | /* Define this if you have the WM8731L audio codec */ | ||
40 | #define HAVE_WM8731L | ||
41 | |||
42 | /* Define this for LCD backlight available */ | ||
43 | #define CONFIG_BACKLIGHT BL_IPOD3G /* port controlled */ | ||
44 | |||
45 | #ifndef SIMULATOR | ||
46 | |||
47 | /* Define this if you have a PortalPlayer PP5002 */ | ||
48 | #define CONFIG_CPU PP5002 | ||
49 | |||
50 | /* Define this if you want to use the PP5002 i2c interface */ | ||
51 | #define CONFIG_I2C I2C_PP5002 | ||
52 | |||
53 | /* Type of mobile power */ | ||
54 | //#define CONFIG_BATTERY BATT_LIPOL1300 | ||
55 | |||
56 | #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ | ||
57 | |||
58 | /* Define this if the platform can charge batteries */ | ||
59 | //#define HAVE_CHARGING 1 | ||
60 | |||
61 | /* define this if the hardware can be powered off while charging */ | ||
62 | //#define HAVE_POWEROFF_WHILE_CHARGING | ||
63 | |||
64 | /* The start address index for ROM builds */ | ||
65 | #define ROM_START 0x00000000 | ||
66 | |||
67 | /* Define this to the CPU frequency */ | ||
68 | #define CPU_FREQ 11289600 | ||
69 | |||
70 | #define CONFIG_LCD LCD_IPOD2BPP | ||
71 | |||
72 | /* Offset ( in the firmware file's header ) to the file length */ | ||
73 | #define FIRMWARE_OFFSET_FILE_LENGTH 0 | ||
74 | |||
75 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
76 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
77 | |||
78 | /* Offset ( in the firmware file's header ) to the real data */ | ||
79 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
80 | |||
81 | #define USB_IPODSTYLE | ||
82 | |||
83 | /* define this if the unit can be powered or charged via USB */ | ||
84 | #define HAVE_USB_POWER | ||
85 | |||
86 | /* Virtual LED (icon) */ | ||
87 | #define CONFIG_LED LED_VIRTUAL | ||
88 | |||
89 | /* Define this if you have adjustable CPU frequency */ | ||
90 | //#define HAVE_ADJUSTABLE_CPU_FREQ | ||
91 | |||
92 | #define BOOTFILE_EXT "ipod" | ||
93 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
94 | |||
95 | #endif | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 8ce7ee61a3..f451173d06 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -44,15 +44,16 @@ | |||
44 | #define PNX0101 101 | 44 | #define PNX0101 101 |
45 | 45 | ||
46 | /* CONFIG_KEYPAD */ | 46 | /* CONFIG_KEYPAD */ |
47 | #define PLAYER_PAD 0 | 47 | #define PLAYER_PAD 0 |
48 | #define RECORDER_PAD 1 | 48 | #define RECORDER_PAD 1 |
49 | #define ONDIO_PAD 2 | 49 | #define ONDIO_PAD 2 |
50 | #define IRIVER_H100_PAD 3 | 50 | #define IRIVER_H100_PAD 3 |
51 | #define GMINI100_PAD 4 | 51 | #define GMINI100_PAD 4 |
52 | #define IRIVER_H300_PAD 5 | 52 | #define IRIVER_H300_PAD 5 |
53 | #define IAUDIO_X5_PAD 6 | 53 | #define IAUDIO_X5_PAD 6 |
54 | #define IPOD_4G_PAD 7 | 54 | #define IPOD_4G_PAD 7 |
55 | #define IRIVER_IFP7XX_PAD 8 | 55 | #define IPOD_3G_PAD 8 |
56 | #define IRIVER_IFP7XX_PAD 9 | ||
56 | 57 | ||
57 | /* CONFIG_REMOTE_KEYPAD */ | 58 | /* CONFIG_REMOTE_KEYPAD */ |
58 | #define H100_REMOTE 1 | 59 | #define H100_REMOTE 1 |
@@ -77,7 +78,8 @@ | |||
77 | #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ | 78 | #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ |
78 | #define LCD_IPODNANO 7 /* as used by iPod Nano */ | 79 | #define LCD_IPODNANO 7 /* as used by iPod Nano */ |
79 | #define LCD_IPODVIDEO 8 /* as used by iPod Video */ | 80 | #define LCD_IPODVIDEO 8 /* as used by iPod Video */ |
80 | #define LCD_IFP7XX 9 /* as used by iRiver iFP 7xx/8xx */ | 81 | #define LCD_IPOD2BPP 9 /* as used by all greyscale iPods */ |
82 | #define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */ | ||
81 | 83 | ||
82 | /* LCD_PIXELFORMAT */ | 84 | /* LCD_PIXELFORMAT */ |
83 | #define RGB565 565 | 85 | #define RGB565 565 |
@@ -91,16 +93,18 @@ | |||
91 | #define BL_GMINI 4 /* Archos GMini */ | 93 | #define BL_GMINI 4 /* Archos GMini */ |
92 | #define BL_IPOD4G 5 /* Apple iPod 4G */ | 94 | #define BL_IPOD4G 5 /* Apple iPod 4G */ |
93 | #define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ | 95 | #define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ |
94 | #define BL_IRIVER_H300 7 /* IRiver PWM */ | 96 | #define BL_IPOD3G 7 /* Apple iPod 3g with dock */ |
95 | #define BL_IRIVER_IFP7XX 8 /* IRiver GPIO */ | 97 | #define BL_IRIVER_H300 8 /* IRiver PWM */ |
98 | #define BL_IRIVER_IFP7XX 9 /* IRiver GPIO */ | ||
96 | 99 | ||
97 | /* CONFIG_I2C */ | 100 | /* CONFIG_I2C */ |
98 | #define I2C_PLAYREC 0 /* Archos Player/Recorder style */ | 101 | #define I2C_PLAYREC 0 /* Archos Player/Recorder style */ |
99 | #define I2C_ONDIO 1 /* Ondio style */ | 102 | #define I2C_ONDIO 1 /* Ondio style */ |
100 | #define I2C_GMINI 2 /* Gmini style */ | 103 | #define I2C_GMINI 2 /* Gmini style */ |
101 | #define I2C_COLDFIRE 3 /* Coldfire style */ | 104 | #define I2C_COLDFIRE 3 /* Coldfire style */ |
102 | #define I2C_PP5020 4 /* PP5020 style */ | 105 | #define I2C_PP5002 4 /* PP5002 style */ |
103 | #define I2C_PNX0101 5 /* PNX0101 style */ | 106 | #define I2C_PP5020 5 /* PP5020 style */ |
107 | #define I2C_PNX0101 6 /* PNX0101 style */ | ||
104 | 108 | ||
105 | /* CONFIG_LED */ | 109 | /* CONFIG_LED */ |
106 | #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ | 110 | #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ |
@@ -111,7 +115,7 @@ | |||
111 | 115 | ||
112 | /* CONFIG_RTC */ | 116 | /* CONFIG_RTC */ |
113 | #define RTC_M41ST84W 1 /* Archos Recorder */ | 117 | #define RTC_M41ST84W 1 /* Archos Recorder */ |
114 | #define RTC_PCF50605 2 /* iPod 4G */ | 118 | #define RTC_PCF50605 2 /* iPod 3G and 4G*/ |
115 | #define RTC_PCF50606 3 /* iriver H300 */ | 119 | #define RTC_PCF50606 3 /* iriver H300 */ |
116 | 120 | ||
117 | /* else HW controlled LED (iRiver H1x0) */ | 121 | /* else HW controlled LED (iRiver H1x0) */ |
@@ -147,6 +151,8 @@ | |||
147 | #include "config-ipodnano.h" | 151 | #include "config-ipodnano.h" |
148 | #elif defined(IPOD_VIDEO) | 152 | #elif defined(IPOD_VIDEO) |
149 | #include "config-ipodvideo.h" | 153 | #include "config-ipodvideo.h" |
154 | #elif defined(IPOD_3G) | ||
155 | #include "config-ipod3g.h" | ||
150 | #elif defined(IRIVER_IFP7XX) | 156 | #elif defined(IRIVER_IFP7XX) |
151 | #include "config-ifp7xx.h" | 157 | #include "config-ifp7xx.h" |
152 | #else | 158 | #else |
@@ -172,7 +178,7 @@ | |||
172 | #endif | 178 | #endif |
173 | 179 | ||
174 | /* define for all cpus from ARM family */ | 180 | /* define for all cpus from ARM family */ |
175 | #if (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) | 181 | #if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) |
176 | #define CPU_ARM | 182 | #define CPU_ARM |
177 | #endif | 183 | #endif |
178 | 184 | ||
@@ -193,11 +199,12 @@ | |||
193 | (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ | 199 | (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ |
194 | (CONFIG_CPU == MCF5249) || /* Coldfire: core, plugins, codecs */ \ | 200 | (CONFIG_CPU == MCF5249) || /* Coldfire: core, plugins, codecs */ \ |
195 | (CONFIG_CPU == PP5020) || /* iPod: core, plugins, codecs */ \ | 201 | (CONFIG_CPU == PP5020) || /* iPod: core, plugins, codecs */ \ |
202 | (CONFIG_CPU == PP5002) || /* iPod: core, plugins, codecs */ \ | ||
196 | (CONFIG_CPU == TCC730)) /* CalmRISC16: core, (plugins, codecs) */ | 203 | (CONFIG_CPU == TCC730)) /* CalmRISC16: core, (plugins, codecs) */ |
197 | #define ICODE_ATTR __attribute__ ((section(".icode"))) | 204 | #define ICODE_ATTR __attribute__ ((section(".icode"))) |
198 | #define ICONST_ATTR __attribute__ ((section(".irodata"))) | 205 | #define ICONST_ATTR __attribute__ ((section(".irodata"))) |
199 | #define IDATA_ATTR __attribute__ ((section(".idata"))) | 206 | #define IDATA_ATTR __attribute__ ((section(".idata"))) |
200 | #define IBSS_ATTR __attribute__ ((section(".ibss"))) | 207 | #define IBSS_ATTR __attribute__ ((section(".ibss"))) |
201 | #define USE_IRAM | 208 | #define USE_IRAM |
202 | #else | 209 | #else |
203 | #define ICODE_ATTR | 210 | #define ICODE_ATTR |
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h index 1ced9fce5e..d0b953ef6f 100644 --- a/firmware/export/cpu.h +++ b/firmware/export/cpu.h | |||
@@ -33,6 +33,9 @@ | |||
33 | #if CONFIG_CPU == PP5020 | 33 | #if CONFIG_CPU == PP5020 |
34 | #include "pp5020.h" | 34 | #include "pp5020.h" |
35 | #endif | 35 | #endif |
36 | #if CONFIG_CPU == PP5002 | ||
37 | #include "pp5002.h" | ||
38 | #endif | ||
36 | #if CONFIG_CPU == PNX0101 | 39 | #if CONFIG_CPU == PNX0101 |
37 | #include "pnx0101.h" | 40 | #include "pnx0101.h" |
38 | #endif | 41 | #endif |
diff --git a/firmware/export/i2c-pp5002.h b/firmware/export/i2c-pp5002.h new file mode 100644 index 0000000000..11e84996d4 --- /dev/null +++ b/firmware/export/i2c-pp5002.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
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 | /* | ||
21 | * PP5002 i2c driver | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #ifndef _I2C_PP5002_H | ||
26 | #define _I2C_PP5002_H | ||
27 | |||
28 | /* TODO: Fully implement i2c driver */ | ||
29 | |||
30 | void i2c_init(void); | ||
31 | int i2c_readbyte(unsigned int dev_addr, int addr); | ||
32 | int ipod_i2c_send(unsigned int addr, int data0, int data1); | ||
33 | |||
34 | #endif | ||
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 5cd3c6dc94..89c56da1b9 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h | |||
@@ -66,10 +66,10 @@ struct mutex | |||
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* global tick variable */ | 68 | /* global tick variable */ |
69 | #if (CONFIG_CPU == PP5020) && defined(BOOTLOADER) | 69 | #if ((CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)) && defined(BOOTLOADER) |
70 | /* We don't enable interrupts in the iPod bootloader, so we need to fake | 70 | /* We don't enable interrupts in the iPod bootloader, so we need to fake |
71 | the current_tick variable */ | 71 | the current_tick variable */ |
72 | #define current_tick ((*((volatile long*)0x60005010))/10000) | 72 | #define current_tick (USEC_TIMER/10000) |
73 | #else | 73 | #else |
74 | extern long current_tick; | 74 | extern long current_tick; |
75 | #endif | 75 | #endif |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 08f5f694b9..bee8d3cd0c 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -192,6 +192,8 @@ typedef void lcd_fastpixelfunc_type(fb_data *address); | |||
192 | /* Memory copy of display bitmap */ | 192 | /* Memory copy of display bitmap */ |
193 | #if LCD_DEPTH == 1 | 193 | #if LCD_DEPTH == 1 |
194 | extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | 194 | extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; |
195 | #elif CONFIG_LCD == LCD_IPOD2BPP | ||
196 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH/4]; | ||
195 | #elif LCD_DEPTH == 2 | 197 | #elif LCD_DEPTH == 2 |
196 | extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; | 198 | extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; |
197 | #elif LCD_DEPTH == 16 | 199 | #elif LCD_DEPTH == 16 |
@@ -200,7 +202,7 @@ extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | |||
200 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | 202 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; |
201 | #endif | 203 | #endif |
202 | 204 | ||
203 | #if CONFIG_BACKLIGHT==BL_IRIVER_H300 | 205 | #if (CONFIG_BACKLIGHT==BL_IRIVER_H300) || (CONFIG_BACKLIGHT==BL_IPOD3G) |
204 | extern void lcd_enable(bool on); | 206 | extern void lcd_enable(bool on); |
205 | #endif | 207 | #endif |
206 | 208 | ||
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h new file mode 100644 index 0000000000..36bb3c9671 --- /dev/null +++ b/firmware/export/pp5002.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 by Thom Johansen | ||
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 | #ifndef __PP5002_H__ | ||
20 | #define __PP5002_H__ | ||
21 | |||
22 | /* All info gleaned and/or copied from the iPodLinux project. */ | ||
23 | |||
24 | #define GPIOA_ENABLE (*(volatile unsigned long *)(0xcf000000)) | ||
25 | #define GPIOB_ENABLE (*(volatile unsigned long *)(0xcf000004)) | ||
26 | #define GPIOC_ENABLE (*(volatile unsigned long *)(0xcf000008)) | ||
27 | #define GPIOD_ENABLE (*(volatile unsigned long *)(0xcf00000c)) | ||
28 | #define GPIOA_OUTPUT_EN (*(volatile unsigned long *)(0xcf000010)) | ||
29 | #define GPIOB_OUTPUT_EN (*(volatile unsigned long *)(0xcf000014)) | ||
30 | #define GPIOC_OUTPUT_EN (*(volatile unsigned long *)(0xcf000018)) | ||
31 | #define GPIOD_OUTPUT_EN (*(volatile unsigned long *)(0xcf00001c)) | ||
32 | #define GPIOA_OUTPUT_VAL (*(volatile unsigned long *)(0xcf000020)) | ||
33 | #define GPIOB_OUTPUT_VAL (*(volatile unsigned long *)(0xcf000024)) | ||
34 | #define GPIOC_OUTPUT_VAL (*(volatile unsigned long *)(0xcf000028)) | ||
35 | #define GPIOD_OUTPUT_VAL (*(volatile unsigned long *)(0xcf00002c)) | ||
36 | #define GPIOA_INPUT_VAL (*(volatile unsigned long *)(0xcf000030)) | ||
37 | #define GPIOB_INPUT_VAL (*(volatile unsigned long *)(0xcf000034)) | ||
38 | #define GPIOC_INPUT_VAL (*(volatile unsigned long *)(0xcf000038)) | ||
39 | #define GPIOD_INPUT_VAL (*(volatile unsigned long *)(0xcf00003c)) | ||
40 | #define GPIOA_INT_STAT (*(volatile unsigned long *)(0xcf000040)) | ||
41 | #define GPIOB_INT_STAT (*(volatile unsigned long *)(0xcf000044)) | ||
42 | #define GPIOC_INT_STAT (*(volatile unsigned long *)(0xcf000048)) | ||
43 | #define GPIOD_INT_STAT (*(volatile unsigned long *)(0xcf00004c)) | ||
44 | #define GPIOA_INT_EN (*(volatile unsigned long *)(0xcf000050)) | ||
45 | #define GPIOB_INT_EN (*(volatile unsigned long *)(0xcf000054)) | ||
46 | #define GPIOC_INT_EN (*(volatile unsigned long *)(0xcf000058)) | ||
47 | #define GPIOD_INT_EN (*(volatile unsigned long *)(0xcf00005c)) | ||
48 | #define GPIOA_INT_LEV (*(volatile unsigned long *)(0xcf000060)) | ||
49 | #define GPIOB_INT_LEV (*(volatile unsigned long *)(0xcf000064)) | ||
50 | #define GPIOC_INT_LEV (*(volatile unsigned long *)(0xcf000068)) | ||
51 | #define GPIOD_INT_LEV (*(volatile unsigned long *)(0xcf00006c)) | ||
52 | #define GPIOA_INT_CLR (*(volatile unsigned long *)(0xcf000070)) | ||
53 | #define GPIOB_INT_CLR (*(volatile unsigned long *)(0xcf000074)) | ||
54 | #define GPIOC_INT_CLR (*(volatile unsigned long *)(0xcf000078)) | ||
55 | #define GPIOD_INT_CLR (*(volatile unsigned long *)(0xcf00007c)) | ||
56 | |||
57 | #define DEV_RS (*(volatile unsigned long *)( 0xcf005030)) | ||
58 | #define DEV_EN (*(volatile unsigned long *)( 0xcf005000)) | ||
59 | |||
60 | |||
61 | #define CPU_INT_STAT (*(volatile unsigned long*)(0xcf001000)) | ||
62 | #define CPU_INT_EN (*(volatile unsigned long*)(0xcf001024)) | ||
63 | #define CPU_INT_CLR (*(volatile unsigned long*)(0xcf001028)) | ||
64 | |||
65 | #define USB2D_IDENT (*(volatile unsigned long*)(0xc5000000)) | ||
66 | #define USB_STATUS (*(volatile unsigned long*)(0xc50001a4)) | ||
67 | |||
68 | #define IISCONFIG (*(volatile unsigned long*)(0xc0002500)) | ||
69 | |||
70 | #define IISFIFO_CFG (*(volatile unsigned long*)(0xc000251c)) | ||
71 | #define IISFIFO_WR (*(volatile unsigned long*)(0xc0002540)) | ||
72 | #define IISFIFO_RD (*(volatile unsigned long*)(0xc0002580)) | ||
73 | /* PP5002 registers */ | ||
74 | #define PP5002_TIMER1 0xcf001100 | ||
75 | #define PP5002_TIMER1_ACK 0xcf001104 | ||
76 | #define PP5002_TIMER2 0xcf001108 | ||
77 | #define PP5002_TIMER2_ACK 0xcf00110c | ||
78 | |||
79 | #define PP5002_TIMER_STATUS 0xcf001110 | ||
80 | |||
81 | #define IDE_IRQ 1 | ||
82 | #define SER0_IRQ 4 | ||
83 | #define I2S_IRQ 5 | ||
84 | #define SER1_IRQ 7 | ||
85 | #define TIMER1_IRQ 11 | ||
86 | #define GPIO_IRQ 14 | ||
87 | #define DMA_OUT_IRQ 30 | ||
88 | #define DMA_IN_IRQ 31 | ||
89 | |||
90 | |||
91 | |||
92 | #define TIMER1_MASK (1 << TIMER1_IRQ) | ||
93 | #define I2S_MASK (1 << I2S_IRQ) | ||
94 | #define IDE_MASK (1 << IDE_IRQ) | ||
95 | #define GPIO_MASK (1 << GPIO_IRQ) | ||
96 | #define SER0_MASK (1 << SER0_IRQ) | ||
97 | #define SER1_MASK (1 << SER1_IRQ) | ||
98 | |||
99 | #define TIMER1_VAL (*(volatile unsigned long *)(0xcf001104)) | ||
100 | #define TIMER1_CFG (*(volatile unsigned long *)(0xcf001100)) | ||
101 | #define USEC_TIMER (*(volatile unsigned long *)(0xcf001110)) | ||
102 | |||
103 | #endif | ||
diff --git a/firmware/export/system.h b/firmware/export/system.h index b5f4bbf2db..380c229f1d 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -29,7 +29,7 @@ extern void system_init(void); | |||
29 | 29 | ||
30 | extern long cpu_frequency; | 30 | extern long cpu_frequency; |
31 | 31 | ||
32 | #if CONFIG_CPU==PP5020 | 32 | #if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) |
33 | #define inl(a) (*(volatile unsigned long *) (a)) | 33 | #define inl(a) (*(volatile unsigned long *) (a)) |
34 | #define outl(a,b) (*(volatile unsigned long *) (b) = (a)) | 34 | #define outl(a,b) (*(volatile unsigned long *) (b) = (a)) |
35 | #define inb(a) (*(volatile unsigned char *) (a)) | 35 | #define inb(a) (*(volatile unsigned char *) (a)) |
@@ -40,8 +40,8 @@ extern unsigned int ipod_hw_rev; | |||
40 | 40 | ||
41 | static inline void udelay(unsigned usecs) | 41 | static inline void udelay(unsigned usecs) |
42 | { | 42 | { |
43 | unsigned start = inl(0x60005010); | 43 | unsigned start = USEC_TIMER; |
44 | while ((inl(0x60005010) - start) < usecs); | 44 | while ((USEC_TIMER - start) < usecs); |
45 | } | 45 | } |
46 | #endif | 46 | #endif |
47 | 47 | ||
diff --git a/firmware/export/wm8731l.h b/firmware/export/wm8731l.h new file mode 100644 index 0000000000..6ed845c714 --- /dev/null +++ b/firmware/export/wm8731l.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Dave Chapman | ||
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 _WM8731L_H | ||
21 | #define _WM8731L_H | ||
22 | |||
23 | extern void wm8731l_reset(void); | ||
24 | extern int wm8731l_init(void); | ||
25 | extern void wm8731l_enable_output(bool enable); | ||
26 | extern int wm8731l_set_master_vol(int vol_l, int vol_r); | ||
27 | extern int wm8731l_set_mixer_vol(int channel1, int channel2); | ||
28 | extern void wm8731l_set_bass(int value); | ||
29 | extern void wm8731l_set_treble(int value); | ||
30 | extern int wm8731l_mute(int mute); | ||
31 | extern void wm8731l_close(void); | ||
32 | extern void wm8731l_set_nsorder(int order); | ||
33 | extern void wm8731l_set_sample_rate(int sampling_control); | ||
34 | |||
35 | extern void wm8731l_enable_recording(bool source_mic); | ||
36 | extern void wm8731l_disable_recording(void); | ||
37 | extern void wm8731l_set_recvol(int left, int right, int type); | ||
38 | extern void wm8731l_set_monitor(int enable); | ||
39 | |||
40 | /* Register settings for the supported samplerates: */ | ||
41 | #define WM8731L_8000HZ 0x4d | ||
42 | /* | ||
43 | IpodLinux don't seem to support those sampling rate with the wm8731L chip | ||
44 | #define WM8975_16000HZ 0x55 | ||
45 | #define WM8975_22050HZ 0x77 | ||
46 | #define WM8975_24000HZ 0x79 | ||
47 | */ | ||
48 | #define WM8731L_32000HZ 0x59 | ||
49 | #define WM8731L_44100HZ 0x63 | ||
50 | #define WM8731L_48000HZ 0x41 | ||
51 | #define WM8731L_88200HZ 0x7f | ||
52 | #define WM8731L_96000HZ 0x5d | ||
53 | |||
54 | #endif /* _WM8975_H */ | ||