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
This commit is contained in:
Dave Chapman 2007-07-25 13:12:38 +00:00
parent ed095235d4
commit ebc076bc15
7 changed files with 27 additions and 27 deletions

View File

@ -630,6 +630,7 @@ static bool dbg_hw_info(void)
return false;
}
#elif defined(CPU_PP502x)
int line = 0;
char buf[32];
char pp_version[] = { (PP_VER2 >> 24) & 0xff, (PP_VER2 >> 16) & 0xff,
(PP_VER2 >> 8) & 0xff, (PP_VER2) & 0xff,
@ -640,16 +641,25 @@ static bool dbg_hw_info(void)
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
lcd_puts(0, 0, "[Hardware info]");
lcd_puts(0, line++, "[Hardware info]");
snprintf(buf, sizeof(buf), "HW rev: 0x%08x", ipod_hw_rev);
lcd_puts(0, 1, buf);
#ifdef IPOD_ARCH
snprintf(buf, sizeof(buf), "HW rev: 0x%08lx", IPOD_HW_REVISION);
lcd_puts(0, line++, buf);
#endif
#ifdef IPOD_COLOR
extern int lcd_type; /* Defined in lcd-colornano.c */
snprintf(buf, sizeof(buf), "LCD type: %d", lcd_type);
lcd_puts(0, line++, buf);
#endif
snprintf(buf, sizeof(buf), "PP version: %s", pp_version);
lcd_puts(0, 2, buf);
lcd_puts(0, line++, buf);
snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck());
lcd_puts(0, 3, buf);
lcd_puts(0, line++, buf);
lcd_update();

View File

@ -40,6 +40,7 @@
#include "power.h"
#include "file.h"
#include "common.h"
#include "hwcompat.h"
#define XSC(X) #X
#define SC(X) XSC(X)
@ -55,12 +56,6 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START;
/* Bootloader version */
char version[] = APPSVERSION;
#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_MENU 2
#define BUTTON_RIGHT 3
@ -240,9 +235,6 @@ void* main(void)
__backlight_on();
TMP_IPOD_HW_REVISION = IPOD_HW_REVISION;
ipod_hw_rev = IPOD_HW_REVISION;
system_init();
kernel_init();
lcd_init();
@ -300,7 +292,6 @@ void* main(void)
printf("Partition 1: 0x%02x %ld MB",
pinfo->type, pinfo->size / 2048);
if (button_was_held || (btn==BUTTON_MENU)) {
/* If either the hold switch was on, or the Menu button was held, then
try the Apple firmware */

View File

@ -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 */

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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)
{