public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 09/14] video: mxsfb: introduce lcdif_power_down
Date: Tue, 20 Oct 2015 15:59:18 +0200	[thread overview]
Message-ID: <562648B6.2040905@denx.de> (raw)
In-Reply-To: <1445341184-22272-10-git-send-email-Peng.Fan@freescale.com>

Hi Peng,

On 20/10/2015 13:39, Peng Fan wrote:
> Introudce a new function lcdif_power_down.
> 
> 1. Waits for a VSYNC interrupt to guarantee the reset is done at the
>    VSYNC edge, which somehow makes the LCDIF consume the display FIFO(?)
>    and helps the LCDIF work normally at the kernel stage.
> 2. Add power down function to stop lcdif.
> 
> The reason to introduce lcdif_power_down is that we want lcdif to be in
> initial state when doing uboot reset or before kernel boot to make
> system stable, otherwise system may hang.
> 

The explanation is independent from the processor type. But checking in
the next patch, this code runs only for 6UL. Why not for the 6sx ?


> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
> 
> V2:
>  none
> 
>  arch/arm/include/asm/imx-common/sys_proto.h |  2 ++
>  drivers/video/mxsfb.c                       | 17 +++++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/arch/arm/include/asm/imx-common/sys_proto.h b/arch/arm/include/asm/imx-common/sys_proto.h
> index 5673fb4..386c2dc 100644
> --- a/arch/arm/include/asm/imx-common/sys_proto.h
> +++ b/arch/arm/include/asm/imx-common/sys_proto.h
> @@ -47,6 +47,8 @@ int fecmxc_initialize(bd_t *bis);
>  u32 get_ahb_clk(void);
>  u32 get_periph_clk(void);
>  
> +void lcdif_power_down(void);
> +
>  int mxs_reset_block(struct mxs_register_32 *reg);
>  int mxs_wait_mask_set(struct mxs_register_32 *reg, u32 mask, u32 timeout);
>  int mxs_wait_mask_clr(struct mxs_register_32 *reg, u32 mask, u32 timeout);
> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
> index eed57d5..ddbb118 100644
> --- a/drivers/video/mxsfb.c
> +++ b/drivers/video/mxsfb.c
> @@ -131,6 +131,23 @@ static void mxs_lcd_init(GraphicDevice *panel,
>  	writel(LCDIF_CTRL_RUN, &regs->hw_lcdif_ctrl_set);
>  }
>  
> +void lcdif_power_down(void)
> +{
> +	struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE;
> +	int timeout = 1000000;
> +
> +	writel(panel.frameAdrs, &regs->hw_lcdif_cur_buf_reg);
> +	writel(panel.frameAdrs, &regs->hw_lcdif_next_buf_reg);
> +	writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, &regs->hw_lcdif_ctrl1_clr);
> +	while (--timeout) {
> +		if (readl(&regs->hw_lcdif_ctrl1_reg) &
> +		    LCDIF_CTRL1_VSYNC_EDGE_IRQ)
> +			break;
> +		udelay(1);
> +	}
> +	mxs_reset_block((struct mxs_register_32 *)&regs->hw_lcdif_ctrl_reg);
> +}
> +
>  void *video_hw_init(void)
>  {
>  	int bpp = -1;
> 

Best regards,
Stefano Babic

-- 
=====================================================================
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: sbabic at denx.de
=====================================================================

  reply	other threads:[~2015-10-20 13:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20 11:39 [U-Boot] [PATCH V2 00/14] imx: mx6/7: support lcdif Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 01/14] mxs: add parameter base_addr for mxs_set_lcdclk Peng Fan
2015-10-20 13:05   ` Stefano Babic
2015-10-26  2:57     ` Peng Fan
2015-10-26 15:52       ` Stefano Babic
2015-10-27  5:28         ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 02/14] sandisk: sfp: correct function name Peng Fan
2015-10-20 13:09   ` Stefano Babic
2015-10-20 11:39 ` [U-Boot] [PATCH V2 03/14] xfi3: " Peng Fan
2015-10-20 13:10   ` Stefano Babic
2015-10-26  3:00     ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 04/14] imx: imx-common: move lcdif structure and macro definition to imx-common Peng Fan
2015-10-20 13:15   ` Stefano Babic
2015-10-26  3:06     ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 05/14] imx: mx6: fix register address Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 06/14] imx: mx6: crm_reg: add LCDIF related macros Peng Fan
2015-10-20 13:19   ` Stefano Babic
2015-10-20 11:39 ` [U-Boot] [PATCH V2 07/14] imx: mx6: add clock api for lcdif Peng Fan
2015-10-20 13:39   ` Stefano Babic
2015-10-26  3:13     ` Peng Fan
2015-10-27  7:36     ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 08/14] imx: mx6ul_14x14_evk: support lcdif display Peng Fan
2015-10-20 13:41   ` Stefano Babic
2015-10-26  3:18     ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 09/14] video: mxsfb: introduce lcdif_power_down Peng Fan
2015-10-20 13:59   ` Stefano Babic [this message]
2015-10-26  3:24     ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 10/14] imx: mx6: implement reset_misc Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 11/14] imx: imx-common: power down lcdif before boot os Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 12/14] imx: mx7: compile misc.c for mx7 Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 13/14] imx: mx7 use the common lcdif register structure Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 14/14] imx: mx7dsabresd: support lcdif Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562648B6.2040905@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox