U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] video: mxsfb: Fix reset hang when videomode variable is not present
@ 2017-02-22  9:52 Fabio Estevam
  2017-02-22  9:58 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2017-02-22  9:52 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@nxp.com>

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 <fabio.estevam@nxp.com>
---
 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, &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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-22  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-22  9:52 [U-Boot] [PATCH] video: mxsfb: Fix reset hang when videomode variable is not present Fabio Estevam
2017-02-22  9:58 ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox