summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-01-31 01:50:07 +0000
committerDave Chapman <dave@dchapman.com>2006-01-31 01:50:07 +0000
commitf9dac40cf311ef130da190cc71de9148551c9cdc (patch)
tree569f8330060b2f72fa4072ef262ba6dcd00c47b0
parentea72d05ec6426b65d52fcbcfbbb008351830583f (diff)
downloadrockbox-f9dac40cf311ef130da190cc71de9148551c9cdc.tar.gz
rockbox-f9dac40cf311ef130da190cc71de9148551c9cdc.zip
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
-rw-r--r--bootloader/ipod.c6
-rw-r--r--firmware/drivers/lcd-ipod.c4
-rw-r--r--firmware/export/system.h2
-rw-r--r--firmware/system.c6
4 files changed, 15 insertions, 3 deletions
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index d09a227d17..4de6b61e62 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -44,6 +44,10 @@
44 44
45#define IPOD_HW_REVISION (*((volatile unsigned long*)(0x00002084))) 45#define IPOD_HW_REVISION (*((volatile unsigned long*)(0x00002084)))
46 46
47/* We copy the hardware revision to the last four bytes of SDRAM and then
48 re-read it after we have re-mapped SDRAM to 0x0 in Rockbox */
49#define TMP_IPOD_HW_REVISION (*((volatile unsigned long*)(0x11fffffc)))
50
47#define BUTTON_LEFT 1 51#define BUTTON_LEFT 1
48#define BUTTON_MENU 2 52#define BUTTON_MENU 2
49#define BUTTON_RIGHT 3 53#define BUTTON_RIGHT 3
@@ -335,6 +339,8 @@ void* main(void)
335 339
336#endif 340#endif
337 341
342 TMP_IPOD_HW_REVISION = IPOD_HW_REVISION;
343
338 system_init(); 344 system_init();
339 kernel_init(); 345 kernel_init();
340 lcd_init(); 346 lcd_init();
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c
index 5178b1b9b2..0ff22ab9b5 100644
--- a/firmware/drivers/lcd-ipod.c
+++ b/firmware/drivers/lcd-ipod.c
@@ -30,8 +30,6 @@
30#include "system.h" 30#include "system.h"
31 31
32/*** definitions ***/ 32/*** definitions ***/
33#define IPOD_HW_REVISION (*((volatile unsigned long*)0x00002084))
34
35#define IPOD_LCD_BASE 0x70008a0c 33#define IPOD_LCD_BASE 0x70008a0c
36#define IPOD_LCD_BUSY_MASK 0x80000000 34#define IPOD_LCD_BUSY_MASK 0x80000000
37 35
@@ -129,7 +127,7 @@ void lcd_roll(int lines)
129void lcd_init_device(void) 127void lcd_init_device(void)
130{ 128{
131#if CONFIG_LCD == LCD_IPODCOLOR 129#if CONFIG_LCD == LCD_IPODCOLOR
132 if (IPOD_HW_REVISION == 0x60000) { 130 if (ipod_hw_rev == 0x60000) {
133 lcd_type = 0; 131 lcd_type = 0;
134 } else { 132 } else {
135 int gpio_a01, gpio_a04; 133 int gpio_a01, gpio_a04;
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 0434425ffd..b5f4bbf2db 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -36,6 +36,8 @@ extern long cpu_frequency;
36#define outb(a,b) (*(volatile unsigned char *) (b) = (a)) 36#define outb(a,b) (*(volatile unsigned char *) (b) = (a))
37#define inw(a) (*(volatile unsigned short *) (a)) 37#define inw(a) (*(volatile unsigned short *) (a))
38#define outw(a,b) (*(volatile unsigned short *) (b) = (a)) 38#define outw(a,b) (*(volatile unsigned short *) (b) = (a))
39extern unsigned int ipod_hw_rev;
40
39static inline void udelay(unsigned usecs) 41static inline void udelay(unsigned usecs)
40{ 42{
41 unsigned start = inl(0x60005010); 43 unsigned start = inl(0x60005010);
diff --git a/firmware/system.c b/firmware/system.c
index bc9f9de973..1ef5fda290 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -1140,6 +1140,8 @@ void UIE(unsigned int pc, unsigned int num)
1140extern void TIMER1(void); 1140extern void TIMER1(void);
1141extern void ipod_4g_button_int(void); 1141extern void ipod_4g_button_int(void);
1142 1142
1143unsigned int ipod_hw_rev;
1144
1143void irq(void) 1145void irq(void)
1144{ 1146{
1145 if (CPU_INT_STAT & TIMER1_MASK) 1147 if (CPU_INT_STAT & TIMER1_MASK)
@@ -1198,6 +1200,10 @@ static void ipod_set_cpu_speed(void)
1198void system_init(void) 1200void system_init(void)
1199{ 1201{
1200#ifndef BOOTLOADER 1202#ifndef BOOTLOADER
1203 /* The hw revision is written to the last 4 bytes of SDRAM by the
1204 bootloader - we save it before Rockbox overwrites it. */
1205 ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
1206
1201 /* disable all irqs */ 1207 /* disable all irqs */
1202 outl(-1, 0x60001138); 1208 outl(-1, 0x60001138);
1203 outl(-1, 0x60001128); 1209 outl(-1, 0x60001128);