Bootloader adjustments for H110

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7072 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-07-08 15:09:44 +00:00
parent 2d25122431
commit e82df4e597

View file

@ -35,6 +35,14 @@
#include "power.h" #include "power.h"
#include "file.h" #include "file.h"
#ifdef IRIVER_H100
#define MODEL_NUMBER 1
#define DRAM_START 0x30000000
#else
#define MODEL_NUMBER 0
#define DRAM_START 0x31000000
#endif
int line = 0; int line = 0;
int usb_screen(void) int usb_screen(void)
@ -88,7 +96,7 @@ int load_firmware(void)
unsigned long chksum; unsigned long chksum;
unsigned long sum; unsigned long sum;
int i; int i;
unsigned char *buf = (unsigned char *)0x31000000; unsigned char *buf = (unsigned char *)DRAM_START;
char str[80]; char str[80];
fd = open("/rockbox.iriver", O_RDONLY); fd = open("/rockbox.iriver", O_RDONLY);
@ -119,7 +127,7 @@ int load_firmware(void)
close(fd); close(fd);
sum = 0; sum = MODEL_NUMBER;
for(i = 0;i < len;i++) { for(i = 0;i < len;i++) {
sum += buf[i]; sum += buf[i];
@ -135,16 +143,17 @@ int load_firmware(void)
return 0; return 0;
} }
void start_firmware(void) void start_firmware(void)
{ {
asm(" move.w #0x2700,%sr"); asm(" move.w #0x2700,%sr");
/* Reset the cookie for the crt0 crash check */ /* Reset the cookie for the crt0 crash check */
asm(" move.l #0,%d0"); asm(" move.l #0,%d0");
asm(" move.l %d0,0x10017ffc"); asm(" move.l %d0,0x10017ffc");
asm(" move.l #0x31000000,%d0"); asm(" move.l %0,%%d0" :: "i"(DRAM_START));
asm(" movec.l %d0,%vbr"); asm(" movec.l %d0,%vbr");
asm(" move.l 0x31000000,%sp"); asm(" move.l %0,%%sp" :: "m"(*(int *)DRAM_START));
asm(" move.l 0x31000004,%a0"); asm(" move.l %0,%%a0" :: "m"(*(int *)(DRAM_START+4)));
asm(" jmp (%a0)"); asm(" jmp (%a0)");
} }