diff options
author | Peng Fan <Peng.Fan@freescale.com> | 2015-10-29 15:54:49 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-11-12 17:40:53 +0100 |
commit | a3c252d6d68f9038106e0c11298438a2e50ab50f (patch) | |
tree | 664654ac167352c938555136dcb670e90ec04099 /drivers/video | |
parent | df6749048846cd15131ba1b4d9ae000eddddae4e (diff) | |
download | u-boot-imx-a3c252d6d68f9038106e0c11298438a2e50ab50f.zip u-boot-imx-a3c252d6d68f9038106e0c11298438a2e50ab50f.tar.gz u-boot-imx-a3c252d6d68f9038106e0c11298438a2e50ab50f.tar.bz2 |
video: mxsfb: introduce lcdif_power_down
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.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/mxsfb.c | 17 |
1 files changed, 17 insertions, 0 deletions
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, ®s->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, ®s->hw_lcdif_cur_buf_reg); + writel(panel.frameAdrs, ®s->hw_lcdif_next_buf_reg); + writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, ®s->hw_lcdif_ctrl1_clr); + while (--timeout) { + if (readl(®s->hw_lcdif_ctrl1_reg) & + LCDIF_CTRL1_VSYNC_EDGE_IRQ) + break; + udelay(1); + } + mxs_reset_block((struct mxs_register_32 *)®s->hw_lcdif_ctrl_reg); +} + void *video_hw_init(void) { int bpp = -1; |