summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/cpu/spc300/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/u-boot-1.1.6/cpu/spc300/timer.c')
-rw-r--r--cleopatre/u-boot-1.1.6/cpu/spc300/timer.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/cleopatre/u-boot-1.1.6/cpu/spc300/timer.c b/cleopatre/u-boot-1.1.6/cpu/spc300/timer.c
index eafe939a74..a10229e454 100644
--- a/cleopatre/u-boot-1.1.6/cpu/spc300/timer.c
+++ b/cleopatre/u-boot-1.1.6/cpu/spc300/timer.c
@@ -29,36 +29,14 @@
/* macro to read the 32 bit timer */
#define READ_TIMER readl(TIMER1CURRENTVAL_1)
-#define TIME_HZ (timerclk/2) /* MARIA_TIMER_CLOCK/timer_prescaler == Xclk/timer_prescaler (timer_prescaler == 2) */
+#define TIME_HZ (3125000) /* xclk/timer_prescaler = 3.125MHz */
static ulong timestamp;
static ulong lastdec;
-static ulong timerclk;
-
-static void get_timer_clock(void)
-{
- DECLARE_GLOBAL_DATA_PTR;
- bd_t *bd = gd->bd;
- spc300_nvram_t *nvram = (spc300_nvram_t*)bd->bi_nvram_addr;
- switch(nvram->pkg_cfg & 0x03)
- {
- case 1:
- timerclk = 25000000;
- break;
- case 2:
- timerclk = 37500000;
- break;
- default:
- timerclk = 18750000;
- break;
- }
-}
/* nothing really to do with interrupts, just starts up a counter. */
int timer_init (void)
{
- get_timer_clock();
-
writel(0x00, TIMER1CONTROLREG_1); /* disable timer1 */
writel(TIMER_LOAD_VAL, TIMER1LOADCOUNT_1);
writel(TIMER_LOAD_VAL, TIMER1CURRENTVAL_1);