summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-ipod.c4
-rw-r--r--firmware/export/system.h2
-rw-r--r--firmware/system.c6
3 files changed, 9 insertions, 3 deletions
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 @@
#include "system.h"
/*** definitions ***/
-#define IPOD_HW_REVISION (*((volatile unsigned long*)0x00002084))
-
#define IPOD_LCD_BASE 0x70008a0c
#define IPOD_LCD_BUSY_MASK 0x80000000
@@ -129,7 +127,7 @@ void lcd_roll(int lines)
void lcd_init_device(void)
{
#if CONFIG_LCD == LCD_IPODCOLOR
- if (IPOD_HW_REVISION == 0x60000) {
+ if (ipod_hw_rev == 0x60000) {
lcd_type = 0;
} else {
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;
#define outb(a,b) (*(volatile unsigned char *) (b) = (a))
#define inw(a) (*(volatile unsigned short *) (a))
#define outw(a,b) (*(volatile unsigned short *) (b) = (a))
+extern unsigned int ipod_hw_rev;
+
static inline void udelay(unsigned usecs)
{
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)
extern void TIMER1(void);
extern void ipod_4g_button_int(void);
+unsigned int ipod_hw_rev;
+
void irq(void)
{
if (CPU_INT_STAT & TIMER1_MASK)
@@ -1198,6 +1200,10 @@ static void ipod_set_cpu_speed(void)
void system_init(void)
{
#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 */
outl(-1, 0x60001138);
outl(-1, 0x60001128);