diff options
author | Tom Rini <trini@konsulko.com> | 2016-06-06 13:24:23 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-06-06 13:39:43 -0400 |
commit | d77fa2ff766bbb4b867e791187f78b6033071613 (patch) | |
tree | b1116470884e46c0a66c49525771cf9b49c3835d /drivers/serial | |
parent | 65eac4cc54921f9496061b0e0f0a7e159b42a3c6 (diff) | |
parent | 086e13c5f6f79a68246d6b803cf4736cb6815e44 (diff) | |
download | u-boot-d77fa2ff766bbb4b867e791187f78b6033071613.tar.gz |
Merge http://git.denx.de/u-boot-samsung
Signed-off-by: Tom Rini <trini@konsulko.com>
Conflicts:
configs/peach-pi_defconfig
configs/peach-pit_defconfig
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/serial_s5p.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index feba467d80..cb55c5ab71 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -17,6 +17,7 @@ #include <asm/arch/clk.h> #include <asm/arch/uart.h> #include <serial.h> +#include <clk.h> DECLARE_GLOBAL_DATA_PTR; @@ -90,7 +91,19 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate) { struct s5p_serial_platdata *plat = dev->platdata; struct s5p_uart *const uart = plat->reg; - u32 uclk = get_uart_clk(plat->port_id); + u32 uclk; + +#ifdef CONFIG_CLK_EXYNOS + struct udevice *clk_dev; + u32 ret; + + ret = clk_get_by_index(dev, 1, &clk_dev); + if (ret < 0) + return ret; + uclk = clk_get_periph_rate(clk_dev, ret); +#else + uclk = get_uart_clk(plat->port_id); +#endif s5p_serial_baud(uart, uclk, baudrate); @@ -174,8 +187,8 @@ static int s5p_serial_ofdata_to_platdata(struct udevice *dev) return -EINVAL; plat->reg = (struct s5p_uart *)addr; - plat->port_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "id", -1); - + plat->port_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + "id", dev->seq); return 0; } |