Skip to contentSkip to conversation

video: check hardware version of DSI

PATCH New Yannick Fertre 4 participants 4 messages Jun 24, 2020 – Jun 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: check hardware version of DSI

Check the hardware version of DSI. Versions 1.30 & 1.31 are only supported.

---
 drivers/video/stm32/stm32_dsi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/video/stm32/stm32_dsi.c +9 -1
index 04796435f1..31ab8ebec7 100644
@@ -271,7 +271,6 @@ static int dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,
 	u32 val;
 
 	/* Update lane capabilities according to hw version */
-	dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
 	dsi->lane_min_kbps = LANE_MIN_KBPS;
 	dsi->lane_max_kbps = LANE_MAX_KBPS;
 	if (dsi->hw_version == HWVER_131) {
@@ -475,6 +474,15 @@ static int stm32_dsi_probe(struct udevice *dev)
 	/* Reset */
 	reset_deassert(&rst);
 
+	/* check hardware version */
+	priv->hw_version = dsi_read(priv, DSI_VERSION) & VERSION;
+	if (priv->hw_version != HWVER_130 &&
+	    priv->hw_version != HWVER_131) {
+		dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
+		ret = -ENODEV;
+		goto err_clk;
+	}
+
 	return 0;
 err_clk:
 	clk_disable(&clk);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 video: check hardware version of DSI

In reply to Yannick Fertre

Hi Yannick,
Many thanks for your patch,

Philippe :-)

Quoted 37 lines · Yannick Fertre

Check the hardware version of DSI. Versions 1.30 & 1.31 are only supported.

---
  drivers/video/stm32/stm32_dsi.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/video/stm32/stm32_dsi.c +9 -1
index 04796435f1..31ab8ebec7 100644
@@ -271,7 +271,6 @@ static int dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,
  	u32 val;
 
  	/* Update lane capabilities according to hw version */
-	dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
  	dsi->lane_min_kbps = LANE_MIN_KBPS;
  	dsi->lane_max_kbps = LANE_MAX_KBPS;
  	if (dsi->hw_version == HWVER_131) {
@@ -475,6 +474,15 @@ static int stm32_dsi_probe(struct udevice *dev)
  	/* Reset */
  	reset_deassert(&rst);
 
+	/* check hardware version */
+	priv->hw_version = dsi_read(priv, DSI_VERSION) & VERSION;
+	if (priv->hw_version != HWVER_130 &&
+	    priv->hw_version != HWVER_131) {
+		dev_err(dev, "DSI version 0x%x not supported\n", priv->hw_version);
+		ret = -ENODEV;
+		goto err_clk;
+	}
+
  	return 0;
  err_clk:
  	clk_disable(&clk);
#3 lore raw

PATCH 1/1 video: check hardware version of DSI

In reply to Yannick Fertre
Quoted 7 lines · On Wed, 24 Jun 2020 10:43:59 +0200 Yannick Fertre yannick.fertre at st.com…

Check the hardware version of DSI. Versions 1.30 & 1.31 are only supported.

---
 drivers/video/stm32/stm32_dsi.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Applied to u-boot-video/master, thanks!

--
Anatolij