1
0
Fork 0
forked from len0rd/rockbox

iPod: Fix the detection of lcd type for the iPod Photo - this should fix problems with that LCD. Affected users also need to install a new bootloader - available from the iPod Installation wiki page.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8499 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2006-01-31 01:50:07 +00:00
parent ea72d05ec6
commit f9dac40cf3
4 changed files with 15 additions and 3 deletions

View file

@ -44,6 +44,10 @@
#define IPOD_HW_REVISION (*((volatile unsigned long*)(0x00002084))) #define IPOD_HW_REVISION (*((volatile unsigned long*)(0x00002084)))
/* We copy the hardware revision to the last four bytes of SDRAM and then
re-read it after we have re-mapped SDRAM to 0x0 in Rockbox */
#define TMP_IPOD_HW_REVISION (*((volatile unsigned long*)(0x11fffffc)))
#define BUTTON_LEFT 1 #define BUTTON_LEFT 1
#define BUTTON_MENU 2 #define BUTTON_MENU 2
#define BUTTON_RIGHT 3 #define BUTTON_RIGHT 3
@ -335,6 +339,8 @@ void* main(void)
#endif #endif
TMP_IPOD_HW_REVISION = IPOD_HW_REVISION;
system_init(); system_init();
kernel_init(); kernel_init();
lcd_init(); lcd_init();

View file

@ -30,8 +30,6 @@
#include "system.h" #include "system.h"
/*** definitions ***/ /*** definitions ***/
#define IPOD_HW_REVISION (*((volatile unsigned long*)0x00002084))
#define IPOD_LCD_BASE 0x70008a0c #define IPOD_LCD_BASE 0x70008a0c
#define IPOD_LCD_BUSY_MASK 0x80000000 #define IPOD_LCD_BUSY_MASK 0x80000000
@ -129,7 +127,7 @@ void lcd_roll(int lines)
void lcd_init_device(void) void lcd_init_device(void)
{ {
#if CONFIG_LCD == LCD_IPODCOLOR #if CONFIG_LCD == LCD_IPODCOLOR
if (IPOD_HW_REVISION == 0x60000) { if (ipod_hw_rev == 0x60000) {
lcd_type = 0; lcd_type = 0;
} else { } else {
int gpio_a01, gpio_a04; int gpio_a01, gpio_a04;

View file

@ -36,6 +36,8 @@ extern long cpu_frequency;
#define outb(a,b) (*(volatile unsigned char *) (b) = (a)) #define outb(a,b) (*(volatile unsigned char *) (b) = (a))
#define inw(a) (*(volatile unsigned short *) (a)) #define inw(a) (*(volatile unsigned short *) (a))
#define outw(a,b) (*(volatile unsigned short *) (b) = (a)) #define outw(a,b) (*(volatile unsigned short *) (b) = (a))
extern unsigned int ipod_hw_rev;
static inline void udelay(unsigned usecs) static inline void udelay(unsigned usecs)
{ {
unsigned start = inl(0x60005010); unsigned start = inl(0x60005010);

View file

@ -1140,6 +1140,8 @@ void UIE(unsigned int pc, unsigned int num)
extern void TIMER1(void); extern void TIMER1(void);
extern void ipod_4g_button_int(void); extern void ipod_4g_button_int(void);
unsigned int ipod_hw_rev;
void irq(void) void irq(void)
{ {
if (CPU_INT_STAT & TIMER1_MASK) if (CPU_INT_STAT & TIMER1_MASK)
@ -1198,6 +1200,10 @@ static void ipod_set_cpu_speed(void)
void system_init(void) void system_init(void)
{ {
#ifndef BOOTLOADER #ifndef BOOTLOADER
/* The hw revision is written to the last 4 bytes of SDRAM by the
bootloader - we save it before Rockbox overwrites it. */
ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
/* disable all irqs */ /* disable all irqs */
outl(-1, 0x60001138); outl(-1, 0x60001138);
outl(-1, 0x60001128); outl(-1, 0x60001128);