provide a system clock to be used by the MIPS timer
Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 34550v19.07.3_mercusys_ac12_duma
parent
79c2ce01b7
commit
e37f6fb458
@ -1,17 +1,20 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#include <asm/time.h>
|
||||
#include <adm8668.h>
|
||||
|
||||
void __init plat_time_init(void)
|
||||
{
|
||||
int adj = (ADM8668_CONFIG_REG(ADM8668_CR3) >> 11) & 0xf;
|
||||
struct clk *sys_clk;
|
||||
|
||||
/* adjustable clock selection
|
||||
CR3 bit 14~11, 0000 -> 175MHz, 0001 -> 180MHz, etc... */
|
||||
adm8668_init_clocks();
|
||||
|
||||
mips_hpt_frequency = (SYS_CLOCK + adj * 5000000) / 2;
|
||||
printk("ADM8668 CPU clock: %d MHz\n", 2*mips_hpt_frequency / 1000000);
|
||||
sys_clk = clk_get(NULL, "sys");
|
||||
if (IS_ERR(sys_clk))
|
||||
panic("unable to get system clock\n");
|
||||
|
||||
mips_hpt_frequency = clk_get_rate(sys_clk) / 2;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue