2019-05-26 23:55:01 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-10-09 20:40:02 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 Zhang, Keguang <keguang.zhang@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/clk.h>
|
2023-03-21 04:18:17 -07:00
|
|
|
#include <linux/of_clk.h>
|
2014-10-09 20:40:02 -07:00
|
|
|
#include <asm/time.h>
|
|
|
|
|
|
|
|
void __init plat_time_init(void)
|
|
|
|
{
|
|
|
|
struct clk *clk = NULL;
|
|
|
|
|
|
|
|
/* initialize LS1X clocks */
|
2023-03-21 04:18:17 -07:00
|
|
|
of_clk_init(NULL);
|
2014-10-09 20:40:02 -07:00
|
|
|
|
|
|
|
/* setup mips r4k timer */
|
|
|
|
clk = clk_get(NULL, "cpu_clk");
|
|
|
|
if (IS_ERR(clk))
|
|
|
|
panic("unable to get cpu clock, err=%ld", PTR_ERR(clk));
|
|
|
|
|
|
|
|
mips_hpt_frequency = clk_get_rate(clk) / 2;
|
|
|
|
}
|