summaryrefslogtreecommitdiffstats
path: root/src/soc/sifive/fu540/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/sifive/fu540/clock.c')
-rw-r--r--src/soc/sifive/fu540/clock.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/sifive/fu540/clock.c b/src/soc/sifive/fu540/clock.c
index 8aaba35d6cb6..597b2069db02 100644
--- a/src/soc/sifive/fu540/clock.c
+++ b/src/soc/sifive/fu540/clock.c
@@ -250,3 +250,14 @@ int clock_get_coreclk_khz(void)
/ (divr + 1)
/ (1ul << divq);
}
+
+/* Get the TileLink clock's frequency, in KHz */
+int clock_get_tlclk_khz(void)
+{
+ /*
+ * The TileLink bus and most peripherals use tlclk, which is coreclk/2,
+ * as input.
+ */
+
+ return clock_get_coreclk_khz() / 2;
+}