Skip to contentSkip to conversation

drm: Add support for Cadence MHDP DPI/DP bridge and J721E wrapper.

PATCH Superseded Yuti Amonkar 3 participants 6 messages Dec 23, 2019 – Jan 4, 2020

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover drm: Add support for Cadence MHDP DPI/DP bridge and J721E wrapper.

This patch series adds new DRM driver for Cadence Display Port. The Cadence Display Port is also referred as MHDP (Mobile High Definition Link, High-Definition Multimedia Interface Display Port) Cadence Display Port complies with VESA DisplayPort (DP) and embedded Display Port (eDP) standards This driver implements Single Stream Transport (SST) support. Adds Texas Instruments SoC J721e specific wrapper and adds the device tree bindings in YAML format.

The patch series has three patches which applies the changes in the below sequence
1. 001-dt-bindings-drm-bridge-Document-Cadence-MHDP-bridge-bindings-in-yaml-format Documents the bindings in yaml format.
2. 002-drm-bridge-Add-support-for-Cadence-MHDP-bridge
This patch adds new DRM driver for Cadence MHDP Display Port. The patch implements supports for single stream transport mode.
3. 003-drm-mhdp-add-j721e-wrapper
Add Texas Instruments (TI) j721e wrapper for mhdp. The wrapper configures mhdp clocks and muxes as required by SoC.

Version History:

v2:
- Use enum in compatible property of YAML file.
- Add reg-names property to YAML file
- Add minItems and maxItems to reg property in YAML.
- Remove cdns_mhdp_link_probe function to remove duplication of reading dpcd capabilities.

This patch series is dependent on PHY DisplayPort configuration patch [1]

[1]

https://patchwork.kernel.org/patch/11307829/

Yuti Amonkar (3):
dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings in yaml
format
drm: bridge: Add support for Cadence MHDP DPI/DP bridge drm/mhdp: add j721e wrapper

 .../bindings/display/bridge/cdns,mhdp.yaml         |  109 +
 drivers/gpu/drm/bridge/Kconfig                     |   21 +
 drivers/gpu/drm/bridge/Makefile                    |    6 +
 drivers/gpu/drm/bridge/cdns-mhdp-j721e.c           |   79 +
 drivers/gpu/drm/bridge/cdns-mhdp-j721e.h           |   55 +
 drivers/gpu/drm/bridge/cdns-mhdp.c                 | 2214 ++++++++++++++++++++
 drivers/gpu/drm/bridge/cdns-mhdp.h                 |  381 ++++
 7 files changed, 2865 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp-j721e.c
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp-j721e.h
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp.c
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/3 dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings in yaml format

Document the bindings used for the Cadence MHDP DPI/DP bridge in yaml format.

---
 .../bindings/display/bridge/cdns,mhdp.yaml         | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +109 -0
new file mode 100644
index 0000000..aed6224
@@ -0,0 +1,109 @@
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/display/bridge/cdns,mhdp.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence MHDP bridge
+
+maintainers:
+  - Swapnil Jakhade <[email protected]>
+  - Yuti Amonkar <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,mhdp8546
+      - ti,j721e-mhdp8546
+
+  clocks:
+    maxItems: 1
+    description:
+      DP bridge clock, it's used by the IP to know how to translate a number of
+      clock cycles into a time (which is used to comply with DP standard timings
+      and delays).
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of mhdptx apb registers upto PHY mapped area(AUX_CONFIG_P).
+          The AUX and PMA registers are mapped to associated phy driver.
+      - description:
+          Register block for DSS_EDP0_INTG_CFG_VP registers in case of TI J7 SoCs.
+
+  reg-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      - const: mhdptx
+      - const: j721e-intg
+
+  phys:
+    description: see the Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
+
+  phy-names:
+    const: dpphy
+
+  ports:
+    type: object
+    description:
+      Ports as described in Documentation/devicetree/bindings/graph.txt
+    properties:
+       '#address-cells':
+         const: 1
+       '#size-cells':
+         const: 0
+       port@0:
+         description:
+           input port representing the DP bridge input
+
+       port@1:
+         description:
+           output port representing the DP bridge output
+    required:
+      - port@0
+      - port@1
+      - '#address-cells'
+      - '#size-cells'
+
+required:
+  - compatible
+  - clocks
+  - reg
+  - phys
+  - phy-names
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    mhdp: dp-bridge@f0fb000000 {
+        compatible = "cdns,mhdp8546";
+        reg = <0xf0 0xfb000000 0x0 0x1000000>,
+              <0xf0 0xfc000000 0x0 0x2000000>;
+        clocks = <&mhdp_clock>;
+        phys = <&dp_phy>;
+        phy-names = "dpphy";
+
+        ports {
+              #address-cells = <1>;
+              #size-cells = <0>;
+
+              port@0 {
+                     reg = <0>;
+                     dp_bridge_input: endpoint {
+                                    remote-endpoint = <&xxx_dpi_output>;
+                     };
+              };
+
+              port@1 {
+                     reg = <1>;
+                     dp_bridge_output: endpoint {
+                                     remote-endpoint = <&xxx_dp_connector_input>;
+                     };
+              };
+      };
+    };
+...
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings in yaml format

Quoted 45 lines · Yuti Amonkar

Document the bindings used for the Cadence MHDP DPI/DP bridge in yaml format.

---
 .../bindings/display/bridge/cdns,mhdp.yaml         | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +30 -0
new file mode 100644
index 0000000..aed6224
@@ -0,0 +1,109 @@
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/display/bridge/cdns,mhdp.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence MHDP bridge
+
+maintainers:
+  - Swapnil Jakhade <[email protected]>
+  - Yuti Amonkar <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,mhdp8546
+      - ti,j721e-mhdp8546
+
+  clocks:
+    maxItems: 1
+    description:
+      DP bridge clock, it's used by the IP to know how to translate a number of
+      clock cycles into a time (which is used to comply with DP standard timings
+      and delays).
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of mhdptx apb registers upto PHY mapped area(AUX_CONFIG_P).

Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +10 -0
+          The AUX and PMA registers are mapped to associated phy driver.
+      - description:
+          Register block for DSS_EDP0_INTG_CFG_VP registers in case of TI J7 SoCs.
+
+  reg-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      - const: mhdptx
+      - const: j721e-intg

You should have an if / then clause to validate that the length is the proper one based on the value of the compatible.

Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml line 43

Quoted 2 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +2 -0
+  phys:
+    description: see the Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml

phys is a generic property, so we shouldn't tie it to one particular phy. Especially since there's nothing in it that really explain what this property is supposed to be.

Quoted 31 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +31 -0
+  phy-names:
+    const: dpphy
+
+  ports:
+    type: object
+    description:
+      Ports as described in Documentation/devicetree/bindings/graph.txt
+    properties:
+       '#address-cells':
+         const: 1
+       '#size-cells':
+         const: 0
+       port@0:
+         description:
+           input port representing the DP bridge input
+
+       port@1:
+         description:
+           output port representing the DP bridge output
+    required:
+      - port@0
+      - port@1
+      - '#address-cells'
+      - '#size-cells'
+
+required:
+  - compatible
+  - clocks
+  - reg
+  - phys
+  - phy-names

Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml line 85

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +10 -0
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    mhdp: dp-bridge@f0fb000000 {
+        compatible = "cdns,mhdp8546";
+        reg = <0xf0 0xfb000000 0x0 0x1000000>,
+              <0xf0 0xfc000000 0x0 0x2000000>;

There's two items here, yet you're not using the TI compatible?

Maxime

maintainer
#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings in yaml format

In reply to Yuti Amonkar
Quoted 62 lines · Yuti Amonkar

Document the bindings used for the Cadence MHDP DPI/DP bridge in yaml format.

---
 .../bindings/display/bridge/cdns,mhdp.yaml         | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +47 -0
new file mode 100644
index 0000000..aed6224
@@ -0,0 +1,109 @@
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/display/bridge/cdns,mhdp.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence MHDP bridge
+
+maintainers:
+  - Swapnil Jakhade <[email protected]>
+  - Yuti Amonkar <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - cdns,mhdp8546
+      - ti,j721e-mhdp8546
+
+  clocks:
+    maxItems: 1
+    description:
+      DP bridge clock, it's used by the IP to know how to translate a number of
+      clock cycles into a time (which is used to comply with DP standard timings
+      and delays).
+
+  reg:
+    minItems: 1
+    maxItems: 2
+    items:
+      - description:
+          Register block of mhdptx apb registers upto PHY mapped area(AUX_CONFIG_P).
+          The AUX and PMA registers are mapped to associated phy driver.
+      - description:
+          Register block for DSS_EDP0_INTG_CFG_VP registers in case of TI J7 SoCs.
+
+  reg-names:
+    minItems: 1
+    maxItems: 2
+    items:
+      - const: mhdptx
+      - const: j721e-intg
+
+  phys:
+    description: see the Documentation/devicetree/bindings/phy/phy-cadence-torrent.yaml
+
+  phy-names:
+    const: dpphy
+

Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml line 57

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +10 -0
+  ports:
+    type: object
+    description:
+      Ports as described in Documentation/devicetree/bindings/graph.txt
+    properties:
+       '#address-cells':
+         const: 1
+       '#size-cells':
+         const: 0
+       port@0:

type: object

Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml line 61

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +4 -0
+         description:
+           input port representing the DP bridge input
+
+       port@1:

type: object

Quoted 51 lines
Documentation/devicetree/bindings/display/bridge/cdns,mhdp.yaml new file +48 -0
+         description:
+           output port representing the DP bridge output
+    required:
+      - port@0
+      - port@1
+      - '#address-cells'
+      - '#size-cells'
+
+required:
+  - compatible
+  - clocks
+  - reg
+  - phys
+  - phy-names
+  - ports
+
+additionalProperties: false
+
+examples:
+  - |
+    mhdp: dp-bridge@f0fb000000 {
+        compatible = "cdns,mhdp8546";
+        reg = <0xf0 0xfb000000 0x0 0x1000000>,
+              <0xf0 0xfc000000 0x0 0x2000000>;
+        clocks = <&mhdp_clock>;
+        phys = <&dp_phy>;
+        phy-names = "dpphy";
+
+        ports {
+              #address-cells = <1>;
+              #size-cells = <0>;
+
+              port@0 {
+                     reg = <0>;
+                     dp_bridge_input: endpoint {
+                                    remote-endpoint = <&xxx_dpi_output>;
+                     };
+              };
+
+              port@1 {
+                     reg = <1>;
+                     dp_bridge_output: endpoint {
+                                     remote-endpoint = <&xxx_dp_connector_input>;
+                     };
+              };
+      };
+    };
+...
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 2/3 drm: bridge: Add support for Cadence MHDP DPI/DP bridge

In reply to Yuti Amonkar

This patch adds new DRM driver for Cadence MHDP DPTX IP used on J721e SoC. MHDP DPTX IP is the component that complies with VESA DisplayPort (DP) and embedded Display Port (eDP) standards.It integrates uCPU running the embedded Firmware(FW) interfaced over APB interface. Basically, it takes a DPI stream as input and output it encoded in DP format. Currently, it supports only SST mode.

---
 drivers/gpu/drm/bridge/Kconfig     |   11 +
 drivers/gpu/drm/bridge/Makefile    |    3 +
 drivers/gpu/drm/bridge/cdns-mhdp.c | 2202 ++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/bridge/cdns-mhdp.h |  380 +++++++
 4 files changed, 2596 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp.c
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp.h
drivers/gpu/drm/bridge/Kconfig +11 -0
index 3436297..616c05f 100644
@@ -37,6 +37,17 @@ config DRM_CDNS_DSI
 	  Support Cadence DPI to DSI bridge. This is an internal
 	  bridge and is meant to be directly embedded in a SoC.
 
+config DRM_CDNS_MHDP
+	tristate "Cadence DPI/DP bridge"
+	select DRM_KMS_HELPER
+	select DRM_PANEL_BRIDGE
+	depends on OF
+	help
+	  Support Cadence DPI to DP bridge. This is an internal
+	  bridge and is meant to be directly embedded in a SoC.
+	  It takes a DPI stream as input and output it encoded
+	  in DP format.
+
 config DRM_DUMB_VGA_DAC
 	tristate "Dumb VGA DAC Bridge support"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +3 -0
index 4934fcf..c1a0da7 100644
@@ -16,4 +16,7 @@ obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/
 obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
 obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
 obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
+obj-$(CONFIG_DRM_CDNS_MHDP) += mhdp8546.o
 obj-y += synopsys/
+
+mhdp8546-objs := cdns-mhdp.o
drivers/gpu/drm/bridge/cdns-mhdp.c new file +2202 -0

2,202 lines not on this page · raw message

drivers/gpu/drm/bridge/cdns-mhdp.h new file +380 -0

380 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 3/3 drm/mhdp: add j721e wrapper

In reply to Yuti Amonkar

Add j721e wrapper for mhdp, which sets up the clock and data muxes.

---
 drivers/gpu/drm/bridge/Kconfig           | 10 ++++
 drivers/gpu/drm/bridge/Makefile          |  3 ++
 drivers/gpu/drm/bridge/cdns-mhdp-j721e.c | 79 ++++++++++++++++++++++++++++++++
 drivers/gpu/drm/bridge/cdns-mhdp-j721e.h | 55 ++++++++++++++++++++++
 drivers/gpu/drm/bridge/cdns-mhdp.c       | 14 +++++-
 drivers/gpu/drm/bridge/cdns-mhdp.h       |  1 +
 6 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp-j721e.c
 create mode 100644 drivers/gpu/drm/bridge/cdns-mhdp-j721e.h
drivers/gpu/drm/bridge/Kconfig +10 -0
index 616c05f..4b6799b 100644
@@ -48,6 +48,16 @@ config DRM_CDNS_MHDP
 	  It takes a DPI stream as input and output it encoded
 	  in DP format.
 
+if DRM_CDNS_MHDP
+
+config DRM_CDNS_MHDP_J721E
+	bool "J721E Cadence DPI/DP wrapper support"
+	default y
+	help
+	  Support J721E Cadence DPI/DP wrapper.It sets up
+	  the clock and data muxes.
+endif
+
 config DRM_DUMB_VGA_DAC
 	tristate "Dumb VGA DAC Bridge support"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +3 -0
index c1a0da7..d358184 100644
@@ -20,3 +20,6 @@ obj-$(CONFIG_DRM_CDNS_MHDP) += mhdp8546.o
 obj-y += synopsys/
 
 mhdp8546-objs := cdns-mhdp.o
+ifeq ($(CONFIG_DRM_CDNS_MHDP_J721E),y)
+	mhdp8546-objs += cdns-mhdp-j721e.o
+endif
drivers/gpu/drm/bridge/cdns-mhdp-j721e.c new file +79 -0

79 lines not on this page · raw message

drivers/gpu/drm/bridge/cdns-mhdp-j721e.h new file +55 -0

55 lines not on this page · raw message

drivers/gpu/drm/bridge/cdns-mhdp.c +13 -1
index 543ce80..19e7684 100644
@@ -35,9 +35,21 @@
 #include <asm/unaligned.h>
 
 #include "cdns-mhdp.h"
-
+#include "cdns-mhdp-j721e.h"
+
+#ifdef CONFIG_DRM_CDNS_MHDP_J721E
+static const struct mhdp_platform_ops mhdp_ti_j721e_ops = {
+	.init = cdns_mhdp_j721e_init,
+	.exit = cdns_mhdp_j721e_fini,
+	.enable = cdns_mhdp_j721e_enable,
+	.disable = cdns_mhdp_j721e_disable,
+};
+#endif
 static const struct of_device_id mhdp_ids[] = {
 	{ .compatible = "cdns,mhdp8546", },
+#ifdef CONFIG_DRM_CDNS_MHDP_J721E
+	{ .compatible = "ti,j721e-mhdp8546", .data = &mhdp_ti_j721e_ops },
+#endif
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mhdp_ids);
drivers/gpu/drm/bridge/cdns-mhdp.h +1 -0
index 9acb89d..c9013be 100644
@@ -335,6 +335,7 @@ struct mhdp_platform_ops {
 
 struct cdns_mhdp_device {
 	void __iomem *regs;
+	void __iomem *j721e_regs;
 
 	struct device *dev;
 	struct clk *clk;
Signature · 1 line
2.7.4