summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-07-22 19:48:07 -0700
committerYe Li <ye.li@nxp.com>2022-04-06 18:03:51 +0800
commit1ecdf3325dcbf18896eff27a89987c7a00a812ef (patch)
tree7cb9525d4c9fba137371f18d38b6684e7cb52192
parent8a249e8c49411c33fbcc77038ef0b37658ac3efe (diff)
MLK-24437-1 video: nw_dsi_imx: Fix initialization sequence
According to RM, doing initialization should assert the reset domain signals first, then enable the DSI related clocks in SCG. However, current implementation reverses the order and we found it will cause the MIPI_DSI_HOST_APB_PKT_IF0_DSI_HOST_IRQ_STATUS not be cleared completely after reset. Because the IRQ mask have been cleared during reset, then a IRQ is rised and pend in GIC and finally cause kernel panic issue. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 308870cac9db95fba2d20f0da7494d6a429e6644) (cherry picked from commit 41884f0ea930ff8d6dea83e88c25830ff491be92) (cherry picked from commit eda592d5ca8a62542c82feda545dacabf82f831d) (cherry picked from commit 62480d07dae903ccab89e61c4e515697b114002f)
-rw-r--r--drivers/video/imx/mipi_dsi_northwest.c7
-rw-r--r--drivers/video/imx/nw_dsi_imx.c5
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/imx/mipi_dsi_northwest.c b/drivers/video/imx/mipi_dsi_northwest.c
index 7c76799945..db05fa04aa 100644
--- a/drivers/video/imx/mipi_dsi_northwest.c
+++ b/drivers/video/imx/mipi_dsi_northwest.c
@@ -26,7 +26,7 @@
#include <dm/device_compat.h>
#include <regmap.h>
#include <syscon.h>
-
+#include <asm/arch/clock.h>
#define MIPI_LCD_SLEEP_MODE_DELAY (120)
#define MIPI_FIFO_TIMEOUT 250000 /* 250ms */
@@ -722,6 +722,8 @@ static void mipi_dsi_shutdown(struct mipi_dsi_northwest_info *mipi_dsi)
writel(0x1, mipi_dsi->mmio_base + DPHY_PD_PLL);
writel(0x1, mipi_dsi->mmio_base + DPHY_PD_DPHY);
+ enable_mipi_dsi_clk(false);
+
reset_dsi_domains(mipi_dsi, true);
}
@@ -739,6 +741,9 @@ static int mipi_dsi_northwest_host_attach(struct mipi_dsi_host *host,
/* Assert resets */
reset_dsi_domains(mipi_dsi, true);
+ /* Enable mipi relevant clocks */
+ enable_mipi_dsi_clk(true);
+
ret = mipi_dsi_dphy_init(mipi_dsi);
if (ret < 0)
return ret;
diff --git a/drivers/video/imx/nw_dsi_imx.c b/drivers/video/imx/nw_dsi_imx.c
index 18cdf7b8ed..5daf86d4e4 100644
--- a/drivers/video/imx/nw_dsi_imx.c
+++ b/drivers/video/imx/nw_dsi_imx.c
@@ -23,7 +23,6 @@
#include <power/regulator.h>
#include <regmap.h>
#include <syscon.h>
-#include <asm/arch/clock.h>
struct nw_dsi_imx_priv {
struct mipi_dsi_device device;
@@ -108,8 +107,6 @@ static int nw_dsi_imx_probe(struct udevice *dev)
return -EINVAL;
}
- enable_mipi_dsi_clk(true);
-
return ret;
}
@@ -127,8 +124,6 @@ static int nw_dsi_imx_remove(struct udevice *dev)
return ret;
}
- enable_mipi_dsi_clk(false);
-
return 0;
}