forked from len0rd/rockbox
Further iPod 3G work from Seven Le Mesle
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8583 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
465596b163
commit
987879b958
10 changed files with 270 additions and 20 deletions
|
@ -50,15 +50,17 @@ drivers/lcd-player.c
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
arabjoin.c
|
arabjoin.c
|
||||||
bidi.c
|
bidi.c
|
||||||
#if LCD_DEPTH == 2
|
#if LCD_DEPTH == 1
|
||||||
drivers/lcd-h100.c
|
|
||||||
#elif LCD_DEPTH == 1
|
|
||||||
drivers/lcd-recorder.c
|
drivers/lcd-recorder.c
|
||||||
|
#elif CONFIG_LCD==LCD_IPOD2BPP
|
||||||
|
drivers/lcd-2bit-horz.c
|
||||||
|
#elif LCD_DEPTH == 2
|
||||||
|
drivers/lcd-h100.c
|
||||||
#elif LCD_DEPTH == 16
|
#elif LCD_DEPTH == 16
|
||||||
drivers/lcd-16bit.c
|
drivers/lcd-16bit.c
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR
|
#if CONFIG_LCD==LCD_IPODNANO || CONFIG_LCD==LCD_IPODCOLOR || CONFIG_LCD == LCD_IPOD2BPP
|
||||||
drivers/lcd-ipod.c
|
drivers/lcd-ipod.c
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_LCD==LCD_IPODVIDEO
|
#if CONFIG_LCD==LCD_IPODVIDEO
|
||||||
|
@ -97,6 +99,8 @@ tuner_philips.c
|
||||||
drivers/i2c-coldfire.c
|
drivers/i2c-coldfire.c
|
||||||
#elif CONFIG_I2C == I2C_PP5020
|
#elif CONFIG_I2C == I2C_PP5020
|
||||||
drivers/i2c-pp5020.c
|
drivers/i2c-pp5020.c
|
||||||
|
#elif CONFIG_I2C == I2C_PP5002
|
||||||
|
drivers/i2c-pp5002.c
|
||||||
#elif CONFIG_I2C == I2C_PNX0101
|
#elif CONFIG_I2C == I2C_PNX0101
|
||||||
drivers/i2c-pnx0101.c
|
drivers/i2c-pnx0101.c
|
||||||
#else
|
#else
|
||||||
|
@ -108,7 +112,7 @@ drivers/mas.c
|
||||||
#ifdef IRIVER_H300_SERIES
|
#ifdef IRIVER_H300_SERIES
|
||||||
drivers/pcf50606.c
|
drivers/pcf50606.c
|
||||||
#endif
|
#endif
|
||||||
#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
|
#if defined(APPLE_IPODCOLOR) || defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO) || defined(APPLE_IPOD3G)
|
||||||
drivers/pcf50605.c
|
drivers/pcf50605.c
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606)
|
#if (CONFIG_RTC == RTC_M41ST84W) || (CONFIG_RTC == RTC_PCF50606)
|
||||||
|
@ -157,6 +161,8 @@ drivers/lcd-h100-remote.c
|
||||||
drivers/uda1380.c
|
drivers/uda1380.c
|
||||||
#elif defined(HAVE_WM8975) && !defined(SIMULATOR)
|
#elif defined(HAVE_WM8975) && !defined(SIMULATOR)
|
||||||
drivers/wm8975.c
|
drivers/wm8975.c
|
||||||
|
#elif defined(HAVE_WM8731L) && !defined(SIMULATOR)
|
||||||
|
drivers/wm8731l.c
|
||||||
#elif defined(HAVE_TLV320) && !defined(SIMULATOR)
|
#elif defined(HAVE_TLV320) && !defined(SIMULATOR)
|
||||||
drivers/tlv320.c
|
drivers/tlv320.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -122,7 +122,7 @@ _pluginbuf = 0;
|
||||||
#define DRAMORIG 0x31000000 + STUBOFFSET
|
#define DRAMORIG 0x31000000 + STUBOFFSET
|
||||||
#define IRAMORIG 0x10000000
|
#define IRAMORIG 0x10000000
|
||||||
#define IRAMSIZE 0xc000
|
#define IRAMSIZE 0xc000
|
||||||
#elif CONFIG_CPU==PP5020
|
#elif (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
|
||||||
#define DRAMORIG 0x00000000 + STUBOFFSET
|
#define DRAMORIG 0x00000000 + STUBOFFSET
|
||||||
#define IRAMORIG 0x40000000
|
#define IRAMORIG 0x40000000
|
||||||
#define IRAMSIZE 0xc000
|
#define IRAMSIZE 0xc000
|
||||||
|
|
|
@ -242,6 +242,8 @@ static void __backlight_on(void)
|
||||||
|
|
||||||
/* set port L07 on */
|
/* set port L07 on */
|
||||||
outl(((0x100 | 1) << 7), 0x6000d12c);
|
outl(((0x100 | 1) << 7), 0x6000d12c);
|
||||||
|
#elif CONFIG_BACKLIGHT==BL_IPOD3G
|
||||||
|
lcd_enable(true);
|
||||||
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
|
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
|
||||||
GPIO3_SET = 1;
|
GPIO3_SET = 1;
|
||||||
#endif
|
#endif
|
||||||
|
@ -283,6 +285,8 @@ static void __backlight_off(void)
|
||||||
outl(((0x100 | 0) << 7), 0x6000d12c);
|
outl(((0x100 | 0) << 7), 0x6000d12c);
|
||||||
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
|
#elif CONFIG_BACKLIGHT==BL_IRIVER_IFP7XX
|
||||||
GPIO3_CLR = 1;
|
GPIO3_CLR = 1;
|
||||||
|
#elif CONFIG_BACKLIGHT==BL_IPOD3G
|
||||||
|
lcd_enable(false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ ENTRY(start)
|
||||||
#ifdef CPU_COLDFIRE
|
#ifdef CPU_COLDFIRE
|
||||||
OUTPUT_FORMAT(elf32-m68k)
|
OUTPUT_FORMAT(elf32-m68k)
|
||||||
INPUT(crt0.o)
|
INPUT(crt0.o)
|
||||||
#elif CONFIG_CPU == PP5020
|
#elif defined (CPU_ARM)
|
||||||
OUTPUT_FORMAT(elf32-littlearm)
|
OUTPUT_FORMAT(elf32-littlearm)
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
#else
|
#else
|
||||||
|
@ -38,6 +38,12 @@ INPUT(crt0.o)
|
||||||
#define IRAMSIZE 0x18000
|
#define IRAMSIZE 0x18000
|
||||||
#define FLASHORIG 0x001f0000
|
#define FLASHORIG 0x001f0000
|
||||||
#define FLASHSIZE 2M
|
#define FLASHSIZE 2M
|
||||||
|
#elif CONFIG_CPU == PP5002
|
||||||
|
#define DRAMORIG 0x28000000
|
||||||
|
#define IRAMORIG 0x40000000
|
||||||
|
#define IRAMSIZE 0x18000
|
||||||
|
#define FLASHORIG 0x001f0000
|
||||||
|
#define FLASHSIZE 2M
|
||||||
#else
|
#else
|
||||||
#define DRAMORIG 0x09000000
|
#define DRAMORIG 0x09000000
|
||||||
#define IRAMORIG 0x0f000000
|
#define IRAMORIG 0x0f000000
|
||||||
|
@ -46,7 +52,7 @@ INPUT(crt0.o)
|
||||||
#define FLASHSIZE 256K - ROM_START
|
#define FLASHSIZE 256K - ROM_START
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_CPU!=PP5020
|
#if (CONFIG_CPU!=PP5002) && (CONFIG_CPU!=PP5002)
|
||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
||||||
|
@ -56,7 +62,7 @@ MEMORY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SECTIONS
|
SECTIONS
|
||||||
#if CONFIG_CPU==PP5020
|
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
|
||||||
{
|
{
|
||||||
. = IRAMORIG;
|
. = IRAMORIG;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "panic.h"
|
#include "panic.h"
|
||||||
|
|
||||||
#if (CONFIG_CPU != PP5020) || !defined(BOOTLOADER)
|
#if ((CONFIG_CPU != PP5020) && (CONFIG_CPU != PP5002)) || !defined(BOOTLOADER)
|
||||||
long current_tick = 0;
|
long current_tick = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void tick_start(unsigned int interval_in_ms)
|
||||||
IMR0 |= (1<<2);
|
IMR0 |= (1<<2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif CONFIG_CPU == PP5020
|
#elif (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
|
||||||
|
|
||||||
#ifndef BOOTLOADER
|
#ifndef BOOTLOADER
|
||||||
void TIMER1(void)
|
void TIMER1(void)
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
#include "wm8975.h"
|
#include "wm8975.h"
|
||||||
#elif defined(HAVE_TLV320)
|
#elif defined(HAVE_TLV320)
|
||||||
#include "tlv320.h"
|
#include "tlv320.h"
|
||||||
|
#elif defined(HAVE_WM8731L)
|
||||||
|
#include "wm8731l.h"
|
||||||
#endif
|
#endif
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -451,6 +453,145 @@ long pcm_get_bytes_waiting(void)
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_WM8731L)
|
||||||
|
|
||||||
|
/* We need to unify this code with the uda1380 code as much as possible, but
|
||||||
|
we will keep it separate during early development.
|
||||||
|
*/
|
||||||
|
|
||||||
|
static bool pcm_playing;
|
||||||
|
static bool pcm_paused;
|
||||||
|
static int pcm_freq = 0x6; /* 44.1 is default */
|
||||||
|
|
||||||
|
static unsigned char *next_start;
|
||||||
|
static long next_size;
|
||||||
|
|
||||||
|
/* Set up the DMA transfer that kicks in when the audio FIFO gets empty */
|
||||||
|
static void dma_start(const void *addr, long size)
|
||||||
|
{
|
||||||
|
pcm_playing = true;
|
||||||
|
|
||||||
|
addr = (void *)((unsigned long)addr & ~3); /* Align data */
|
||||||
|
size &= ~3; /* Size must be multiple of 4 */
|
||||||
|
|
||||||
|
/* Disable playback for now */
|
||||||
|
pcm_playing = false;
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* This is the uda1380 code */
|
||||||
|
#if 0
|
||||||
|
/* Reset the audio FIFO */
|
||||||
|
|
||||||
|
/* Set up DMA transfer */
|
||||||
|
SAR0 = ((unsigned long)addr); /* Source address */
|
||||||
|
DAR0 = (unsigned long)&PDOR3; /* Destination address */
|
||||||
|
BCR0 = size; /* Bytes to transfer */
|
||||||
|
|
||||||
|
/* Enable the FIFO and force one write to it */
|
||||||
|
IIS2CONFIG = IIS_DEFPARM(pcm_freq);
|
||||||
|
|
||||||
|
DCR0 = DMA_INT | DMA_EEXT | DMA_CS | DMA_SINC | DMA_START;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stops the DMA transfer and interrupt */
|
||||||
|
static void dma_stop(void)
|
||||||
|
{
|
||||||
|
pcm_playing = false;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This is the uda1380 code */
|
||||||
|
DCR0 = 0;
|
||||||
|
DSR0 = 1;
|
||||||
|
/* Reset the FIFO */
|
||||||
|
IIS2CONFIG = IIS_RESET | IIS_DEFPARM(pcm_freq);
|
||||||
|
#endif
|
||||||
|
next_start = NULL;
|
||||||
|
next_size = 0;
|
||||||
|
pcm_paused = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pcm_init(void)
|
||||||
|
{
|
||||||
|
pcm_playing = false;
|
||||||
|
pcm_paused = false;
|
||||||
|
|
||||||
|
/* Initialize default register values. */
|
||||||
|
wm8731l_init();
|
||||||
|
|
||||||
|
/* The uda1380 needs a sleep(HZ) here - do we need one? */
|
||||||
|
|
||||||
|
/* Power on */
|
||||||
|
wm8731l_enable_output(true);
|
||||||
|
|
||||||
|
/* Unmute the master channel (DAC should be at zero point now). */
|
||||||
|
wm8731l_mute(false);
|
||||||
|
|
||||||
|
/* Call dma_stop to initialize everything. */
|
||||||
|
dma_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pcm_set_frequency(unsigned int frequency)
|
||||||
|
{
|
||||||
|
(void)frequency;
|
||||||
|
pcm_freq=frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the registered callback function to ask for more mp3 data */
|
||||||
|
static void (*callback_for_more)(unsigned char**, long*) = NULL;
|
||||||
|
|
||||||
|
void pcm_play_data(void (*get_more)(unsigned char** start, long* size))
|
||||||
|
{
|
||||||
|
unsigned char *start;
|
||||||
|
long size;
|
||||||
|
|
||||||
|
callback_for_more = get_more;
|
||||||
|
|
||||||
|
get_more((unsigned char **)&start, (long *)&size);
|
||||||
|
get_more(&next_start, &next_size);
|
||||||
|
|
||||||
|
dma_start(start, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pcm_play_stop(void)
|
||||||
|
{
|
||||||
|
if (pcm_playing) {
|
||||||
|
dma_stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pcm_play_pause(bool play)
|
||||||
|
{
|
||||||
|
if(pcm_paused && play && next_size)
|
||||||
|
{
|
||||||
|
logf("unpause");
|
||||||
|
/* We need to enable DMA here */
|
||||||
|
}
|
||||||
|
else if(!pcm_paused && !play)
|
||||||
|
{
|
||||||
|
logf("pause");
|
||||||
|
/* We need to disable DMA here */
|
||||||
|
}
|
||||||
|
pcm_paused = !play;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pcm_is_paused(void)
|
||||||
|
{
|
||||||
|
return pcm_paused;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pcm_is_playing(void)
|
||||||
|
{
|
||||||
|
return pcm_playing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
long pcm_get_bytes_waiting(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#elif CONFIG_CPU == PNX0101
|
#elif CONFIG_CPU == PNX0101
|
||||||
|
|
||||||
/* TODO: Implement for iFP7xx
|
/* TODO: Implement for iFP7xx
|
||||||
|
@ -530,6 +671,9 @@ void pcm_calculate_peaks(int *left, int *right)
|
||||||
#elif defined(HAVE_WM8975)
|
#elif defined(HAVE_WM8975)
|
||||||
long samples = size / 4;
|
long samples = size / 4;
|
||||||
short *addr = p;
|
short *addr = p;
|
||||||
|
#elif defined(HAVE_WM8731L)
|
||||||
|
long samples = next_size / 4;
|
||||||
|
short *addr = (short *)next_start;
|
||||||
#elif defined(HAVE_TLV320)
|
#elif defined(HAVE_TLV320)
|
||||||
long samples = 4; /* TODO X5 */
|
long samples = 4; /* TODO X5 */
|
||||||
short *addr = NULL;
|
short *addr = NULL;
|
||||||
|
|
|
@ -73,7 +73,7 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
|
||||||
: : "a"(dest)
|
: : "a"(dest)
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CPU == PP5020
|
#if (CONFIG_CPU == PP5002) || (CONFIG_CPU==PP5020)
|
||||||
/* TODO: Implement for iPod */
|
/* TODO: Implement for iPod */
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ int rolo_load(const char* filename)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
long length;
|
long length;
|
||||||
#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020
|
#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
|
||||||
int i;
|
int i;
|
||||||
unsigned long checksum,file_checksum;
|
unsigned long checksum,file_checksum;
|
||||||
#else
|
#else
|
||||||
|
@ -116,7 +116,7 @@ int rolo_load(const char* filename)
|
||||||
|
|
||||||
length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
|
length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
|
||||||
|
|
||||||
#if CONFIG_CPU == MCF5249 || CONFIG_CPU == PP5020
|
#if (CONFIG_CPU == MCF5249) || (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020)
|
||||||
/* Read and save checksum */
|
/* Read and save checksum */
|
||||||
lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
|
lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
|
||||||
if (read(fd, &file_checksum, 4) != 4) {
|
if (read(fd, &file_checksum, 4) != 4) {
|
||||||
|
|
|
@ -477,7 +477,7 @@ void (* const vbr[]) (void) __attribute__ ((section (".vectors"))) =
|
||||||
UIE,UIE,UIE,UIE,UIE,UIE,UIE,UIE,
|
UIE,UIE,UIE,UIE,UIE,UIE,UIE,UIE,
|
||||||
UIE,UIE,UIE,TIMER0,TIMER1,UIE,UIE,UIE,
|
UIE,UIE,UIE,TIMER0,TIMER1,UIE,UIE,UIE,
|
||||||
/* lvl 3 lvl 4 */
|
/* lvl 3 lvl 4 */
|
||||||
|
|
||||||
TRAP0,TRAP1,TRAP2,TRAP3,TRAP4,TRAP5,TRAP6,TRAP7,
|
TRAP0,TRAP1,TRAP2,TRAP3,TRAP4,TRAP5,TRAP6,TRAP7,
|
||||||
TRAP8,TRAP9,TRAP10,TRAP11,TRAP12,TRAP13,TRAP14,TRAP15,
|
TRAP8,TRAP9,TRAP10,TRAP11,TRAP12,TRAP13,TRAP14,TRAP15,
|
||||||
|
|
||||||
|
@ -1221,6 +1221,96 @@ void system_reboot(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int system_memory_guard(int newmode)
|
||||||
|
{
|
||||||
|
(void)newmode;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#elif CONFIG_CPU==PP5002
|
||||||
|
unsigned int ipod_hw_rev;
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
extern void TIMER1(void);
|
||||||
|
extern void ipod_3g_button_int(void);
|
||||||
|
|
||||||
|
void irq(void)
|
||||||
|
{
|
||||||
|
if (CPU_INT_STAT & TIMER1_MASK)
|
||||||
|
TIMER1();
|
||||||
|
else if (CPU_INT_STAT & GPIO_MASK)
|
||||||
|
ipod_3g_button_int();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* TODO: The following two function have been lifted straight from IPL, and
|
||||||
|
hence have a lot of numeric addresses used straight. I'd like to use
|
||||||
|
#defines for these, but don't know what most of them are for or even what
|
||||||
|
they should be named. Because of this I also have no way of knowing how
|
||||||
|
to extend the funtions to do alternate cache configurations and/or
|
||||||
|
some other CPU frequency scaling. */
|
||||||
|
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
static void ipod_init_cache(void)
|
||||||
|
{
|
||||||
|
int i =0;
|
||||||
|
/* Initialising the cache in the iPod bootloader prevents Rockbox from starting */
|
||||||
|
outl(inl(0xcf004050) & ~0x700, 0xcf004050);
|
||||||
|
outl(0x4000, 0xcf004020);
|
||||||
|
|
||||||
|
outl(0x2, 0xcf004024);
|
||||||
|
|
||||||
|
/* PP5002 has 8KB cache */
|
||||||
|
for (i = 0xf0004000; i < 0xf0006000; i += 16) {
|
||||||
|
outl(0x0, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
outl(0x0, 0xf000f020);
|
||||||
|
outl(0x3fc0, 0xf000f024);
|
||||||
|
|
||||||
|
outl(0x3, 0xcf004024);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ipod_set_cpu_speed(void)
|
||||||
|
{
|
||||||
|
outl(0x02, 0xcf005008);
|
||||||
|
outl(0x55, 0xcf00500c);
|
||||||
|
outl(0x6000, 0xcf005010);
|
||||||
|
#if 1
|
||||||
|
// 75 MHz (24/24 * 75) (default)
|
||||||
|
outl(24, 0xcf005018);
|
||||||
|
outl(75, 0xcf00501c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// 66 MHz (24/3 * 8)
|
||||||
|
outl(3, 0xcf005018);
|
||||||
|
outl(8, 0xcf00501c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
outl(0xe000, 0xcf005010);
|
||||||
|
|
||||||
|
udelay(2000);
|
||||||
|
|
||||||
|
outl(0xa8, 0xcf00500c);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void system_init(void)
|
||||||
|
{
|
||||||
|
#ifndef BOOTLOADER
|
||||||
|
ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
|
||||||
|
outl(-1, 0xcf00101c);
|
||||||
|
outl(-1, 0xcf001028);
|
||||||
|
outl(-1, 0xcf001038);
|
||||||
|
ipod_set_cpu_speed();
|
||||||
|
ipod_init_cache();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void system_reboot(void)
|
||||||
|
{
|
||||||
|
outl(inl(0xcf005030) | 0x4, 0xcf005030);
|
||||||
|
}
|
||||||
|
|
||||||
int system_memory_guard(int newmode)
|
int system_memory_guard(int newmode)
|
||||||
{
|
{
|
||||||
(void)newmode;
|
(void)newmode;
|
||||||
|
|
|
@ -56,7 +56,7 @@ static bool timer_set(long cycles, bool start)
|
||||||
int phi = 0; /* bits for the prescaler */
|
int phi = 0; /* bits for the prescaler */
|
||||||
int prescale = 1;
|
int prescale = 1;
|
||||||
|
|
||||||
#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
|
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
|
||||||
/* TODO: Implement for iPod and iFP */
|
/* TODO: Implement for iPod and iFP */
|
||||||
(void)start;
|
(void)start;
|
||||||
(void)phi;
|
(void)phi;
|
||||||
|
@ -162,8 +162,8 @@ bool timer_register(int reg_prio, void (*unregister_callback)(void),
|
||||||
if (reg_prio <= timer_prio || cycles == 0)
|
if (reg_prio <= timer_prio || cycles == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
|
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
|
||||||
/* TODO: Implement for iPod */
|
/* TODO: Implement for iPod and iFP */
|
||||||
(void)int_prio;
|
(void)int_prio;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ void screen_dump(void); /* Nasty again. Defined in apps/ too */
|
||||||
#elif CONFIG_KEYPAD == ONDIO_PAD
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
#define USBPOWER_BUTTON BUTTON_MENU
|
#define USBPOWER_BUTTON BUTTON_MENU
|
||||||
#define USBPOWER_BTN_IGNORE BUTTON_OFF
|
#define USBPOWER_BTN_IGNORE BUTTON_OFF
|
||||||
#elif CONFIG_KEYPAD == IPOD_4G_PAD
|
#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
|
||||||
#define USBPOWER_BUTTON BUTTON_MENU
|
#define USBPOWER_BUTTON BUTTON_MENU
|
||||||
#define USBPOWER_BTN_IGNORE BUTTON_PLAY
|
#define USBPOWER_BTN_IGNORE BUTTON_PLAY
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
|
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
|
||||||
|
@ -172,7 +172,7 @@ void usb_enable(bool on)
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
/* The following code is copied from ipodlinux */
|
/* The following code is copied from ipodlinux */
|
||||||
#ifdef APPLE_IPODCOLOR
|
#if defined (APPLE_IPODCOLOR) || defined(APPLE_IPOD3G)
|
||||||
unsigned char* storage_ptr = (unsigned char *)0x40017F00;
|
unsigned char* storage_ptr = (unsigned char *)0x40017F00;
|
||||||
#elif defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
|
#elif defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO)
|
||||||
unsigned char* storage_ptr = (unsigned char *)0x4001FF00;
|
unsigned char* storage_ptr = (unsigned char *)0x4001FF00;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue