Blame view

arch/mips/wrppmc/time.c 1.06 KB
a240a4696   Mark.Zhan   [MIPS] Wind River...
1
2
3
4
5
6
7
8
9
10
11
12
  /*
   * time.c: MIPS CPU Count/Compare timer hookup
   *
   * Author: Mark.Zhan, <rongkai.zhan@windriver.com>
   *
   * This file is subject to the terms and conditions of the GNU General Public
   * License.  See the file "COPYING" in the main directory of this archive
   * for more details.
   *
   * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)
   * Copyright (C) 2006, Wind River System Inc.
   */
a240a4696   Mark.Zhan   [MIPS] Wind River...
13
  #include <linux/init.h>
a240a4696   Mark.Zhan   [MIPS] Wind River...
14
  #include <linux/interrupt.h>
4b92fe230   Yoichi Yuasa   [MIPS] cleanup WR...
15
  #include <linux/irq.h>
a240a4696   Mark.Zhan   [MIPS] Wind River...
16

a240a4696   Mark.Zhan   [MIPS] Wind River...
17
  #include <asm/gt64120.h>
4b92fe230   Yoichi Yuasa   [MIPS] cleanup WR...
18
  #include <asm/time.h>
a240a4696   Mark.Zhan   [MIPS] Wind River...
19
20
  
  #define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
a240a4696   Mark.Zhan   [MIPS] Wind River...
21
22
23
24
25
26
  /*
   * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
   *
   * NOTE: We disable all GT64120 timers, and use MIPS processor internal
   * timer as the source of kernel clock tick.
   */
4b550488f   Ralf Baechle   [MIPS] Deforest t...
27
  void __init plat_time_init(void)
a240a4696   Mark.Zhan   [MIPS] Wind River...
28
29
30
31
32
33
34
35
36
37
38
  {
  	/* Disable GT64120 timers */
  	GT_WRITE(GT_TC_CONTROL_OFS, 0x00);
  	GT_WRITE(GT_TC0_OFS, 0x00);
  	GT_WRITE(GT_TC1_OFS, 0x00);
  	GT_WRITE(GT_TC2_OFS, 0x00);
  	GT_WRITE(GT_TC3_OFS, 0x00);
  
  	/* Use MIPS compare/count internal timer */
  	mips_hpt_frequency = WRPPMC_CPU_CLK_FREQ;
  }