From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Estevam Date: Wed, 22 Feb 2017 06:52:24 -0300 Subject: [U-Boot] [PATCH] video: mxsfb: Fix reset hang when videomode variable is not present Message-ID: <1487757144-11823-1-git-send-email-festevam@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Fabio Estevam Currently the system hangs when the 'videomode' variable is not present: => setenv videomode => saveenv => reset (Board hangs) lcdif_power_down() assumes that the LCDIF controller has been properly configured and enabled, which may not be true. To fix this issue check whether video_hw_init() succeeded or not and only perform the LCDIF shutdown when the controller has been properly enabled. Tested on a imx7dsabresd board. Signed-off-by: Fabio Estevam --- drivers/video/mxsfb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 3cc03ca..83fd9aa 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -136,6 +136,9 @@ void lcdif_power_down(void) struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)MXS_LCDIF_BASE; int timeout = 1000000; + if (!video_hw_init()) + return; + 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); -- 2.7.4