/*1* time.c: MIPS CPU Count/Compare timer hookup2*3* Author: Mark.Zhan, <[email protected]>4*5* This file is subject to the terms and conditions of the GNU General Public6* License. See the file "COPYING" in the main directory of this archive7* for more details.8*9* Copyright (C) 1996, 1997, 2004 by Ralf Baechle ([email protected])10* Copyright (C) 2006, Wind River System Inc.11*/12#include <linux/init.h>13#include <linux/interrupt.h>14#include <linux/irq.h>1516#include <asm/gt64120.h>17#include <asm/time.h>1819#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */2021/*22* Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect23*24* NOTE: We disable all GT64120 timers, and use MIPS processor internal25* timer as the source of kernel clock tick.26*/27void __init plat_time_init(void)28{29/* Disable GT64120 timers */30GT_WRITE(GT_TC_CONTROL_OFS, 0x00);31GT_WRITE(GT_TC0_OFS, 0x00);32GT_WRITE(GT_TC1_OFS, 0x00);33GT_WRITE(GT_TC2_OFS, 0x00);34GT_WRITE(GT_TC3_OFS, 0x00);3536/* Use MIPS compare/count internal timer */37mips_hpt_frequency = WRPPMC_CPU_CLK_FREQ;38}394041