Fix RoLo on PortalPlayer targets

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12609 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Ankers 2007-03-04 23:53:38 +00:00
parent fa6c449565
commit ee07215d50
1 changed files with 11 additions and 0 deletions

View File

@ -55,10 +55,14 @@ void rolo_restart_cop(void)
/* Disable cache */
CACHE_CTL = CACHE_DISABLE;
/* Tell the main core that we're ready to reload */
cpu_reply = 2;
/* Wait while RoLo loads the image into SDRAM */
/* TODO: Accept checksum failure gracefully */
while(cpu_message == 1) {}
/* Acknowledge the CPU and then reload */
cpu_reply = 1;
asm volatile(
@ -111,6 +115,7 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
);
#elif (CONFIG_CPU==PP5020) || (CONFIG_CPU==PP5024)
/* Tell the COP that we've finished loading and started rebooting */
cpu_message = 0;
/* Flush cache */
@ -124,6 +129,7 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
for (i=0;i<8;i++)
memmapregs[i]=0;
/* Wait for the COP to tell us it is rebooting */
while(cpu_reply != 1) {}
asm volatile(
@ -190,6 +196,11 @@ int rolo_load(const char* filename)
#ifdef CPU_PP
cpu_message = COP_REBOOT;
COP_CTL = PROC_WAKE;
lcd_puts(0, 2, "Waiting for coprocessor...");
lcd_update();
while(cpu_reply != 2) {}
lcd_puts(0, 2, " ");
lcd_update();
#endif
lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);