[adm8668] move time related functions to their own file
[openwrt.git] / target / linux / adm8668 / files / arch / mips / adm8668 / time.c
1 #include <linux/init.h>
2 #include <linux/kernel.h>
3
4 #include <asm/time.h>
5 #include <adm8668.h>
6
7 void __init plat_time_init(void)
8 {
9         int adj = (ADM8668_CONFIG_REG(ADM8668_CR3) >> 11) & 0xf;
10
11         /* adjustable clock selection
12            CR3 bit 14~11, 0000 -> 175MHz, 0001 -> 180MHz, etc... */
13
14         mips_hpt_frequency = (SYS_CLOCK + adj * 5000000) / 2;
15         printk("ADM8668 CPU clock: %d MHz\n", 2*mips_hpt_frequency / 1000000);
16 }
17