[U-Boot] Enable HDMI on i.MX6 without VPU

Message ID CAHDRk=mMgcHjC23rYgNfChcHpYg69g=ey2r+DJ8aq1kgJD6A5g@mail.gmail.com
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series
  • [U-Boot] Enable HDMI on i.MX6 without VPU
Related show

Commit Message

Nikolay Petukhov Oct. 10, 2017, 2:27 p.m.
Hi, all

This patch enables HDMI on CPU without VPU.
A similar patch for the mainline kernel:
https://patchwork.kernel.org/patch/9874831/
Tested on MCIMX6Q4AVT10AD.


Signed-off-by: Nikolay Petukhov <nikolaypetukhov@gmail.com>
Cc: Stefano Babic sbabic@denx.de
---
 arch/arm/mach-imx/mx6/soc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Stefano Babic Oct. 31, 2017, 10:33 a.m. | #1
Hi Nikolay,

On 10/10/2017 16:27, Nikolay Petukhov wrote:
> Hi, all
> 
> This patch enables HDMI on CPU without VPU.
> A similar patch for the mainline
> kernel:https://patchwork.kernel.org/patch/9874831/
> Tested on MCIMX6Q4AVT10AD.
> 

This is stored in the commit message if I apply. Please rewrite the
commit message to be suitable for inclusion.

> 
> Signed-off-by: Nikolay Petukhov <nikolaypetukhov@gmail.com
> <mailto:nikolaypetukhov@gmail.com>>
> Cc: Stefano Babic sbabic@denx.de <mailto:sbabic@denx.de>
> ---
>  arch/arm/mach-imx/mx6/soc.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
> index b724668..8b976f7 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -655,6 +655,11 @@ void imx_setup_hdmi(void)
>      int reg, count;
>      u8 val;
>  
> +    /* Turn on MIPI core cfg clock */
> +    reg = readl(&mxc_ccm->CCGR3);
> +    reg |= MXC_CCM_CCGR3_MIPI_CORE_CFG_MASK;
> +    writel(reg, &mxc_ccm->CCGR3);
> +
>      /* Turn on HDMI PHY clock */
>      reg = readl(&mxc_ccm->CCGR2);
>      reg |=  MXC_CCM_CCGR2_HDMI_TX_IAHBCLK_MASK|
> -- 
> 2.7.4
> 
> 

Best regards,
Stefano Babic
Nikolay Petukhov Nov. 2, 2017, 8 a.m. | #2
Hi Stefano,

On i.MX6 SoCs without VPU(MCIMX6Q4AVT10AD) the HDMI is not working.
That's because hdmi_isfr's parent clock, video_27m, is not correctly
ungated.

The video_27m clock is gated by CCM_CCGR3[CG8] - mipi_core_cfg_clk_enable.

On i.MX6 SoCs with VPU, the HDMI is working thanks to the
CCM_CMEOR[mod_en_ov_vpu] bit which makes the video_27m ungated whatever
is in CCM_CCGR3[CG8].

This patch make the HDMI to work in every case by gating the mipi_core_cfg
clock.

Signed-off-by: Nikolay Petukhov <nikolaypetukhov@gmail.com>
Cc: Stefano Babic sbabic@denx.de
---
 arch/arm/mach-imx/mx6/soc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index b724668..8b976f7 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -655,6 +655,11 @@ void imx_setup_hdmi(void)
     int reg, count;
     u8 val;

+    /* Turn on MIPI core cfg clock */
+    reg = readl(&mxc_ccm->CCGR3);
+    reg |= MXC_CCM_CCGR3_MIPI_CORE_CFG_MASK;
+    writel(reg, &mxc_ccm->CCGR3);
+
     /* Turn on HDMI PHY clock */
     reg = readl(&mxc_ccm->CCGR2);
     reg |=  MXC_CCM_CCGR2_HDMI_TX_IAHBCLK_MASK|

Patch

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index b724668..8b976f7 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -655,6 +655,11 @@  void imx_setup_hdmi(void)
     int reg, count;
     u8 val;

+    /* Turn on MIPI core cfg clock */
+    reg = readl(&mxc_ccm->CCGR3);
+    reg |= MXC_CCM_CCGR3_MIPI_CORE_CFG_MASK;
+    writel(reg, &mxc_ccm->CCGR3);
+
     /* Turn on HDMI PHY clock */
     reg = readl(&mxc_ccm->CCGR2);
     reg |=  MXC_CCM_CCGR2_HDMI_TX_IAHBCLK_MASK|