From 82f9056988331572e01231d70fadc64b7ab76c6f Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Sun, 4 Mar 2007 20:06:41 +0000 Subject: Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - iPod G3 will be coming soon.) This allows threads to be run on either core provided that all communications between the cores is done using uncached memory. There should be no significant change in battery life from doing this. Documentation (on the RockboxKernel wiki page) will follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12601 a1c6a512-1295-4272-9138-f99709370657 --- apps/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'apps/main.c') diff --git a/apps/main.c b/apps/main.c index 6286b68ed1..e4d90bce61 100644 --- a/apps/main.c +++ b/apps/main.c @@ -296,6 +296,9 @@ static void init(void) #if CONFIG_CHARGING && (CONFIG_CPU == SH7034) /* if nobody initialized ATA before, I consider this a cold start */ bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */ +#endif +#ifdef CPU_PP + COP_CTL = PROC_WAKE; #endif system_init(); kernel_init(); @@ -549,19 +552,22 @@ void cop_main(void) so it should not be assumed that the coprocessor be usable even on platforms which support it. - At present the COP sleeps unless it receives a message from the CPU telling - it that we are loading a new kernel, so must reboot */ + A kernel thread runs on the coprocessor which waits for other threads to be + added, and gracefully handles RoLo */ #if CONFIG_CPU == PP5002 -/* 3G doesn't have Rolo support yet */ +/* 3G doesn't have Rolo or dual core support yet */ while(1) { COP_CTL = PROC_SLEEP; } #else extern volatile unsigned char cpu_message; + system_init(); + kernel_init(); + while(cpu_message != COP_REBOOT) { - COP_CTL = PROC_SLEEP; + sleep(HZ); } rolo_restart_cop(); #endif /* PP5002 */ -- cgit v1.2.3