2020-04-21 16:17:44

by Adrian Ratiu

[permalink] [raw]
Subject: [PATCH v7 0/8] Genericize DW MIPI DSI bridge and add i.MX 6 driver

Hello everyone,

v7 addresses the points raised by Enric and Laurent in v6.
Specific details in patch changelogs.

Two new independent patches were derived from this series
and posted for review (now they are dependencies for v7):

Message-ID: [email protected]
Web: https://lore.kernel.org/linux-devicetree/[email protected]/T/#u

and

Message-ID: [email protected]
Web: https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#u

Tested on latest linux-next 20200421 with the above two patches
applied.

Thank you,
Adrian

Adrian Ratiu (8):
drm: bridge: dw_mipi_dsi: add initial regmap infrastructure
drm: bridge: dw_mipi_dsi: abstract register access using reg_fields
drm: bridge: synopsis: add dsi v1.01 support
drm: imx: Add i.MX 6 MIPI DSI host platform driver
dt-bindings: display: add i.MX6 MIPI DSI host controller doc
drm: stm: dw-mipi-dsi: let the bridge handle the HW version check
drm: bridge: dw-mipi-dsi: split low power cfg register into fields
drm: bridge: dw-mipi-dsi: fix bad register field offsets

.../display/imx/fsl,mipi-dsi-imx6.yaml | 135 ++++
drivers/gpu/drm/bridge/synopsys/Kconfig | 1 +
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 692 +++++++++++++-----
drivers/gpu/drm/imx/Kconfig | 8 +
drivers/gpu/drm/imx/Makefile | 1 +
drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c | 391 ++++++++++
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 12 +-
7 files changed, 1035 insertions(+), 205 deletions(-)
create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml
create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c

--
2.26.0


2020-04-21 16:19:42

by Adrian Ratiu

[permalink] [raw]
Subject: [PATCH v7 6/8] drm: stm: dw-mipi-dsi: let the bridge handle the HW version check

The stm mipi-dsi platform driver added a version test in
commit fa6251a747b7 ("drm/stm: dsi: check hardware version")
so that HW revisions other than v1.3x get rejected. The rockchip
driver had no such check and just assumed register layouts are
v1.3x compatible.

Having such tests was a good idea because only v130/v131 layouts
were supported at the time, however since adding multiple layout
support in the bridge, the version is automatically checked for
all drivers, compatible layouts get picked and unsupported HW is
automatically rejected by the bridge, so there's no use keeping
the test in the stm driver.

The main reason prompting this change is that the stm driver
test immediately disabled the peripheral clock after reading
the version, making the bridge read version 0x0 immediately
after in its own probe(), so we move the clock disabling after
the bridge does the version test.

Tested on STM32F769 and STM32MP1.

Cc: [email protected]
Reported-by: Adrian Pop <[email protected]>
Tested-by: Adrian Pop <[email protected]>
Tested-by: Arnaud Ferraris <[email protected]>
Signed-off-by: Adrian Ratiu <[email protected]>
---
New in v6.
---
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 2e1f2664495d0..7218e405d7e2b 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -402,15 +402,6 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
goto err_dsi_probe;
}

- dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
- clk_disable_unprepare(pclk);
-
- if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) {
- ret = -ENODEV;
- DRM_ERROR("bad dsi hardware version\n");
- goto err_dsi_probe;
- }
-
dw_mipi_dsi_stm_plat_data.base = dsi->base;
dw_mipi_dsi_stm_plat_data.priv_data = dsi;

@@ -423,6 +414,9 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
goto err_dsi_probe;
}

+ dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
+ clk_disable_unprepare(pclk);
+
return 0;

err_dsi_probe:
--
2.26.0

2020-04-23 07:34:32

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH v7 0/8] Genericize DW MIPI DSI bridge and add i.MX 6 driver

On 21/04/2020 18:16, Adrian Ratiu wrote:
> Hello everyone,
>
> v7 addresses the points raised by Enric and Laurent in v6.
> Specific details in patch changelogs.
>
> Two new independent patches were derived from this series
> and posted for review (now they are dependencies for v7):
>
> Message-ID: [email protected]
> Web: https://lore.kernel.org/linux-devicetree/[email protected]/T/#u
>
> and
>
> Message-ID: [email protected]
> Web: https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#u

Side note, you can build the following URL from message-id:
http://lore.kernel.org/r/[email protected]

Neil

>
> Tested on latest linux-next 20200421 with the above two patches
> applied.
>
> Thank you,
> Adrian
>
> Adrian Ratiu (8):
> drm: bridge: dw_mipi_dsi: add initial regmap infrastructure
> drm: bridge: dw_mipi_dsi: abstract register access using reg_fields
> drm: bridge: synopsis: add dsi v1.01 support
> drm: imx: Add i.MX 6 MIPI DSI host platform driver
> dt-bindings: display: add i.MX6 MIPI DSI host controller doc
> drm: stm: dw-mipi-dsi: let the bridge handle the HW version check
> drm: bridge: dw-mipi-dsi: split low power cfg register into fields
> drm: bridge: dw-mipi-dsi: fix bad register field offsets
>
> .../display/imx/fsl,mipi-dsi-imx6.yaml | 135 ++++
> drivers/gpu/drm/bridge/synopsys/Kconfig | 1 +
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 692 +++++++++++++-----
> drivers/gpu/drm/imx/Kconfig | 8 +
> drivers/gpu/drm/imx/Makefile | 1 +
> drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c | 391 ++++++++++
> drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 12 +-
> 7 files changed, 1035 insertions(+), 205 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mipi-dsi-imx6.yaml
> create mode 100644 drivers/gpu/drm/imx/dw_mipi_dsi-imx6.c
>