2023-08-30 17:31:07 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 Zhang, Keguang <keguang.zhang@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/clk.h>
|
2023-10-24 12:59:35 +02:00
|
|
|
#include <linux/of_clk.h>
|
2023-08-30 17:31:07 +02:00
|
|
|
#include <asm/time.h>
|
|
|
|
|
|
|
|
void __init plat_time_init(void)
|
|
|
|
{
|
|
|
|
struct clk *clk = NULL;
|
|
|
|
|
|
|
|
/* initialize LS1X clocks */
|
2023-10-24 12:59:35 +02:00
|
|
|
of_clk_init(NULL);
|
2023-08-30 17:31:07 +02: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;
|
|
|
|
}
|