summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-12-10 13:33:12 +0000
committerDave Chapman <dave@dchapman.com>2006-12-10 13:33:12 +0000
commit0a8d88228baf68c3bc515ca4a1add44aac7e5617 (patch)
treeb42a2caade6c8e14cc0f06df06d891d668e8a197
parent3f85262de2c7dfea0e27dfdbc1f317dac0643f52 (diff)
downloadrockbox-0a8d88228baf68c3bc515ca4a1add44aac7e5617.tar.gz
rockbox-0a8d88228baf68c3bc515ca4a1add44aac7e5617.zip
Remove unused code in (and hence simplify) the ipod bootloader - the image header parsing and memmove isn't used in Rockbox, it was just leftover from the original ipodlinux loader. Note that we still need the empty space in the bootloader (400 bytes starting at 0x100 - the 'boot_table' definition in firmware/target/arm/crt0-pp.S) to maintain compatibility with ipod_fw/make_fw (which will write information there that we have always ignored).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11704 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/ipod.c57
-rw-r--r--firmware/boot.lds4
2 files changed, 7 insertions, 54 deletions
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index 26e5ae2937..878ef105b3 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -65,44 +65,8 @@
65 65
66char version[] = APPSVERSION; 66char version[] = APPSVERSION;
67 67
68typedef struct _image {
69 unsigned type; /* '' */
70 unsigned id; /* */
71 unsigned pad1; /* 0000 0000 */
72 unsigned devOffset; /* byte offset of start of image code */
73 unsigned len; /* length in bytes of image */
74 void *addr; /* load address */
75 unsigned entryOffset; /* execution start within image */
76 unsigned chksum; /* checksum for image */
77 unsigned vers; /* image version */
78 unsigned loadAddr; /* load address for image */
79} image_t;
80
81extern image_t boot_table[];
82
83int line=0; 68int line=0;
84 69
85static void memmove16(void *dest, const void *src, unsigned count)
86{
87 struct bufstr {
88 unsigned _buf[4];
89 } *d, *s;
90
91 if (src >= dest) {
92 count = (count + 15) >> 4;
93 d = (struct bufstr *) dest;
94 s = (struct bufstr *) src;
95 while (count--)
96 *d++ = *s++;
97 } else {
98 count = (count + 15) >> 4;
99 d = (struct bufstr *)(dest + (count <<4));
100 s = (struct bufstr *)(src + (count <<4));
101 while (count--)
102 *--d = *--s;
103 }
104}
105
106#if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI) 70#if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI)
107/* check if number of seconds has past */ 71/* check if number of seconds has past */
108int timer_check(int clock_start, unsigned int usecs) 72int timer_check(int clock_start, unsigned int usecs)
@@ -318,12 +282,8 @@ unsigned char loadbuffer[MAX_LOADSIZE];
318void* main(void) 282void* main(void)
319{ 283{
320 char buf[256]; 284 char buf[256];
321 int imageno=0;
322 int i; 285 int i;
323 int rc; 286 int rc;
324 int padding = 0x4400;
325 image_t *tblp = boot_table;
326 void* entry;
327 struct partinfo* pinfo; 287 struct partinfo* pinfo;
328 unsigned short* identify_info; 288 unsigned short* identify_info;
329 289
@@ -447,17 +407,14 @@ void* main(void)
447 lcd_puts(0, line, "Loading original firmware..."); 407 lcd_puts(0, line, "Loading original firmware...");
448 lcd_update(); 408 lcd_update();
449 409
450 /* Pause for 5 seconds so we can see what's happened */ 410 /* The original firmware should already be at the correct location
451// udelay(5000000); 411 in RAM - the Rockbox bootloader has been appended to the end of
452 412 it, and the "entryOffset" in the firmware header modified to
453 entry = tblp->addr + tblp->entryOffset; 413 tell the Apple bootloader to pass execution to our bootloader,
454 if (imageno || ((int)tblp->addr & 0xffffff) != 0) { 414 rather than the start of the original firmware - which is
455 memmove16(tblp->addr, tblp->addr + tblp->devOffset - padding, 415 always at the start of RAM. */
456 tblp->len);
457 }
458 416
459 /* Return the start address in loaded image */ 417 return (void*)DRAM_START;
460 return entry;
461} 418}
462 419
463/* These functions are present in the firmware library, but we reimplement 420/* These functions are present in the firmware library, but we reimplement
diff --git a/firmware/boot.lds b/firmware/boot.lds
index f361e45e9e..556e8db990 100644
--- a/firmware/boot.lds
+++ b/firmware/boot.lds
@@ -7,15 +7,11 @@ INPUT(target/coldfire/crt0.o)
7#elif defined (CPU_ARM) 7#elif defined (CPU_ARM)
8OUTPUT_FORMAT(elf32-littlearm) 8OUTPUT_FORMAT(elf32-littlearm)
9OUTPUT_ARCH(arm) 9OUTPUT_ARCH(arm)
10#ifndef IPOD_ARCH
11/* the ipods can't have the crt0.o mentioned here, but the others can't do
12 without it! */
13#ifdef CPU_PP 10#ifdef CPU_PP
14INPUT(target/arm/crt0-pp.o) 11INPUT(target/arm/crt0-pp.o)
15#else 12#else
16INPUT(target/arm/crt0.o) 13INPUT(target/arm/crt0.o)
17#endif 14#endif
18#endif
19#else 15#else
20OUTPUT_FORMAT(elf32-sh) 16OUTPUT_FORMAT(elf32-sh)
21INPUT(target/sh/crt0.o) 17INPUT(target/sh/crt0.o)