Skip to contentSkip to conversation

imx8mm eLCDIF clock

DISCUSSION Tommaso Merciai 6 participants 13 messages Apr 21, 2022 – May 27, 2022

lore
Share & tools
lore
#0 lore raw

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the following code to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?

Thanks,
Tommmaso

Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
#1 lore raw

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 29 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

Thanks,
Tommmaso

Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
#2 lore raw
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

adam

Quoted 26 lines
Quoted 9 lines

Thanks,
Tommmaso
--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Quoted 5 lines

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com

--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com

#3 lore raw
Quoted 27 lines · Adam Ford
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

Quoted 6 lines

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Just boot quickly and init the graphics pipeline in Linux ?

#4 lore raw
Quoted 28 lines · Marek Vasut
Quoted 27 lines · Adam Ford
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

Quoted 8 lines
Quoted 6 lines

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Just boot quickly and init the graphics pipeline in Linux ?

Hi Marek,
Thanks for your feedback. You think make no sense to enable support for the graphics pipeline at U-Boot level? Some customers want this feature for that I think is better to have support for that. What do you think about?

Thanks,
Tommaso

Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
#5 lore raw
Quoted 36 lines · Tommaso Merciai
Quoted 35 lines · Marek Vasut
Quoted 33 lines · Adam Ford
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Quoted 7 lines
Quoted 1 line

Just boot quickly and init the graphics pipeline in Linux ?

Hi Marek,
Thanks for your feedback. You think make no sense to enable support for the graphics pipeline at U-Boot level? Some customers want this feature for that I think is better to have support for that. What do you think about?

I think it makes no sense to duplicate graphics pipeline in U-Boot.

Just boot quickly enough and bring the graphics pipeline in Linux, then maintain one copy of all the drivers involved in the pipeline (scanout engine, GPCs, block controllers, bridge drivers, panel drivers). Also, you won't have to deal with the display pipeline handoff from U-Boot to Linux, which incurs flicker.

#6 lore raw
Quoted 45 lines · Marek Vasut
Quoted 36 lines · Tommaso Merciai
Quoted 35 lines · Marek Vasut
Quoted 33 lines · Adam Ford
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

I think the LCD driver should request the clock and clock rate based on settings the device tree.  However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Quoted 7 lines
Quoted 1 line

Just boot quickly and init the graphics pipeline in Linux ?

Hi Marek,
Thanks for your feedback. You think make no sense to enable support for the graphics pipeline at U-Boot level? Some customers want this feature for that I think is better to have support for that. What do you think about?

Quoted 3 lines

I think it makes no sense to duplicate graphics pipeline in U-Boot.

Just boot quickly enough and bring the graphics pipeline in Linux,

+1

Rather, it is not time anymore to get a flickering-free display from U-Boot to Linux (it was possible on some SOC before DRM). Just booting fast is the best option.

Regards,
Stefano

Quoted 1 line

then maintain one copy of all the drivers involved in the pipeline (scanout engine, GPCs, block controllers, bridge drivers, panel drivers). Also, you won't have to deal with the display pipeline handoff from U-Boot to Linux, which incurs flicker.

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#7 lore raw
Quoted 53 lines · Stefano Babic
Quoted 47 lines · Marek Vasut
Quoted 38 lines · Tommaso Merciai
Quoted 37 lines · Marek Vasut
Quoted 35 lines · Adam Ford
Quoted 26 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 17 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF
clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable
it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Quoted 7 lines
Quoted 1 line

Just boot quickly and init the graphics pipeline in Linux ?

Hi Marek,
Thanks for your feedback. You think make no sense to enable support for the graphics pipeline at U-Boot level? Some customers want this feature for that I think is better to have support for that. What do you think about?

Quoted 3 lines

I think it makes no sense to duplicate graphics pipeline in U-Boot.

Just boot quickly enough and bring the graphics pipeline in Linux,

Quoted 14 lines

+1

Rather, it is not time anymore to get a flickering-free display from U-Boot to Linux (it was possible on some SOC before DRM). Just booting fast is the best option.

Regards,
Stefano

Quoted 5 lines

then
maintain one copy of all the drivers involved in the pipeline (scanout engine, GPCs, block controllers, bridge drivers, panel drivers). Also, you won't have to deal with the display pipeline handoff from U-Boot to Linux, which incurs flicker.

For what it's worth, there was a thread about using Falcon mode with ARM64. I was going to investigate it when I have some time. It would be nice to bypass the U-Boot phase completely and jump from SPL->ATF->Linux if possible.

adam

Quoted 10 lines

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================

#8 lore raw

Hi

Quoted 70 lines · Adam Ford
Quoted 53 lines · Stefano Babic
Quoted 47 lines · Marek Vasut
Quoted 38 lines · Tommaso Merciai
Quoted 37 lines · Marek Vasut
Quoted 35 lines · Adam Ford
Quoted 26 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 17 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF
clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable
it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Quoted 7 lines
Quoted 1 line

Just boot quickly and init the graphics pipeline in Linux ?

Hi Marek,
Thanks for your feedback. You think make no sense to enable support for the graphics pipeline at U-Boot level? Some customers want this feature for that I think is better to have support for that. What do you think about?

Quoted 3 lines

I think it makes no sense to duplicate graphics pipeline in U-Boot.

Just boot quickly enough and bring the graphics pipeline in Linux,

Quoted 14 lines

+1

Rather, it is not time anymore to get a flickering-free display from U-Boot to Linux (it was possible on some SOC before DRM). Just booting fast is the best option.

Regards,
Stefano

Quoted 5 lines

then
maintain one copy of all the drivers involved in the pipeline (scanout engine, GPCs, block controllers, bridge drivers, panel drivers). Also, you won't have to deal with the display pipeline handoff from U-Boot to Linux, which incurs flicker.

Quoted 6 lines

For what it's worth, there was a thread about using Falcon mode with ARM64. I was going to investigate it when I have some time. It would be nice to bypass the U-Boot phase completely and jump from SPL->ATF->Linux if possible.

adam

Well we should consider graphics panel in uboot, it's standard chain for mobile phone, or rockchip bsp

Michael

Quoted 10 lines
Quoted 10 lines

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================

--
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
[email protected]
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
[email protected]
www.amarulasolutions.com

#9 lore raw
In reply to Adam Ford
Quoted 27 lines · Adam Ford
Quoted 24 lines · Tommaso Merciai

On Thu, Apr 21, 2022 at 08:48:05AM +0200, Tommaso Merciai wrote:

+ Fabio
+ Tim
+ Michael
+ Marek
+ Adam

Quoted 15 lines

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the clk_enable to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?
I'm missing somethings?

Quoted 6 lines

I think the LCD driver should request the clock and clock rate based on settings the device tree. However, I think the bigger issues is that you might run into issues with the lack of a disp-blkctrl driver. Marek enable the GPC driver fairly recently, but the blkctrl driver will be needed to enable the LCD and DSI portions or the system may hang.

Hi Adam,
Thanks for the tips, I will investigate on that.

Tommaso

Quoted 28 lines

adam

Quoted 26 lines
Quoted 9 lines

Thanks,
Tommmaso
--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Quoted 5 lines

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com

--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com

Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
#10 lore raw
In reply to Tommaso Merciai
Quoted 6 lines · Tommaso Merciai

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the following code to enable it at the end of the clk-imx8mm probe:

Quoted 8 lines

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

What do you think about this solution?
There is a more standard way to do this?

PLL1 should be a parent of one of the clocks required by the eLCDIF. That clock should call clk_enable() on PLL1 when it is enabled itself. If you want to set a specific rate, you can do that with assigned-clock-rates in either the clock's DT node, or the eLCDIF's DT node.

--Sean

#11 lore raw
Quoted 13 lines · Sean Anderson
Quoted 12 lines · Tommaso Merciai

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the following code to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

Quoted 7 lines
Quoted 2 lines

What do you think about this solution?
There is a more standard way to do this?

PLL1 should be a parent of one of the clocks required by the eLCDIF. That clock should call clk_enable() on PLL1 when it is enabled itself. If you want to set a specific rate, you can do that with assigned-clock-rates in either the clock's DT node, or the eLCDIF's DT node.

Hi Sean,
Thanks for your suggestion, I need only to enable it, I have already assign the right rate from dts. The doubt at this point is: it's right call clk_enable from clk-imx8mm.c? I think yes because it handle by "fsl,imx8mm-ccm" driver, maybe protected by CONFIG_DM_VIDEO could be a good solution.
Let me know.

Thanks,
Tommaso

Quoted 2 lines

--Sean

Signature · 10 lines
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
www.amarulasolutions.com
#12 lore raw
Quoted 22 lines · Tommaso Merciai
Quoted 13 lines · Sean Anderson
Quoted 12 lines · Tommaso Merciai

Hi,
I'm working on drivers/clk/imx/clk-imx8mm.c to port and bring up eLCDIF clocks. After port all necessary clocks needed by eLCDIF I found that IMX8MM_VIDEO_PLL1 clock is not enabled and need the following code to enable it at the end of the clk-imx8mm probe:

struct clk *clkp;

clk_get_by_id(IMX8MM_VIDEO_PLL1, &clkp);
clk_set_rate(clkp, 594000000UL);
clk_enable(clkp);

Quoted 7 lines
Quoted 2 lines

What do you think about this solution?
There is a more standard way to do this?

PLL1 should be a parent of one of the clocks required by the eLCDIF. That clock should call clk_enable() on PLL1 when it is enabled itself. If you want to set a specific rate, you can do that with assigned-clock-rates in either the clock's DT node, or the eLCDIF's DT node.

Quoted 6 lines

Hi Sean,
Thanks for your suggestion, I need only to enable it, I have already assign the right rate from dts. The doubt at this point is: it's right call clk_enable from clk-imx8mm.c? I think yes because it handle by "fsl,imx8mm-ccm" driver, maybe protected by CONFIG_DM_VIDEO could be a good solution.
Let me know.

I don't think so. Generally whatever uses the clock (e.g. your video driver) will call clk_enable, and CCF should propegate that enable up the clock tree.

--Sean