Skip to contentSkip to conversation

drm: bridge: Add Samsung MIPI DSIM bridge

PATCH Superseded Jagan Teki 6 participants 27 messages Apr 8, 2022 – May 4, 2022

Subsystems (9)

v1 of 16 Superseded Latest is v16 →

lore
Share & tools
lore

Jagan Teki

author maintainer
#0 lore raw

cover drm: bridge: Add Samsung MIPI DSIM bridge

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://github.com/openedev/kernel/tree/imx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?
Jagan.

Jagan Teki (11):
drm: bridge: Add Samsung DSIM bridge driver
drm: bridge: samsung-dsim: Handle platform init via driver_data
drm: bridge: samsung-dsim: Mark PHY as optional
drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()
drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset
drm: bridge: samsung-dsim: Add module init, exit
drm: bridge: samsung-dsim: Add atomic_check
drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts
drm: bridge: samsung-dsim: Add input_bus_flags
dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support
drm: bridge: samsung-dsim: Add i.MX8MM support

 .../bindings/display/exynos/exynos_dsim.txt   |    1 +
 MAINTAINERS                                   |   12 +
 drivers/gpu/drm/bridge/Kconfig                |   12 +
 drivers/gpu/drm/bridge/Makefile               |    1 +
 drivers/gpu/drm/bridge/samsung-dsim.c         | 1803 +++++++++++++++++
 drivers/gpu/drm/exynos/Kconfig                |    1 +
 drivers/gpu/drm/exynos/exynos_drm_dsi.c       | 1704 +---------------
 include/drm/bridge/samsung-dsim.h             |   97 +
 8 files changed, 1982 insertions(+), 1649 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c
 create mode 100644 include/drm/bridge/samsung-dsim.h
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/11 drm: bridge: Add Samsung DSIM bridge driver

Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano.

In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver.

This patch is trying to differentiate platform-specific and bridge driver code and keep maintaining the exynos_drm_dsi.c code as platform-specific glue code and samsung-dsim.c as a common bridge driver code.

- Exynos specific glue code is exynos specific te_irq, host_attach, and detach code along with conventional component_ops.

- Samsung DSIM is a bridge driver which is common across all platforms and the respective platform-specific glue will initialize at the end of the probe. The platform-specific operations and other glue calls will invoke on associate code areas.

Updated MAINTAINERS file for this bridge with exynos drm maintainers along with Andrzej as he is the original author.

Tomasz Figa has been not included in MAINTAINERS as he is not available via samsung.com.

v1:
* Don't maintain component_ops in bridge driver
* Don't maintain platform glue code in bridge driver
* Add platform-specific glue code and make a common bridge

---
 MAINTAINERS                             |   12 +
 drivers/gpu/drm/bridge/Kconfig          |   12 +
 drivers/gpu/drm/bridge/Makefile         |    1 +
 drivers/gpu/drm/bridge/samsung-dsim.c   | 1676 ++++++++++++++++++++++
 drivers/gpu/drm/exynos/Kconfig          |    1 +
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1704 +----------------------
 include/drm/bridge/samsung-dsim.h       |   95 ++
 7 files changed, 1852 insertions(+), 1649 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c
 create mode 100644 include/drm/bridge/samsung-dsim.h
MAINTAINERS +12 -0
index db7fe53643c2..281d0f351854 100644
@@ -6227,6 +6227,18 @@ T:	git git://anongit.freedesktop.org/drm/drm-misc
 F:	Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml
 F:	drivers/gpu/drm/panel/panel-samsung-db7430.c
 
+DRM DRIVER FOR SAMSUNG MIPI DSIM BRIDGE
+M:	Inki Dae <[email protected]>
+M:	Joonyoung Shim <[email protected]>
+M:	Seung-Woo Kim <[email protected]>
+M:	Kyungmin Park <[email protected]>
+M:	Andrzej Hajda <[email protected]>
+M:	Jagan Teki <[email protected]>
+S:	Maintained
+T:	git git://anongit.freedesktop.org/drm/drm-misc
+F:	drivers/gpu/drm/bridge/samsung-dsim.c
+F:	include/drm/bridge/samsung-dsim.h
+
 DRM DRIVER FOR SAMSUNG S6D27A1 PANELS
 M:	Markuss Broks <[email protected]>
 S:	Maintained
drivers/gpu/drm/bridge/Kconfig +12 -0
index e4cbf31797c5..10f839154e63 100644
@@ -202,6 +202,18 @@ config DRM_PARADE_PS8640
 	  The PS8640 is a high-performance and low-power
 	  MIPI DSI to eDP converter
 
+config DRM_SAMSUNG_DSIM
+	tristate "Samsung MIPI DSIM bridge driver"
+	depends on COMMON_CLK
+	depends on OF && HAS_IOMEM
+	select DRM_KMS_HELPER
+	select DRM_MIPI_DSI
+	select DRM_PANEL_BRIDGE
+	help
+	  The Samsung MIPI DSIM bridge controller driver.
+	  This MIPI DSIM bridge can be found it on Exynos SoCs and
+	  NXP's i.MX8M Mini/Nano.
+
 config DRM_SIL_SII8620
 	tristate "Silicon Image SII8620 HDMI/MHL bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 425844c30495..d1d2e6414fc5 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
+obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o
 obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o
 obj-$(CONFIG_DRM_SII902X) += sii902x.o
 obj-$(CONFIG_DRM_SII9234) += sii9234.o
drivers/gpu/drm/bridge/samsung-dsim.c new file +1676 -0

1,676 lines not on this page · raw message

drivers/gpu/drm/exynos/Kconfig +1 -0
index f27cfd2a9726..784d379e3dd2 100644
@@ -58,6 +58,7 @@ config DRM_EXYNOS_DSI
 	depends on DRM_EXYNOS_FIMD || DRM_EXYNOS5433_DECON || DRM_EXYNOS7_DECON
 	select DRM_MIPI_DSI
 	select DRM_PANEL
+	select DRM_SAMSUNG_DSIM
 	default n
 	help
 	  This enables support for Exynos MIPI-DSI device.
drivers/gpu/drm/exynos/exynos_drm_dsi.c +55 -1649

1,274 lines not on this page · raw message

include/drm/bridge/samsung-dsim.h new file +95 -0

95 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

author maintainer
#5 lore raw

PATCH 2/11 drm: bridge: samsung-dsim: Handle platform init via driver_data

In reply to Jagan Teki

In order to make a common Samsung DSIM bridge driver some platform specific glue code needs to maintain separately as it is hard to maintain platform specific glue and conventional component_ops on the drm bridge drivers side.

This patch is trying to support that glue code initialization and invocation in the form of platform_init flag in driver_data.

So, the platforms which enable platform_init flags will handle all platform specific initialization via samsung_dsim_plat_probe.

The Platform probe is responsible to
- initialize samsung_dsim_plat_data and install hooks
- initialize component_ops
- preserve samsung_dsim structure pointer

v1:
* use platform_init instead of exynos_specific
* handle component_ops in glue code

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 20 ++++++++++++++++----
 include/drm/bridge/samsung-dsim.h     |  1 +
 2 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +16 -4
index ee5d7e5518a6..0e6a5d1c7e4e 100644
@@ -370,6 +370,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
 	.reg_values = reg_values,
+	.platform_init = true,
 };
 
 static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
@@ -382,6 +383,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
 	.reg_values = reg_values,
+	.platform_init = true,
 };
 
 static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
@@ -392,6 +394,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
 	.reg_values = reg_values,
+	.platform_init = true,
 };
 
 static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
@@ -403,6 +406,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
 	.wait_for_reset = 0,
 	.num_bits_resol = 12,
 	.reg_values = exynos5433_reg_values,
+	.platform_init = true,
 };
 
 static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
@@ -414,6 +418,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
 	.wait_for_reset = 1,
 	.num_bits_resol = 12,
 	.reg_values = exynos5422_reg_values,
+	.platform_init = true,
 };
 
 static const struct of_device_id samsung_dsim_of_match[] = {
@@ -1565,12 +1570,16 @@ static int samsung_dsim_probe(struct platform_device *pdev)
 	dsi->bridge.of_node = dev->of_node;
 	dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
 
-	dsi->plat_data = samsung_dsim_plat_probe(dsi);
-	if (IS_ERR(dsi->plat_data)) {
+	if (dsi->driver_data->platform_init) {
+		dsi->plat_data = samsung_dsim_plat_probe(dsi);
 		ret = PTR_ERR(dsi->plat_data);
-		goto err_disable_runtime;
+	} else {
+		ret = mipi_dsi_host_register(&dsi->dsi_host);
 	}
 
+	if (ret)
+		goto err_disable_runtime;
+
 	return 0;
 
 err_disable_runtime:
@@ -1585,7 +1594,10 @@ static int samsung_dsim_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(&pdev->dev);
 
-	samsung_dsim_plat_remove(dsi);
+	if (dsi->driver_data->platform_init)
+		samsung_dsim_plat_remove(dsi);
+	else
+		mipi_dsi_host_unregister(&dsi->dsi_host);
 
 	return 0;
 }
include/drm/bridge/samsung-dsim.h +1 -0
index 59a43f9c4477..eca7eacb5910 100644
@@ -39,6 +39,7 @@ struct samsung_dsim_driver_data {
 	unsigned int wait_for_reset;
 	unsigned int num_bits_resol;
 	const unsigned int *reg_values;
+	bool platform_init;
 };
 
 struct samsung_dsim_host_ops {
Signature · 1 line
2.25.1
author maintainer
#7 lore raw

PATCH 3/11 drm: bridge: samsung-dsim: Mark PHY as optional

In reply to Jagan Teki

In i.MX8M Mini/Nano SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver.

So, mark the phy get as optional.

v1:
* new patch

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/samsung-dsim.c +1 -1
index 0e6a5d1c7e4e..ff05c8e01cff 100644
@@ -1539,7 +1539,7 @@ static int samsung_dsim_probe(struct platform_device *pdev)
 	if (IS_ERR(dsi->reg_base))
 		return PTR_ERR(dsi->reg_base);
 
-	dsi->phy = devm_phy_get(dev, "dsim");
+	dsi->phy = devm_phy_optional_get(dev, "dsim");
 	if (IS_ERR(dsi->phy)) {
 		dev_info(dev, "failed to get dsim phy\n");
 		return PTR_ERR(dsi->phy);
Signature · 1 line
2.25.1
author maintainer
#8 lore raw

PATCH 4/11 drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()

In reply to Jagan Teki

Host transfer() in DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke for I2C-based-DSI bridge drivers.

Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges.

This patch adds the DSI initialization from transfer to bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers.

v1:
* keep DSI init in host transfer

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +7 -0
index ff05c8e01cff..3e12b469dfa8 100644
@@ -1290,6 +1290,13 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge,
 	}
 
 	dsi->state |= DSIM_STATE_ENABLED;
+
+	if (!(dsi->state & DSIM_STATE_INITIALIZED)) {
+		ret = samsung_dsim_init(dsi);
+		if (ret)
+			return;
+		dsi->state |= DSIM_STATE_INITIALIZED;
+	}
 }
 
 static void samsung_dsim_atomic_enable(struct drm_bridge *bridge,
Signature · 1 line
2.25.1
author maintainer
#10 lore raw

PATCH 5/11 drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset

In reply to Jagan Teki

The i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 with 13.7.10.1 Master PLL PMS Value setting Register mentioned PMS_P offset range from BIT[18-13] and the upstream driver is using the same offset.

However, offset 13 is not working on i.MX8M Mini platforms but downstream NXP driver is using 14 [1] and it is working with i.MX8M Mini SoC.

Not sure about whether it is reference manual documentation or something else but this patch trusts the downstream code and fixes the PLL_P offset.

[1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211

v1:
* updated commit message
* add downstream driver link

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 10 ++++++++--
 include/drm/bridge/samsung-dsim.h     |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +8 -2
index 3e12b469dfa8..423d654e8ffd 100644
@@ -169,7 +169,7 @@
 /* DSIM_PLLCTRL */
 #define DSIM_FREQ_BAND(x)		((x) << 24)
 #define DSIM_PLL_EN			(1 << 23)
-#define DSIM_PLL_P(x)			((x) << 13)
+#define DSIM_PLL_P(x, offset)		((x) << (offset))
 #define DSIM_PLL_M(x)			((x) << 4)
 #define DSIM_PLL_S(x)			((x) << 1)
 
@@ -369,6 +369,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
 	.max_freq = 1000,
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
+	.pll_p_offset = 13,
 	.reg_values = reg_values,
 	.platform_init = true,
 };
@@ -382,6 +383,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
 	.max_freq = 1000,
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
+	.pll_p_offset = 13,
 	.reg_values = reg_values,
 	.platform_init = true,
 };
@@ -393,6 +395,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
 	.max_freq = 1000,
 	.wait_for_reset = 1,
 	.num_bits_resol = 11,
+	.pll_p_offset = 13,
 	.reg_values = reg_values,
 	.platform_init = true,
 };
@@ -405,6 +408,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
 	.max_freq = 1500,
 	.wait_for_reset = 0,
 	.num_bits_resol = 12,
+	.pll_p_offset = 13,
 	.reg_values = exynos5433_reg_values,
 	.platform_init = true,
 };
@@ -417,6 +421,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
 	.max_freq = 1500,
 	.wait_for_reset = 1,
 	.num_bits_resol = 12,
+	.pll_p_offset = 13,
 	.reg_values = exynos5422_reg_values,
 	.platform_init = true,
 };
@@ -564,7 +569,8 @@ static unsigned long samsung_dsim_set_pll(struct samsung_dsim *dsi,
 	writel(driver_data->reg_values[PLL_TIMER],
 			dsi->reg_base + driver_data->plltmr_reg);
 
-	reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s);
+	reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) |
+	      DSIM_PLL_M(m) | DSIM_PLL_S(s);
 
 	if (driver_data->has_freqband) {
 		static const unsigned long freq_bands[] = {
include/drm/bridge/samsung-dsim.h +1 -0
index eca7eacb5910..4eb48ec6543f 100644
@@ -38,6 +38,7 @@ struct samsung_dsim_driver_data {
 	unsigned int max_freq;
 	unsigned int wait_for_reset;
 	unsigned int num_bits_resol;
+	unsigned int pll_p_offset;
 	const unsigned int *reg_values;
 	bool platform_init;
 };
Signature · 1 line
2.25.1
author maintainer
#11 lore raw

PATCH 6/11 drm: bridge: samsung-dsim: Add module init, exit

In reply to Jagan Teki

Add module init and exit functions for the bridge to register and unregister dsi_driver.

Exynos drm driver stack will register the platform_driver separately in the common of it's exynos_drm_drv.c including dsi_driver.

Register again would return -EBUSY, so return 0 for such cases as dsi_driver is already registered.

v1:
* none

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +22 -0
index 423d654e8ffd..1fe4b8e737a4 100644
@@ -1696,6 +1696,28 @@ struct platform_driver dsi_driver = {
 	},
 };
 
+static int __init samsung_mipi_dsim_init(void)
+{
+	int ret;
+
+	ret = platform_driver_register(&dsi_driver);
+
+	/**
+	 * Exynos drm driver stack will register the platform_driver
+	 * separately in the common of it's exynos_drm_drv.c including
+	 * dsi_driver. Register again would return -EBUSY, so return 0
+	 * for such cases as dsi_driver is already registered.
+	 */
+	return ret == -EBUSY ? 0 : ret;
+}
+module_init(samsung_mipi_dsim_init);
+
+static void __exit samsung_mipi_dsim_exit(void)
+{
+	platform_driver_unregister(&dsi_driver);
+}
+module_exit(samsung_mipi_dsim_exit);
+
 MODULE_AUTHOR("Jagan Teki <[email protected]>");
 MODULE_DESCRIPTION("Samsung MIPI DSIM controller bridge");
 MODULE_LICENSE("GPL v2");
Signature · 1 line
2.25.1
author maintainer
#12 lore raw

PATCH 7/11 drm: bridge: samsung-dsim: Add atomic_check

In reply to Jagan Teki

Fixing up the mode flags is required in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly.

So, handle the mode flags via bridge, atomic_check.

v1:
* fix mode flags in atomic_check instead of mode_fixup

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +14 -0
index 1fe4b8e737a4..38db1f93ed51 100644
@@ -1338,6 +1338,19 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge,
 	pm_runtime_put_sync(dsi->dev);
 }
 
+static int samsung_dsim_atomic_check(struct drm_bridge *bridge,
+				     struct drm_bridge_state *bridge_state,
+				     struct drm_crtc_state *crtc_state,
+				     struct drm_connector_state *conn_state)
+{
+	struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
+
+	adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC);
+	adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
+
+	return 0;
+}
+
 static void samsung_dsim_mode_set(struct drm_bridge *bridge,
 				  const struct drm_display_mode *mode,
 				  const struct drm_display_mode *adjusted_mode)
@@ -1359,6 +1372,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = {
 	.atomic_duplicate_state		= drm_atomic_helper_bridge_duplicate_state,
 	.atomic_destroy_state		= drm_atomic_helper_bridge_destroy_state,
 	.atomic_reset			= drm_atomic_helper_bridge_reset,
+	.atomic_check			= samsung_dsim_atomic_check,
 	.atomic_pre_enable		= samsung_dsim_atomic_pre_enable,
 	.atomic_enable			= samsung_dsim_atomic_enable,
 	.atomic_disable			= samsung_dsim_atomic_disable,
Signature · 1 line
2.25.1
author maintainer
#13 lore raw

PATCH 8/11 drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts

In reply to Jagan Teki

Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the default RGB888_1X24 bus format on DSI-end.

This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components.

v1:
* new patch

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +27 -0
index 38db1f93ed51..02802526f82f 100644
@@ -1338,6 +1338,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge,
 	pm_runtime_put_sync(dsi->dev);
 }
 
+#define MAX_INPUT_SEL_FORMATS	1
+
+static u32 *
+samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
+				       struct drm_bridge_state *bridge_state,
+				       struct drm_crtc_state *crtc_state,
+				       struct drm_connector_state *conn_state,
+				       u32 output_fmt,
+				       unsigned int *num_input_fmts)
+{
+	u32 *input_fmts;
+
+	*num_input_fmts = 0;
+
+	input_fmts = kcalloc(MAX_INPUT_SEL_FORMATS, sizeof(*input_fmts),
+			     GFP_KERNEL);
+	if (!input_fmts)
+		return NULL;
+
+	/* This is the DSI-end bus format */
+	input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24;
+	*num_input_fmts = 1;
+
+	return input_fmts;
+}
+
 static int samsung_dsim_atomic_check(struct drm_bridge *bridge,
 				     struct drm_bridge_state *bridge_state,
 				     struct drm_crtc_state *crtc_state,
@@ -1372,6 +1398,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = {
 	.atomic_duplicate_state		= drm_atomic_helper_bridge_duplicate_state,
 	.atomic_destroy_state		= drm_atomic_helper_bridge_destroy_state,
 	.atomic_reset			= drm_atomic_helper_bridge_reset,
+	.atomic_get_input_bus_fmts	= samsung_dsim_atomic_get_input_bus_fmts,
 	.atomic_check			= samsung_dsim_atomic_check,
 	.atomic_pre_enable		= samsung_dsim_atomic_pre_enable,
 	.atomic_enable			= samsung_dsim_atomic_enable,
Signature · 1 line
2.25.1
author maintainer
#14 lore raw

PATCH 9/11 drm: bridge: samsung-dsim: Add input_bus_flags

In reply to Jagan Teki

eLCDIF is expecting to have input_bus_flags as DE_LOW in order to set active low during valid data transfer on each horizontal line.

Add DE_LOW flag via drm bridge timings.

v1:
* none

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +5 -0
index 02802526f82f..71bbaf19f530 100644
@@ -1543,6 +1543,10 @@ __weak void samsung_dsim_plat_remove(struct samsung_dsim *priv)
 {
 }
 
+static const struct drm_bridge_timings samsung_dsim_bridge_timings = {
+	.input_bus_flags = DRM_BUS_FLAG_DE_LOW,
+};
+
 static int samsung_dsim_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -1622,6 +1626,7 @@ static int samsung_dsim_probe(struct platform_device *pdev)
 
 	dsi->bridge.funcs = &samsung_dsim_bridge_funcs;
 	dsi->bridge.of_node = dev->of_node;
+	dsi->bridge.timings = &samsung_dsim_bridge_timings;
 	dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
 
 	if (dsi->driver_data->platform_init) {
Signature · 1 line
2.25.1
author maintainer
#15 lore raw

PATCH 10/11 dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support

In reply to Jagan Teki

Samsung MIPI DSIM bridge can also be found in i.MX8MM/i.MX8MN SoC.

Add dt-bingings for it.

v1:
* new patch

---
 Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +1 -0
index be377786e8cd..5133d4d39190 100644
@@ -7,6 +7,7 @@ Required properties:
 		"samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */
 		"samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */
 		"samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */
+		"fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini/Nano SoCs */
   - reg: physical base address and length of the registers set for the device
   - interrupts: should contain DSI interrupt
   - clocks: list of clock specifiers, must contain an entry for each required
Signature · 1 line
2.25.1
author maintainer
#18 lore raw

PATCH 11/11 drm: bridge: samsung-dsim: Add i.MX8MM support

In reply to Jagan Teki

Samsung MIPI DSIM master can also be found in i.MX8MM SoC.

Add compatible and associated driver_data for it.

v1:
* none

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 34 +++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +34 -0
index 71bbaf19f530..d91510a51981 100644
@@ -360,6 +360,24 @@ static const unsigned int exynos5433_reg_values[] = {
 	[PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c),
 };
 
+static const unsigned int imx8mm_dsim_reg_values[] = {
+	[RESET_TYPE] = DSIM_SWRST,
+	[PLL_TIMER] = 500,
+	[STOP_STATE_CNT] = 0xf,
+	[PHYCTRL_ULPS_EXIT] = 0,
+	[PHYCTRL_VREG_LP] = 0,
+	[PHYCTRL_SLEW_UP] = 0,
+	[PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06),
+	[PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b),
+	[PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07),
+	[PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26),
+	[PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d),
+	[PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08),
+	[PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08),
+	[PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d),
+	[PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b),
+};
+
 static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
 	.reg_ofs = exynos_reg_ofs,
 	.plltmr_reg = 0x50,
@@ -426,6 +444,18 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
 	.platform_init = true,
 };
 
+static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = {
+	.reg_ofs = exynos5433_reg_ofs,
+	.plltmr_reg = 0xa0,
+	.has_clklane_stop = 1,
+	.num_clks = 2,
+	.max_freq = 2100,
+	.wait_for_reset = 0,
+	.num_bits_resol = 12,
+	.pll_p_offset = 14,
+	.reg_values = imx8mm_dsim_reg_values,
+};
+
 static const struct of_device_id samsung_dsim_of_match[] = {
 	{
 		.compatible = "samsung,exynos3250-mipi-dsi",
@@ -447,6 +477,10 @@ static const struct of_device_id samsung_dsim_of_match[] = {
 		.compatible = "samsung,exynos5433-mipi-dsi",
 		.data = &exynos5433_dsi_driver_data
 	},
+	{
+		.compatible = "fsl,imx8mm-mipi-dsim",
+		.data = &imx8mm_dsi_driver_data
+	},
 	{ /* sentinel. */ }
 };
 
Signature · 1 line
2.25.1
Tested-by on the v1 series
#20 lore raw
In reply to Jagan Teki
Quoted 57 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://github.com/openedev/kernel/tree/imx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?
Jagan.

Jagan Teki (11):
drm: bridge: Add Samsung DSIM bridge driver
drm: bridge: samsung-dsim: Handle platform init via driver_data
drm: bridge: samsung-dsim: Mark PHY as optional
drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()
drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset
drm: bridge: samsung-dsim: Add module init, exit
drm: bridge: samsung-dsim: Add atomic_check
drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts
drm: bridge: samsung-dsim: Add input_bus_flags
dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support
drm: bridge: samsung-dsim: Add i.MX8MM support

 .../bindings/display/exynos/exynos_dsim.txt   |    1 +
 MAINTAINERS                                   |   12 +
 drivers/gpu/drm/bridge/Kconfig                |   12 +
 drivers/gpu/drm/bridge/Makefile               |    1 +
 drivers/gpu/drm/bridge/samsung-dsim.c         | 1803 +++++++++++++++++
 drivers/gpu/drm/exynos/Kconfig                |    1 +
 drivers/gpu/drm/exynos/exynos_drm_dsi.c       | 1704 +---------------
 include/drm/bridge/samsung-dsim.h             |   97 +
 8 files changed, 1982 insertions(+), 1649 deletions(-)
 create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c
 create mode 100644 include/drm/bridge/samsung-dsim.h
Quoted 3 lines

--
2.25.1

Jagan,

Thanks so much for continuing to work this through!

I've successfully tested this series on imx8mm-venice-gw73xx-0x using the following:
- DFROBOT 7" raspberrypi touchscreen display (DFR0506) [1]
- the following defconfig:
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY CONFIG_DRM_PANEL_SIMPLE
CONFIG_DRM_PANEL_BRIDGE CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN CONFIG_DRM_TOSHIBA_TC358762
CONFIG_DRM_SAMSUNG_DSIM
CONFIG_DRM_MXSFB
- the following dt overlay:
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright 2022 Gateworks Corporation
*/

#include <dt-bindings/gpio/gpio.h>

#include "imx8mm-pinfunc.h"

/dts-v1/;
/plugin/;

&{/} {
        compatible = "gw,imx8mm-gw73xx-0x", "fsl,imx8mm";

        panel {
                compatible = "powertip,ph800480t013-idf02";
                power-supply = <&attiny>;
                backlight = <&attiny>;

                port {
                        panel_out_bridge: endpoint {
                                remote-endpoint = <&bridge_out_panel>;
                        };
                };
        };
};
&i2c3 {
        #address-cells = <1>;
        #size-cells = <0>;

        attiny: regulator@45 {
                compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
                reg = <0x45>;
        };
};
&lcdif {
        status = "okay";
};
&dsi {
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";

        bridge@0 {
                compatible = "toshiba,tc358762";
                reg = <0>;
                vddc-supply = <&attiny>;
                #address-cells = <1>;
                #size-cells = <0>;
                status = "okay";

                ports {
                        #address-cells = <1>;
                        #size-cells = <0>;

                        port@0 {
                                reg = <0>;
                                bridge_in_dsi: endpoint {
                                        remote-endpoint = <&dsi_out_bridge>;
                                        data-lanes = <0 1>;
                                };
                        };

                        port@1 {
                                reg = <1>;
                                bridge_out_panel: endpoint {
                                        remote-endpoint = <&panel_out_bridge>;
                                };
                        };
                };
        };

        ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@1 {
                        reg = <1>;

                        dsi_out_bridge: endpoint {
                                remote-endpoint = <&bridge_in_dsi>;
                        };
                };
        };
};

I'll be happy to test any follow-on series as needed.

Best Regards,

Tim
[1] https://www.dfrobot.com/product-1655.html

reviewer Reviewed-by on v1 11/11
#19 lore raw

Re: [PATCH 11/11] drm: bridge: samsung-dsim: Add i.MX8MM support

In reply to Jagan Teki

Hi Jagan,

Thank you for the patch.

Quoted 27 lines · Jagan Teki

Samsung MIPI DSIM master can also be found in i.MX8MM SoC.

Add compatible and associated driver_data for it.

v1:
* none

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 34 +++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +7 -0
index 71bbaf19f530..d91510a51981 100644
@@ -360,6 +360,24 @@ static const unsigned int exynos5433_reg_values[] = {
 	[PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c),
 };
 
+static const unsigned int imx8mm_dsim_reg_values[] = {
+	[RESET_TYPE] = DSIM_SWRST,
+	[PLL_TIMER] = 500,
+	[STOP_STATE_CNT] = 0xf,
+	[PHYCTRL_ULPS_EXIT] = 0,
+	[PHYCTRL_VREG_LP] = 0,
+	[PHYCTRL_SLEW_UP] = 0,

drivers/gpu/drm/bridge/samsung-dsim.c static const unsigned int exynos5433_reg_values[] = { · line 379

Quoted 10 lines
drivers/gpu/drm/bridge/samsung-dsim.c +10 -0
+	[PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06),
+	[PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b),
+	[PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07),
+	[PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26),
+	[PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d),
+	[PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08),
+	[PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08),
+	[PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d),
+	[PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b),
+};

Most of these values don't seem to be specific to a particular SoC integration, but should be tuned for the board and the connected DSI sink. That's out of scope for this patch of course.

Quoted 9 lines
drivers/gpu/drm/bridge/samsung-dsim.c +2 -0
+
 static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
 	.reg_ofs = exynos_reg_ofs,
 	.plltmr_reg = 0x50,
@@ -426,6 +444,18 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
 	.platform_init = true,
 };
 
+static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = {

drivers/gpu/drm/bridge/samsung-dsim.c static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { · line 457

Quoted 10 lines
drivers/gpu/drm/bridge/samsung-dsim.c +10 -0
+	.reg_ofs = exynos5433_reg_ofs,
+	.plltmr_reg = 0xa0,
+	.has_clklane_stop = 1,
+	.num_clks = 2,
+	.max_freq = 2100,
+	.wait_for_reset = 0,
+	.num_bits_resol = 12,
+	.pll_p_offset = 14,
+	.reg_values = imx8mm_dsim_reg_values,
+};

I haven't verified the values, the rest looks good to me.

Quoted 15 lines
drivers/gpu/drm/bridge/samsung-dsim.c +5 -0
+
 static const struct of_device_id samsung_dsim_of_match[] = {
 	{
 		.compatible = "samsung,exynos3250-mipi-dsi",
@@ -447,6 +477,10 @@ static const struct of_device_id samsung_dsim_of_match[] = {
 		.compatible = "samsung,exynos5433-mipi-dsi",
 		.data = &exynos5433_dsi_driver_data
 	},
+	{
+		.compatible = "fsl,imx8mm-mipi-dsim",
+		.data = &imx8mm_dsi_driver_data
+	},
 	{ /* sentinel. */ }
 };
 
Signature · 3 lines
Regards,

Laurent Pinchart
#16 lore raw

Re: [PATCH 10/11] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support

In reply to Jagan Teki

Hi Jagan,

Thank you for the patch.

Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt Required properties:

Quoted 17 lines · Jagan Teki

Samsung MIPI DSIM bridge can also be found in i.MX8MM/i.MX8MN SoC.

Add dt-bingings for it.

v1:
* new patch

---
 Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +0 -0
index be377786e8cd..5133d4d39190 100644
@@ -7,6 +7,7 @@ Required properties:

May I try and ask you to convert the DT bindings to YAML as part of this series ? :-)

Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt Required properties: · line 10

Quoted 4 lines
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +1 -0
 		"samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */
 		"samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */
 		"samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */
+		"fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini/Nano SoCs */

Should we have two different compatible strings for i.MX8MM and i.MX8MN ?

Quoted 3 lines
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +0 -0
   - reg: physical base address and length of the registers set for the device
   - interrupts: should contain DSI interrupt
   - clocks: list of clock specifiers, must contain an entry for each required
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

Re: [PATCH 04/11] drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()

In reply to Jagan Teki
Quoted 25 lines · Jagan Teki

Host transfer() in DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke for I2C-based-DSI bridge drivers.

Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges.

This patch adds the DSI initialization from transfer to bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers.

v1:
* keep DSI init in host transfer

---
 drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/bridge/samsung-dsim.c +0 -0
index ff05c8e01cff..3e12b469dfa8 100644

drivers/gpu/drm/bridge/samsung-dsim.c static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, · line 1298

Quoted 9 lines
drivers/gpu/drm/bridge/samsung-dsim.c +6 -0
@@ -1290,6 +1290,13 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge,
        }
 
        dsi->state |= DSIM_STATE_ENABLED;
+
+       if (!(dsi->state & DSIM_STATE_INITIALIZED)) {
+               ret = samsung_dsim_init(dsi);
+               if (ret)
+                       return;
+               dsi->state |= DSIM_STATE_INITIALIZED;

Out of curiosity, is there a reason that dsi->state cannot add DSIM_STATE_INITIALIZED inside the samsung_dsim_init function call? It seems to me that if samsung_dsim_init returns successfully, it should set that flag. I don't know if it's called from other places or not.

adam

Quoted 7 lines
drivers/gpu/drm/bridge/samsung-dsim.c +1 -1
+       }
 }
 
 static void samsung_dsim_atomic_enable(struct drm_bridge *bridge,
--

2.25.1

#21 lore raw

Re: (EXT) [PATCH 00/11] drm: bridge: Add Samsung MIPI DSIM bridge

In reply to Jagan Teki

Hi Jagan,

thanks for picking this up again and sending a new version.

Am Freitag, 8. April 2022, 18:20:57 CEST schrieb Jagan Teki:

Quoted 23 lines

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Quoted 8 lines

Anyone interested, please have a look on this repo [2]

[2] https://github.com/openedev/kernel/tree/imx8mm-dsi-v1
[1]
https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/
T/

Any inputs?

With the following patch I can use LVDS, connected via an LVDS bridge on my TQMa8MxML + MBa8Mx. Unless I enable 4 MIPI-DSI lanes.
Using "data-lanes = <1 2 3 4>;" instead show a flickering image, but the "content" seems ok. On the downstream kernel MIPI-DSI is working, apparently using 4-lanes. On the first glance a bigger difference to the downstream kernel from NXP is that AFAICS they change the clocks depending on the currently selected mode [1]. I tried playing with the clocks but I don't fully grasp which clock has which effect, so I eventually had no results. Any ideas what might be wrong here?

On a side note, might be completely unrelated to this series, I get the following warning as well:

Quoted 1 line

sn65dsi83 2-002d: Unsupported LVDS bus format 0x100a, please check output

bridge driver. Falling back to SPWG24.

0x100a is MEDIA_BUS_FMT_RGB888_1X24 from samsung_dsim_atomic_get_input_bus_fmts(). For some reason this is propagates to the output_bus_cfg used in sn65dsi83_atomic_enable(). I would have expected this is MEDIA_BUS_FMT_RGB888_1X7X4_SPWG from "tianma,tm070jvhg33" display.

Best regards,
Alexander

[1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/
bridge/sec-dsim.c?h=lf-5.10.72-2.2.0#n1255

Here is my patch for the DT
--->8---

arch/arm64/boot/dts/ renamed from arch/arm64/boot/dts/freescale/Makefile +0 -0

freescale/Makefile
index 52ce0f798657..7dd280b45681 100644

arch/arm64/boot/dts/freescale/Makefile +2 -0
@@ -58,6 +58,11 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-kontron-n801x-s.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-nitrogen-r2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-tqma8mqml-mba8mx.dtb
+
+tqma8mqml-mba8mx-imx327-dtbs += imx8mm-tqma8mqml-mba8mx.dtb imx8mm-tqma8mqml-

mba8mx-imx327.dtbo
+tqma8mqml-mba8mx-lvds-dtbs += imx8mm-tqma8mqml-mba8mx.dtb imx8mm-tqma8mqml- mba8mx-lvds.dtbo
+dtb-$(CONFIG_ARCH_MXC) += tqma8mqml-mba8mx-imx327.dtb tqma8mqml-mba8mx- lvds.dtb
+
dtb-$(CONFIG_ARCH_MXC) += imx8mm-var-som-symphony.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw71xx-0x.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x.dtb

(quoted diff) renamed from arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-lvds.dts +0 -0

arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-lvds.dts new file mode 100644
index 000000000000..8c743d291459

arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-lvds.dts new file +10 -0
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Copyright 2021-2022 TQ-Systems GmbH
+ */
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+	compatible = "tq,imx8mm-tqma8mqml-mba8mx", "tq,imx8mm-tqma8mqml", 

"fsl,imx8mm";
+};
+
+&backlight_lvds0 {
+ status = "okay";
+};
+
+&dsi {
+ status = "okay";
+
+ ports {
+ port@1 {
+ mipi_dsi_out: endpoint {
+ remote-endpoint =
<&lvds_bridge_in>;
+ };
+ };
+ };
+};
+
+&dsi_lvds_bridge {
+ status = "okay";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ lvds_bridge_in: endpoint {
+ data-lanes = <1 2 3>;
+ remote-endpoint = <&mipi_dsi_out>;
+ };
+ };
+ };
+};
+
+&expander0 {
+ dsi-mux-oe-hog {
+ gpio-hog;
+ gpios = <10 0>;
+ output-low;
+ line-name = "DSI_MUX_OE#";
+ };
+};
+
+&lcdif {
+ status = "okay";
+};
+
+&panel0 {
+ compatible = "tianma,tm070jvhg33";
+ status = "okay";
+};

arch/arm64/boot/dts/ renamed from arch/arm64/boot/dts/freescale/mba8mx.dtsi +0 -0

freescale/mba8mx.dtsi
index c2f0f1a1566c..4b2cca3268eb 100644

arch/arm64/boot/dts/freescale/mba8mx.dtsi +17 -0
@@ -8,6 +8,16 @@
 /* TQ-Systems GmbH MBa8Mx baseboard */
 
 / {
+	backlight_lvds0: backlight0 {
+		compatible = "pwm-backlight";
+		pwms = <&pwm3 0 5000000>;
+		brightness-levels = <0 4 8 16 32 64 128 255>;
+		default-brightness-level = <7>;
+		power-supply = <&reg_12v>;
+		enable-gpios = <&expander2 2 GPIO_ACTIVE_HIGH>;
+		status = "disabled";
+	};
+
 	beeper {
 		compatible = "pwm-beeper";
 		pwms = <&pwm4 0 250000 0>;
@@ -66,12 +76,31 @@ led2: led2 {
 		};
 	};
 
+	panel0: panel_lvds0 {
+		backlight = <&backlight_lvds0>;
+		status = "disabled";
+
+		port {
+			panel_in_lvds0: endpoint {
+				remote-endpoint = 

<&lvds_bridge_out>;
+ };
+ };
+ };
+
pcie0_refclk: pcie0-refclk {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <100000000>;
};

+ reg_12v: regulator-12v {
+ compatible = "regulator-fixed";
+ regulator-name = "MBA8MX_12V";
+ regulator-min-microvolt = <12000000>;
+ regulator-max-microvolt = <12000000>;
+ regulator-always-on;
+ };
+
reg_hub_vbus: regulator-hub-vbus {
compatible = "regulator-fixed"; regulator-name = "MBA8MX_HUB_VBUS";
@@ -227,6 +256,27 @@ &i2c3 {
scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; status = "okay";
+
+ dsi_lvds_bridge: dsi-lvds-bridge@2d {
+ compatible = "ti,sn65dsi83";
+ reg = <0x2d>;
+ enable-gpios = <&expander0 6 GPIO_ACTIVE_HIGH>;
+ vcc-supply = <&reg_sn65dsi83_1v8>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@2 {
+ reg = <2>;
+
+ lvds_bridge_out: endpoint {
+ remote-endpoint =
<&panel_in_lvds0>;
+ };
+ };
+ };
+ };
};

&pwm3 {
--->8---

maintainer
#22 lore raw
In reply to Jagan Teki
Quoted 21 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Quoted 8 lines

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://protect2.fireeye.com/v1/url?k=930e329a-f28527b5-930fb9d5-74fe485cbfe7-b0c53e2d688ddbc5&q=1&e=e6aa727d-5ae2-4ca5-bff3-7f62d8fae87e&u=https%3A%2F%2Fgithub.com%2Fopenedev%2Fkernel%2Ftree%2Fimx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?

I wanted to test this on the Exynos, but I wasn't able to find what base should I apply this patchset. I've tried linux-next as well as 95a2441e4347 ("drm: exynos: dsi: Switch to atomic funcs").

Please note that pointing a proper base for the patchset is really essential if you really want others to test it.

Quoted 24 lines

Jagan.

Jagan Teki (11):
drm: bridge: Add Samsung DSIM bridge driver
drm: bridge: samsung-dsim: Handle platform init via driver_data
drm: bridge: samsung-dsim: Mark PHY as optional
drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()
drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset
drm: bridge: samsung-dsim: Add module init, exit
drm: bridge: samsung-dsim: Add atomic_check
drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts
drm: bridge: samsung-dsim: Add input_bus_flags
dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support
drm: bridge: samsung-dsim: Add i.MX8MM support

  .../bindings/display/exynos/exynos_dsim.txt   |    1 +
  MAINTAINERS                                   |   12 +
  drivers/gpu/drm/bridge/Kconfig                |   12 +
  drivers/gpu/drm/bridge/Makefile               |    1 +
  drivers/gpu/drm/bridge/samsung-dsim.c         | 1803 +++++++++++++++++
  drivers/gpu/drm/exynos/Kconfig                |    1 +
  drivers/gpu/drm/exynos/exynos_drm_dsi.c       | 1704 +---------------
  include/drm/bridge/samsung-dsim.h             |   97 +
  8 files changed, 1982 insertions(+), 1649 deletions(-)
Quoted 3 lines

create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#23 lore raw
Quoted 30 lines · Marek Szyprowski
Quoted 28 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://protect2.fireeye.com/v1/url?k=930e329a-f28527b5-930fb9d5-74fe485cbfe7-b0c53e2d688ddbc5&q=1&e=e6aa727d-5ae2-4ca5-bff3-7f62d8fae87e&u=https%3A%2F%2Fgithub.com%2Fopenedev%2Fkernel%2Ftree%2Fimx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Quoted 8 lines
Quoted 1 line

Any inputs?

I wanted to test this on the Exynos, but I wasn't able to find what base should I apply this patchset. I've tried linux-next as well as 95a2441e4347 ("drm: exynos: dsi: Switch to atomic funcs").

Please note that pointing a proper base for the patchset is really essential if you really want others to test it.

Can you clone his repo and test that? He posted it above. I was going to clone it at some point this week to give it a try.

adam

Quoted 34 lines
Quoted 26 lines

Jagan.

Jagan Teki (11):
drm: bridge: Add Samsung DSIM bridge driver
drm: bridge: samsung-dsim: Handle platform init via driver_data
drm: bridge: samsung-dsim: Mark PHY as optional
drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()
drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset
drm: bridge: samsung-dsim: Add module init, exit
drm: bridge: samsung-dsim: Add atomic_check
drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts
drm: bridge: samsung-dsim: Add input_bus_flags
dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support
drm: bridge: samsung-dsim: Add i.MX8MM support

  .../bindings/display/exynos/exynos_dsim.txt   |    1 +
  MAINTAINERS                                   |   12 +
  drivers/gpu/drm/bridge/Kconfig                |   12 +
  drivers/gpu/drm/bridge/Makefile               |    1 +
  drivers/gpu/drm/bridge/samsung-dsim.c         | 1803 +++++++++++++++++
  drivers/gpu/drm/exynos/Kconfig                |    1 +
  drivers/gpu/drm/exynos/exynos_drm_dsi.c       | 1704 +---------------
  include/drm/bridge/samsung-dsim.h             |   97 +
  8 files changed, 1982 insertions(+), 1649 deletions(-)
Quoted 3 lines

create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

#24 lore raw
Quoted 39 lines · Adam Ford
Quoted 36 lines · Marek Szyprowski
Quoted 21 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Quoted 8 lines

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://protect2.fireeye.com/v1/url?k=930e329a-f28527b5-930fb9d5-74fe485cbfe7-b0c53e2d688ddbc5&q=1&e=e6aa727d-5ae2-4ca5-bff3-7f62d8fae87e&u=https%3A%2F%2Fgithub.com%2Fopenedev%2Fkernel%2Ftree%2Fimx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?

I wanted to test this on the Exynos, but I wasn't able to find what base should I apply this patchset. I've tried linux-next as well as 95a2441e4347 ("drm: exynos: dsi: Switch to atomic funcs").

Quoted 5 lines
Quoted 2 lines

Please note that pointing a proper base for the patchset is really essential if you really want others to test it.

Can you clone his repo and test that? He posted it above. I was going to clone it at some point this week to give it a try.

Jagan,

Is there anyway you could rebase this onto 5.18-rc1? Marek was having issues applying patches to a known branch, and it looks like I cannot enable stuff on Nano without applying a bunch of patches, because this base lacks the power-domain features on Nano that are present in the 5.18-rc1.

thanks,

adam

Quoted 36 lines

adam

Quoted 34 lines
Quoted 26 lines

Jagan.

Jagan Teki (11):
drm: bridge: Add Samsung DSIM bridge driver
drm: bridge: samsung-dsim: Handle platform init via driver_data
drm: bridge: samsung-dsim: Mark PHY as optional
drm: bridge: samsung-dsim: Add DSI init in bridge pre_enable()
drm: bridge: samsung-dsim: Fix PLL_P (PMS_P) offset
drm: bridge: samsung-dsim: Add module init, exit
drm: bridge: samsung-dsim: Add atomic_check
drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts
drm: bridge: samsung-dsim: Add input_bus_flags
dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support
drm: bridge: samsung-dsim: Add i.MX8MM support

  .../bindings/display/exynos/exynos_dsim.txt   |    1 +
  MAINTAINERS                                   |   12 +
  drivers/gpu/drm/bridge/Kconfig                |   12 +
  drivers/gpu/drm/bridge/Makefile               |    1 +
  drivers/gpu/drm/bridge/samsung-dsim.c         | 1803 +++++++++++++++++
  drivers/gpu/drm/exynos/Kconfig                |    1 +
  drivers/gpu/drm/exynos/exynos_drm_dsi.c       | 1704 +---------------
  include/drm/bridge/samsung-dsim.h             |   97 +
  8 files changed, 1982 insertions(+), 1649 deletions(-)
Quoted 3 lines

create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

maintainer
#25 lore raw
In reply to Adam Ford
Quoted 32 lines · Adam Ford
Quoted 30 lines · Marek Szyprowski
Quoted 29 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

[2] https://protect2.fireeye.com/v1/url?k=930e329a-f28527b5-930fb9d5-74fe485cbfe7-b0c53e2d688ddbc5&q=1&e=e6aa727d-5ae2-4ca5-bff3-7f62d8fae87e&u=https%3A%2F%2Fgithub.com%2Fopenedev%2Fkernel%2Ftree%2Fimx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?

Quoted 8 lines
Quoted 6 lines

I wanted to test this on the Exynos, but I wasn't able to find what base should I apply this patchset. I've tried linux-next as well as 95a2441e4347 ("drm: exynos: dsi: Switch to atomic funcs").

Please note that pointing a proper base for the patchset is really essential if you really want others to test it.

Can you clone his repo and test that? He posted it above. I was going to clone it at some point this week to give it a try.

Okay, my fault. I've missed that.

There is a trivial compilation issue, drivers/gpu/drm/exynos/exynos_drm_dsi.c lacks "#include <linux/gpio/consumer.h>" after conversion. Besides that, it simply nukes on the simplest Exynos setup (exynos4210-trats) during the initialization:

[drm] Exynos DRM: using 11c00000.fimd device for DMA mapping operations exynos-drm exynos-drm: bound 11c00000.fimd (ops fimd_component_ops) 8<--- cut here ---

Unable to handle kernel NULL pointer dereference at virtual address 00000048
[00000048] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
5.17.0-rc2-00577-g22e968113668-dirty #11635
Hardware name: Samsung Exynos (Flattened Device Tree)
PC is at exynos_dsi_bind+0x14/0x3c
LR is at component_bind_all+0x130/0x290
pc : [<c06924e0>]    lr : [<c06b0f6c>]    psr: 60000113

sp : c1cafcb8  ip : 00000002  fp : c0f4a53c
r10: c135e6a8  r9 : c1efd800  r8 : 00000000
r7 : c26d2100  r6 : c2c69fc0  r5 : 00000018  r4 : 00000000 r3 : c06924cc  r2 : 00000002  r1 : 00000000  r0 : c1efd800
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 10c5387d  Table: 4000404a  DAC: 00000051
Register r0 information: slab kmalloc-2k start c1efd800 pointer offset 0 size 2048
Register r1 information: NULL pointer
Register r2 information: non-paged memory
Register r3 information: non-slab/vmalloc memory
Register r4 information: NULL pointer
Register r5 information: non-paged memory
Register r6 information: slab kmalloc-64 start c2c69fc0 pointer offset 0 size 64
Register r7 information: slab kmalloc-64 start c26d2100 pointer offset 0 size 64
Register r8 information: NULL pointer
Register r9 information: slab kmalloc-2k start c1efd800 pointer offset 0 size 2048
Register r10 information: non-slab/vmalloc memory
Register r11 information: non-slab/vmalloc memory
Register r12 information: non-paged memory
Process swapper/0 (pid: 1, stack limit = 0x(ptrval))

Stack: (0xc1cafcb8 to 0xc1cb0000)

...
 exynos_dsi_bind from component_bind_all+0x130/0x290 component_bind_all from exynos_drm_bind+0xe8/0x194 exynos_drm_bind from try_to_bring_up_master+0x208/0x2d0 try_to_bring_up_master from component_master_add_with_match+0xd0/0x104 component_master_add_with_match from exynos_drm_platform_probe+0xe8/0x118 exynos_drm_platform_probe from platform_probe+0x80/0xc0 platform_probe from really_probe+0xfc/0x440
 really_probe from __driver_probe_device+0xa4/0x204 __driver_probe_device from driver_probe_device+0x34/0xd4 driver_probe_device from __driver_attach+0x114/0x184 __driver_attach from bus_for_each_dev+0x64/0xb0 bus_for_each_dev from bus_add_driver+0x170/0x20c bus_add_driver from driver_register+0x78/0x10c driver_register from exynos_drm_init+0xe0/0x14c exynos_drm_init from do_one_initcall+0x6c/0x3a4 do_one_initcall from kernel_init_freeable+0x1c4/0x214 kernel_init_freeable from kernel_init+0x18/0x12c
 kernel_init from ret_from_fork+0x14/0x2c

Exception stack(0xc1caffb0 to 0xc1cafff8)

ffa0:                                     00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000

Code: e5904040 e1a00002 e3a02002 e1a01004 (e5945048)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D 
5.17.0-rc2-00577-g22e968113668-dirty #11635
Hardware name: Samsung Exynos (Flattened Device Tree)
  unwind_backtrace from show_stack+0x10/0x14
  show_stack from dump_stack_lvl+0x58/0x70
  dump_stack_lvl from do_handle_IPI+0x2ec/0x36c
  do_handle_IPI from ipi_handler+0x18/0x20
  ipi_handler from handle_percpu_devid_irq+0xd0/0x394
  handle_percpu_devid_irq from generic_handle_domain_irq+0x44/0x88
  generic_handle_domain_irq from gic_handle_irq+0x88/0xac
  gic_handle_irq from generic_handle_arch_irq+0x58/0x78
  generic_handle_arch_irq from __irq_svc+0x54/0x88
Exception stack(0xc1cd1f48 to 0xc1cd1f90)

1f40:                   00000001 c0eff5a4 00000001 c011ca80 c1208f0c c1353420
1f60: 00000000 c1d8d000 00000000 c0f34234 c1d8d000 00000000 c0eeee98 c1cd1f98
1f80: c0109144 c0109148 20000013 ffffffff
 __irq_svc from arch_cpu_idle+0x40/0x44
 arch_cpu_idle from default_idle_call+0x74/0x2c4 default_idle_call from do_idle+0x1cc/0x284
 do_idle from cpu_startup_entry+0x18/0x1c cpu_startup_entry from 0x401018b4

---[ end Kernel panic - not syncing: Attempted to kill init! 

exitcode=0x0000000b ]---

I will try to take a look into this later in the evening.

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#26 lore raw
Quoted 22 lines · Marek Szyprowski
Quoted 20 lines · Adam Ford
Quoted 18 lines · Marek Szyprowski
Quoted 17 lines · Jagan Teki

This series supports common bridge support for Samsung MIPI DSIM which is used in Exynos and i.MX8MM SoC's.

Previous RFC can be available here [1].

The final bridge supports both the Exynos and i.MX8MM DSI devices.

On, summary this patch-set break the entire DSIM driver into
- platform specific glue code for platform ops, component_ops.
- common bridge driver which handle platform glue init and invoke.

Patch 0000: Samsung DSIM bridge

Patch 0001: platform init flag via driver_data

Patch 0002/9: bridge fixes, atomic API's

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Patch 0010: document fsl,imx8mm-mipi-dsim

Patch 0011: add i.MX8MM DSIM support

Tested in Engicam i.Core MX8M Mini SoM.

Anyone interested, please have a look on this repo [2]

I attempted to build your newer repo, but I get build errors:

~/src/linux-opendev$ make Image modules ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j8

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h

MODPOST modules-only.symvers
ERROR: modpost: "dsi_driver" [drivers/gpu/drm/exynos/exynosdrm.ko] undefined! make[1]: *** [scripts/Makefile.modpost:134: modules-only.symvers] Error 1 make[1]: *** Deleting file 'modules-only.symvers'
make: *** [Makefile:1746: modules] Error 2

I'm using gcc version 11.2.0 (Ubuntu 11.2.0-17ubuntu1) part of the ubuntu 22.04 beta. I know it's beta, so it might be buggy, but I expect GCC 11.2 to be stable.

I'm going to keep investigating. If I find a fix, I'll send you a private message with the patch attached to avoid spamming everyone.

adam

Quoted 123 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

[2] https://protect2.fireeye.com/v1/url?k=930e329a-f28527b5-930fb9d5-74fe485cbfe7-b0c53e2d688ddbc5&q=1&e=e6aa727d-5ae2-4ca5-bff3-7f62d8fae87e&u=https%3A%2F%2Fgithub.com%2Fopenedev%2Fkernel%2Ftree%2Fimx8mm-dsi-v1
[1] https://lore.kernel.org/linux-arm-kernel/YP2j9k5SrZ2%2Fo2%[email protected]/T/

Any inputs?

Quoted 8 lines
Quoted 6 lines

I wanted to test this on the Exynos, but I wasn't able to find what base should I apply this patchset. I've tried linux-next as well as 95a2441e4347 ("drm: exynos: dsi: Switch to atomic funcs").

Please note that pointing a proper base for the patchset is really essential if you really want others to test it.

Can you clone his repo and test that? He posted it above. I was going to clone it at some point this week to give it a try.

Okay, my fault. I've missed that.

There is a trivial compilation issue, drivers/gpu/drm/exynos/exynos_drm_dsi.c lacks "#include <linux/gpio/consumer.h>" after conversion. Besides that, it simply nukes on the simplest Exynos setup (exynos4210-trats) during the initialization:

[drm] Exynos DRM: using 11c00000.fimd device for DMA mapping operations exynos-drm exynos-drm: bound 11c00000.fimd (ops fimd_component_ops) 8<--- cut here ---

Unable to handle kernel NULL pointer dereference at virtual address 00000048
[00000048] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted
5.17.0-rc2-00577-g22e968113668-dirty #11635
Hardware name: Samsung Exynos (Flattened Device Tree)
PC is at exynos_dsi_bind+0x14/0x3c
LR is at component_bind_all+0x130/0x290
pc : [<c06924e0>]    lr : [<c06b0f6c>]    psr: 60000113

sp : c1cafcb8 ip : 00000002 fp : c0f4a53c
r10: c135e6a8 r9 : c1efd800 r8 : 00000000
r7 : c26d2100 r6 : c2c69fc0 r5 : 00000018 r4 : 00000000 r3 : c06924cc r2 : 00000002 r1 : 00000000 r0 : c1efd800
Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
Control: 10c5387d Table: 4000404a DAC: 00000051
Register r0 information: slab kmalloc-2k start c1efd800 pointer offset 0 size 2048
Register r1 information: NULL pointer
Register r2 information: non-paged memory
Register r3 information: non-slab/vmalloc memory
Register r4 information: NULL pointer
Register r5 information: non-paged memory
Register r6 information: slab kmalloc-64 start c2c69fc0 pointer offset 0 size 64
Register r7 information: slab kmalloc-64 start c26d2100 pointer offset 0 size 64
Register r8 information: NULL pointer
Register r9 information: slab kmalloc-2k start c1efd800 pointer offset 0 size 2048
Register r10 information: non-slab/vmalloc memory
Register r11 information: non-slab/vmalloc memory
Register r12 information: non-paged memory
Process swapper/0 (pid: 1, stack limit = 0x(ptrval))

Stack: (0xc1cafcb8 to 0xc1cb0000)

...
exynos_dsi_bind from component_bind_all+0x130/0x290 component_bind_all from exynos_drm_bind+0xe8/0x194 exynos_drm_bind from try_to_bring_up_master+0x208/0x2d0 try_to_bring_up_master from component_master_add_with_match+0xd0/0x104 component_master_add_with_match from exynos_drm_platform_probe+0xe8/0x118 exynos_drm_platform_probe from platform_probe+0x80/0xc0 platform_probe from really_probe+0xfc/0x440
really_probe from __driver_probe_device+0xa4/0x204 __driver_probe_device from driver_probe_device+0x34/0xd4 driver_probe_device from __driver_attach+0x114/0x184 __driver_attach from bus_for_each_dev+0x64/0xb0 bus_for_each_dev from bus_add_driver+0x170/0x20c bus_add_driver from driver_register+0x78/0x10c driver_register from exynos_drm_init+0xe0/0x14c exynos_drm_init from do_one_initcall+0x6c/0x3a4 do_one_initcall from kernel_init_freeable+0x1c4/0x214 kernel_init_freeable from kernel_init+0x18/0x12c
kernel_init from ret_from_fork+0x14/0x2c

Exception stack(0xc1caffb0 to 0xc1cafff8)

ffa0: 00000000 00000000 00000000
00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000

Code: e5904040 e1a00002 e3a02002 e1a01004 (e5945048)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D
5.17.0-rc2-00577-g22e968113668-dirty #11635
Hardware name: Samsung Exynos (Flattened Device Tree)
  unwind_backtrace from show_stack+0x10/0x14
  show_stack from dump_stack_lvl+0x58/0x70
  dump_stack_lvl from do_handle_IPI+0x2ec/0x36c
  do_handle_IPI from ipi_handler+0x18/0x20
  ipi_handler from handle_percpu_devid_irq+0xd0/0x394
  handle_percpu_devid_irq from generic_handle_domain_irq+0x44/0x88
  generic_handle_domain_irq from gic_handle_irq+0x88/0xac
  gic_handle_irq from generic_handle_arch_irq+0x58/0x78
  generic_handle_arch_irq from __irq_svc+0x54/0x88
Exception stack(0xc1cd1f48 to 0xc1cd1f90)

1f40: 00000001 c0eff5a4 00000001 c011ca80 c1208f0c
c1353420
1f60: 00000000 c1d8d000 00000000 c0f34234 c1d8d000 00000000 c0eeee98 c1cd1f98
1f80: c0109144 c0109148 20000013 ffffffff
__irq_svc from arch_cpu_idle+0x40/0x44
arch_cpu_idle from default_idle_call+0x74/0x2c4 default_idle_call from do_idle+0x1cc/0x284
do_idle from cpu_startup_entry+0x18/0x1c cpu_startup_entry from 0x401018b4

---[ end Kernel panic - not syncing: Attempted to kill init!

exitcode=0x0000000b ]---

I will try to take a look into this later in the evening.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

maintainer
#2 lore raw

Re: [PATCH 01/11] drm: bridge: Add Samsung DSIM bridge driver

In reply to Jagan Teki

Hi Jagan,

Quoted 24 lines · Jagan Teki

Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano.

In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver.

This patch is trying to differentiate platform-specific and bridge driver code and keep maintaining the exynos_drm_dsi.c code as platform-specific glue code and samsung-dsim.c as a common bridge driver code.

- Exynos specific glue code is exynos specific te_irq, host_attach, and detach code along with conventional component_ops.

- Samsung DSIM is a bridge driver which is common across all platforms and the respective platform-specific glue will initialize at the end of the probe. The platform-specific operations and other glue calls will invoke on associate code areas.

Updated MAINTAINERS file for this bridge with exynos drm maintainers along with Andrzej as he is the original author.

Tomasz Figa has been not included in MAINTAINERS as he is not available via samsung.com.

Quoted 6 lines

v1:
* Don't maintain component_ops in bridge driver
* Don't maintain platform glue code in bridge driver
* Add platform-specific glue code and make a common bridge

Well, it took me a while to make this working on Exynos. I'm not really happy of the design, although I didn't spent much time thinking how to improve it and clarify some ambiguities. It doesn't even look that one has compiled the Exynos code after this conversion.

The following changes are needed to get it to the same working state as before this patch (the next patches however break it even further):

commit e358ee6239305744062713c5aa2e8d44f740b81a (HEAD)
Author: Marek Szyprowski <[email protected]> Date:   Tue Apr 12 11:30:26 2022 +0200

    drm: exynos: dsi: fixup driver after conversion

(quoted diff) +0 -0

b/drivers/gpu/drm/bridge/samsung-dsim.c
index ee5d7e5518a6..8e0064282ce6 100644

drivers/gpu/drm/bridge/samsung-dsim.c +0 -1
@@ -17,7 +17,6 @@
 
  #include <linux/clk.h>
  #include <linux/delay.h>
-#include <linux/gpio/consumer.h>
  #include <linux/irq.h>
  #include <linux/of_device.h>
  #include <linux/phy/phy.h>
(quoted diff) +0 -0

b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 97167c5ffc78..bbfacb22d99d 100644

drivers/gpu/drm/exynos/exynos_drm_dsi.c +4 -2
@@ -8,6 +8,7 @@
   */
 
  #include <linux/component.h>
+#include <linux/gpio/consumer.h>
 
  #include <drm/bridge/samsung-dsim.h>
  #include <drm/drm_probe_helper.h>
@@ -25,17 +26,19 @@ struct exynos_dsi {
         struct samsung_dsim_plat_data pdata;
  };
 
-static void exynos_dsi_enable_irq(void *priv)
+static void exynos_dsi_enable_irq(struct samsung_dsim *priv)
  {
-       struct exynos_dsi *dsi = priv;
+       const struct samsung_dsim_plat_data *pdata = priv->plat_data;
+       struct exynos_dsi *dsi = container_of(pdata, struct exynos_dsi, 

pdata);

        if (dsi->te_gpio) enable_irq(gpiod_to_irq(dsi->te_gpio)); }

-static void exynos_dsi_disable_irq(void *priv)
+static void exynos_dsi_disable_irq(struct samsung_dsim *priv)
 {
-       struct exynos_dsi *dsi = priv;
+       const struct samsung_dsim_plat_data *pdata = priv->plat_data; +       struct exynos_dsi *dsi = container_of(pdata, struct exynos_dsi, pdata);

        if (dsi->te_gpio) disable_irq(gpiod_to_irq(dsi->te_gpio));
@@ -92,15 +95,15 @@ static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi)
        }
 }

-static int exynos_dsi_host_attach(void *priv, struct mipi_dsi_device *device)
+static int exynos_dsi_host_attach(struct samsung_dsim *priv, struct mipi_dsi_device *device)
 {
-       struct exynos_dsi *dsi = priv;
-       struct samsung_dsim *_priv = dsi->priv;
+       const struct samsung_dsim_plat_data *pdata = priv->plat_data; +       struct exynos_dsi *dsi = container_of(pdata, struct exynos_dsi, pdata);
        struct drm_encoder *encoder = &dsi->encoder;
        struct drm_device *drm = encoder->dev;
        int ret;

-       drm_bridge_attach(encoder, &_priv->bridge, NULL, 0); +       drm_bridge_attach(encoder, &priv->bridge, NULL, 0);

        /*
         * This is a temporary solution and should be made by more
generic way.
@@ -116,11 +119,11 @@ static int exynos_dsi_host_attach(void *priv, struct mipi_dsi_device *device)

        mutex_lock(&drm->mode_config.mutex);

-       _priv->lanes = device->lanes;
-       _priv->format = device->format;
-       _priv->mode_flags = device->mode_flags;
+       priv->lanes = device->lanes;
+       priv->format = device->format;
+       priv->mode_flags = device->mode_flags;
        exynos_drm_crtc_get_by_type(drm,
EXYNOS_DISPLAY_TYPE_LCD)->i80_mode =
-                       !(_priv->mode_flags & MIPI_DSI_MODE_VIDEO); +                       !(priv->mode_flags & MIPI_DSI_MODE_VIDEO);

        mutex_unlock(&drm->mode_config.mutex);

@@ -130,9 +133,10 @@ static int exynos_dsi_host_attach(void *priv, struct mipi_dsi_device *device)
        return 0;
 }

-static int exynos_dsi_host_detach(void *priv, struct mipi_dsi_device *device)
+static int exynos_dsi_host_detach(struct samsung_dsim *priv, struct mipi_dsi_device *device)
 {
-       struct exynos_dsi *dsi = priv;
+       const struct samsung_dsim_plat_data *pdata = priv->plat_data; +       struct exynos_dsi *dsi = container_of(pdata, struct exynos_dsi, pdata);
        struct drm_device *drm = dsi->encoder.dev;

        if (drm->mode_config.poll_enabled)
@@ -150,8 +154,9 @@ static const struct samsung_dsim_host_ops samsung_dsim_exynos_host_ops = {

 static int exynos_dsi_bind(struct device *dev, struct device *master,
void *data)
 {
-       struct exynos_dsi *dsi = dev_get_drvdata(dev);
-       struct samsung_dsim *priv = dsi->priv;
+       struct samsung_dsim *priv = dev_get_drvdata(dev);
+       const struct samsung_dsim_plat_data *pdata = priv->plat_data; +       struct exynos_dsi *dsi = container_of(pdata, struct exynos_dsi, pdata);
        struct drm_encoder *encoder = &dsi->encoder;
        struct drm_device *drm_dev = data;
        int ret;
@@ -167,8 +172,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, void *data

 static void exynos_dsi_unbind(struct device *dev, struct device
*master, void *data)
 {
-       struct exynos_dsi *dsi = dev_get_drvdata(dev); -       struct samsung_dsim *priv = dsi->priv;
+       struct samsung_dsim *priv = dev_get_drvdata(dev);

priv->bridge.funcs->atomic_disable(&priv->bridge, NULL);

(quoted diff) +0 -0

b/include/drm/bridge/samsung-dsim.h
index 59a43f9c4477..9f579a798635 100644

include/drm/bridge/samsung-dsim.h +8 -4
@@ -41,14 +41,18 @@ struct samsung_dsim_driver_data {
         const unsigned int *reg_values;
  };
 
+struct samsung_dsim;
+
  struct samsung_dsim_host_ops {
-       int (*attach)(void *priv, struct mipi_dsi_device *device);
-       int (*detach)(void *priv, struct mipi_dsi_device *device);
+       int (*attach)(struct samsung_dsim *priv,
+                     struct mipi_dsi_device *device);
+       int (*detach)(struct samsung_dsim *priv,
+                     struct mipi_dsi_device *device);
  };
 
  struct samsung_dsim_irq_ops {
-       void (*enable)(void *priv);
-       void (*disable)(void *priv);
+       void (*enable)(struct samsung_dsim *priv);
+       void (*disable)(struct samsung_dsim *priv);
  };
 
  struct samsung_dsim_plat_data {
Quoted 9 lines
---
  MAINTAINERS                             |   12 +
  drivers/gpu/drm/bridge/Kconfig          |   12 +
  drivers/gpu/drm/bridge/Makefile         |    1 +
  drivers/gpu/drm/bridge/samsung-dsim.c   | 1676 ++++++++++++++++++++++
  drivers/gpu/drm/exynos/Kconfig          |    1 +
  drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1704 +----------------------
  include/drm/bridge/samsung-dsim.h       |   95 ++
  7 files changed, 1852 insertions(+), 1649 deletions(-)
Quoted 4 lines

create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c create mode 100644 include/drm/bridge/samsung-dsim.h

...

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
maintainer
#6 lore raw

Re: [PATCH 02/11] drm: bridge: samsung-dsim: Handle platform init via driver_data

In reply to Jagan Teki
Quoted 70 lines · Jagan Teki

In order to make a common Samsung DSIM bridge driver some platform specific glue code needs to maintain separately as it is hard to maintain platform specific glue and conventional component_ops on the drm bridge drivers side.

This patch is trying to support that glue code initialization and invocation in the form of platform_init flag in driver_data.

So, the platforms which enable platform_init flags will handle all platform specific initialization via samsung_dsim_plat_probe.

The Platform probe is responsible to
- initialize samsung_dsim_plat_data and install hooks
- initialize component_ops
- preserve samsung_dsim structure pointer

v1:
* use platform_init instead of exynos_specific
* handle component_ops in glue code

---
  drivers/gpu/drm/bridge/samsung-dsim.c | 20 ++++++++++++++++----
  include/drm/bridge/samsung-dsim.h     |  1 +
  2 files changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +5 -0
index ee5d7e5518a6..0e6a5d1c7e4e 100644
@@ -370,6 +370,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = {
  	.wait_for_reset = 1,
  	.num_bits_resol = 11,
  	.reg_values = reg_values,
+	.platform_init = true,
  };
 
  static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
@@ -382,6 +383,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = {
  	.wait_for_reset = 1,
  	.num_bits_resol = 11,
  	.reg_values = reg_values,
+	.platform_init = true,
  };
 
  static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
@@ -392,6 +394,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = {
  	.wait_for_reset = 1,
  	.num_bits_resol = 11,
  	.reg_values = reg_values,
+	.platform_init = true,
  };
 
  static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
@@ -403,6 +406,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = {
  	.wait_for_reset = 0,
  	.num_bits_resol = 12,
  	.reg_values = exynos5433_reg_values,
+	.platform_init = true,
  };
 
  static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
@@ -414,6 +418,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = {
  	.wait_for_reset = 1,
  	.num_bits_resol = 12,
  	.reg_values = exynos5422_reg_values,
+	.platform_init = true,
  };
 
  static const struct of_device_id samsung_dsim_of_match[] = {

drivers/gpu/drm/bridge/samsung-dsim.c static int samsung_dsim_probe(struct platform_device *pdev) · line 1575

Quoted 8 lines
drivers/gpu/drm/bridge/samsung-dsim.c +2 -2
@@ -1565,12 +1570,16 @@ static int samsung_dsim_probe(struct platform_device *pdev)
  	dsi->bridge.of_node = dev->of_node;
  	dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
 
-	dsi->plat_data = samsung_dsim_plat_probe(dsi);
-	if (IS_ERR(dsi->plat_data)) {
+	if (dsi->driver_data->platform_init) {
+		dsi->plat_data = samsung_dsim_plat_probe(dsi);
  		ret = PTR_ERR(dsi->plat_data);

ret = IS_ERR(dsi->plat_data) ? PTR_ERR(dsi->plat_data) : 0;

otherwise it always fails.

Quoted 28 lines
drivers/gpu/drm/bridge/samsung-dsim.c +9 -2
-		goto err_disable_runtime;
+	} else {
+		ret = mipi_dsi_host_register(&dsi->dsi_host);
  	}
 
+	if (ret)
+		goto err_disable_runtime;
+
  	return 0;
 
  err_disable_runtime:
@@ -1585,7 +1594,10 @@ static int samsung_dsim_remove(struct platform_device *pdev)
 
  	pm_runtime_disable(&pdev->dev);
 
-	samsung_dsim_plat_remove(dsi);
+	if (dsi->driver_data->platform_init)
+		samsung_dsim_plat_remove(dsi);
+	else
+		mipi_dsi_host_unregister(&dsi->dsi_host);
 
  	return 0;
  }
include/drm/bridge/samsung-dsim.h +0 -0
index 59a43f9c4477..eca7eacb5910 100644

include/drm/bridge/samsung-dsim.h struct samsung_dsim_driver_data { · line 45

Quoted 7 lines
include/drm/bridge/samsung-dsim.h +1 -0
@@ -39,6 +39,7 @@ struct samsung_dsim_driver_data {
  	unsigned int wait_for_reset;
  	unsigned int num_bits_resol;
  	const unsigned int *reg_values;
+	bool platform_init;
  };
 
  struct samsung_dsim_host_ops {

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
author maintainer
#17 lore raw

Re: [PATCH 10/11] dt-bindings: display: exynos: dsim: Add NXP i.MX8MM support

In reply to Laurent Pinchart

Hi Laurent,

Quoted 18 lines · Laurent Pinchart

Hi Jagan,

Thank you for the patch.

Quoted 12 lines · Jagan Teki

Samsung MIPI DSIM bridge can also be found in i.MX8MM/i.MX8MN SoC.

Add dt-bingings for it.

v1:
* new patch

---
 Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 +
 1 file changed, 1 insertion(+)
Quoted 8 lines

Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt Required properties:

Quoted 5 lines
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +0 -0
index be377786e8cd..5133d4d39190 100644
@@ -7,6 +7,7 @@ Required properties:

May I try and ask you to convert the DT bindings to YAML as part of this series ? :-)

I thought the same and I did it for RFC
https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/

But, I'm thinking of sending a separate patch series for updating yaml as the existing binding is old that it has some properties need to fix.

Let me know if you are okay or not for it?

Quoted 8 lines

Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt Required properties: · line 10

Quoted 5 lines
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +1 -0
              "samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */
              "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */
              "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */
+             "fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini/Nano SoCs */

Should we have two different compatible strings for i.MX8MM and i.MX8MN ?

Yes, MN is fallback to MM. I will update in next series or add it as part of yaml conversion series.

Thanks,
Jagan.

author maintainer
#3 lore raw

Re: [PATCH 01/11] drm: bridge: Add Samsung DSIM bridge driver

In reply to Marek Szyprowski

Hi Marek,

Quoted 33 lines · Marek Szyprowski

Hi Jagan,

Quoted 29 lines · Jagan Teki

Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano.

In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver.

This patch is trying to differentiate platform-specific and bridge driver code and keep maintaining the exynos_drm_dsi.c code as platform-specific glue code and samsung-dsim.c as a common bridge driver code.

- Exynos specific glue code is exynos specific te_irq, host_attach, and detach code along with conventional component_ops.

- Samsung DSIM is a bridge driver which is common across all platforms and the respective platform-specific glue will initialize at the end of the probe. The platform-specific operations and other glue calls will invoke on associate code areas.

Updated MAINTAINERS file for this bridge with exynos drm maintainers along with Andrzej as he is the original author.

Tomasz Figa has been not included in MAINTAINERS as he is not available via samsung.com.

v1:
* Don't maintain component_ops in bridge driver
* Don't maintain platform glue code in bridge driver
* Add platform-specific glue code and make a common bridge

Quoted 6 lines
Quoted 1 line

Well, it took me a while to make this working on Exynos. I'm not really happy of the design, although I didn't spent much time thinking how to improve it and clarify some ambiguities. It doesn't even look that one has compiled the Exynos code after this conversion.

Well, I was successfully built the each commit on exynos and non-exynos

Quoted 9 lines

The following changes are needed to get it to the same working state as before this patch (the next patches however break it even further):

commit e358ee6239305744062713c5aa2e8d44f740b81a (HEAD)

Author: Marek Szyprowski <[email protected]>
Date:   Tue Apr 12 11:30:26 2022 +0200

drm: exynos: dsi: fixup driver after conversion

What exactly it is fixing the existing conversion, could you point that out?

Jagan.

maintainer
#4 lore raw

Re: [PATCH 01/11] drm: bridge: Add Samsung DSIM bridge driver

Hi Jagan,

Quoted 46 lines · Jagan Teki

Hi Marek,

Quoted 32 lines · Marek Szyprowski

Hi Jagan,

Quoted 29 lines · Jagan Teki

Samsung MIPI DSIM controller is common DSI IP that can be used in various SoCs like Exynos, i.MX8M Mini/Nano.

In order to access this DSI controller between various platform SoCs, the ideal way to incorporate this in the drm stack is via the drm bridge driver.

This patch is trying to differentiate platform-specific and bridge driver code and keep maintaining the exynos_drm_dsi.c code as platform-specific glue code and samsung-dsim.c as a common bridge driver code.

- Exynos specific glue code is exynos specific te_irq, host_attach, and detach code along with conventional component_ops.

- Samsung DSIM is a bridge driver which is common across all platforms and the respective platform-specific glue will initialize at the end of the probe. The platform-specific operations and other glue calls will invoke on associate code areas.

Updated MAINTAINERS file for this bridge with exynos drm maintainers along with Andrzej as he is the original author.

Tomasz Figa has been not included in MAINTAINERS as he is not available via samsung.com.

v1:
* Don't maintain component_ops in bridge driver
* Don't maintain platform glue code in bridge driver
* Add platform-specific glue code and make a common bridge

Quoted 5 lines
Quoted 1 line

Well, it took me a while to make this working on Exynos. I'm not really happy of the design, although I didn't spent much time thinking how to improve it and clarify some ambiguities. It doesn't even look that one has compiled the Exynos code after this conversion.

Well, I was successfully built the each commit on exynos and non-exynos

Quoted 3 lines

The following changes are needed to get it to the same working state as before this patch (the next patches however break it even further):

Quoted 6 lines
Quoted 5 lines

commit e358ee6239305744062713c5aa2e8d44f740b81a (HEAD)

Author: Marek Szyprowski <[email protected]>
Date:   Tue Apr 12 11:30:26 2022 +0200

drm: exynos: dsi: fixup driver after conversion

What exactly it is fixing the existing conversion, could you point that out?

See the diff. Broken build (missing gpio_consumer.h in exynos-dsi), mixed structures put into drvdata (samsung_dsim vs. exynos_dsi) hidden by the casting to void * in the samsung_dsim_host_ops.

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland