summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c14
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 */