Angel Pons | 5de47d0 | 2020-04-04 18:51:30 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 2 | |
Philipp Hug | df5e6f6 | 2018-07-11 13:31:34 +0200 | [diff] [blame] | 3 | #include <stdint.h> |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 4 | #include <console/uart.h> |
Elyes HAOUAS | 0d0fe14 | 2020-05-07 21:36:06 +0200 | [diff] [blame] | 5 | #include <commonlib/bsd/helpers.h> |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 6 | #include <soc/addressmap.h> |
Philipp Hug | df5e6f6 | 2018-07-11 13:31:34 +0200 | [diff] [blame] | 7 | #include <soc/clock.h> |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 8 | |
Felix Held | e3a1247 | 2020-09-11 15:47:09 +0200 | [diff] [blame] | 9 | uintptr_t uart_platform_base(unsigned int idx) |
Jonathan Neuschäfer | 55b4645 | 2018-04-19 16:23:54 +0200 | [diff] [blame] | 10 | { |
11 | if (idx < 2) | ||||
12 | return FU540_UART(idx); | ||||
13 | else | ||||
14 | return 0; | ||||
15 | } | ||||
Philipp Hug | 7524400 | 2018-07-07 21:34:31 +0200 | [diff] [blame] | 16 | |
17 | unsigned int uart_platform_refclk(void) | ||||
18 | { | ||||
Jonathan Neuschäfer | 97ca02c | 2018-10-29 14:32:49 +0100 | [diff] [blame] | 19 | return clock_get_tlclk_khz() * KHz; |
Philipp Hug | 7524400 | 2018-07-07 21:34:31 +0200 | [diff] [blame] | 20 | } |