diff options
author | Daniel Ankers <dan@weirdo.org.uk> | 2007-03-04 20:06:41 +0000 |
---|---|---|
committer | Daniel Ankers <dan@weirdo.org.uk> | 2007-03-04 20:06:41 +0000 |
commit | 82f9056988331572e01231d70fadc64b7ab76c6f (patch) | |
tree | 9f1d33b904516fd5eeac2067e4afb32ce5e990df /apps/main.c | |
parent | 74e572c9d600247ee795b206da3715f6af442a25 (diff) | |
download | rockbox-82f9056988331572e01231d70fadc64b7ab76c6f.tar.gz rockbox-82f9056988331572e01231d70fadc64b7ab76c6f.zip |
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
Diffstat (limited to 'apps/main.c')
-rw-r--r-- | apps/main.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/main.c b/apps/main.c index 6286b68ed1..e4d90bce61 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -297,6 +297,9 @@ static void init(void) | |||
297 | /* if nobody initialized ATA before, I consider this a cold start */ | 297 | /* if nobody initialized ATA before, I consider this a cold start */ |
298 | bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */ | 298 | bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */ |
299 | #endif | 299 | #endif |
300 | #ifdef CPU_PP | ||
301 | COP_CTL = PROC_WAKE; | ||
302 | #endif | ||
300 | system_init(); | 303 | system_init(); |
301 | kernel_init(); | 304 | kernel_init(); |
302 | 305 | ||
@@ -549,19 +552,22 @@ void cop_main(void) | |||
549 | so it should not be assumed that the coprocessor be usable even on | 552 | so it should not be assumed that the coprocessor be usable even on |
550 | platforms which support it. | 553 | platforms which support it. |
551 | 554 | ||
552 | At present the COP sleeps unless it receives a message from the CPU telling | 555 | A kernel thread runs on the coprocessor which waits for other threads to be |
553 | it that we are loading a new kernel, so must reboot */ | 556 | added, and gracefully handles RoLo */ |
554 | 557 | ||
555 | #if CONFIG_CPU == PP5002 | 558 | #if CONFIG_CPU == PP5002 |
556 | /* 3G doesn't have Rolo support yet */ | 559 | /* 3G doesn't have Rolo or dual core support yet */ |
557 | while(1) { | 560 | while(1) { |
558 | COP_CTL = PROC_SLEEP; | 561 | COP_CTL = PROC_SLEEP; |
559 | } | 562 | } |
560 | #else | 563 | #else |
561 | extern volatile unsigned char cpu_message; | 564 | extern volatile unsigned char cpu_message; |
562 | 565 | ||
566 | system_init(); | ||
567 | kernel_init(); | ||
568 | |||
563 | while(cpu_message != COP_REBOOT) { | 569 | while(cpu_message != COP_REBOOT) { |
564 | COP_CTL = PROC_SLEEP; | 570 | sleep(HZ); |
565 | } | 571 | } |
566 | rolo_restart_cop(); | 572 | rolo_restart_cop(); |
567 | #endif /* PP5002 */ | 573 | #endif /* PP5002 */ |