/*1* Carsten Langgaard, [email protected]2* Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.3*4* This program is free software; you can distribute it and/or modify it5* under the terms of the GNU General Public License (Version 2) as6* published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* for more details.12*13* You should have received a copy of the GNU General Public License along14* with this program; if not, write to the Free Software Foundation, Inc.,15* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.16*17* Setting up the clock on the MIPS boards.18*/1920#include <linux/init.h>21#include <linux/time.h>22#include <linux/err.h>23#include <linux/clk.h>2425#include <asm/time.h>26#include <asm/mach-ar7/ar7.h>2728void __init plat_time_init(void)29{30struct clk *cpu_clk;3132/* Initialize ar7 clocks so the CPU clock frequency is correct */33ar7_init_clocks();3435cpu_clk = clk_get(NULL, "cpu");36if (IS_ERR(cpu_clk)) {37printk(KERN_ERR "unable to get cpu clock\n");38return;39}4041mips_hpt_frequency = clk_get_rate(cpu_clk) / 2;42}434445