diff options
| author | Dave Chapman <dave@dchapman.com> | 2006-07-23 14:30:10 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2006-07-23 14:30:10 +0000 |
| commit | ffc0cab8167ab0ac5ceb4153cdc545045aed3bce (patch) | |
| tree | 5ba143ef8df7fd32a3ca726f8ed2982e4527c92e | |
| parent | 9161425b08332de7d9f9eb7c5296c3120dcbc294 (diff) | |
| download | rockbox-ffc0cab8167ab0ac5ceb4153cdc545045aed3bce.zip rockbox-ffc0cab8167ab0ac5ceb4153cdc545045aed3bce.tar.gz rockbox-ffc0cab8167ab0ac5ceb4153cdc545045aed3bce.tar.bz2 rockbox-ffc0cab8167ab0ac5ceb4153cdc545045aed3bce.tar.xz | |
Implement Rolo for the PP502x-based ipods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10293 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/rolo.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c index e729f3a..cae5eda 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c @@ -31,8 +31,8 @@ #include "buffer.h" #if (CONFIG_CPU != TCC730) && !defined(IRIVER_IFP7XX_SERIES) && \ - !defined(IPOD_ARCH) -/* FIX: this doesn't work on Gmini, iFP and iPods yet */ + (CONFIG_CPU != PP5002) +/* FIX: this doesn't work on Gmini, iFP or 3rd Gen ipods yet */ #define IRQ0_EDGE_TRIGGER 0x80 @@ -62,6 +62,9 @@ void rolo_restart(const unsigned char* source, unsigned char* dest, { long i; unsigned char* localdest = dest; +#if (CONFIG_CPU==PP5020) + unsigned long* memmapregs = (unsigned long*)0xf000f000; +#endif for(i = 0;i < length;i++) *localdest++ = *source++; @@ -74,9 +77,22 @@ void rolo_restart(const unsigned char* source, unsigned char* dest, "jmp (%0) \n" : : "a"(dest) ); -#endif -#if (CONFIG_CPU == PP5002) || (CONFIG_CPU==PP5020) - /* TODO: Implement for iPod */ +#elif (CONFIG_CPU==PP5020) + /* Copy a further 8KB of data to try and ensure the cache is flushed */ + for(i = length; i < length+8192; i++) + *localdest++ = *source++; + + /* Disable cache */ + outl(0x0, 0x6000C000); + + /* Reset the memory mapping registers to zero */ + for (i=0;i<8;i++) + memmapregs[i]=0; + + asm volatile( + "mov r0, #0x10000000 \n" + "mov pc, r0 \n" + ); #endif } #endif @@ -131,6 +147,10 @@ int rolo_load(const char* filename) rolo_error("Error Reading checksum"); return -1; } + + /* Rockbox checksums are big-endian */ + file_checksum = betoh32(file_checksum); + lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET); if (read(fd, audiobuf, length) != length) { |