@@ -6,7 +6,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
-#include <common.h>
+#include <clk.h>
#include <dm.h>
#include <linux/io.h>
#include <linux/serial_reg.h>
@@ -90,11 +90,12 @@ static int uniphier_serial_pending(struct udevice *dev, bool input)
static int uniphier_serial_probe(struct udevice *dev)
{
- DECLARE_GLOBAL_DATA_PTR;
struct uniphier_serial_private_data *priv = dev_get_priv(dev);
struct uniphier_serial __iomem *port;
+ struct clk clk;
fdt_addr_t base;
u32 tmp;
+ int ret;
base = devfdt_get_addr(dev);
if (base == FDT_ADDR_T_NONE)
@@ -106,8 +107,15 @@ static int uniphier_serial_probe(struct udevice *dev)
priv->membase = port;
- priv->uartclk = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
- "clock-frequency", 0);
+ ret = clk_get_by_index(dev, 0, &clk);
+ if (ret)
+ return ret;
+
+ ret = clk_enable(&clk);
+ if (ret)
+ return ret;
+
+ priv->uartclk = clk_get_rate(&clk);
tmp = readl(&port->lcr_mcr);
tmp &= ~LCR_MASK;
Get clock rate from the clock driver to drop U-Boot specific property "clock-frequency". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- drivers/serial/serial_uniphier.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)