summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorDaniel Ankers <dan@weirdo.org.uk>2007-03-04 20:06:41 +0000
committerDaniel Ankers <dan@weirdo.org.uk>2007-03-04 20:06:41 +0000
commit82f9056988331572e01231d70fadc64b7ab76c6f (patch)
tree9f1d33b904516fd5eeac2067e4afb32ce5e990df /firmware/export
parent74e572c9d600247ee795b206da3715f6af442a25 (diff)
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 'firmware/export')
-rw-r--r--firmware/export/config.h39
-rw-r--r--firmware/export/pp5002.h3
-rw-r--r--firmware/export/pp5020.h9
-rw-r--r--firmware/export/thread.h9
4 files changed, 38 insertions, 22 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index d848d16155..13fb77661d 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -273,21 +273,6 @@
/* define for all cpus from PP family */
#if (CONFIG_CPU == PP5002) || (CONFIG_CPU == PP5020) || (CONFIG_CPU == PP5024)
#define CPU_PP
-
-/* PP family has dual cores */
-#if 0
-/* Keep it as single core until dual core support is ready */
-#define NUM_CORES 2
-#define CURRENT_CORE current_core()
-#endif
-
-#define NUM_CORES 1
-#define CURRENT_CORE 0
-
-#define COP_REBOOT 0x00000001
-#else
-#define NUM_CORES 1
-#define CURRENT_CORE 0
#endif
/* define for all cpus from ARM family */
@@ -348,4 +333,28 @@
#define IRAM_LCDFRAMEBUFFER
#endif
+/* Dual core support - not yet working on the 3G iPod */
+#if defined(CPU_PP) && CONFIG_CPU != PP5002
+#define NUM_CORES 2
+#define CURRENT_CORE current_core()
+/* Hopefully at some point we will learn how to mark areas of main memory as
+ * not to be cached. Until then, use IRAM for variables shared across cores */
+#define NOCACHEBSS_ATTR IBSS_ATTR
+#define NOCACHEDATA_ATTR IDATA_ATTR
+
+#define IF_COP(empty, x, y) , x, y
+
+/* Defines for inter-core messaging */
+#define COP_REBOOT 1
+
+#else
+#define NUM_CORES 1
+#define CURRENT_CORE CPU
+#define NOCACHEBSS_ATTR
+#define NOCACHEDATA_ATTR
+
+#define IF_COP(empty, x, y)
+
+#endif /* Processor specific */
+
#endif
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h
index ef131fe6d6..9636313390 100644
--- a/firmware/export/pp5002.h
+++ b/firmware/export/pp5002.h
@@ -73,6 +73,9 @@
#define CPU_INT_STAT (*(volatile unsigned long*)(0xcf001000))
#define CPU_INT_EN (*(volatile unsigned long*)(0xcf001024))
#define CPU_INT_CLR (*(volatile unsigned long*)(0xcf001028))
+#define COP_INT_STAT (*(volatile unsigned long*)(0xcf001010)) /* A guess */
+#define COP_INT_EN (*(volatile unsigned long*)(0xcf001034))
+#define COP_INT_CLR (*(volatile unsigned long*)(0xcf001038))
#define USB2D_IDENT (*(volatile unsigned long*)(0xc5000000))
#define USB_STATUS (*(volatile unsigned long*)(0xc50001a4))
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h
index 3d205a0ea1..a34f1251c9 100644
--- a/firmware/export/pp5020.h
+++ b/firmware/export/pp5020.h
@@ -30,6 +30,15 @@
#define PROC_ID_CPU 0x55
#define PROC_ID_COP 0xaa
+/* Mailboxes */
+/* Each processor has two mailboxes it can write to and two which
+ it can read from. We define the first to be for sending messages
+ and the second for replying to messages */
+#define CPU_MESSAGE (*(volatile unsigned long *)(0x60001000))
+#define COP_MESSAGE (*(volatile unsigned long *)(0x60001004))
+#define CPU_REPLY (*(volatile unsigned long *)(0x60001008))
+#define COP_REPLY (*(volatile unsigned long *)(0x6000100c))
+
/* Interrupts */
#define CPU_INT_STAT (*(volatile unsigned long*)(0x64004000))
#define COP_INT_STAT (*(volatile unsigned long*)(0x60004004))
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index bced98ea23..2ff4694159 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -124,13 +124,8 @@ struct core_entry {
struct thread_entry*
create_thread(void (*function)(void), void* stack, int stack_size,
- const char *name IF_PRIO(, int priority));
-
-struct thread_entry*
- create_thread_on_core(unsigned int core, void (*function)(void),
- void* stack, int stack_size,
- const char *name
- IF_PRIO(, int priority));
+ const char *name IF_PRIO(, int priority)
+ IF_COP(, unsigned int core, bool fallback));
#ifdef HAVE_SCHEDULER_BOOSTCTRL
void trigger_cpu_boost(void);