Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Carsten Langgaard, carstenl@mips.com
0004  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
0005  *
0006  * Setting up the clock on the MIPS boards.
0007  */
0008 
0009 #include <linux/init.h>
0010 #include <linux/time.h>
0011 #include <linux/err.h>
0012 #include <linux/clk.h>
0013 
0014 #include <asm/time.h>
0015 #include <asm/mach-ar7/ar7.h>
0016 
0017 void __init plat_time_init(void)
0018 {
0019     struct clk *cpu_clk;
0020 
0021     /* Initialize ar7 clocks so the CPU clock frequency is correct */
0022     ar7_init_clocks();
0023 
0024     cpu_clk = clk_get(NULL, "cpu");
0025     if (IS_ERR(cpu_clk)) {
0026         printk(KERN_ERR "unable to get cpu clock\n");
0027         return;
0028     }
0029 
0030     mips_hpt_frequency = clk_get_rate(cpu_clk) / 2;
0031 }