diff mbox

[U-Boot,01/12] arm: mx6: cm-fx6: map HDMI to IPU1 DI0 explicitly

Message ID 1437661179-32128-2-git-send-email-nikita@compulab.co.il
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show

Commit Message

Nikita Kiryanov July 23, 2015, 2:19 p.m. UTC
U-Boot does not explicitly assign the display to an IPU interface. Instead, it
relies on the power-on default of DI0.

Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
display no longer works in U-Boot.

Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 board/compulab/cm_fx6/cm_fx6.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Nikolay Dimitrov July 23, 2015, 5:54 p.m. UTC | #1
Hi Nikita,

On 07/23/2015 05:19 PM, Nikita Kiryanov wrote:
> U-Boot does not explicitly assign the display to an IPU interface. Instead, it
> relies on the power-on default of DI0.
>
> Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
> display no longer works in U-Boot.
>
> Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.
>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
>   board/compulab/cm_fx6/cm_fx6.c | 2 ++
>   1 file changed, 2 insertions(+)

I'm just curious - what motivated your choice of DI0 instead of DI1?

Regards,
Nikolay
Nikita Kiryanov July 26, 2015, 8:48 a.m. UTC | #2
On Thu, Jul 23, 2015 at 08:54:25PM +0300, Nikolay Dimitrov wrote:
> Hi Nikita,
> 
> On 07/23/2015 05:19 PM, Nikita Kiryanov wrote:
> >U-Boot does not explicitly assign the display to an IPU interface. Instead, it
> >relies on the power-on default of DI0.
> >
> >Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
> >display no longer works in U-Boot.
> >
> >Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.
> >
> >Cc: Stefano Babic <sbabic@denx.de>
> >Cc: Igor Grinberg <grinberg@compulab.co.il>
> >Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> >---
> >  board/compulab/cm_fx6/cm_fx6.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> I'm just curious - what motivated your choice of DI0 instead of DI1?

We discovered this after we already did a release with DI0, so I kept it
consistent with that release.

> 
> Regards,
> Nikolay
>
Nikolay Dimitrov July 26, 2015, 1:32 p.m. UTC | #3
On 07/26/2015 11:48 AM, Nikita Kiryanov wrote:
> On Thu, Jul 23, 2015 at 08:54:25PM +0300, Nikolay Dimitrov wrote:
>> Hi Nikita,
>>
>> On 07/23/2015 05:19 PM, Nikita Kiryanov wrote:
>>> U-Boot does not explicitly assign the display to an IPU interface. Instead, it
>>> relies on the power-on default of DI0.
>>>
>>> Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
>>> display no longer works in U-Boot.
>>>
>>> Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.
>>>
>>> Cc: Stefano Babic <sbabic@denx.de>
>>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>>> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
>>> ---
>>>   board/compulab/cm_fx6/cm_fx6.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>
>> I'm just curious - what motivated your choice of DI0 instead of DI1?
>
> We discovered this after we already did a release with DI0, so I kept it
> consistent with that release.
>
>>
>> Regards,
>> Nikolay
>>
>

Thanks!
Igor Grinberg July 26, 2015, 5:04 p.m. UTC | #4
Hi Nikita,

On 07/23/15 17:19, Nikita Kiryanov wrote:
> U-Boot does not explicitly assign the display to an IPU interface. Instead, it
> relies on the power-on default of DI0.
> 
> Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
> display no longer works in U-Boot.
> 
> Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.
> 
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
>  board/compulab/cm_fx6/cm_fx6.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 7a1bbaf..b500f91 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -83,6 +83,7 @@ size_t display_count = ARRAY_SIZE(displays);
>  static void cm_fx6_setup_display(void)
>  {
>  	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  	int reg;
>  
>  	enable_ipu_clock();
> @@ -90,6 +91,7 @@ static void cm_fx6_setup_display(void)
>  	reg = __raw_readl(&mxc_ccm->CCGR3);
>  	reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
>  	writel(reg, &mxc_ccm->CCGR3);
> +	clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK);

I would like to see this done through a display framework of some kind...
But since there none...

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

>  }
>  #else
>  static inline void cm_fx6_setup_display(void) {}
>
Stefano Babic Aug. 2, 2015, 8:53 a.m. UTC | #5
On 23/07/2015 16:19, Nikita Kiryanov wrote:
> U-Boot does not explicitly assign the display to an IPU interface. Instead, it
> relies on the power-on default of DI0.
> 
> Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI
> display no longer works in U-Boot.
> 
> Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot.
> 
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
>  board/compulab/cm_fx6/cm_fx6.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 7a1bbaf..b500f91 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -83,6 +83,7 @@ size_t display_count = ARRAY_SIZE(displays);
>  static void cm_fx6_setup_display(void)
>  {
>  	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
> +	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
>  	int reg;
>  
>  	enable_ipu_clock();
> @@ -90,6 +91,7 @@ static void cm_fx6_setup_display(void)
>  	reg = __raw_readl(&mxc_ccm->CCGR3);
>  	reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
>  	writel(reg, &mxc_ccm->CCGR3);
> +	clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK);
>  }
>  #else
>  static inline void cm_fx6_setup_display(void) {}
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index 7a1bbaf..b500f91 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -83,6 +83,7 @@  size_t display_count = ARRAY_SIZE(displays);
 static void cm_fx6_setup_display(void)
 {
 	struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
 	int reg;
 
 	enable_ipu_clock();
@@ -90,6 +91,7 @@  static void cm_fx6_setup_display(void)
 	reg = __raw_readl(&mxc_ccm->CCGR3);
 	reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
 	writel(reg, &mxc_ccm->CCGR3);
+	clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK);
 }
 #else
 static inline void cm_fx6_setup_display(void) {}