ramips: fix cpu clock of mt7621 and add dt clk devices

For a long time the mt7621 uses a fixed cpu clock which causes a problem
if the cpu frequency is not 880MHz.

This patch fixes the cpu clock calculation and adds the cpu/bus clkdev
which will be used in dts.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
This commit is contained in:
Weijie Gao
2018-11-19 01:14:53 +08:00
committed by John Crispin
parent f5af8be636
commit c7ca224299
3 changed files with 232 additions and 19 deletions

View File

@@ -85,22 +85,3 @@
endchoice
choice
--- a/arch/mips/ralink/timer-gic.c
+++ b/arch/mips/ralink/timer-gic.c
@@ -12,6 +12,7 @@
#include <linux/of.h>
#include <linux/clk-provider.h>
#include <linux/clocksource.h>
+#include <asm/time.h>
#include "common.h"
@@ -19,6 +20,8 @@ void __init plat_time_init(void)
{
ralink_of_remap();
+ mips_hpt_frequency = 880000000 / 2;
+
of_clk_init(NULL);
timer_probe();
}