mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-30 11:01:33 +00:00
riscv: clk: Add CLINT clock to kendryte clock driver
Another "virtual" clock (in the sense that it isn't configurable). This could possibly be done as a clock in the device tree, but I think this is a bit cleaner. Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
parent
e5ca9a7523
commit
a952c3a454
2 changed files with 5 additions and 0 deletions
|
@ -646,6 +646,10 @@ static int k210_clk_probe(struct udevice *dev)
|
||||||
REGISTER_GATE(K210_CLK_RTC, "rtc", in0);
|
REGISTER_GATE(K210_CLK_RTC, "rtc", in0);
|
||||||
#undef REGISTER_GATE
|
#undef REGISTER_GATE
|
||||||
|
|
||||||
|
/* The MTIME register in CLINT runs at one 50th the CPU clock speed */
|
||||||
|
clk_dm(K210_CLK_CLINT,
|
||||||
|
clk_register_fixed_factor(NULL, "clint", "cpu", 0, 1, 50));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,5 +55,6 @@
|
||||||
#define K210_CLK_OTP 43
|
#define K210_CLK_OTP 43
|
||||||
#define K210_CLK_RTC 44
|
#define K210_CLK_RTC 44
|
||||||
#define K210_CLK_ACLK 45
|
#define K210_CLK_ACLK 45
|
||||||
|
#define K210_CLK_CLINT 46
|
||||||
|
|
||||||
#endif /* CLOCK_K210_SYSCTL_H */
|
#endif /* CLOCK_K210_SYSCTL_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue