summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-07-25 13:12:38 +0000
committerDave Chapman <dave@dchapman.com>2007-07-25 13:12:38 +0000
commitebc076bc15d6501674b9db772557a0eadfb4a5e2 (patch)
treea49e4460708d78c76ea25669afded36c3c631f04 /firmware
parented095235d44a9427e76f05f9f6d35325ddf1d4d9 (diff)
downloadrockbox-ebc076bc15d6501674b9db772557a0eadfb4a5e2.tar.gz
rockbox-ebc076bc15d6501674b9db772557a0eadfb4a5e2.zip
Remove the hack which read the ipod hardware revision from flash in the bootloader and passed it to Rockbox via a fixed address in SDRAM. Rockbox now remaps flash and so can just read the value itself. Also clean up the debug menu a little - only display the hw revision for ipods, and add the lcd_type variable to indicate the type of LCD (0 or 1) for ipod Color/Photo.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13986 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/hwcompat.h8
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c6
-rw-r--r--firmware/target/arm/system-pp5002.c2
-rw-r--r--firmware/target/arm/system-pp502x.c6
-rw-r--r--firmware/target/arm/system-target.h1
5 files changed, 11 insertions, 12 deletions
diff --git a/firmware/export/hwcompat.h b/firmware/export/hwcompat.h
index 2261a91a36..b75ea81c8c 100644
--- a/firmware/export/hwcompat.h
+++ b/firmware/export/hwcompat.h
@@ -53,4 +53,12 @@ static inline int tuner_detect_type(void)
bool is_new_player(void);
#endif
+#ifdef IPOD_ARCH
+#ifdef BOOTLOADER
+#define IPOD_HW_REVISION (*((unsigned long*)(0x00002084)))
+#else
+#define IPOD_HW_REVISION (*((unsigned long*)(0x20002084)))
+#endif
+#endif
+
#endif /* HWCOMPAT_H */
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index 6a29cbe680..c17b99b859 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -28,7 +28,7 @@
#include "lcd.h"
#include "kernel.h"
#include "system.h"
-
+#include "hwcompat.h"
/* check if number of useconds has past */
static inline bool timer_check(int clock_start, int usecs)
@@ -46,7 +46,7 @@ static inline bool timer_check(int clock_start, int usecs)
#define LCD_CNTL_VERT_RAM_ADDR_POS 0x45
/*** globals ***/
-static int lcd_type = 1; /* 0 = "old" Color/Photo, 1 = "new" Color & Nano */
+int lcd_type = 1; /* 0 = "old" Color/Photo, 1 = "new" Color & Nano */
static void lcd_wait_write(void)
{
@@ -109,7 +109,7 @@ void lcd_set_flip(bool yesno)
void lcd_init_device(void)
{
#if CONFIG_LCD == LCD_IPODCOLOR
- if (ipod_hw_rev == 0x60000) {
+ if (IPOD_HW_REVISION == 0x60000) {
lcd_type = 0;
} else {
int gpio_a01, gpio_a04;
diff --git a/firmware/target/arm/system-pp5002.c b/firmware/target/arm/system-pp5002.c
index 25e1f700eb..8ed6592694 100644
--- a/firmware/target/arm/system-pp5002.c
+++ b/firmware/target/arm/system-pp5002.c
@@ -18,7 +18,6 @@
****************************************************************************/
#include "system.h"
-unsigned int ipod_hw_rev;
#ifndef BOOTLOADER
extern void TIMER1(void);
extern void TIMER2(void);
@@ -149,7 +148,6 @@ void system_init(void)
MMAP3_LOGICAL = 0x20000000 | 0x3a00;
MMAP3_PHYSICAL = 0x00000000 | 0x3f84;
- ipod_hw_rev = (*((volatile unsigned long*)(0x01fffffc)));
outl(-1, 0xcf00101c);
outl(-1, 0xcf001028);
outl(-1, 0xcf001038);
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index 4fca84600b..e2497c92e2 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -19,8 +19,6 @@
#include "system.h"
#include "thread.h"
-unsigned int ipod_hw_rev;
-
#if NUM_CORES > 1
struct mutex boostctrl_mtx NOCACHEBSS_ATTR;
#endif
@@ -240,10 +238,6 @@ void system_init(void)
MMAP3_LOGICAL = 0x20000000 | 0x3a00;
MMAP3_PHYSICAL = 0x00000000 | 0x3f84;
- /* 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 */
COP_HI_INT_CLR = -1;
CPU_HI_INT_CLR = -1;
diff --git a/firmware/target/arm/system-target.h b/firmware/target/arm/system-target.h
index afb1ce7314..2a06ee471f 100644
--- a/firmware/target/arm/system-target.h
+++ b/firmware/target/arm/system-target.h
@@ -28,7 +28,6 @@
#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)
{