Skip to contentSkip to conversation

rework DSI characteristics

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

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

cover rework DSI characteristics

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

Yannick Fertre (4):
video: mipi update panel platform data
video: stm32: stm32_dsi: copy DSI fields
video: raydium_rm68200: fill characteristics of DSI data link
video: orisetech_otm8009a: fill characteristics of DSI data link

 drivers/video/orisetech_otm8009a.c | 20 +++++---------------
 drivers/video/raydium-rm68200.c    | 20 +++++---------------
 drivers/video/stm32/stm32_dsi.c    |  3 +++
 include/mipi_dsi.h                 |  6 ++++++
 4 files changed, 19 insertions(+), 30 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/4 video: mipi update panel platform data

Add new fields "lanes, format & mode_flags" to structure mipi_dsi_panel_plat.

---
 include/mipi_dsi.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/mipi_dsi.h +6 -0
index 83c5163cf8..c8a7d3daef 100644
@@ -221,9 +221,15 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
 /**
  * struct mipi_dsi_panel_plat - DSI panel platform data
  * @device: DSI peripheral device
+ * @lanes: number of active data lanes
+ * @format: pixel format for video mode
+ * @mode_flags: DSI operation mode related flags
  */
 struct mipi_dsi_panel_plat {
 	struct mipi_dsi_device *device;
+	unsigned int lanes;
+	enum mipi_dsi_pixel_format format;
+	unsigned long mode_flags;
 };
 
 /**
Signature · 1 line
2.17.1
#3 lore raw

PATCH 1/4 video: mipi update panel platform data

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

Add new fields "lanes, format & mode_flags" to structure mipi_dsi_panel_plat.

---
 include/mipi_dsi.h | 6 ++++++
 1 file changed, 6 insertions(+)

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

--
Anatolij

#4 lore raw

PATCH 2/4 video: stm32: stm32_dsi: copy DSI fields

In reply to Yannick Fertre

Copy the DSI data link characteristics from panel
platform data to mipi DSI device.

---
 drivers/video/stm32/stm32_dsi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/stm32/stm32_dsi.c +3 -0
index 04796435f1..c9b1633cf7 100644
@@ -354,6 +354,9 @@ static int stm32_dsi_attach(struct udevice *dev)
 
 	mplat = dev_get_platdata(priv->panel);
 	mplat->device = &priv->device;
+	device->lanes = mplat->lanes;
+	device->format = mplat->format;
+	device->mode_flags = mplat->mode_flags;
 
 	ret = panel_get_display_timing(priv->panel, &timings);
 	if (ret) {
Signature · 1 line
2.17.1
#6 lore raw

PATCH 2/4 video: stm32: stm32_dsi: copy DSI fields

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

Copy the DSI data link characteristics from panel
platform data to mipi DSI device.

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

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

--
Anatolij

#7 lore raw

PATCH 3/4 video: raydium_rm68200: fill characteristics of DSI data link

In reply to Yannick Fertre

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/raydium-rm68200.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/video/raydium-rm68200.c +5 -15
index 9169280fb8..353894503b 100644
@@ -75,9 +75,6 @@ struct rm68200_panel_priv {
 	struct udevice *reg;
 	struct udevice *backlight;
 	struct gpio_desc reset;
-	unsigned int lanes;
-	enum mipi_dsi_pixel_format format;
-	unsigned long mode_flags;
 };
 
 static const struct display_timing default_timing = {
@@ -259,17 +256,8 @@ static int rm68200_panel_enable_backlight(struct udevice *dev)
 static int rm68200_panel_get_display_timing(struct udevice *dev,
 					    struct display_timing *timings)
 {
-	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
-	struct mipi_dsi_device *device = plat->device;
-	struct rm68200_panel_priv *priv = dev_get_priv(dev);
-
 	memcpy(timings, &default_timing, sizeof(*timings));
 
-	/* fill characteristics of DSI data link */
-	device->lanes = priv->lanes;
-	device->format = priv->format;
-	device->mode_flags = priv->mode_flags;
-
 	return 0;
 }
 
@@ -308,6 +296,7 @@ static int rm68200_panel_ofdata_to_platdata(struct udevice *dev)
 static int rm68200_panel_probe(struct udevice *dev)
 {
 	struct rm68200_panel_priv *priv = dev_get_priv(dev);
+	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
 	int ret;
 
 	if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) {
@@ -322,9 +311,10 @@ static int rm68200_panel_probe(struct udevice *dev)
 	dm_gpio_set_value(&priv->reset, false);
 	mdelay(10);
 
-	priv->lanes = 2;
-	priv->format = MIPI_DSI_FMT_RGB888;
-	priv->mode_flags = MIPI_DSI_MODE_VIDEO |
+	/* fill characteristics of DSI data link */
+	plat->lanes = 2;
+	plat->format = MIPI_DSI_FMT_RGB888;
+	plat->mode_flags = MIPI_DSI_MODE_VIDEO |
 			   MIPI_DSI_MODE_VIDEO_BURST |
 			   MIPI_DSI_MODE_LPM;
 
Signature · 1 line
2.17.1
#8 lore raw

PATCH 3/4 video: raydium_rm68200: fill characteristics of DSI data link

Hi Yannick

Quoted 11 lines

From: Yannick FERTRE <[email protected]>
Sent: mercredi 24 juin 2020 10:46

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/raydium-rm68200.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

Thanks

Patrick

#9 lore raw

PATCH 3/4 video: raydium_rm68200: fill characteristics of DSI data link

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

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/raydium-rm68200.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

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

--
Anatolij

#10 lore raw

PATCH 4/4 video: orisetech_otm8009a: fill characteristics of DSI data link

In reply to Yannick Fertre

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/orisetech_otm8009a.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/video/orisetech_otm8009a.c +5 -15
index b1f2dd403e..362bf6a6fe 100644
@@ -62,9 +62,6 @@
 struct otm8009a_panel_priv {
 	struct udevice *reg;
 	struct gpio_desc reset;
-	unsigned int lanes;
-	enum mipi_dsi_pixel_format format;
-	unsigned long mode_flags;
 };
 
 static const struct display_timing default_timing = {
@@ -293,17 +290,8 @@ static int otm8009a_panel_enable_backlight(struct udevice *dev)
 static int otm8009a_panel_get_display_timing(struct udevice *dev,
 					     struct display_timing *timings)
 {
-	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
-	struct mipi_dsi_device *device = plat->device;
-	struct otm8009a_panel_priv *priv = dev_get_priv(dev);
-
 	memcpy(timings, &default_timing, sizeof(*timings));
 
-	/* fill characteristics of DSI data link */
-	device->lanes = priv->lanes;
-	device->format = priv->format;
-	device->mode_flags = priv->mode_flags;
-
 	return 0;
 }
 
@@ -335,6 +323,7 @@ static int otm8009a_panel_ofdata_to_platdata(struct udevice *dev)
 static int otm8009a_panel_probe(struct udevice *dev)
 {
 	struct otm8009a_panel_priv *priv = dev_get_priv(dev);
+	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
 	int ret;
 
 	if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) {
@@ -350,9 +339,10 @@ static int otm8009a_panel_probe(struct udevice *dev)
 	dm_gpio_set_value(&priv->reset, false);
 	mdelay(10); /* >5ms */
 
-	priv->lanes = 2;
-	priv->format = MIPI_DSI_FMT_RGB888;
-	priv->mode_flags = MIPI_DSI_MODE_VIDEO |
+	/* fill characteristics of DSI data link */
+	plat->lanes = 2;
+	plat->format = MIPI_DSI_FMT_RGB888;
+	plat->mode_flags = MIPI_DSI_MODE_VIDEO |
 			   MIPI_DSI_MODE_VIDEO_BURST |
 			   MIPI_DSI_MODE_LPM;
 
Signature · 1 line
2.17.1
#11 lore raw

PATCH 4/4 video: orisetech_otm8009a: fill characteristics of DSI data link

Hi Yannick,

Quoted 11 lines

From: Yannick FERTRE <[email protected]>
Sent: mercredi 24 juin 2020 10:46

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/orisetech_otm8009a.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

Thanks

Patrick

#12 lore raw

PATCH 4/4 video: orisetech_otm8009a: fill characteristics of DSI data link

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

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

---
 drivers/video/orisetech_otm8009a.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

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

--
Anatolij

#13 lore raw

cover rework DSI characteristics

In reply to Yannick Fertre

Hi Yannick,

Quoted 2 lines · On Wed, 24 Jun 2020 10:45:38 +0200 Yannick Fertre yannick.fertre at st.com…

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

This sounds like a bug fix? Should this series be applied for v2020.07 release?

Thanks!

--
Anatolij

#14 lore raw

cover rework DSI characteristics

Hi Anatolij

Quoted 5 lines

From: Anatolij Gustschin <[email protected]>
Sent: mercredi 24 juin 2020 15:32

Hi Yannick,

Quoted 8 lines
Quoted 2 lines · On Wed, 24 Jun 2020 10:45:38 +0200 Yannick Fertre yannick.fertre at st.com…

Fill characteristics of DSI data link to platform data instead of mipi device to avoid memory corruption.

This sounds like a bug fix? Should this series be applied for v2020.07 release?

Yes it is a bugfix....
We have crash when the STM32MP157x boards (EV1 or DK2) is booting with TF-A and OP-TEE support.

But we don't see any issue for TF-A boot only (with secure monitor = SPMIN) or SPL boot, So I assumed that it is not a blocker today for STM32MP15x support.

But it is perfect if this serie can be integrated in a v2020.07 pull request.

Thanks!

Patrick