From d055ffe715458267c4f5fdfc43807268a9da68d8 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 12 Apr 2008 23:55:30 +0000 Subject: Refine information and macros for clock skipping. Not functional changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17091 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/pp5020.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h index bda4665..1635119 100644 --- a/firmware/export/pp5020.h +++ b/firmware/export/pp5020.h @@ -162,23 +162,21 @@ #define COP_CTL (*(volatile unsigned long *)(0x60007004)) #define PROC_CTL(core) ((&CPU_CTL)[core]) -#define PROC_SLEEP 0x80000000 -#define PROC_WAIT 0x40000000 -#define PROC_WAIT_CLR 0x20000000 -#define PROC_CNT_START 0x08000000 +/* Control flags, can be ORed together */ +#define PROC_SLEEP 0x80000000 /* Sleep until an interrupt occurs */ +#define PROC_WAIT_CNT 0x40000000 /* Sleep until end of countdown */ +#define PROC_WAKE_INT 0x20000000 /* Fire interrupt on wake-up. Auto-clears. */ + +/* Counter source, select one */ +#define PROC_CNT_CLKS 0x08000000 /* Clock cycles */ +#define PROC_CNT_USEC 0x02000000 /* Microseconds */ +#define PROC_CNT_MSEC 0x01000000 /* Milliseconds */ +#define PROC_CNT_SEC 0x00800000 /* Seconds. Works on PP5022+ only! */ + #define PROC_WAKE 0x00000000 + /** - * This is based on some quick but sound experiments on PP5022C. - * CPU/COP_CTL bitmap: - * [31] - sleep until an interrupt occurs - * [30] - wait for cycle countdown to 0 - * [29] - wait for cycle countdown to 0 - * behaves identically to bit 30 unless bit 30 is set as well - * in which case this bit is cleared at the end of the count - * [28] - unknown - no execution effect observed yet - * [27] - begin cycle countdown - * [26:8] - semaphore flags for core communication ? - * no execution effect observed yet + * [22:8] - Semaphore flags for core communication? No execution effect observed * [11:8] seem to often be set to the core's own ID * nybble when sleeping - 0x5 or 0xa. * [7:0] - W: number of cycles to skip on next instruction @@ -190,6 +188,7 @@ * Reading CPU_CTL after the nop will return 0x48000000 */ + /* Cache Control */ #define CACHE_PRIORITY (*(volatile unsigned long *)(0x60006044)) #define CACHE_CTL (*(volatile unsigned long *)(0x6000c000)) -- cgit v1.1