Skip to content

Commit

Permalink
MLK-24192-1 lpuart: Enable IPG clock
Browse files Browse the repository at this point in the history
Current codes only ennable the PER clock. However on iMX8 the LPUART
also needs IPG clock which is an LPCG. Should not depend on the default
LPCG setting.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 117c616)
(cherry picked from commit 0108adc)
(cherry picked from commit dc0789d8fbd16d095ffe0271506dfd725cb4407f)
  • Loading branch information
Ye Li committed Apr 19, 2023
1 parent 29b3a96 commit 16aa732
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/serial/serial_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,18 +480,30 @@ static int lpuart_serial_probe(struct udevice *dev)
{
#if CONFIG_IS_ENABLED(CLK)
struct clk per_clk;
struct clk ipg_clk;
int ret;

ret = clk_get_by_name(dev, "per", &per_clk);
if (!ret) {
ret = clk_enable(&per_clk);
if (ret) {
dev_err(dev, "Failed to get per clk: %d\n", ret);
dev_err(dev, "Failed to enable per clk: %d\n", ret);
return ret;
}
} else {
debug("%s: Failed to get per clk: %d\n", __func__, ret);
}

ret = clk_get_by_name(dev, "ipg", &ipg_clk);
if (!ret) {
ret = clk_enable(&ipg_clk);
if (ret) {
dev_err(dev, "Failed to enable ipg clk: %d\n", ret);
return ret;
}
} else {
debug("%s: Failed to get ipg clk: %d\n", __func__, ret);
}
#endif

if (is_lpuart32(dev))
Expand Down

0 comments on commit 16aa732

Please sign in to comment.