summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-29 06:56:21 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-29 06:56:21 +0000
commit3e7d4f0d147199d503ab24708ff787850bb6a990 (patch)
treef4d2db2cae1a94de3c58f8d0840b2766c3ff1d38
parentda55251a35d8ad6c0b8b9e62904798212caba46f (diff)
downloadrockbox-3e7d4f0d147199d503ab24708ff787850bb6a990.tar.gz
rockbox-3e7d4f0d147199d503ab24708ff787850bb6a990.zip
Anti-red?
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14899 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/export/config.h19
-rw-r--r--firmware/rolo.c10
3 files changed, 17 insertions, 14 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 58595a493a..45bedd9dbe 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -13,9 +13,7 @@ logf.c
13profile.c 13profile.c
14#endif /* RB_PROFILE */ 14#endif /* RB_PROFILE */
15kernel.c 15kernel.c
16#ifndef BOOTLOADER
17rolo.c 16rolo.c
18#endif /* BOOTLOADER */
19thread.c 17thread.c
20timer.c 18timer.c
21#endif /* SIMULATOR */ 19#endif /* SIMULATOR */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 784856d2f2..9bf589a459 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -364,7 +364,11 @@
364#endif 364#endif
365 365
366/* Dual core support - not yet working on the 1G/2G and 3G iPod */ 366/* Dual core support - not yet working on the 1G/2G and 3G iPod */
367#if defined(CPU_PP) && CONFIG_CPU != PP5002 && !defined(BOOTLOADER) 367#if defined(CPU_PP)
368#define IDLE_STACK_SIZE 0x80
369#define IDLE_STACK_WORDS 0x20
370
371#if !defined(BOOTLOADER) && CONFIG_CPU != PP5002
368#define NUM_CORES 2 372#define NUM_CORES 2
369#define CURRENT_CORE current_core() 373#define CURRENT_CORE current_core()
370/* Hopefully at some point we will learn how to mark areas of main memory as 374/* Hopefully at some point we will learn how to mark areas of main memory as
@@ -373,18 +377,17 @@
373#define NOCACHEDATA_ATTR IDATA_ATTR 377#define NOCACHEDATA_ATTR IDATA_ATTR
374 378
375#define IF_COP(...) __VA_ARGS__ 379#define IF_COP(...) __VA_ARGS__
380#endif /* !defined(BOOTLOADER) && CONFIG_CPU != PP5002 */
381#endif /* CPU_PP */
376 382
377#define IDLE_STACK_SIZE 0x80 383#ifndef NUM_CORES
378#define IDLE_STACK_WORDS 0x20 384/* Default to single core */
379
380#else
381#define NUM_CORES 1 385#define NUM_CORES 1
382#define CURRENT_CORE CPU 386#define CURRENT_CORE CPU
383#define NOCACHEBSS_ATTR 387#define NOCACHEBSS_ATTR
384#define NOCACHEDATA_ATTR 388#define NOCACHEDATA_ATTR
385 389
386#define IF_COP(...) 390#define IF_COP(...)
391#endif /* NUM_CORES */
387 392
388#endif /* Processor specific */ 393#endif /* __CONFIG_H__ */
389
390#endif
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 1e9fc45984..9f83f916f9 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -51,11 +51,10 @@
51 * TODO: Use the mailboxes built into the PP processor for this 51 * TODO: Use the mailboxes built into the PP processor for this
52 */ 52 */
53 53
54#if NUM_CORES > 1
54volatile unsigned char IDATA_ATTR cpu_message = 0; 55volatile unsigned char IDATA_ATTR cpu_message = 0;
55volatile unsigned char IDATA_ATTR cpu_reply = 0; 56volatile unsigned char IDATA_ATTR cpu_reply = 0;
56#if NUM_CORES > 1
57extern int cop_idlestackbegin[]; 57extern int cop_idlestackbegin[];
58#endif
59 58
60void rolo_restart_cop(void) ICODE_ATTR; 59void rolo_restart_cop(void) ICODE_ATTR;
61void rolo_restart_cop(void) 60void rolo_restart_cop(void)
@@ -92,7 +91,8 @@ void rolo_restart_cop(void)
92 "mov pc, r0 \n" 91 "mov pc, r0 \n"
93 ); 92 );
94} 93}
95#endif 94#endif /* NUM_CORES > 1 */
95#endif /* CPU_PP */
96 96
97static void rolo_error(const char *text) 97static void rolo_error(const char *text)
98{ 98{
@@ -154,11 +154,13 @@ void rolo_restart(const unsigned char* source, unsigned char* dest,
154 for (i=0;i<8;i++) 154 for (i=0;i<8;i++)
155 memmapregs[i]=0; 155 memmapregs[i]=0;
156 156
157#if NUM_CORES > 1
157 /* Tell the COP it's safe to continue rebooting */ 158 /* Tell the COP it's safe to continue rebooting */
158 cpu_message = 1; 159 cpu_message = 1;
159 160
160 /* Wait for the COP to tell us it is rebooting */ 161 /* Wait for the COP to tell us it is rebooting */
161 while(cpu_reply != 2); 162 while(cpu_reply != 2);
163#endif
162 164
163 asm volatile( 165 asm volatile(
164 "mov r0, #0x10000000 \n" 166 "mov r0, #0x10000000 \n"
@@ -226,7 +228,7 @@ int rolo_load(const char* filename)
226 file_checksum = betoh32(file_checksum); 228 file_checksum = betoh32(file_checksum);
227#endif 229#endif
228 230
229#ifdef CPU_PP 231#if defined(CPU_PP) && NUM_CORES > 1
230 lcd_puts(0, 2, "Waiting for coprocessor..."); 232 lcd_puts(0, 2, "Waiting for coprocessor...");
231 lcd_update(); 233 lcd_update();
232 rolo_restart_cop(); 234 rolo_restart_cop();