]> git.sur5r.net Git - u-boot/commitdiff
video: mxsfb: Fix reset hang when videomode variable is not present
authorFabio Estevam <fabio.estevam@nxp.com>
Wed, 22 Feb 2017 13:40:22 +0000 (10:40 -0300)
committerAnatolij Gustschin <agust@denx.de>
Wed, 22 Feb 2017 20:47:59 +0000 (21:47 +0100)
Currently the system hangs when the 'videomode' variable is not present
and a reset command is issued:

=> 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 panel.frameAdrs has been initialized and
in case it has not been initialized, do not continue with the LCDIF
powerdown sequence.

Tested on a imx7dsabresd board.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
drivers/video/mxsfb.c

index 3cc03cadeee24a41029a0155d5625d101a56bbbd..32ecbe2b0991c34b93cbecf7ba5f785f33286ad0 100644 (file)
@@ -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 (!panel.frameAdrs)
+               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);