summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-29 14:30:12 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-29 14:30:12 +0000
commitffefe0c08bdeeab725ce5fc054b3add4e05a1f7f (patch)
treedfc702293ed4218f62c57b8d3ba29e5ae49dc263 /firmware/export
parentc5dedd7d762f48e940ecc0bd17dd2173d59a92e1 (diff)
downloadrockbox-ffefe0c08bdeeab725ce5fc054b3add4e05a1f7f.zip
rockbox-ffefe0c08bdeeab725ce5fc054b3add4e05a1f7f.tar.gz
rockbox-ffefe0c08bdeeab725ce5fc054b3add4e05a1f7f.tar.bz2
rockbox-ffefe0c08bdeeab725ce5fc054b3add4e05a1f7f.tar.xz
Put TIMER_FREQ definition in CPU-specific config, and remove timer-target.h
Note : SH has TIMER_FREQ defined to CPU_FREQ, so any code wanting it must include #config.h before #cpu.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21560 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/as3525.h3
-rw-r--r--firmware/export/at91sam9260.h4
-rw-r--r--firmware/export/dm320.h4
-rwxr-xr-xfirmware/export/imx31l.h4
-rw-r--r--firmware/export/jz4740.h3
-rw-r--r--firmware/export/mcf5249.h3
-rw-r--r--firmware/export/pnx0101.h3
-rw-r--r--firmware/export/pp5002.h4
-rw-r--r--firmware/export/pp5020.h4
-rw-r--r--firmware/export/s3c2440.h7
-rw-r--r--firmware/export/sh7034.h3
-rw-r--r--firmware/export/tcc77x.h4
-rw-r--r--firmware/export/tcc780x.h4
-rw-r--r--firmware/export/timer.h15
14 files changed, 52 insertions, 13 deletions
diff --git a/firmware/export/as3525.h b/firmware/export/as3525.h
index 31bbeed..39e0706 100644
--- a/firmware/export/as3525.h
+++ b/firmware/export/as3525.h
@@ -497,4 +497,7 @@ interface */
/* PCM addresses for obtaining buffers will be what DMA is using (physical) */
#define HAVE_PCM_DMA_ADDRESS
+/* Timer frequency */
+#define TIMER_FREQ (24000000 / 16)
+
#endif /*__AS3525_H__*/
diff --git a/firmware/export/at91sam9260.h b/firmware/export/at91sam9260.h
index fa0b9d2..87826d4 100644
--- a/firmware/export/at91sam9260.h
+++ b/firmware/export/at91sam9260.h
@@ -676,3 +676,7 @@ base address */
#define AT91C_EBI_SDRAM_32BIT (0x20000000) /* SDRAM on EBI Chip Select 1
base address */
#define AT91C_BASE_AIC 0xFFFFF000 /* (AIC) Base Address */
+
+/* Timer frequency */
+/* timer is based on PCLK and minimum division is 2 */
+#define TIMER_FREQ (49156800/2)
diff --git a/firmware/export/dm320.h b/firmware/export/dm320.h
index a1bbc3c..619a77f 100644
--- a/firmware/export/dm320.h
+++ b/firmware/export/dm320.h
@@ -1016,4 +1016,8 @@ extern unsigned long _ttbstart;
#define VENC_DCLKCTL_DCKIH (1 << 8)
#define VENC_DCLKCTL_DCKPW(x) (x << 0)
+/* Timer frequency */
+/* timer is based on PCLK and minimum division is 2 */
+#define TIMER_FREQ (27000000)
+
#endif
diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h
index 2c1e93e..dea5588 100755
--- a/firmware/export/imx31l.h
+++ b/firmware/export/imx31l.h
@@ -1754,4 +1754,8 @@
#define UART_FIFO_CTRL 0x881
#define TIMEOUT 1000
+/* Timer frequency */
+/* timer is based on ipg_clk */
+#define TIMER_FREQ (66000000)
+
#endif /* __IMX31L_H__ */
diff --git a/firmware/export/jz4740.h b/firmware/export/jz4740.h
index 3bf34bd..a29266a 100644
--- a/firmware/export/jz4740.h
+++ b/firmware/export/jz4740.h
@@ -5209,4 +5209,7 @@ struct Ration2m
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
+/* Timer frequency */
+#define TIMER_FREQ (CFG_EXTAL) /* For full precision! */
+
#endif /* __JZ4740_H__ */
diff --git a/firmware/export/mcf5249.h b/firmware/export/mcf5249.h
index 0063913..ed4f4d1 100644
--- a/firmware/export/mcf5249.h
+++ b/firmware/export/mcf5249.h
@@ -279,5 +279,8 @@
#define DMA1_REQ_AUDIO_1 0x8000
#define DMA1_REQ_AUDIO_2 0x8100
+/* Timer frequency */
+/* timer is based on busclk == cpuclk/2 */
+#define TIMER_FREQ (CPU_FREQ/2)
#endif
diff --git a/firmware/export/pnx0101.h b/firmware/export/pnx0101.h
index a70d430..1df48f5 100644
--- a/firmware/export/pnx0101.h
+++ b/firmware/export/pnx0101.h
@@ -262,4 +262,7 @@ struct pnx0101_audio {
#endif /* ASM */
+/* Timer frequency */
+#define TIMER_FREQ 3000000
+
#endif
diff --git a/firmware/export/pp5002.h b/firmware/export/pp5002.h
index 9fab86b..cdf0318 100644
--- a/firmware/export/pp5002.h
+++ b/firmware/export/pp5002.h
@@ -248,4 +248,8 @@
#define MMAP3_LOGICAL (*(volatile unsigned long *)(0xf000f018))
#define MMAP3_PHYSICAL (*(volatile unsigned long *)(0xf000f01c))
+/* Timer frequency */
+/* Portalplayer chips use a microsecond timer. */
+#define TIMER_FREQ 1000000
+
#endif
diff --git a/firmware/export/pp5020.h b/firmware/export/pp5020.h
index 35fe09c..2d8d0e1 100644
--- a/firmware/export/pp5020.h
+++ b/firmware/export/pp5020.h
@@ -690,4 +690,8 @@
#define DMA_INCR_WIDTH_32BIT (0x2 << 28)
/* All other values reserved? */
+/* Timer frequency */
+/* Portalplayer chips use a microsecond timer. */
+#define TIMER_FREQ 1000000
+
#endif /* __PP5020_H__ */
diff --git a/firmware/export/s3c2440.h b/firmware/export/s3c2440.h
index a7da64f..2682660 100644
--- a/firmware/export/s3c2440.h
+++ b/firmware/export/s3c2440.h
@@ -550,4 +550,11 @@
#define DRAM1 0x31000000
#define BOOTRAM 0x40000000
+/* Timer frequency */
+
+/* timer is based on PCLK and minimum division is 2 */
+#define TIMER_FREQ (49156800/2)
+#define TIMER234_PRESCALE 21
+
+
#endif /* __S3C2440_H__ */
diff --git a/firmware/export/sh7034.h b/firmware/export/sh7034.h
index 717ba66..2695acb 100644
--- a/firmware/export/sh7034.h
+++ b/firmware/export/sh7034.h
@@ -370,4 +370,7 @@
#define SCI_MPB 0x02 /* Multiprocessor bit */
#define SCI_MPBT 0x01 /* Multiprocessor bit transfer */
+/* Timer frequency */
+#define TIMER_FREQ CPU_FREQ
+
#endif
diff --git a/firmware/export/tcc77x.h b/firmware/export/tcc77x.h
index 5346e58..ad1a8a1 100644
--- a/firmware/export/tcc77x.h
+++ b/firmware/export/tcc77x.h
@@ -261,4 +261,8 @@
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
+/* Timer frequency */
+/* timers are based on XIN (12Mhz) */
+#define TIMER_FREQ (12000000)
+
#endif
diff --git a/firmware/export/tcc780x.h b/firmware/export/tcc780x.h
index 3ff910f..5b37b40 100644
--- a/firmware/export/tcc780x.h
+++ b/firmware/export/tcc780x.h
@@ -249,4 +249,8 @@
#define USB_NUM_ENDPOINTS 3
#define USB_DEVBSS_ATTR IBSS_ATTR
+/* Timer frequency */
+/* Timer is based on PCK_TCT (set to 2Mhz in system.c) */
+#define TIMER_FREQ (2000000)
+
#endif
diff --git a/firmware/export/timer.h b/firmware/export/timer.h
index 230c0ae..b070aca 100644
--- a/firmware/export/timer.h
+++ b/firmware/export/timer.h
@@ -24,21 +24,10 @@
#include <stdbool.h>
#include "config.h"
+#include "cpu.h"
#if defined(SIMULATOR)
- #define TIMER_FREQ 1000000
-#elif CONFIG_CPU == S3C2440 || CONFIG_CPU == DM320 || CONFIG_CPU == TCC7801 \
- || defined(CPU_TCC77X) || CONFIG_CPU == AS3525 || CONFIG_CPU == IMX31L \
- || CONFIG_CPU == JZ4732 || CONFIG_CPU == PNX0101 \
- || defined(CPU_COLDFIRE) || CONFIG_CPU == SH7034 || defined(CPU_PP)
- #include "timer-target.h"
-#else
- #warning "Target without timer-target.h"
-#endif
-
-#ifndef TIMER_FREQ
- #warning "TIMER_FREQ not defined"
- #define TIMER_FREQ CPU_FREQ
+#define TIMER_FREQ 1000000
#endif
bool timer_register(int reg_prio, void (*unregister_callback)(void),