1 // SPDX-License-Identifier: GPL-2.0-only
3 * Pistachio clocksource/timer setup
5 * Copyright (C) 2014 Google, Inc.
9 #include <linux/clocksource.h>
10 #include <linux/init.h>
12 #include <linux/of_clk.h>
14 #include <asm/mips-cps.h>
17 unsigned int get_c0_compare_int(void)
19 return gic_get_c0_compare_int();
22 int get_c0_perfcount_int(void)
24 return gic_get_c0_perfcount_int();
26 EXPORT_SYMBOL_GPL(get_c0_perfcount_int
);
28 int get_c0_fdc_int(void)
30 return gic_get_c0_fdc_int();
33 void __init
plat_time_init(void)
35 struct device_node
*np
;
41 np
= of_get_cpu_node(0, NULL
);
43 pr_err("Failed to get CPU node\n");
47 clk
= of_clk_get(np
, 0);
49 pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk
));
53 mips_hpt_frequency
= clk_get_rate(clk
) / 2;