+// SPDX-License-Identifier: GPL-2.0+
/*
* (C) Copyright 2009 SAMSUNG Electronics
* Minkyu Kang <mk7.kang@samsung.com>
* Heungjun Kim <riverful.kim@samsung.com>
*
* based on drivers/serial/s3c64xx.c
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/arch/clk.h>
#include <asm/arch/uart.h>
#include <serial.h>
+#include <clk.h>
DECLARE_GLOBAL_DATA_PTR;
{
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 clk clk;
+ u32 ret;
+
+ ret = clk_get_by_index(dev, 1, &clk);
+ if (ret < 0)
+ return ret;
+ uclk = clk_get_rate(&clk);
+#else
+ uclk = get_uart_clk(plat->port_id);
+#endif
s5p_serial_baud(uart, uclk, baudrate);
struct s5p_serial_platdata *plat = dev->platdata;
fdt_addr_t addr;
- addr = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
+ addr = dev_read_addr(dev);
if (addr == FDT_ADDR_T_NONE)
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(dev),
+ "id", dev->seq);
return 0;
}
.platdata_auto_alloc_size = sizeof(struct s5p_serial_platdata),
.probe = s5p_serial_probe,
.ops = &s5p_serial_ops,
- .flags = DM_FLAG_PRE_RELOC,
};
#endif
#include <debug_uart.h>
-void debug_uart_init(void)
+static inline void _debug_uart_init(void)
{
struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE;