summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-02-05 17:34:49 +0000
committerDave Chapman <dave@dchapman.com>2006-02-05 17:34:49 +0000
commit987879b958f87a9af7ef9edcf6ae417fe56db788 (patch)
tree5de31eff771b81440b833f4b9d5b0a3b382afe0f
parent465596b1639393ef320decced442537133ab09e8 (diff)
downloadrockbox-987879b958f87a9af7ef9edcf6ae417fe56db788.tar.gz
rockbox-987879b958f87a9af7ef9edcf6ae417fe56db788.zip
Further iPod 3G work from Seven Le Mesle
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8583 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES16
-rw-r--r--firmware/app.lds2
-rw-r--r--firmware/backlight.c4
-rw-r--r--firmware/boot.lds12
-rw-r--r--firmware/kernel.c4
-rw-r--r--firmware/pcm_playback.c144
-rw-r--r--firmware/rolo.c6
-rw-r--r--firmware/system.c92
-rw-r--r--firmware/timer.c6
-rw-r--r--firmware/usb.c4
10 files changed, 270 insertions, 20 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index b70ee7f118..ce7be4fe7a 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -50,15 +50,17 @@ drivers/lcd-player.c
50#ifdef HAVE_LCD_BITMAP 50#ifdef HAVE_LCD_BITMAP
51arabjoin.c 51arabjoin.c
52bidi.c 52bidi.c
53#if LCD_DEPTH == 2 53#if LCD_DEPTH == 1
54drivers/lcd-h100.c
55#elif LCD_DEPTH == 1
56drivers/lcd-recorder.c 54drivers/lcd-recorder.c
55#elif CONFIG_LCD==LCD_IPOD2BPP
56drivers/lcd-2bit-horz.c
57#elif LCD_DEPTH == 2
58drivers/lcd-h100.c
57#elif LCD_DEPTH == 16 59#elif LCD_DEPTH == 16
58drivers/lcd-16bit.c 60drivers/lcd-16bit.c
59#endif 61#endif
60#endif 62#endif
61#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR 63#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR || CONFIG_LCD == LCD_IPOD2BPP
62drivers/lcd-ipod.c 64drivers/lcd-ipod.c
63#endif 65#endif
64#if CONFIG_LCD==LCD_IPODVIDEO 66#if CONFIG_LCD==LCD_IPODVIDEO
@@ -97,6 +99,8 @@ tuner_philips.c
97drivers/i2c-coldfire.c 99drivers/i2c-coldfire.c
98#elif CONFIG_I2C == I2C_PP5020 100#elif CONFIG_I2C == I2C_PP5020
99drivers/i2c-pp5020.c 101drivers/i2c-pp5020.c
102#elif CONFIG_I2C == I2C_PP5002
103drivers/i2c-pp5002.c
100#elif CONFIG_I2C == I2C_PNX0101 104#elif CONFIG_I2C == I2C_PNX0101
101drivers/i2c-pnx0101.c 105drivers/i2c-pnx0101.c
102#else 106#else
@@ -108,7 +112,7 @@ drivers/mas.c
108#ifdef IRIVER_H300_SERIES 112#ifdef IRIVER_H300_SERIES
109drivers/pcf50606.c 113drivers/pcf50606.c
110#endif 114#endif
111#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO) 115#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO) || defined(APPLE_IPOD3G)
112drivers/pcf50605.c 116drivers/pcf50605.c
113#endif 117#endif
114#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606) 118#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606)
@@ -157,6 +161,8 @@ drivers/lcd-h100-remote.c
157drivers/uda1380.c 161drivers/uda1380.c
158#elif defined(HAVE_WM8975) && !defined(SIMULATOR) 162#elif defined(HAVE_WM8975) && !defined(SIMULATOR)
159drivers/wm8975.c 163drivers/wm8975.c
164#elif defined(HAVE_WM8731L) && !defined(SIMULATOR)
165drivers/wm8731l.c
160#elif defined(HAVE_TLV320) && !defined(SIMULATOR) 166#elif defined(HAVE_TLV320) && !defined(SIMULATOR)
161drivers/tlv320.c 167drivers/tlv320.c
162#endif 168#endif
diff --git a/firmware/app.lds b/firmware/app.lds
index d49949930d..e796f4a05b 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -122,7 +122,7 @@ _pluginbuf = 0;
122#define DRAMORIG 0x31000000 + STUBOFFSET 122#define DRAMORIG 0x31000000 + STUBOFFSET
123#define IRAMORIG 0x10000000 123#define IRAMORIG 0x10000000
124#define IRAMSIZE 0xc000 124#define IRAMSIZE 0xc000
125#elif CONFIG_CPU==PP5020 125#elif (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
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
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 5e79e4e479..daf987791d 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_IPOD3G
246 lcd_enable(true);
245#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX 247#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
246 GPIO3_SET = 1; 248 GPIO3_SET = 1;
247#endif 249#endif
@@ -283,6 +285,8 @@ static void __backlight_off(void)
283 outl(((0x100 | 0) << 7), 0x6000d12c); 285 outl(((0x100 | 0) << 7), 0x6000d12c);
284#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX 286#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
285 GPIO3_CLR = 1; 287 GPIO3_CLR = 1;
288#elif CONFIG_BACKLIGHT==BL_IPOD3G
289 lcd_enable(false);
286#endif 290#endif
287} 291}
288 292
diff --git a/firmware/boot.lds b/firmware/boot.lds
index f38f3c6a3a..fc0d2c82c2 100644
--- a/firmware/boot.lds
+++ b/firmware/boot.lds
@@ -4,7 +4,7 @@ ENTRY(start)
4#ifdef CPU_COLDFIRE 4#ifdef CPU_COLDFIRE
5OUTPUT_FORMAT(elf32-m68k) 5OUTPUT_FORMAT(elf32-m68k)
6INPUT(crt0.o) 6INPUT(crt0.o)
7#elif CONFIG_CPU == PP5020 7#elif defined (CPU_ARM)
8OUTPUT_FORMAT(elf32-littlearm) 8OUTPUT_FORMAT(elf32-littlearm)
9OUTPUT_ARCH(arm) 9OUTPUT_ARCH(arm)
10#else 10#else
@@ -38,6 +38,12 @@ INPUT(crt0.o)
38#define IRAMSIZE 0x18000 38#define IRAMSIZE 0x18000
39#define FLASHORIG 0x001f0000 39#define FLASHORIG 0x001f0000
40#define FLASHSIZE 2M 40#define FLASHSIZE 2M
41#elif CONFIG_CPU == PP5002
42#define DRAMORIG 0x28000000
43#define IRAMORIG 0x40000000
44#define IRAMSIZE 0x18000
45#define FLASHORIG 0x001f0000
46#define FLASHSIZE 2M
41#else 47#else
42#define DRAMORIG 0x09000000 48#define DRAMORIG 0x09000000
43#define IRAMORIG 0x0f000000 49#define IRAMORIG 0x0f000000
@@ -46,7 +52,7 @@ INPUT(crt0.o)
46#define FLASHSIZE 256K - ROM_START 52#define FLASHSIZE 256K - ROM_START
47#endif 53#endif
48 54
49#if CONFIG_CPU!=PP5020 55#if (CONFIG_CPU!=PP5002) && (CONFIG_CPU!=PP5002)
50MEMORY 56MEMORY
51{ 57{
52 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE 58 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
@@ -56,7 +62,7 @@ MEMORY
56#endif 62#endif
57 63
58SECTIONS 64SECTIONS
59#if CONFIG_CPU==PP5020 65#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
60{ 66{
61 . = IRAMORIG; 67 . = IRAMORIG;
62 68
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 85dca37b84..c5edacabec 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -25,7 +25,7 @@
25#include "system.h" 25#include "system.h"
26#include "panic.h" 26#include "panic.h"
27 27
28#if (CONFIG_CPU != PP5020) || !defined(BOOTLOADER) 28#if ((CONFIG_CPU != PP5020) && (CONFIG_CPU != PP5002)) || !defined(BOOTLOADER)
29long current_tick = 0; 29long current_tick = 0;
30#endif 30#endif
31 31
@@ -344,7 +344,7 @@ void tick_start(unsigned int interval_in_ms)
344 IMR0 |= (1<<2); 344 IMR0 |= (1<<2);
345} 345}
346 346
347#elif CONFIG_CPU == PP5020 347#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
348 348
349#ifndef BOOTLOADER 349#ifndef BOOTLOADER
350void TIMER1(void) 350void TIMER1(void)
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 980f077b5e..0d9af14f2c 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -30,6 +30,8 @@
30#include "wm8975.h" 30#include "wm8975.h"
31#elif defined(HAVE_TLV320) 31#elif defined(HAVE_TLV320)
32#include "tlv320.h" 32#include "tlv320.h"
33#elif defined(HAVE_WM8731L)
34#include "wm8731l.h"
33#endif 35#endif
34#include "system.h" 36#include "system.h"
35#endif 37#endif
@@ -451,6 +453,145 @@ long pcm_get_bytes_waiting(void)
451 return size; 453 return size;
452} 454}
453 455
456#elif defined(HAVE_WM8731L)
457
458/* We need to unify this code with the uda1380 code as much as possible, but
459 we will keep it separate during early development.
460*/
461
462static bool pcm_playing;
463static bool pcm_paused;
464static int pcm_freq = 0x6; /* 44.1 is default */
465
466static unsigned char *next_start;
467static long next_size;
468
469/* Set up the DMA transfer that kicks in when the audio FIFO gets empty */
470static void dma_start(const void *addr, long size)
471{
472 pcm_playing = true;
473
474 addr = (void *)((unsigned long)addr & ~3); /* Align data */
475 size &= ~3; /* Size must be multiple of 4 */
476
477 /* Disable playback for now */
478 pcm_playing = false;
479 return;
480
481/* This is the uda1380 code */
482#if 0
483 /* Reset the audio FIFO */
484
485 /* Set up DMA transfer */
486 SAR0 = ((unsigned long)addr); /* Source address */
487 DAR0 = (unsigned long)&PDOR3; /* Destination address */
488 BCR0 = size; /* Bytes to transfer */
489
490 /* Enable the FIFO and force one write to it */
491 IIS2CONFIG = IIS_DEFPARM(pcm_freq);
492
493 DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START;
494#endif
495}
496
497/* Stops the DMA transfer and interrupt */
498static void dma_stop(void)
499{
500 pcm_playing = false;
501
502#if 0
503/* This is the uda1380 code */
504 DCR0 = 0;
505 DSR0 = 1;
506 /* Reset the FIFO */
507 IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
508#endif
509 next_start = NULL;
510 next_size = 0;
511 pcm_paused = false;
512}
513
514
515void pcm_init(void)
516{
517 pcm_playing = false;
518 pcm_paused = false;
519
520 /* Initialize default register values. */
521 wm8731l_init();
522
523 /* The uda1380 needs a sleep(HZ) here - do we need one? */
524
525 /* Power on */
526 wm8731l_enable_output(true);
527
528 /* Unmute the master channel (DAC should be at zero point now). */
529 wm8731l_mute(false);
530
531 /* Call dma_stop to initialize everything. */
532 dma_stop();
533}
534
535void pcm_set_frequency(unsigned int frequency)
536{
537 (void)frequency;
538 pcm_freq=frequency;
539}
540
541/* the registered callback function to ask for more mp3 data */
542static void (*callback_for_more)(unsigned char**, long*) = NULL;
543
544void pcm_play_data(void (*get_more)(unsigned char** start, long* size))
545{
546 unsigned char *start;
547 long size;
548
549 callback_for_more = get_more;
550
551 get_more((unsigned char **)&start, (long *)&size);
552 get_more(&next_start, &next_size);
553
554 dma_start(start, size);
555}
556
557void pcm_play_stop(void)
558{
559 if (pcm_playing) {
560 dma_stop();
561 }
562}
563
564void pcm_play_pause(bool play)
565{
566 if(pcm_paused && play && next_size)
567 {
568 logf("unpause");
569 /* We need to enable DMA here */
570 }
571 else if(!pcm_paused && !play)
572 {
573 logf("pause");
574 /* We need to disable DMA here */
575 }
576 pcm_paused = !play;
577}
578
579bool pcm_is_paused(void)
580{
581 return pcm_paused;
582}
583
584bool pcm_is_playing(void)
585{
586 return pcm_playing;
587}
588
589
590long pcm_get_bytes_waiting(void)
591{
592 return 0;
593}
594
454#elif CONFIG_CPU == PNX0101 595#elif CONFIG_CPU == PNX0101
455 596
456/* TODO: Implement for iFP7xx 597/* TODO: Implement for iFP7xx
@@ -530,6 +671,9 @@ void pcm_calculate_peaks(int *left, int *right)
530#elif defined(HAVE_WM8975) 671#elif defined(HAVE_WM8975)
531 long samples = size / 4; 672 long samples = size / 4;
532 short *addr = p; 673 short *addr = p;
674#elif defined(HAVE_WM8731L)
675 long samples = next_size / 4;
676 short *addr = (short *)next_start;
533#elif defined(HAVE_TLV320) 677#elif defined(HAVE_TLV320)
534 long samples = 4; /* TODO X5 */ 678 long samples = 4; /* TODO X5 */
535 short *addr = NULL; 679 short *addr = NULL;
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 958db56322..f25f2ba6fe 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -73,7 +73,7 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
73 : : "a"(dest) 73 : : "a"(dest)
74 ); 74 );
75#endif 75#endif
76#if CONFIG_CPU == PP5020 76#if (CONFIG_CPU == PP5002) || (CONFIG_CPU==PP5020)
77 /* TODO: Implement for iPod */ 77 /* TODO: Implement for iPod */
78#endif 78#endif
79} 79}
@@ -92,7 +92,7 @@ int rolo_load(const char* filename)
92{ 92{
93 int fd; 93 int fd;
94 long length; 94 long length;
95#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020 95#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
96 int i; 96 int i;
97 unsigned long checksum,file_checksum; 97 unsigned long checksum,file_checksum;
98#else 98#else
@@ -116,7 +116,7 @@ int rolo_load(const char* filename)
116 116
117 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA; 117 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
118 118
119#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020 119#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
120 /* Read and save checksum */ 120 /* Read and save checksum */
121 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET); 121 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
122 if (read(fd, &file_checksum, 4) != 4) { 122 if (read(fd, &file_checksum, 4) != 4) {
diff --git a/firmware/system.c b/firmware/system.c
index fc23edd6ef..df75fbb5a1 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -477,7 +477,7 @@ void (* const vbr[]) (void) __attribute__ ((section (".vectors"))) =
477 UIE,UIE,UIE,UIE,UIE,UIE,UIE,UIE, 477 UIE,UIE,UIE,UIE,UIE,UIE,UIE,UIE,
478 UIE,UIE,UIE,TIMER0,TIMER1,UIE,UIE,UIE, 478 UIE,UIE,UIE,TIMER0,TIMER1,UIE,UIE,UIE,
479 /* lvl 3 lvl 4 */ 479 /* lvl 3 lvl 4 */
480 480
481 TRAP0,TRAP1,TRAP2,TRAP3,TRAP4,TRAP5,TRAP6,TRAP7, 481 TRAP0,TRAP1,TRAP2,TRAP3,TRAP4,TRAP5,TRAP6,TRAP7,
482 TRAP8,TRAP9,TRAP10,TRAP11,TRAP12,TRAP13,TRAP14,TRAP15, 482 TRAP8,TRAP9,TRAP10,TRAP11,TRAP12,TRAP13,TRAP14,TRAP15,
483 483
@@ -1226,6 +1226,96 @@ int system_memory_guard(int newmode)
1226 (void)newmode; 1226 (void)newmode;
1227 return 0; 1227 return 0;
1228} 1228}
1229#elif CONFIG_CPU==PP5002
1230unsigned int ipod_hw_rev;
1231#ifndef BOOTLOADER
1232extern void TIMER1(void);
1233extern void ipod_3g_button_int(void);
1234
1235void irq(void)
1236{
1237 if (CPU_INT_STAT & TIMER1_MASK)
1238 TIMER1();
1239 else if (CPU_INT_STAT & GPIO_MASK)
1240 ipod_3g_button_int();
1241}
1242#endif
1243
1244/* TODO: The following two function have been lifted straight from IPL, and
1245 hence have a lot of numeric addresses used straight. I'd like to use
1246 #defines for these, but don't know what most of them are for or even what
1247 they should be named. Because of this I also have no way of knowing how
1248 to extend the funtions to do alternate cache configurations and/or
1249 some other CPU frequency scaling. */
1250
1251#ifndef BOOTLOADER
1252static void ipod_init_cache(void)
1253{
1254 int i =0;
1255/* Initialising the cache in the iPod bootloader prevents Rockbox from starting */
1256 outl(inl(0xcf004050) & ~0x700, 0xcf004050);
1257 outl(0x4000, 0xcf004020);
1258
1259 outl(0x2, 0xcf004024);
1260
1261 /* PP5002 has 8KB cache */
1262 for (i = 0xf0004000; i < 0xf0006000; i += 16) {
1263 outl(0x0, i);
1264 }
1265
1266 outl(0x0, 0xf000f020);
1267 outl(0x3fc0, 0xf000f024);
1268
1269 outl(0x3, 0xcf004024);
1270}
1271
1272static void ipod_set_cpu_speed(void)
1273{
1274 outl(0x02, 0xcf005008);
1275 outl(0x55, 0xcf00500c);
1276 outl(0x6000, 0xcf005010);
1277#if 1
1278 // 75 MHz (24/24 * 75) (default)
1279 outl(24, 0xcf005018);
1280 outl(75, 0xcf00501c);
1281#endif
1282
1283#if 0
1284 // 66 MHz (24/3 * 8)
1285 outl(3, 0xcf005018);
1286 outl(8, 0xcf00501c);
1287#endif
1288
1289 outl(0xe000, 0xcf005010);
1290
1291 udelay(2000);
1292
1293 outl(0xa8, 0xcf00500c);
1294}
1295#endif
1296
1297void system_init(void)
1298{
1299#ifndef BOOTLOADER
1300 ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
1301 outl(-1, 0xcf00101c);
1302 outl(-1, 0xcf001028);
1303 outl(-1, 0xcf001038);
1304 ipod_set_cpu_speed();
1305 ipod_init_cache();
1306#endif
1307}
1308
1309void system_reboot(void)
1310{
1311 outl(inl(0xcf005030) | 0x4, 0xcf005030);
1312}
1313
1314int system_memory_guard(int newmode)
1315{
1316 (void)newmode;
1317 return 0;
1318}
1229 1319
1230#elif CONFIG_CPU==PNX0101 1320#elif CONFIG_CPU==PNX0101
1231 1321
diff --git a/firmware/timer.c b/firmware/timer.c
index d4ce069637..7d9c288cdd 100644
--- a/firmware/timer.c
+++ b/firmware/timer.c
@@ -56,7 +56,7 @@ static bool timer_set(long cycles, bool start)
56 int phi = 0; /* bits for the prescaler */ 56 int phi = 0; /* bits for the prescaler */
57 int prescale = 1; 57 int prescale = 1;
58 58
59#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101) 59#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
60 /* TODO: Implement for iPod and iFP */ 60 /* TODO: Implement for iPod and iFP */
61 (void)start; 61 (void)start;
62 (void)phi; 62 (void)phi;
@@ -162,8 +162,8 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
162 if (reg_prio <= timer_prio || cycles == 0) 162 if (reg_prio <= timer_prio || cycles == 0)
163 return false; 163 return false;
164 164
165#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101) 165#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
166 /* TODO: Implement for iPod */ 166 /* TODO: Implement for iPod and iFP */
167 (void)int_prio; 167 (void)int_prio;
168#endif 168#endif
169 169
diff --git a/firmware/usb.c b/firmware/usb.c
index 80a8c98d8c..32e98ef6ce 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -68,7 +68,7 @@ void screen_dump(void); /* Nasty again. Defined in apps/ too */
68#elif CONFIG_KEYPAD == ONDIO_PAD 68#elif CONFIG_KEYPAD == ONDIO_PAD
69#define USBPOWER_BUTTON BUTTON_MENU 69#define USBPOWER_BUTTON BUTTON_MENU
70#define USBPOWER_BTN_IGNORE BUTTON_OFF 70#define USBPOWER_BTN_IGNORE BUTTON_OFF
71#elif CONFIG_KEYPAD == IPOD_4G_PAD 71#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
72#define USBPOWER_BUTTON BUTTON_MENU 72#define USBPOWER_BUTTON BUTTON_MENU
73#define USBPOWER_BTN_IGNORE BUTTON_PLAY 73#define USBPOWER_BTN_IGNORE BUTTON_PLAY
74#elif CONFIG_KEYPAD == IRIVER_H300_PAD 74#elif CONFIG_KEYPAD == IRIVER_H300_PAD
@@ -172,7 +172,7 @@ void usb_enable(bool on)
172 if (on) 172 if (on)
173 { 173 {
174 /* The following code is copied from ipodlinux */ 174 /* The following code is copied from ipodlinux */
175#ifdef APPLE_IPODCOLOR 175#if defined (APPLE_IPODCOLOR) || defined(APPLE_IPOD3G)
176 unsigned char* storage_ptr = (unsigned char *)0x40017F00; 176 unsigned char* storage_ptr = (unsigned char *)0x40017F00;
177#elif defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO) 177#elif defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
178 unsigned char* storage_ptr = (unsigned char *)0x4001FF00; 178 unsigned char* storage_ptr = (unsigned char *)0x4001FF00;