WIP FPC-III support
[linux/fpc-iii.git] / arch / mips / ar7 / time.c
blob72aa77d7087b009a8c9a6644e1785c7034cae812
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Carsten Langgaard, carstenl@mips.com
4 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
6 * Setting up the clock on the MIPS boards.
7 */
9 #include <linux/init.h>
10 #include <linux/time.h>
11 #include <linux/err.h>
12 #include <linux/clk.h>
14 #include <asm/time.h>
15 #include <asm/mach-ar7/ar7.h>
17 void __init plat_time_init(void)
19 struct clk *cpu_clk;
21 /* Initialize ar7 clocks so the CPU clock frequency is correct */
22 ar7_init_clocks();
24 cpu_clk = clk_get(NULL, "cpu");
25 if (IS_ERR(cpu_clk)) {
26 printk(KERN_ERR "unable to get cpu clock\n");
27 return;
30 mips_hpt_frequency = clk_get_rate(cpu_clk) / 2;