summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/rolo.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c
index e729f3a7e1..cae5eda180 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -31,8 +31,8 @@
31#include "buffer.h" 31#include "buffer.h"
32 32
33#if (CONFIG_CPU != TCC730) && !defined(IRIVER_IFP7XX_SERIES) && \ 33#if (CONFIG_CPU != TCC730) && !defined(IRIVER_IFP7XX_SERIES) && \
34 !defined(IPOD_ARCH) 34 (CONFIG_CPU != PP5002)
35/* FIX: this doesn't work on Gmini, iFP and iPods yet */ 35/* FIX: this doesn't work on Gmini, iFP or 3rd Gen ipods yet */
36 36
37#define IRQ0_EDGE_TRIGGER 0x80 37#define IRQ0_EDGE_TRIGGER 0x80
38 38
@@ -62,6 +62,9 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
62{ 62{
63 long i; 63 long i;
64 unsigned char* localdest = dest; 64 unsigned char* localdest = dest;
65#if (CONFIG_CPU==PP5020)
66 unsigned long* memmapregs = (unsigned long*)0xf000f000;
67#endif
65 68
66 for(i = 0;i < length;i++) 69 for(i = 0;i < length;i++)
67 *localdest++ = *source++; 70 *localdest++ = *source++;
@@ -74,9 +77,22 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
74 "jmp (%0) \n" 77 "jmp (%0) \n"
75 : : "a"(dest) 78 : : "a"(dest)
76 ); 79 );
77#endif 80#elif (CONFIG_CPU==PP5020)
78#if (CONFIG_CPU == PP5002) || (CONFIG_CPU==PP5020) 81 /* Copy a further 8KB of data to try and ensure the cache is flushed */
79 /* TODO: Implement for iPod */ 82 for(i = length; i < length+8192; i++)
83 *localdest++ = *source++;
84
85 /* Disable cache */
86 outl(0x0, 0x6000C000);
87
88 /* Reset the memory mapping registers to zero */
89 for (i=0;i<8;i++)
90 memmapregs[i]=0;
91
92 asm volatile(
93 "mov r0, #0x10000000 \n"
94 "mov pc, r0 \n"
95 );
80#endif 96#endif
81} 97}
82#endif 98#endif
@@ -131,6 +147,10 @@ int rolo_load(const char* filename)
131 rolo_error("Error Reading checksum"); 147 rolo_error("Error Reading checksum");
132 return -1; 148 return -1;
133 } 149 }
150
151 /* Rockbox checksums are big-endian */
152 file_checksum = betoh32(file_checksum);
153
134 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET); 154 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
135 155
136 if (read(fd, audiobuf, length) != length) { 156 if (read(fd, audiobuf, length) != length) {