diff options
Diffstat (limited to 'src/soc/sifive/fu540/clock.c')
-rw-r--r-- | src/soc/sifive/fu540/clock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/soc/sifive/fu540/clock.c b/src/soc/sifive/fu540/clock.c index 8aaba35d6c..597b2069db 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; +} |