summaryrefslogtreecommitdiffstats
path: root/src/soc/sifive/fu540/uart.c
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2018-10-29 14:32:49 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-12-05 13:36:43 +0000
commit97ca02cb170f870d5a47f92d5b9a79fe4664dca4 (patch)
tree9027303014bae8f3fe23b0563dfc111e978e2554 /src/soc/sifive/fu540/uart.c
parent042772a6bd66cd09add08da40785406e34e92d0a (diff)
downloadcoreboot-97ca02cb170f870d5a47f92d5b9a79fe4664dca4.tar.gz
coreboot-97ca02cb170f870d5a47f92d5b9a79fe4664dca4.tar.bz2
coreboot-97ca02cb170f870d5a47f92d5b9a79fe4664dca4.zip
soc/sifive/fu540: Add helper function to get tlclk frequency
tlclk is not specific to the UART block in the FU540, so let's calculate its frequency in clock.c. Change-Id: I270920027f1132253e413a1bf9feb4fe279b651a Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/c/29335 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Philipp Hug <philipp@hug.cx>
Diffstat (limited to 'src/soc/sifive/fu540/uart.c')
-rw-r--r--src/soc/sifive/fu540/uart.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/soc/sifive/fu540/uart.c b/src/soc/sifive/fu540/uart.c
index 454b13d11146..b59b78902a7d 100644
--- a/src/soc/sifive/fu540/uart.c
+++ b/src/soc/sifive/fu540/uart.c
@@ -29,9 +29,5 @@ uintptr_t uart_platform_base(int idx)
unsigned int uart_platform_refclk(void)
{
- /*
- * The SiFive UART uses tlclk, which is coreclk/2, as input
- */
-
- return clock_get_coreclk_khz() * KHz / 2;
+ return clock_get_tlclk_khz() * KHz;
}