summaryrefslogtreecommitdiffstats
path: root/bootloader
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 /bootloader
parent3f85262de2c7dfea0e27dfdbc1f317dac0643f52 (diff)
downloadrockbox-0a8d88228baf68c3bc515ca4a1add44aac7e5617.tar.gz
rockbox-0a8d88228baf68c3bc515ca4a1add44aac7e5617.tar.bz2
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
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/ipod.c57
1 files changed, 7 insertions, 50 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 @@
char version[] = APPSVERSION;
-typedef struct _image {
- unsigned type; /* '' */
- unsigned id; /* */
- unsigned pad1; /* 0000 0000 */
- unsigned devOffset; /* byte offset of start of image code */
- unsigned len; /* length in bytes of image */
- void *addr; /* load address */
- unsigned entryOffset; /* execution start within image */
- unsigned chksum; /* checksum for image */
- unsigned vers; /* image version */
- unsigned loadAddr; /* load address for image */
-} image_t;
-
-extern image_t boot_table[];
-
int line=0;
-static void memmove16(void *dest, const void *src, unsigned count)
-{
- struct bufstr {
- unsigned _buf[4];
- } *d, *s;
-
- if (src >= dest) {
- count = (count + 15) >> 4;
- d = (struct bufstr *) dest;
- s = (struct bufstr *) src;
- while (count--)
- *d++ = *s++;
- } else {
- count = (count + 15) >> 4;
- d = (struct bufstr *)(dest + (count <<4));
- s = (struct bufstr *)(src + (count <<4));
- while (count--)
- *--d = *--s;
- }
-}
-
#if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI)
/* check if number of seconds has past */
int timer_check(int clock_start, unsigned int usecs)
@@ -318,12 +282,8 @@ unsigned char loadbuffer[MAX_LOADSIZE];
void* main(void)
{
char buf[256];
- int imageno=0;
int i;
int rc;
- int padding = 0x4400;
- image_t *tblp = boot_table;
- void* entry;
struct partinfo* pinfo;
unsigned short* identify_info;
@@ -447,17 +407,14 @@ void* main(void)
lcd_puts(0, line, "Loading original firmware...");
lcd_update();
- /* Pause for 5 seconds so we can see what's happened */
-// udelay(5000000);
-
- entry = tblp->addr + tblp->entryOffset;
- if (imageno || ((int)tblp->addr & 0xffffff) != 0) {
- memmove16(tblp->addr, tblp->addr + tblp->devOffset - padding,
- tblp->len);
- }
+ /* The original firmware should already be at the correct location
+ in RAM - the Rockbox bootloader has been appended to the end of
+ it, and the "entryOffset" in the firmware header modified to
+ tell the Apple bootloader to pass execution to our bootloader,
+ rather than the start of the original firmware - which is
+ always at the start of RAM. */
- /* Return the start address in loaded image */
- return entry;
+ return (void*)DRAM_START;
}
/* These functions are present in the firmware library, but we reimplement