diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 6 | ||||
-rw-r--r-- | firmware/app.lds | 12 | ||||
-rw-r--r-- | firmware/backlight.c | 4 | ||||
-rw-r--r-- | firmware/crt0.S | 6 | ||||
-rw-r--r-- | firmware/drivers/adc.c | 34 | ||||
-rw-r--r-- | firmware/drivers/button.c | 50 | ||||
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 31 | ||||
-rw-r--r-- | firmware/drivers/power.c | 5 | ||||
-rw-r--r-- | firmware/drivers/serial.c | 3 | ||||
-rw-r--r-- | firmware/export/adc.h | 9 | ||||
-rw-r--r-- | firmware/export/button.h | 13 | ||||
-rw-r--r-- | firmware/export/config-ifp7xx.h | 96 | ||||
-rw-r--r-- | firmware/export/config.h | 12 | ||||
-rw-r--r-- | firmware/export/cpu.h | 3 | ||||
-rw-r--r-- | firmware/export/pnx0101.h | 67 | ||||
-rw-r--r-- | firmware/export/system.h | 18 | ||||
-rw-r--r-- | firmware/kernel.c | 35 | ||||
-rw-r--r-- | firmware/pcm_playback.c | 51 | ||||
-rw-r--r-- | firmware/system.c | 81 | ||||
-rw-r--r-- | firmware/thread.c | 2 | ||||
-rw-r--r-- | firmware/usb.c | 7 |
21 files changed, 532 insertions, 13 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 7f07598273..4fe5fc91f5 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -74,8 +74,12 @@ drivers/adc.c | |||
74 | #ifdef HAVE_MMC | 74 | #ifdef HAVE_MMC |
75 | drivers/ata_mmc.c | 75 | drivers/ata_mmc.c |
76 | #else | 76 | #else |
77 | #ifdef HAVE_FLASH_DISK | ||
78 | drivers/ata_flash.c | ||
79 | #else | ||
77 | drivers/ata.c | 80 | drivers/ata.c |
78 | #endif | 81 | #endif |
82 | #endif | ||
79 | drivers/button.c | 83 | drivers/button.c |
80 | drivers/dac.c | 84 | drivers/dac.c |
81 | drivers/fat.c | 85 | drivers/fat.c |
@@ -93,6 +97,8 @@ tuner_philips.c | |||
93 | drivers/i2c-coldfire.c | 97 | drivers/i2c-coldfire.c |
94 | #elif CONFIG_I2C == I2C_PP5020 | 98 | #elif CONFIG_I2C == I2C_PP5020 |
95 | drivers/i2c-pp5020.c | 99 | drivers/i2c-pp5020.c |
100 | #elif CONFIG_I2C == I2C_PNX0101 | ||
101 | drivers/i2c-pnx0101.c | ||
96 | #else | 102 | #else |
97 | drivers/i2c.c | 103 | drivers/i2c.c |
98 | #endif | 104 | #endif |
diff --git a/firmware/app.lds b/firmware/app.lds index e17e5a97b9..feff264d39 100644 --- a/firmware/app.lds +++ b/firmware/app.lds | |||
@@ -7,7 +7,7 @@ INPUT(crt0.o) | |||
7 | #elif CONFIG_CPU == TCC730 | 7 | #elif CONFIG_CPU == TCC730 |
8 | OUTPUT_FORMAT(elf32-calmrisc16) | 8 | OUTPUT_FORMAT(elf32-calmrisc16) |
9 | INPUT(crt0.o) | 9 | INPUT(crt0.o) |
10 | #elif CONFIG_CPU == PP5020 | 10 | #elif defined(CPU_ARM) |
11 | OUTPUT_FORMAT(elf32-littlearm) | 11 | OUTPUT_FORMAT(elf32-littlearm) |
12 | OUTPUT_ARCH(arm) | 12 | OUTPUT_ARCH(arm) |
13 | INPUT(crt0.o) | 13 | INPUT(crt0.o) |
@@ -126,6 +126,10 @@ _pluginbuf = 0; | |||
126 | #define DRAMORIG 0x00000000 + STUBOFFSET | 126 | #define DRAMORIG 0x00000000 + STUBOFFSET |
127 | #define IRAMORIG 0x40000000 | 127 | #define IRAMORIG 0x40000000 |
128 | #define IRAMSIZE 0xc000 | 128 | #define IRAMSIZE 0xc000 |
129 | #elif CONFIG_CPU==PNX0101 | ||
130 | #define DRAMORIG 0x24000000 + STUBOFFSET | ||
131 | #define IRAMORIG 0x400100 | ||
132 | #define IRAMSIZE 0x7f00 | ||
129 | #else | 133 | #else |
130 | #define DRAMORIG 0x09000000 + STUBOFFSET | 134 | #define DRAMORIG 0x09000000 + STUBOFFSET |
131 | #define IRAMORIG 0x0f000000 | 135 | #define IRAMORIG 0x0f000000 |
@@ -161,7 +165,7 @@ SECTIONS | |||
161 | . = ALIGN(0x200); | 165 | . = ALIGN(0x200); |
162 | *(.init.text) | 166 | *(.init.text) |
163 | *(.text*) | 167 | *(.text*) |
164 | #if CONFIG_CPU==PP5020 | 168 | #ifdef CPU_ARM |
165 | *(.glue_7) | 169 | *(.glue_7) |
166 | *(.glue_7t) | 170 | *(.glue_7t) |
167 | #endif | 171 | #endif |
@@ -214,7 +218,7 @@ SECTIONS | |||
214 | _iend = .; | 218 | _iend = .; |
215 | } > IRAM | 219 | } > IRAM |
216 | 220 | ||
217 | #if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020 | 221 | #if defined(CPU_COLDFIRE) || defined(CPU_ARM) |
218 | .stack : | 222 | .stack : |
219 | { | 223 | { |
220 | *(.stack) | 224 | *(.stack) |
@@ -234,7 +238,7 @@ SECTIONS | |||
234 | } > DRAM | 238 | } > DRAM |
235 | #endif | 239 | #endif |
236 | 240 | ||
237 | #if defined(CPU_COLDFIRE) || CONFIG_CPU==PP5020 | 241 | #if defined(CPU_COLDFIRE) || defined(CPU_ARM) |
238 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): | 242 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): |
239 | #else | 243 | #else |
240 | .bss : | 244 | .bss : |
diff --git a/firmware/backlight.c b/firmware/backlight.c index 740acd1d82..b475c61fc0 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -242,6 +242,8 @@ static void __backlight_on(void) | |||
242 | 242 | ||
243 | /* set port L07 on */ | 243 | /* set port L07 on */ |
244 | outl(((0x100 | 1) << 7), 0x6000d12c); | 244 | outl(((0x100 | 1) << 7), 0x6000d12c); |
245 | #elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX | ||
246 | GPIO3_SET = 1; | ||
245 | #endif | 247 | #endif |
246 | } | 248 | } |
247 | 249 | ||
@@ -279,6 +281,8 @@ static void __backlight_off(void) | |||
279 | 281 | ||
280 | /* set port L07 off */ | 282 | /* set port L07 off */ |
281 | outl(((0x100 | 0) << 7), 0x6000d12c); | 283 | outl(((0x100 | 0) << 7), 0x6000d12c); |
284 | #elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX | ||
285 | GPIO3_CLR = 1; | ||
282 | #endif | 286 | #endif |
283 | } | 287 | } |
284 | 288 | ||
diff --git a/firmware/crt0.S b/firmware/crt0.S index 0e75195530..1e07e0c029 100644 --- a/firmware/crt0.S +++ b/firmware/crt0.S | |||
@@ -37,6 +37,8 @@ start: | |||
37 | * | 37 | * |
38 | */ | 38 | */ |
39 | 39 | ||
40 | msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */ | ||
41 | |||
40 | #ifndef BOOTLOADER | 42 | #ifndef BOOTLOADER |
41 | #if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020 | 43 | #if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020 |
42 | b pad_skip | 44 | b pad_skip |
@@ -247,8 +249,8 @@ boot_table: | |||
247 | /* Set up stack for IRQ mode */ | 249 | /* Set up stack for IRQ mode */ |
248 | msr cpsr_c, #0xd2 | 250 | msr cpsr_c, #0xd2 |
249 | ldr sp, =irq_stack | 251 | ldr sp, =irq_stack |
250 | /* Switch to supervisor mode, enable IRQ and FIQ processing */ | 252 | /* Switch to supervisor mode */ |
251 | msr cpsr_c, #0x13 | 253 | msr cpsr_c, #0xd3 |
252 | ldr sp, =stackend | 254 | ldr sp, =stackend |
253 | bl main | 255 | bl main |
254 | /* main() should never return */ | 256 | /* main() should never return */ |
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c index c9ae2daca8..ad10017d85 100644 --- a/firmware/drivers/adc.c +++ b/firmware/drivers/adc.c | |||
@@ -294,4 +294,38 @@ void adc_init(void) | |||
294 | 294 | ||
295 | } | 295 | } |
296 | 296 | ||
297 | #elif CONFIG_CPU == PNX0101 | ||
298 | |||
299 | static unsigned short adcdata[NUM_ADC_CHANNELS]; | ||
300 | |||
301 | unsigned short adc_read(int channel) | ||
302 | { | ||
303 | return adcdata[channel]; | ||
304 | } | ||
305 | |||
306 | static void adc_tick(void) | ||
307 | { | ||
308 | if (ADCST & 0x10) { | ||
309 | adcdata[0] = ADCCH0 & 0x3ff; | ||
310 | adcdata[1] = ADCCH1 & 0x3ff; | ||
311 | adcdata[2] = ADCCH2 & 0x3ff; | ||
312 | adcdata[3] = ADCCH3 & 0x3ff; | ||
313 | adcdata[4] = ADCCH4 & 0x3ff; | ||
314 | ADCST = 0xa; | ||
315 | } | ||
316 | } | ||
317 | |||
318 | void adc_init(void) | ||
319 | { | ||
320 | ADCR24 = 0xaaaaa; | ||
321 | ADCR28 = 0; | ||
322 | ADCST = 2; | ||
323 | ADCST = 0xa; | ||
324 | |||
325 | while (!(ADCST & 0x10)); | ||
326 | adc_tick(); | ||
327 | |||
328 | tick_add_task(adc_tick); | ||
329 | } | ||
330 | |||
297 | #endif | 331 | #endif |
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 544cfec32e..0c17fce4c6 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -61,7 +61,7 @@ static bool flipped; /* buttons can be flipped to match the LCD flip */ | |||
61 | #define REPEAT_INTERVAL_FINISH 5 | 61 | #define REPEAT_INTERVAL_FINISH 5 |
62 | 62 | ||
63 | /* the power-off button and number of repeated keys before shutting off */ | 63 | /* the power-off button and number of repeated keys before shutting off */ |
64 | #if CONFIG_KEYPAD == IPOD_4G_PAD | 64 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) |
65 | #define POWEROFF_BUTTON BUTTON_PLAY | 65 | #define POWEROFF_BUTTON BUTTON_PLAY |
66 | #define POWEROFF_COUNT 40 | 66 | #define POWEROFF_COUNT 40 |
67 | #else | 67 | #else |
@@ -731,6 +731,47 @@ static int button_read(void) | |||
731 | if (!remote_hold_button && ((data & 0x40) == 0)) | 731 | if (!remote_hold_button && ((data & 0x40) == 0)) |
732 | btn |= BUTTON_RC_ON; | 732 | btn |= BUTTON_RC_ON; |
733 | 733 | ||
734 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
735 | |||
736 | static bool hold_button = false; | ||
737 | |||
738 | /* light handling */ | ||
739 | if (hold_button && !button_hold()) | ||
740 | { | ||
741 | backlight_on(); | ||
742 | } | ||
743 | hold_button = button_hold(); | ||
744 | |||
745 | /* normal buttons */ | ||
746 | if (!button_hold()) | ||
747 | { | ||
748 | data = adc_read(ADC_BUTTONS); | ||
749 | |||
750 | if (data < 0x151) | ||
751 | if (data < 0xc7) | ||
752 | if (data < 0x41) | ||
753 | btn = BUTTON_LEFT; | ||
754 | else | ||
755 | btn = BUTTON_RIGHT; | ||
756 | else | ||
757 | btn = BUTTON_SELECT; | ||
758 | else | ||
759 | if (data < 0x268) | ||
760 | if (data < 0x1d7) | ||
761 | btn = BUTTON_UP; | ||
762 | else | ||
763 | btn = BUTTON_DOWN; | ||
764 | else | ||
765 | if (data < 0x2f9) | ||
766 | btn = BUTTON_EQ; | ||
767 | else | ||
768 | if (data < 0x35c) | ||
769 | btn = BUTTON_MODE; | ||
770 | } | ||
771 | |||
772 | if (!button_hold() && (adc_read(ADC_BUTTON_PLAY) < 0x64)) | ||
773 | btn |= BUTTON_PLAY; | ||
774 | |||
734 | #elif CONFIG_KEYPAD == RECORDER_PAD | 775 | #elif CONFIG_KEYPAD == RECORDER_PAD |
735 | 776 | ||
736 | #ifdef HAVE_FMADC | 777 | #ifdef HAVE_FMADC |
@@ -877,6 +918,13 @@ bool remote_button_hold(void) | |||
877 | } | 918 | } |
878 | #endif | 919 | #endif |
879 | 920 | ||
921 | #if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
922 | bool button_hold(void) | ||
923 | { | ||
924 | return (GPIO5_READ & 4) ? false : true; | ||
925 | } | ||
926 | #endif | ||
927 | |||
880 | int button_status(void) | 928 | int button_status(void) |
881 | { | 929 | { |
882 | return lastbtn; | 930 | return lastbtn; |
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 081a7a5267..523e8a1c09 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -135,6 +135,24 @@ void lcd_write_data( const unsigned char* data, int count ) { | |||
135 | P2 |= 0x20; | 135 | P2 |= 0x20; |
136 | } | 136 | } |
137 | } | 137 | } |
138 | |||
139 | #elif CONFIG_CPU == PNX0101 | ||
140 | |||
141 | void lcd_write_command(int cmd) | ||
142 | { | ||
143 | while ((LCDSTAT & 3) != 3); | ||
144 | LCDCMD = cmd; | ||
145 | } | ||
146 | |||
147 | void lcd_write_data( const unsigned char* data, int count ) | ||
148 | { | ||
149 | int i; | ||
150 | for (i=0; i < count; i++) { | ||
151 | while ((LCDSTAT & 3) != 3); | ||
152 | LCDDATA = data[i]; | ||
153 | } | ||
154 | } | ||
155 | |||
138 | #endif | 156 | #endif |
139 | 157 | ||
140 | /*** hardware configuration ***/ | 158 | /*** hardware configuration ***/ |
@@ -145,6 +163,8 @@ int lcd_default_contrast(void) | |||
145 | return 30; | 163 | return 30; |
146 | #elif CONFIG_LCD == LCD_GMINI100 | 164 | #elif CONFIG_LCD == LCD_GMINI100 |
147 | return 31; | 165 | return 31; |
166 | #elif CONFIG_LCD == LCD_IFP7XX | ||
167 | return 45; | ||
148 | #else | 168 | #else |
149 | return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; | 169 | return (read_hw_mask() & LCD_CONTRAST_BIAS) ? 31 : 49; |
150 | #endif | 170 | #endif |
@@ -197,7 +217,11 @@ void lcd_set_flip(bool yesno) | |||
197 | { | 217 | { |
198 | lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01); | 218 | lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01); |
199 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); | 219 | lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08); |
220 | #if CONFIG_LCD == LCD_IFP7XX | ||
221 | xoffset = 4; | ||
222 | #else | ||
200 | xoffset = 0; | 223 | xoffset = 0; |
224 | #endif | ||
201 | } | 225 | } |
202 | #endif | 226 | #endif |
203 | } | 227 | } |
@@ -236,6 +260,9 @@ void lcd_init(void) | |||
236 | P2CONL |= 0x5a; | 260 | P2CONL |= 0x5a; |
237 | P2CONL &= 0x5b; | 261 | P2CONL &= 0x5b; |
238 | P2CONH |= 1; | 262 | P2CONH |= 1; |
263 | #elif CONFIG_CPU == PNX0101 | ||
264 | LCDREG10 = 0xf; | ||
265 | LCDREG04 = 0x4084; | ||
239 | #else | 266 | #else |
240 | /* Initialize PB0-3 as output pins */ | 267 | /* Initialize PB0-3 as output pins */ |
241 | PBCR2 &= 0xff00; /* MD = 00 */ | 268 | PBCR2 &= 0xff00; /* MD = 00 */ |
@@ -245,7 +272,11 @@ void lcd_init(void) | |||
245 | /* inits like the original firmware */ | 272 | /* inits like the original firmware */ |
246 | lcd_write_command(LCD_SOFTWARE_RESET); | 273 | lcd_write_command(LCD_SOFTWARE_RESET); |
247 | lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); | 274 | lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4); |
275 | #if CONFIG_LCD == LCD_IFP7XX | ||
276 | lcd_write_command(LCD_SET_LCD_BIAS); | ||
277 | #else | ||
248 | lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ | 278 | lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */ |
279 | #endif | ||
249 | lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7); | 280 | lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7); |
250 | /* power control register: op-amp=1, regulator=1, booster=1 */ | 281 | /* power control register: op-amp=1, regulator=1, booster=1 */ |
251 | lcd_write_command(LCD_SET_DISPLAY_ON); | 282 | lcd_write_command(LCD_SET_DISPLAY_ON); |
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index 141d985ee6..da97233e57 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c | |||
@@ -182,6 +182,8 @@ void ide_power_enable(bool on) | |||
182 | P1 |= 0x08; | 182 | P1 |= 0x08; |
183 | else | 183 | else |
184 | P1 &= ~0x08; | 184 | P1 &= ~0x08; |
185 | #elif CONFIG_CPU == PNX0101 | ||
186 | /* no ide controller */ | ||
185 | #else /* SH1 based archos */ | 187 | #else /* SH1 based archos */ |
186 | bool touched = false; | 188 | bool touched = false; |
187 | #ifdef NEEDS_ATA_POWER_ON | 189 | #ifdef NEEDS_ATA_POWER_ON |
@@ -266,6 +268,9 @@ void power_off(void) | |||
266 | /* We don't turn off the ipod, we put it in a deep sleep */ | 268 | /* We don't turn off the ipod, we put it in a deep sleep */ |
267 | pcf50605_standby_mode(); | 269 | pcf50605_standby_mode(); |
268 | #endif | 270 | #endif |
271 | #elif CONFIG_CPU == PNX0101 | ||
272 | GPIO1_CLR = 1 << 16; | ||
273 | GPIO2_SET = 1; | ||
269 | #elif defined(GMINI_ARCH) | 274 | #elif defined(GMINI_ARCH) |
270 | P1 &= ~1; | 275 | P1 &= ~1; |
271 | P1CON &= ~1; | 276 | P1CON &= ~1; |
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index 4c5c5a8172..27061c299b 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c | |||
@@ -27,8 +27,9 @@ | |||
27 | #include "lcd.h" | 27 | #include "lcd.h" |
28 | #include "serial.h" | 28 | #include "serial.h" |
29 | 29 | ||
30 | #if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020) | 30 | #if (CONFIG_CPU != MCF5249) && (CONFIG_CPU != TCC730) && (CONFIG_CPU != PP5020) && (CONFIG_CPU != PNX0101) |
31 | /* FIX: this doesn't work on iRiver or Gmini or iPod yet */ | 31 | /* FIX: this doesn't work on iRiver or Gmini or iPod yet */ |
32 | /* iFP7xx has no remote */ | ||
32 | 33 | ||
33 | #ifndef HAVE_MMC /* MMC takes serial port 1, so don't mess with it */ | 34 | #ifndef HAVE_MMC /* MMC takes serial port 1, so don't mess with it */ |
34 | 35 | ||
diff --git a/firmware/export/adc.h b/firmware/export/adc.h index 3ae9dae215..8364cdb012 100644 --- a/firmware/export/adc.h +++ b/firmware/export/adc.h | |||
@@ -29,6 +29,15 @@ | |||
29 | #define ADC_BATTERY 2 | 29 | #define ADC_BATTERY 2 |
30 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | 30 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ |
31 | 31 | ||
32 | #elif defined(IRIVER_IFP7XX) | ||
33 | |||
34 | #define NUM_ADC_CHANNELS 5 | ||
35 | |||
36 | #define ADC_BUTTONS 0 | ||
37 | #define ADC_BATTERY 1 | ||
38 | #define ADC_BUTTON_PLAY 2 | ||
39 | #define ADC_UNREG_POWER ADC_BATTERY /* For compatibility */ | ||
40 | |||
32 | #else | 41 | #else |
33 | 42 | ||
34 | #define NUM_ADC_CHANNELS 8 | 43 | #define NUM_ADC_CHANNELS 8 |
diff --git a/firmware/export/button.h b/firmware/export/button.h index 47912ef1df..7f50b1013c 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -45,6 +45,10 @@ bool button_hold(void); | |||
45 | bool remote_button_hold(void); | 45 | bool remote_button_hold(void); |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
49 | bool button_hold(void); | ||
50 | #endif | ||
51 | |||
48 | #define BUTTON_NONE 0x0000 | 52 | #define BUTTON_NONE 0x0000 |
49 | 53 | ||
50 | /* Shared button codes */ | 54 | /* Shared button codes */ |
@@ -159,6 +163,15 @@ bool remote_button_hold(void); | |||
159 | #define BUTTON_SCROLL_FWD 0x0010 | 163 | #define BUTTON_SCROLL_FWD 0x0010 |
160 | #define BUTTON_SCROLL_BACK 0x0020 | 164 | #define BUTTON_SCROLL_BACK 0x0020 |
161 | 165 | ||
166 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | ||
167 | |||
168 | #define BUTTON_PLAY 0x0001 | ||
169 | #define BUTTON_EQ 0x0002 | ||
170 | #define BUTTON_MODE 0x0004 | ||
171 | #define BUTTON_UP 0x0010 | ||
172 | #define BUTTON_DOWN 0x0020 | ||
173 | #define BUTTON_SELECT 0x0100 | ||
174 | |||
162 | #endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ | 175 | #endif /* RECORDER/PLAYER/ONDIO/GMINI KEYPAD */ |
163 | 176 | ||
164 | #endif /* _BUTTON_H_ */ | 177 | #endif /* _BUTTON_H_ */ |
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h new file mode 100644 index 0000000000..086b455235 --- /dev/null +++ b/firmware/export/config-ifp7xx.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * This config file is for iriver iFP-799 | ||
3 | */ | ||
4 | #define IRIVER_IFP7XX_SERIES 1 | ||
5 | |||
6 | /* For Rolo and boot loader */ | ||
7 | #define MODEL_NUMBER 6 | ||
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 | /* define this if you have a colour LCD */ | ||
16 | /* #define HAVE_LCD_COLOR 1 */ | ||
17 | |||
18 | /* LCD dimensions */ | ||
19 | #define LCD_WIDTH 128 | ||
20 | #define LCD_HEIGHT 64 | ||
21 | #define LCD_DEPTH 1 | ||
22 | |||
23 | #define CONFIG_KEYPAD IRIVER_IFP7XX_PAD | ||
24 | |||
25 | #define CONFIG_FLASH FLASH_IFP7XX | ||
26 | |||
27 | #define HAVE_FAT16SUPPORT | ||
28 | |||
29 | /* Define this if you do software codec */ | ||
30 | #define CONFIG_CODEC SWCODEC | ||
31 | |||
32 | /* Define this if you have a software controlled poweroff */ | ||
33 | #define HAVE_SW_POWEROFF | ||
34 | |||
35 | /* The number of bytes reserved for loadable codecs */ | ||
36 | #define CODEC_SIZE 0x30000 | ||
37 | |||
38 | /* The number of bytes reserved for loadable plugins */ | ||
39 | #define PLUGIN_BUFFER_SIZE 0x20000 | ||
40 | |||
41 | /* Define this if you have the WM8975 audio codec */ | ||
42 | /* #define HAVE_WM8975 */ | ||
43 | |||
44 | #define HAVE_FLASH_DISK | ||
45 | |||
46 | #ifndef SIMULATOR | ||
47 | |||
48 | /* Define this if you have a Philips PNX0101 */ | ||
49 | #define CONFIG_CPU PNX0101 | ||
50 | |||
51 | /* Define this if you want to use the PNX0101 i2c interface */ | ||
52 | #define CONFIG_I2C I2C_PNX0101 | ||
53 | |||
54 | /* Type of mobile power */ | ||
55 | //#define CONFIG_BATTERY BATT_LIPOL1300 | ||
56 | |||
57 | #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ | ||
58 | |||
59 | /* Define this if the platform can charge batteries */ | ||
60 | //#define HAVE_CHARGING 1 | ||
61 | |||
62 | /* define this if the hardware can be powered off while charging */ | ||
63 | //#define HAVE_POWEROFF_WHILE_CHARGING | ||
64 | |||
65 | /* The start address index for ROM builds */ | ||
66 | #define ROM_START 0x00000000 | ||
67 | |||
68 | /* Define this for LCD backlight available */ | ||
69 | #define CONFIG_BACKLIGHT BL_IRIVER_IFP7XX /* port controlled */ | ||
70 | |||
71 | /* Define this to the CPU frequency */ | ||
72 | #define CPU_FREQ 30000000 | ||
73 | |||
74 | #define CONFIG_LCD LCD_IFP7XX | ||
75 | |||
76 | /* Offset ( in the firmware file's header ) to the file length */ | ||
77 | #define FIRMWARE_OFFSET_FILE_LENGTH 0 | ||
78 | |||
79 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
80 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
81 | |||
82 | /* Offset ( in the firmware file's header ) to the real data */ | ||
83 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
84 | |||
85 | #define USB_ISP1582 | ||
86 | |||
87 | /* Virtual LED (icon) */ | ||
88 | #define CONFIG_LED LED_VIRTUAL | ||
89 | |||
90 | /* Define this if you have adjustable CPU frequency */ | ||
91 | //#define HAVE_ADJUSTABLE_CPU_FREQ | ||
92 | |||
93 | #define BOOTFILE_EXT "iriver" | ||
94 | #define BOOTFILE "rockbox." BOOTFILE_EXT | ||
95 | |||
96 | #endif | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 3f563ca9df..5e3bbeb645 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #define TCC730 730 /* lacking a proper abbrivation */ | 41 | #define TCC730 730 /* lacking a proper abbrivation */ |
42 | #define PP5002 5002 | 42 | #define PP5002 5002 |
43 | #define PP5020 5020 | 43 | #define PP5020 5020 |
44 | #define PNX0101 101 | ||
44 | 45 | ||
45 | /* CONFIG_KEYPAD */ | 46 | /* CONFIG_KEYPAD */ |
46 | #define PLAYER_PAD 0 | 47 | #define PLAYER_PAD 0 |
@@ -51,6 +52,7 @@ | |||
51 | #define IRIVER_H300_PAD 5 | 52 | #define IRIVER_H300_PAD 5 |
52 | #define IAUDIO_X5_PAD 6 | 53 | #define IAUDIO_X5_PAD 6 |
53 | #define IPOD_4G_PAD 7 | 54 | #define IPOD_4G_PAD 7 |
55 | #define IRIVER_IFP7XX_PAD 8 | ||
54 | 56 | ||
55 | /* CONFIG_REMOTE_KEYPAD */ | 57 | /* CONFIG_REMOTE_KEYPAD */ |
56 | #define H100_REMOTE 1 | 58 | #define H100_REMOTE 1 |
@@ -75,6 +77,7 @@ | |||
75 | #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ | 77 | #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ |
76 | #define LCD_IPODNANO 7 /* as used by iPod Nano */ | 78 | #define LCD_IPODNANO 7 /* as used by iPod Nano */ |
77 | #define LCD_IPODVIDEO 8 /* as used by iPod Video */ | 79 | #define LCD_IPODVIDEO 8 /* as used by iPod Video */ |
80 | #define LCD_IFP7XX 9 /* as used by iRiver iFP 7xx/8xx */ | ||
78 | 81 | ||
79 | /* LCD_PIXELFORMAT */ | 82 | /* LCD_PIXELFORMAT */ |
80 | #define RGB565 565 | 83 | #define RGB565 565 |
@@ -89,6 +92,7 @@ | |||
89 | #define BL_IPOD4G 5 /* Apple iPod 4G */ | 92 | #define BL_IPOD4G 5 /* Apple iPod 4G */ |
90 | #define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ | 93 | #define BL_IPODNANO 6 /* Apple iPod Nano and iPod Video*/ |
91 | #define BL_IRIVER_H300 7 /* IRiver PWM */ | 94 | #define BL_IRIVER_H300 7 /* IRiver PWM */ |
95 | #define BL_IRIVER_IFP7XX 8 /* IRiver GPIO */ | ||
92 | 96 | ||
93 | /* CONFIG_I2C */ | 97 | /* CONFIG_I2C */ |
94 | #define I2C_PLAYREC 0 /* Archos Player/Recorder style */ | 98 | #define I2C_PLAYREC 0 /* Archos Player/Recorder style */ |
@@ -96,11 +100,15 @@ | |||
96 | #define I2C_GMINI 2 /* Gmini style */ | 100 | #define I2C_GMINI 2 /* Gmini style */ |
97 | #define I2C_COLDFIRE 3 /* Coldfire style */ | 101 | #define I2C_COLDFIRE 3 /* Coldfire style */ |
98 | #define I2C_PP5020 4 /* PP5020 style */ | 102 | #define I2C_PP5020 4 /* PP5020 style */ |
103 | #define I2C_PNX0101 5 /* PNX0101 style */ | ||
99 | 104 | ||
100 | /* CONFIG_LED */ | 105 | /* CONFIG_LED */ |
101 | #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ | 106 | #define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */ |
102 | #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ | 107 | #define LED_VIRTUAL 2 /* Virtual LED (icon) (Archos Ondio) */ |
103 | 108 | ||
109 | /* CONFIG_FLASH */ | ||
110 | #define FLASH_IFP7XX 1 | ||
111 | |||
104 | /* CONFIG_RTC */ | 112 | /* CONFIG_RTC */ |
105 | #define RTC_M41ST84W 1 /* Archos Recorder */ | 113 | #define RTC_M41ST84W 1 /* Archos Recorder */ |
106 | #define RTC_PCF50605 2 /* iPod 4G */ | 114 | #define RTC_PCF50605 2 /* iPod 4G */ |
@@ -139,6 +147,8 @@ | |||
139 | #include "config-ipodnano.h" | 147 | #include "config-ipodnano.h" |
140 | #elif defined(IPOD_VIDEO) | 148 | #elif defined(IPOD_VIDEO) |
141 | #include "config-ipodvideo.h" | 149 | #include "config-ipodvideo.h" |
150 | #elif defined(IRIVER_IFP7XX) | ||
151 | #include "config-ifp7xx.h" | ||
142 | #else | 152 | #else |
143 | /* no known platform */ | 153 | /* no known platform */ |
144 | #endif | 154 | #endif |
@@ -156,7 +166,7 @@ | |||
156 | #endif | 166 | #endif |
157 | 167 | ||
158 | /* define for all cpus from ARM family */ | 168 | /* define for all cpus from ARM family */ |
159 | #if (CONFIG_CPU == PP5020) | 169 | #if (CONFIG_CPU == PP5020) || (CONFIG_CPU == PNX0101) |
160 | #define CPU_ARM | 170 | #define CPU_ARM |
161 | #endif | 171 | #endif |
162 | 172 | ||
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h index a65786c69f..1ced9fce5e 100644 --- a/firmware/export/cpu.h +++ b/firmware/export/cpu.h | |||
@@ -33,3 +33,6 @@ | |||
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 == PNX0101 | ||
37 | #include "pnx0101.h" | ||
38 | #endif | ||
diff --git a/firmware/export/pnx0101.h b/firmware/export/pnx0101.h new file mode 100644 index 0000000000..4408c0aa5b --- /dev/null +++ b/firmware/export/pnx0101.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Tomasz Malesinski | ||
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 __PNX0101_H__ | ||
21 | #define __PNX0101_H__ | ||
22 | |||
23 | #define GPIO0_READ (*(volatile unsigned long *)0x80003000) | ||
24 | #define GPIO0_SET (*(volatile unsigned long *)0x80003014) | ||
25 | #define GPIO0_CLR (*(volatile unsigned long *)0x80003018) | ||
26 | #define GPIO1_READ (*(volatile unsigned long *)0x80003040) | ||
27 | #define GPIO1_SET (*(volatile unsigned long *)0x80003054) | ||
28 | #define GPIO1_CLR (*(volatile unsigned long *)0x80003058) | ||
29 | #define GPIO2_READ (*(volatile unsigned long *)0x80003080) | ||
30 | #define GPIO2_SET (*(volatile unsigned long *)0x80003094) | ||
31 | #define GPIO2_CLR (*(volatile unsigned long *)0x80003098) | ||
32 | #define GPIO3_READ (*(volatile unsigned long *)0x800030c0) | ||
33 | #define GPIO3_SET (*(volatile unsigned long *)0x800030d4) | ||
34 | #define GPIO3_CLR (*(volatile unsigned long *)0x800030d8) | ||
35 | #define GPIO4_READ (*(volatile unsigned long *)0x80003100) | ||
36 | #define GPIO4_SET (*(volatile unsigned long *)0x80003114) | ||
37 | #define GPIO4_CLR (*(volatile unsigned long *)0x80003118) | ||
38 | #define GPIO5_READ (*(volatile unsigned long *)0x80003140) | ||
39 | #define GPIO5_SET (*(volatile unsigned long *)0x80003154) | ||
40 | #define GPIO5_CLR (*(volatile unsigned long *)0x80003158) | ||
41 | #define GPIO6_READ (*(volatile unsigned long *)0x80003180) | ||
42 | #define GPIO6_SET (*(volatile unsigned long *)0x80003194) | ||
43 | #define GPIO6_CLR (*(volatile unsigned long *)0x80003198) | ||
44 | #define GPIO7_READ (*(volatile unsigned long *)0x800031c0) | ||
45 | #define GPIO7_SET (*(volatile unsigned long *)0x800031d4) | ||
46 | #define GPIO7_CLR (*(volatile unsigned long *)0x800031d8) | ||
47 | |||
48 | #define LCDREG04 (*(volatile unsigned long *)0x80104004) | ||
49 | #define LCDSTAT (*(volatile unsigned long *)0x80104008) | ||
50 | #define LCDREG10 (*(volatile unsigned long *)0x80104010) | ||
51 | #define LCDCMD (*(volatile unsigned long *)0x80104020) | ||
52 | #define LCDDATA (*(volatile unsigned long *)0x80104030) | ||
53 | |||
54 | #define TIMERR00 (*(volatile unsigned long *)0x80020000) | ||
55 | #define TIMERR08 (*(volatile unsigned long *)0x80020008) | ||
56 | #define TIMERR0C (*(volatile unsigned long *)0x8002000c) | ||
57 | |||
58 | #define ADCCH0 (*(volatile unsigned long *)0x80002400) | ||
59 | #define ADCCH1 (*(volatile unsigned long *)0x80002404) | ||
60 | #define ADCCH2 (*(volatile unsigned long *)0x80002408) | ||
61 | #define ADCCH3 (*(volatile unsigned long *)0x8000240c) | ||
62 | #define ADCCH4 (*(volatile unsigned long *)0x80002410) | ||
63 | #define ADCST (*(volatile unsigned long *)0x80002420) | ||
64 | #define ADCR24 (*(volatile unsigned long *)0x80002424) | ||
65 | #define ADCR28 (*(volatile unsigned long *)0x80002428) | ||
66 | |||
67 | #endif | ||
diff --git a/firmware/export/system.h b/firmware/export/system.h index d197b06547..50cbaee686 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -299,7 +299,7 @@ static inline void invalidate_icache(void) | |||
299 | #define CPUFREQ_MAX_MULT 11 | 299 | #define CPUFREQ_MAX_MULT 11 |
300 | #define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ) | 300 | #define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ) |
301 | 301 | ||
302 | #elif CONFIG_CPU == PP5020 | 302 | #elif defined(CPU_ARM) |
303 | 303 | ||
304 | /* TODO: Implement set_irq_level and check CPU frequencies */ | 304 | /* TODO: Implement set_irq_level and check CPU frequencies */ |
305 | 305 | ||
@@ -330,14 +330,26 @@ static inline unsigned long swap32(unsigned long value) | |||
330 | } | 330 | } |
331 | 331 | ||
332 | #define HIGHEST_IRQ_LEVEL (1) | 332 | #define HIGHEST_IRQ_LEVEL (1) |
333 | |||
333 | static inline int set_irq_level(int level) | 334 | static inline int set_irq_level(int level) |
334 | { | 335 | { |
335 | int result=level; | 336 | unsigned long cpsr; |
336 | return result; | 337 | /* Read the old level and set the new one */ |
338 | asm volatile ("mrs %0,cpsr" : "=r" (cpsr)); | ||
339 | asm volatile ("msr cpsr_c,%0" | ||
340 | : : "r" ((cpsr & ~0x80) | (level << 7))); | ||
341 | return (cpsr >> 7) & 1; | ||
337 | } | 342 | } |
338 | 343 | ||
339 | #define invalidate_icache() | 344 | #define invalidate_icache() |
340 | 345 | ||
346 | #if CONFIG_CPU == PNX0101 | ||
347 | typedef void (*interrupt_handler_t)(void); | ||
348 | |||
349 | void irq_set_int_handler(int n, interrupt_handler_t handler); | ||
350 | void irq_enable_int(int n); | ||
351 | #endif | ||
352 | |||
341 | #elif CONFIG_CPU == TCC730 | 353 | #elif CONFIG_CPU == TCC730 |
342 | 354 | ||
343 | extern int smsc_version(void); | 355 | extern int smsc_version(void); |
diff --git a/firmware/kernel.c b/firmware/kernel.c index a353c4bdc9..b30a3bb12b 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -358,6 +358,41 @@ void tick_start(unsigned int interval_in_ms) | |||
358 | #endif | 358 | #endif |
359 | } | 359 | } |
360 | 360 | ||
361 | #elif CONFIG_CPU == PNX0101 | ||
362 | |||
363 | void timer_handler(void) | ||
364 | { | ||
365 | int i; | ||
366 | |||
367 | /* Run through the list of tick tasks */ | ||
368 | for(i = 0;i < MAX_NUM_TICK_TASKS;i++) | ||
369 | { | ||
370 | if(tick_funcs[i]) | ||
371 | tick_funcs[i](); | ||
372 | } | ||
373 | |||
374 | current_tick++; | ||
375 | wake_up_thread(); | ||
376 | |||
377 | TIMERR0C = 1; | ||
378 | } | ||
379 | |||
380 | void tick_start(unsigned int interval_in_ms) | ||
381 | { | ||
382 | TIMERR08 &= ~0x80; | ||
383 | TIMERR0C = 1; | ||
384 | TIMERR08 &= ~0x80; | ||
385 | TIMERR08 |= 0x40; | ||
386 | TIMERR00 = 3000000 * interval_in_ms / 1000; | ||
387 | TIMERR08 &= ~0xc; | ||
388 | TIMERR0C = 1; | ||
389 | |||
390 | irq_set_int_handler(4, timer_handler); | ||
391 | irq_enable_int(4); | ||
392 | |||
393 | TIMERR08 |= 0x80; | ||
394 | } | ||
395 | |||
361 | #endif | 396 | #endif |
362 | 397 | ||
363 | int tick_add_task(void (*f)(void)) | 398 | int tick_add_task(void (*f)(void)) |
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index 5e16353b85..62a48b5855 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c | |||
@@ -487,4 +487,55 @@ long pcm_get_bytes_waiting(void) | |||
487 | return 0; | 487 | return 0; |
488 | } | 488 | } |
489 | 489 | ||
490 | #elif CONFIG_CPU == PNX0101 | ||
491 | |||
492 | /* TODO: Implement for iFP7xx | ||
493 | For now, just implement some dummy functions. | ||
494 | */ | ||
495 | |||
496 | void pcm_init(void) | ||
497 | { | ||
498 | |||
499 | } | ||
500 | |||
501 | void pcm_set_frequency(unsigned int frequency) | ||
502 | { | ||
503 | (void)frequency; | ||
504 | } | ||
505 | |||
506 | void pcm_play_data(void (*get_more)(unsigned char** start, long* size)) | ||
507 | { | ||
508 | (void)get_more; | ||
509 | } | ||
510 | |||
511 | void pcm_play_stop(void) | ||
512 | { | ||
513 | } | ||
514 | |||
515 | void pcm_play_pause(bool play) | ||
516 | { | ||
517 | (void)play; | ||
518 | } | ||
519 | |||
520 | bool pcm_is_paused(void) | ||
521 | { | ||
522 | return false; | ||
523 | } | ||
524 | |||
525 | bool pcm_is_playing(void) | ||
526 | { | ||
527 | return false; | ||
528 | } | ||
529 | |||
530 | void pcm_calculate_peaks(int *left, int *right) | ||
531 | { | ||
532 | (void)left; | ||
533 | (void)right; | ||
534 | } | ||
535 | |||
536 | long pcm_get_bytes_waiting(void) | ||
537 | { | ||
538 | return 0; | ||
539 | } | ||
540 | |||
490 | #endif | 541 | #endif |
diff --git a/firmware/system.c b/firmware/system.c index 7afa3f720e..da15ee1122 100644 --- a/firmware/system.c +++ b/firmware/system.c | |||
@@ -1191,5 +1191,86 @@ int system_memory_guard(int newmode) | |||
1191 | return 0; | 1191 | return 0; |
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | #elif CONFIG_CPU==PNX0101 | ||
1195 | |||
1196 | interrupt_handler_t interrupt_vector[0x1d] __attribute__ ((section(".idata"))); | ||
1197 | |||
1198 | #define IRQ_REG(reg) (*(volatile unsigned long *)(0x80300000 + (reg))) | ||
1199 | |||
1200 | static inline unsigned long irq_read(int reg) | ||
1201 | { | ||
1202 | unsigned long v, v2; | ||
1203 | do | ||
1204 | { | ||
1205 | v = IRQ_REG(reg); | ||
1206 | v2 = IRQ_REG(reg); | ||
1207 | } while (v != v2); | ||
1208 | return v; | ||
1209 | } | ||
1210 | |||
1211 | #define IRQ_WRITE_WAIT(reg, val, cond) \ | ||
1212 | do { unsigned long v, v2; \ | ||
1213 | do { \ | ||
1214 | IRQ_REG(reg) = (val); \ | ||
1215 | v = IRQ_REG(reg); \ | ||
1216 | v2 = IRQ_REG(reg); \ | ||
1217 | } while ((v != v2) || !(cond)); \ | ||
1218 | } while (0); | ||
1219 | |||
1220 | static void UIE(void) {} | ||
1221 | |||
1222 | void irq(void) | ||
1223 | { | ||
1224 | int n = irq_read(0x100) >> 3; | ||
1225 | (*(interrupt_vector[n]))(); | ||
1226 | } | ||
1227 | |||
1228 | void irq_enable_int(int n) | ||
1229 | { | ||
1230 | IRQ_WRITE_WAIT(0x404 + n * 4, 0x4010000, v & 0x10000); | ||
1231 | } | ||
1232 | |||
1233 | void irq_set_int_handler(int n, interrupt_handler_t handler) | ||
1234 | { | ||
1235 | interrupt_vector[n + 1] = handler; | ||
1236 | } | ||
1237 | |||
1238 | void system_init(void) | ||
1239 | { | ||
1240 | int i; | ||
1241 | |||
1242 | /* turn off watchdog */ | ||
1243 | (*(volatile unsigned long *)0x80002804) = 0; | ||
1244 | |||
1245 | /* | ||
1246 | IRQ_WRITE_WAIT(0x100, 0, v == 0); | ||
1247 | IRQ_WRITE_WAIT(0x104, 0, v == 0); | ||
1248 | IRQ_WRITE_WAIT(0, 0, v == 0); | ||
1249 | IRQ_WRITE_WAIT(4, 0, v == 0); | ||
1250 | */ | ||
1251 | |||
1252 | for (i = 0; i < 0x1c; i++) | ||
1253 | { | ||
1254 | IRQ_WRITE_WAIT(0x404 + i * 4, 0x1e000001, (v & 0x3010f) == 1); | ||
1255 | IRQ_WRITE_WAIT(0x404 + i * 4, 0x4000000, (v & 0x10000) == 0); | ||
1256 | IRQ_WRITE_WAIT(0x404 + i * 4, 0x10000001, (v & 0xf) == 1); | ||
1257 | interrupt_vector[i + 1] = UIE; | ||
1258 | } | ||
1259 | interrupt_vector[0] = UIE; | ||
1260 | } | ||
1261 | |||
1262 | |||
1263 | void system_reboot(void) | ||
1264 | { | ||
1265 | (*(volatile unsigned long *)0x80002804) = 1; | ||
1266 | while (1); | ||
1267 | } | ||
1268 | |||
1269 | int system_memory_guard(int newmode) | ||
1270 | { | ||
1271 | (void)newmode; | ||
1272 | return 0; | ||
1273 | } | ||
1274 | |||
1194 | #endif /* CONFIG_CPU */ | 1275 | #endif /* CONFIG_CPU */ |
1195 | 1276 | ||
diff --git a/firmware/thread.c b/firmware/thread.c index 13577e8efb..281801418f 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -326,7 +326,7 @@ int create_thread(void (*function)(void), void* stack, int stack_size, | |||
326 | thread_stack[num_threads] = stack; | 326 | thread_stack[num_threads] = stack; |
327 | thread_stack_size[num_threads] = stack_size; | 327 | thread_stack_size[num_threads] = stack_size; |
328 | regs = &thread_contexts[num_threads]; | 328 | regs = &thread_contexts[num_threads]; |
329 | #if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || (CONFIG_CPU == PP5020) | 329 | #if defined(CPU_COLDFIRE) || (CONFIG_CPU == SH7034) || defined(CPU_ARM) |
330 | /* Align stack to an even 32 bit boundary */ | 330 | /* Align stack to an even 32 bit boundary */ |
331 | regs->sp = (void*)(((unsigned int)stack + stack_size) & ~3); | 331 | regs->sp = (void*)(((unsigned int)stack + stack_size) & ~3); |
332 | #elif CONFIG_CPU == TCC730 | 332 | #elif CONFIG_CPU == TCC730 |
diff --git a/firmware/usb.c b/firmware/usb.c index 98f224f781..bd2fde3ab8 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -180,6 +180,9 @@ void usb_enable(bool on) | |||
180 | outl(1, 0x40017F10); | 180 | outl(1, 0x40017F10); |
181 | outl(inl(0x60006004) | 0x4, 0x60006004); | 181 | outl(inl(0x60006004) | 0x4, 0x60006004); |
182 | } | 182 | } |
183 | #elif defined(USB_ISP1582) | ||
184 | /* TODO: Implement USB_ISP1582 */ | ||
185 | (void) on; | ||
183 | #else | 186 | #else |
184 | #ifdef HAVE_LCD_BITMAP | 187 | #ifdef HAVE_LCD_BITMAP |
185 | if(read_hw_mask() & USB_ACTIVE_HIGH) | 188 | if(read_hw_mask() & USB_ACTIVE_HIGH) |
@@ -404,6 +407,10 @@ bool usb_detect(void) | |||
404 | } | 407 | } |
405 | current_status = (USB_STATUS & 0x800)?true:false; | 408 | current_status = (USB_STATUS & 0x800)?true:false; |
406 | #endif | 409 | #endif |
410 | #ifdef USB_ISP1582 | ||
411 | /* TODO: Implement USB_ISP1582 */ | ||
412 | current_status = false; | ||
413 | #endif | ||
407 | return current_status; | 414 | return current_status; |
408 | } | 415 | } |
409 | 416 | ||