samsung/exynos5: Fix baudrate calculation

Account for possible use of get_option() when baudrate is no longer
compile-time constant.

Change-Id: Ib45acd98e55c5892dbce9903830665aefeda5be0
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5288
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Kyösti Mälkki
2014-02-19 08:58:12 +02:00
parent 919923def3
commit c5332e30da
2 changed files with 2 additions and 4 deletions

View File

@@ -63,12 +63,11 @@ static void serial_setbrg_dev(void)
{ {
struct s5p_uart *uart = (struct s5p_uart *)base_port; struct s5p_uart *uart = (struct s5p_uart *)base_port;
u32 uclk; u32 uclk;
u32 baudrate = CONFIG_TTYS0_BAUD;
u32 val; u32 val;
// All UARTs share the same clock. // All UARTs share the same clock.
uclk = clock_get_periph_rate(PERIPH_ID_UART3); uclk = clock_get_periph_rate(PERIPH_ID_UART3);
val = uclk / baudrate; val = uclk / default_baudrate();
writel(val / 16 - 1, &uart->ubrdiv); writel(val / 16 - 1, &uart->ubrdiv);

View File

@@ -63,12 +63,11 @@ static void serial_setbrg_dev(void)
{ {
struct s5p_uart *uart = (struct s5p_uart *)base_port; struct s5p_uart *uart = (struct s5p_uart *)base_port;
u32 uclk; u32 uclk;
u32 baudrate = CONFIG_TTYS0_BAUD;
u32 val; u32 val;
// All UARTs share the same clock. // All UARTs share the same clock.
uclk = clock_get_periph_rate(PERIPH_ID_UART3); uclk = clock_get_periph_rate(PERIPH_ID_UART3);
val = uclk / baudrate; val = uclk / default_baudrate();
writel(val / 16 - 1, &uart->ubrdiv); writel(val / 16 - 1, &uart->ubrdiv);