diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-07-08 15:09:44 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-07-08 15:09:44 +0000 |
commit | e82df4e5970fbf970f471db81df56cc55d977a7c (patch) | |
tree | 68282ce5dcaa0a2a9060835baa1e643883796693 /bootloader | |
parent | 2d251224313a42efbbd5b7cde5ccc9245138fbc4 (diff) | |
download | rockbox-e82df4e5970fbf970f471db81df56cc55d977a7c.tar.gz rockbox-e82df4e5970fbf970f471db81df56cc55d977a7c.zip |
Bootloader adjustments for H110
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7072 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/main.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/bootloader/main.c b/bootloader/main.c index 208d5cf662..736b0a6f5f 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -35,6 +35,14 @@ #include "power.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 usb_screen(void) @@ -88,7 +96,7 @@ int load_firmware(void) unsigned long chksum; unsigned long sum; int i; - unsigned char *buf = (unsigned char *)0x31000000; + unsigned char *buf = (unsigned char *)DRAM_START; char str[80]; fd = open("/rockbox.iriver", O_RDONLY); @@ -119,7 +127,7 @@ int load_firmware(void) close(fd); - sum = 0; + sum = MODEL_NUMBER; for(i = 0;i < len;i++) { sum += buf[i]; @@ -135,16 +143,17 @@ int load_firmware(void) return 0; } + void start_firmware(void) { asm(" move.w #0x2700,%sr"); /* Reset the cookie for the crt0 crash check */ asm(" move.l #0,%d0"); asm(" move.l %d0,0x10017ffc"); - asm(" move.l #0x31000000,%d0"); + asm(" move.l %0,%%d0" :: "i"(DRAM_START)); asm(" movec.l %d0,%vbr"); - asm(" move.l 0x31000000,%sp"); - asm(" move.l 0x31000004,%a0"); + asm(" move.l %0,%%sp" :: "m"(*(int *)DRAM_START)); + asm(" move.l %0,%%a0" :: "m"(*(int *)(DRAM_START+4))); asm(" jmp (%a0)"); } |