diff mbox series

[v3,03/19] clk: imx: clk-imxrt1050: setup PLL5 for video in non-SPL

Message ID 20200408151025.20549-4-giulio.benetti@benettiengineering.com
State Superseded
Headers show
Series i.MXRT1050 add LCDIF support | expand

Commit Message

Giulio Benetti April 8, 2020, 3:10 p.m. UTC
mxsfb needs PLL5 as source, so let's setup it at its default frequency
specified in RM(650Mhz).

Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma at denx.de>
---
V1->V2:
* removed LCDIF set_parent() since it's setup in dts file(suggested by Fabio)
---
 drivers/clk/imx/clk-imxrt1050.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Stefano Babic April 19, 2020, 9:08 a.m. UTC | #1
> mxsfb needs PLL5 as source, so let's setup it at its default frequency
> specified in RM(650Mhz).
> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> Reviewed-by: Lukasz Majewski <lukma at denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/drivers/clk/imx/clk-imxrt1050.c b/drivers/clk/imx/clk-imxrt1050.c
index e33d426363..bb12644605 100644
--- a/drivers/clk/imx/clk-imxrt1050.c
+++ b/drivers/clk/imx/clk-imxrt1050.c
@@ -238,9 +238,9 @@  static int imxrt1050_clk_probe(struct udevice *dev)
 	clk_dm(IMXRT1050_CLK_LCDIF,
 	       imx_clk_gate2("lcdif", "lcdif_podf", base + 0x70, 28));
 
-#ifdef CONFIG_SPL_BUILD
 	struct clk *clk, *clk1;
 
+#ifdef CONFIG_SPL_BUILD
 	/* bypass pll1 before setting its rate */
 	clk_get_by_id(IMXRT1050_CLK_PLL1_REF_SEL, &clk);
 	clk_get_by_id(IMXRT1050_CLK_PLL1_BYPASS, &clk1);
@@ -271,7 +271,14 @@  static int imxrt1050_clk_probe(struct udevice *dev)
 
 	clk_get_by_id(IMXRT1050_CLK_PLL3_BYPASS, &clk1);
 	clk_set_parent(clk1, clk);
+#else
+	/* Set PLL5 for LCDIF to its default 650Mhz */
+	clk_get_by_id(IMXRT1050_CLK_PLL5_VIDEO, &clk);
+	clk_enable(clk);
+	clk_set_rate(clk, 650000000UL);
 
+	clk_get_by_id(IMXRT1050_CLK_PLL5_BYPASS, &clk1);
+	clk_set_parent(clk1, clk);
 #endif
 
 	return 0;