Skip to contentSkip to conversation

dt-bindings: display: bridge: ldb: Implement simple NXP i.MX8M LDB bridge

PATCH Superseded Marek Vasut 3 participants 7 messages Mar 13, 2022 – Mar 14, 2022

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: display: bridge: ldb: Implement simple NXP i.MX8M LDB bridge

The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Add DT binding which represents this serializer as a bridge.

Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Peng Fan <[email protected]>
Cc Rob Herring <[email protected]>
Cc Robby Cai <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Thomas Zimmermann <[email protected]>

To: [email protected]

---
 .../bindings/display/bridge/nxp,ldb.yaml      | 99 +++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +99 -0
new file mode 100644
index 0000000000000..a05dd05547836
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,ldb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8M DPI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>
+
+description: |
+  The i.MX8MP contains two syscon registers which are responsible
+  for configuring the on-SoC DPI-to-LVDS serializer. This describes
+  those registers as bridge within the DT.
+
+properties:
+  compatible:
+    items:
+      - const: nxp,imx8mp-ldb
+
+  clocks:
+    minItems: 1
+
+  clock-names:
+    const: "ldb"
+
+  syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: A phandle to media block controller.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for DPI input.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for LVDS Channel-A output (panel or bridge).
+
+      port@2:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for LVDS Channel-B output (panel or bridge).
+
+    required:
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - clocks
+  - syscon
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+
+    lvds-ldb {
+        #address-cells = <0>;
+        #size-cells = <0>;
+        compatible = "fsl,imx8mp-ldb";
+        clocks = <&clk IMX8MP_CLK_MEDIA_LDB>;
+        clock-names = "ldb";
+        syscon = <&media_blk_ctrl>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+
+                ldb_from_lcdif2: endpoint {
+                    remote-endpoint = <&lcdif2_to_ldb>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+
+                ldb_lvds_ch0: endpoint {
+                    remote-endpoint = <&ldb_to_lvdsx4panel>;
+                };
+            };
+
+            port@2 {
+                reg = <2>;
+
+                ldb_lvds_ch1: endpoint {
+                };
+            };
+        };
+    };
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/2 drm: bridge: ldb: Implement simple NXP i.MX8M LDB bridge

The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Implement a simple bridge driver for this serializer.

Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Thomas Zimmermann <[email protected]>

To: [email protected]

---
 drivers/gpu/drm/bridge/Kconfig   |   8 +
 drivers/gpu/drm/bridge/Makefile  |   1 +
 drivers/gpu/drm/bridge/nxp-ldb.c | 343 +++++++++++++++++++++++++++++++
 3 files changed, 352 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/nxp-ldb.c
drivers/gpu/drm/bridge/Kconfig +8 -0
index bf58cc997d964..9dfc7bac9270d 100644
@@ -171,6 +171,14 @@ config DRM_NWL_MIPI_DSI
 	  This enables the Northwest Logic MIPI DSI Host controller as
 	  for example found on NXP's i.MX8 Processors.
 
+config DRM_NXP_LDB
+	tristate "NXP i.MX8M LDB bridge"
+	depends on OF
+	select DRM_KMS_HELPER
+	select DRM_PANEL_BRIDGE
+	help
+	  Support for i.MX8M DPI-to-LVDS on-SoC encoder.
+
 config DRM_NXP_PTN3460
 	tristate "NXP PTN3460 DP/LVDS bridge"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index c90fdf1d1d251..0774e289f81b2 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
 obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
 obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
+obj-$(CONFIG_DRM_NXP_LDB) += nxp-ldb.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/nxp-ldb.c new file +343 -0

343 lines not on this page · raw message

Signature · 1 line
2.35.1
#2 lore raw
In reply to Marek Vasut
Quoted 27 lines · Marek Vasut

The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Add DT binding which represents this serializer as a bridge.

Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Peng Fan <[email protected]>
Cc Rob Herring <[email protected]>
Cc Robby Cai <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Thomas Zimmermann <[email protected]>

To: [email protected]

---
 .../bindings/display/bridge/nxp,ldb.yaml      | 99 +++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +0 -0
new file mode 100644
index 0000000000000..a05dd05547836

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 4

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +4 -0
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,ldb.yaml#

In title, description and commit msg you point this is specific to i.MX8M, so maybe reflect it in the file name as well.

Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +6 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8M DPI to LVDS bridge chip
+
+maintainers:
+  - Marek Vasut <[email protected]>

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 20

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +10 -0
+
+description: |
+  The i.MX8MP contains two syscon registers which are responsible
+  for configuring the on-SoC DPI-to-LVDS serializer. This describes
+  those registers as bridge within the DT.
+
+properties:
+  compatible:
+    items:
+      - const: nxp,imx8mp-ldb

No items.

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 23

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +3 -0
+
+  clocks:
+    minItems: 1

maxItems

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 26

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +3 -0
+
+  clock-names:
+    const: "ldb"

No quotes

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 28

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +2 -0
+
+  syscon:

You need a specific name with vendor prefix.

Quoted 25 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +25 -0
+    $ref: /schemas/types.yaml#/definitions/phandle> +    description: A phandle to media block controller.
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for DPI input.
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for LVDS Channel-A output (panel or bridge).
+
+      port@2:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: Video port for LVDS Channel-B output (panel or bridge).
+
+    required:
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - clocks

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 64

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +10 -0
+  - syscon
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+
+    lvds-ldb {

Generic node name, so "bridge" or "display-bridge"

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 65

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +2 -0
+        #address-cells = <0>;
+        #size-cells = <0>;

Why do you need address and size cells? This will complain if you test your bindings with proper compatible.

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 67

Quoted 1 line
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +1 -0
+        compatible = "fsl,imx8mp-ldb";

This does not look the same as documented here.

Best regards,
Krzysztof

#3 lore raw

On 3/13/22 16:47, Krzysztof Kozlowski wrote:

Hi,

[...]

Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +0 -0
new file mode 100644
index 0000000000000..a05dd05547836
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 4

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +4 -0
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,ldb.yaml#

In title, description and commit msg you point this is specific to i.MX8M, so maybe reflect it in the file name as well.

That's how it is so far, however NXP does recycle their IPs quite a bit so I don't want to encode the SoC type into the bindings file name. I do expect them to re-use this bridge somewhere else sooner rather than later.

[...]

The rest is fixed.

[...]

Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 64

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +5 -0
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+
+    lvds-ldb {

Generic node name, so "bridge" or "display-bridge"

Quoted 5 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 11

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +2 -0
+        #address-cells = <0>;
+        #size-cells = <0>;

Why do you need address and size cells? This will complain if you test your bindings with proper compatible.

Because the subnodes of this bridge have no dimension, so address/size cells = 0.

I don't understand the second part about "proper compatible", can you elaborate ?

Quoted 3 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 67

Quoted 1 line
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +1 -0
+        compatible = "fsl,imx8mp-ldb";

This does not look the same as documented here.

This is the right compatible string, fixed.

#4 lore raw
Quoted 41 lines · Marek Vasut

On 3/13/22 16:47, Krzysztof Kozlowski wrote:

Hi,

[...]

Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +0 -0
new file mode 100644
index 0000000000000..a05dd05547836
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 4

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +4 -0
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,ldb.yaml#

In title, description and commit msg you point this is specific to i.MX8M, so maybe reflect it in the file name as well.

That's how it is so far, however NXP does recycle their IPs quite a bit so I don't want to encode the SoC type into the bindings file name. I do expect them to re-use this bridge somewhere else sooner rather than later.

[...]

The rest is fixed.

[...]

Quoted 11 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 64

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +5 -0
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+
+    lvds-ldb {

Generic node name, so "bridge" or "display-bridge"

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +2 -0
+        #address-cells = <0>;
+        #size-cells = <0>;
Quoted 8 lines
Quoted 2 lines

Why do you need address and size cells? This will complain if you test your bindings with proper compatible.

Because the subnodes of this bridge have no dimension, so address/size cells = 0.

I don't understand the second part about "proper compatible", can you elaborate ?

You have wrong compatible in example and in bindings, so you do not see the error of address/size cells.

They are also not required in your example, since you do not have unit address. Otherwise your lvds-ldb node would be wrong (see its address/size cells).

If you supply address-cells you should see a W=1 warning:
#address-cells/#size-cells without "ranges" or child "reg" property

Best regards,
Krzysztof

#5 lore raw
Quoted 54 lines · Krzysztof Kozlowski
Quoted 41 lines · Marek Vasut

On 3/13/22 16:47, Krzysztof Kozlowski wrote:

Hi,

[...]

Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +0 -0
new file mode 100644
index 0000000000000..a05dd05547836
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 4

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +4 -0
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/nxp,ldb.yaml#

In title, description and commit msg you point this is specific to i.MX8M, so maybe reflect it in the file name as well.

That's how it is so far, however NXP does recycle their IPs quite a bit so I don't want to encode the SoC type into the bindings file name. I do expect them to re-use this bridge somewhere else sooner rather than later.

[...]

The rest is fixed.

[...]

Quoted 11 lines

Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml line 64

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +5 -0
+examples:
+  - |
+    #include <dt-bindings/clock/imx8mp-clock.h>
+
+    lvds-ldb {

Generic node name, so "bridge" or "display-bridge"

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml new file +2 -0
+        #address-cells = <0>;
+        #size-cells = <0>;
Quoted 8 lines
Quoted 2 lines

Why do you need address and size cells? This will complain if you test your bindings with proper compatible.

Because the subnodes of this bridge have no dimension, so address/size cells = 0.

I don't understand the second part about "proper compatible", can you elaborate ?

You have wrong compatible in example and in bindings, so you do not see the error of address/size cells.

Quoted 6 lines

They are also not required in your example, since you do not have unit address. Otherwise your lvds-ldb node would be wrong (see its address/size cells).

If you supply address-cells you should see a W=1 warning:
#address-cells/#size-cells without "ranges" or child "reg" property

Ah, right, both are fixed now. I'll wait a bit for more feedback esp. on the bridge driver and send a V2.

maintainer
#6 lore raw
In reply to Marek Vasut
Quoted 15 lines · Marek Vasut

The i.MX8MP contains two syscon registers which are responsible for configuring the on-SoC DPI-to-LVDS serializer. Add DT binding which represents this serializer as a bridge.

Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Peng Fan <[email protected]>
Cc Rob Herring <[email protected]>
Cc Robby Cai <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Quoted 6 lines

To: [email protected]

---
 .../bindings/display/bridge/nxp,ldb.yaml      | 99 +++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/nxp,ldb.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/display/bridge/nxp,ldb.example.dt.yaml:0:0: /example-0/lvds-ldb: failed to match any schema with compatible: ['fsl,imx8mp-ldb']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1604767

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.