Skip to contentSkip to conversation

Add support for DisplayPort driver on SnapDragon.

PATCH Superseded Tanmay Shah 5 participants 16 messages Apr 1, 2020 – Jun 9, 2020 1 message not in the archive

Subsystems (8)

v5 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add support for DisplayPort driver on SnapDragon.

These patches add support for Display-Port driver on SnapDragon 845 hardware. It adds DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +             | DISPLAY |+---+      |      |
     |             +-+-----+-+    |      |      |
     |               |     |      |      |      |
     |               |     |      |      |      |
     |               |     |      |      |      |
     v               v     v      v      v      v
 +------+          +---+ +----+ +----+ +---+ +-----+
 |  DP  |          |DP | | DP | | DP | |DP | | DP  |
 |PARSER|          |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+          +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+

These patches have dependency on clock driver changes mentioned below:
https://patchwork.kernel.org/patch/10632753/
https://patchwork.kernel.org/patch/10632757/

Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver

Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU

 .../devicetree/bindings/display/msm/dp-sc7180.yaml |  325 ++++
 .../devicetree/bindings/display/msm/dpu.txt        |   16 +-
 drivers/gpu/drm/i915/display/intel_display.c       |    2 +-
 drivers/gpu/drm/msm/Kconfig                        |   21 +
 drivers/gpu/drm/msm/Makefile                       |   16 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   28 +-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |    8 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |   65 +-
 drivers/gpu/drm/msm/dp/dp_aux.c                    |  531 ++++++
 drivers/gpu/drm/msm/dp/dp_aux.h                    |   35 +
 drivers/gpu/drm/msm/dp/dp_catalog.c                |  988 +++++++++++
 drivers/gpu/drm/msm/dp/dp_catalog.h                |   86 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   | 1707 ++++++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   35 +
 drivers/gpu/drm/msm/dp/dp_display.c                |  943 +++++++++++
 drivers/gpu/drm/msm/dp/dp_display.h                |   31 +
 drivers/gpu/drm/msm/dp/dp_drm.c                    |  170 ++
 drivers/gpu/drm/msm/dp/dp_drm.h                    |   19 +
 drivers/gpu/drm/msm/dp/dp_hpd.c                    |   69 +
 drivers/gpu/drm/msm/dp/dp_hpd.h                    |   79 +
 drivers/gpu/drm/msm/dp/dp_link.c                   | 1216 ++++++++++++++
 drivers/gpu/drm/msm/dp/dp_link.h                   |  132 ++
 drivers/gpu/drm/msm/dp/dp_panel.c                  |  490 ++++++
 drivers/gpu/drm/msm/dp/dp_panel.h                  |   95 ++
 drivers/gpu/drm/msm/dp/dp_parser.c                 |  473 ++++++
 drivers/gpu/drm/msm/dp/dp_parser.h                 |  220 +++
 drivers/gpu/drm/msm/dp/dp_power.c                  |  545 +++++++
 drivers/gpu/drm/msm/dp/dp_power.h                  |  115 ++
 drivers/gpu/drm/msm/dp/dp_reg.h                    |  489 ++++++
 drivers/gpu/drm/msm/dp/pll/dp_pll.c                |  127 ++
 drivers/gpu/drm/msm/dp/pll/dp_pll.h                |   57 +
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c           |  401 +++++
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h           |   86 +
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c      |  524 ++++++
 drivers/gpu/drm/msm/msm_drv.c                      |    2 +
 drivers/gpu/drm/msm/msm_drv.h                      |   53 +-
 include/drm/drm_dp_helper.h                        |    2 +
 37 files changed, 10178 insertions(+), 23 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v5 1/5 dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort and
display-port PLL driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Changes in V5:
Moved dp.txt to yaml file.

---
 .../devicetree/bindings/display/msm/dp-sc7180.yaml | 325 +++++++++++++++++++++
 .../devicetree/bindings/display/msm/dpu.txt        |  16 +-
 2 files changed, 337 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +325 -0
new file mode 100644
index 0000000..761a01d
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, power supplies.
+
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's registers.
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The required region
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the device.
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks property.
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg9-settings:
+       description: |
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the chipset.
+
+     data-lanes:
+       description: Maximum number of lanes that can be used for Display port.
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface output.
+           Documentation/devicetree/bindings/graph.txt and
+           Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+  "dp_pll":
+     type: object
+     description: Node contains properties of Display port pll and phy driver.
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and pll registers.
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The required region
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by the device.
+
+       clock-names:
+         description: |
+           Device clock names in the same order as mentioned in clocks property.
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
+            "crypto_clk", "pixel_clk_rcg";
+
+        pll-node = <&dp_pll>;
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];
+
+        max-pclk-frequency-khz = <67500>;
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +12 -4
index 551ae26..7e99e45 100644
@@ -63,8 +63,9 @@ Required properties:
 	Documentation/devicetree/bindings/graph.txt
 	Documentation/devicetree/bindings/media/video-interfaces.txt
 
-	Port 0 -> DPU_INTF1 (DSI1)
-	Port 1 -> DPU_INTF2 (DSI2)
+	Port 0 -> DPU_INTF0 (DP)
+	Port 1 -> DPU_INTF1 (DSI1)
+	Port 2 -> DPU_INTF2 (DSI2)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
@@ -125,13 +126,20 @@ Example:
 
 				port@0 {
 					reg = <0>;
-					dpu_intf1_out: endpoint {
-						remote-endpoint = <&dsi0_in>;
+					dpu_intf0_out: endpoint {
+						remote-endpoint = <&dp_in>;
 					};
 				};
 
 				port@1 {
 					reg = <1>;
+					dpu_intf1_out: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
 					dpu_intf2_out: endpoint {
 						remote-endpoint = <&dsi1_in>;
 					};
Signature · 5 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Re: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Hi Tanmay

Reviewing the yaml bindings triggered a few comments. See below.

Sam

Quoted 12 lines · Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort and
display-port PLL driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Quoted 5 lines

Changes in V5:
Moved dp.txt to yaml file.

As you handle the patch, thus the patch passed throgh you, you are supposed to sign-off the patch.

The changes to dpu.txt is not explained in the changelog.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 1

Quoted 13 lines
---
 .../devicetree/bindings/display/msm/dp-sc7180.yaml | 325 +++++++++++++++++++++
 .../devicetree/bindings/display/msm/dpu.txt        |  16 +-
 2 files changed, 337 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
new file mode 100644
index 0000000..761a01d
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only

For new bindings please use: (GPL-2.0-only OR BSD-2-Clause)

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 18

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":

The quotes seems not necessary.
This describes the name of the node.
The typical way to identify a node is using a compatible.

So I think that the right solution here is to drop "msm_dp".

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 22

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, power supplies.
+

And start here.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 32

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's registers.

This description is generic and can be omitted.
But it would be good with a descrition of the individual registers like this:

reg:
items:
- description: AHB bla bla
- description: aux bla bla

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The required region
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 55

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the device.

items:
- description: aux clock bla bla
- description: ref clock bla bla

Quoted 9 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks property.
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 74

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.

Add type (phandle)

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 87

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.

Add type, goes for all *-settings

Quoted 63 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +63 -0
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg9-settings:
+       description: |
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 160

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the chipset.
+
+     data-lanes:
+       description: Maximum number of lanes that can be used for Display port.
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.

Shall be named -gpios. Goes for all -gpio properties.
maxItems: 1 is good. Keep it.

Quoted 9 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 179

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface output.
+           Documentation/devicetree/bindings/graph.txt and
+           Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+  "dp_pll":

quotes should not be required here.

I looks like yo try to describe two differents nodes in the same file. Consider to split in two files.

Some of the comments from above applies here too.

Quoted 29 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +29 -0
+     type: object
+     description: Node contains properties of Display port pll and phy driver.
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and pll registers.
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The required region
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by the device.
+
+       clock-names:

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 218

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         description: |
+           Device clock names in the same order as mentioned in clocks property.
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:

4 spaces as indent - good.
You have include files - good.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 226

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;

indent only four spaces

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 228

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,

Only one space after '=' - rememebr to adjust indent in following lines.

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 242

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";

Indent so names in following lines starts where names in previous lines starts.
Like this:

        reg-names = "dp_ahb", "dp_aux", "dp_link",
                    "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
                    "qfprom_physical", "dp_pll",
                    "usb3_dp_com", "hdcp_physical";

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 248

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,

Indent so '<' are aligned under each other. Like done above for reg =

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 261

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
+            "crypto_clk", "pixel_clk_rcg";

Fix indent

Quoted 109 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +64 -0
+
+        pll-node = <&dp_pll>;
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];
+
+        max-pclk-frequency-khz = <67500>;
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +12 -4
index 551ae26..7e99e45 100644
@@ -63,8 +63,9 @@ Required properties:
 	Documentation/devicetree/bindings/graph.txt
 	Documentation/devicetree/bindings/media/video-interfaces.txt
 
-	Port 0 -> DPU_INTF1 (DSI1)
-	Port 1 -> DPU_INTF2 (DSI2)
+	Port 0 -> DPU_INTF0 (DP)
+	Port 1 -> DPU_INTF1 (DSI1)
+	Port 2 -> DPU_INTF2 (DSI2)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
@@ -125,13 +126,20 @@ Example:
 
 				port@0 {
 					reg = <0>;
-					dpu_intf1_out: endpoint {
-						remote-endpoint = <&dsi0_in>;
+					dpu_intf0_out: endpoint {
+						remote-endpoint = <&dp_in>;
 					};
 				};
 
 				port@1 {
 					reg = <1>;
+					dpu_intf1_out: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
 					dpu_intf2_out: endpoint {
 						remote-endpoint = <&dsi1_in>;
 					};
Signature · 5 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

RE: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Hi Sam,

Thanks for reviews.

The changes were posted by Vara Reddy. Due to some configuration errors, changes were posted with my E-mail ID. Vara will be addressing comments, and we will take care of this error with next patchset.

Thanks,
Tanmay

-----Original Message-----
From: Sam Ravnborg <[email protected]>
Sent: Tuesday, March 31, 2020 10:50 PM
To: Tanmay Shah <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Vara Reddy <[email protected]>; [email protected]; [email protected]; Chandan Uddaraju <[email protected]>
Subject: Re: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Hi Tanmay

Reviewing the yaml bindings triggered a few comments. See below.

Sam

Quoted 11 lines · Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort and display-port PLL driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Quoted 5 lines

Changes in V5:
Moved dp.txt to yaml file.

As you handle the patch, thus the patch passed throgh you, you are supposed to sign-off the patch.

The changes to dpu.txt is not explained in the changelog.

Quoted 2 lines
---
 .../devicetree/bindings/display/msm/dp-sc7180.yaml | 325

+++++++++++++++++++++

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 1

Quoted 13 lines
 .../devicetree/bindings/display/msm/dpu.txt        |  16 +-
 2 files changed, 337 insertions(+), 4 deletions(-)  create mode 

100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

(quoted diff) +0 -0

a/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml b/Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file mode 100644
index 0000000..761a01d

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only

For new bindings please use: (GPL-2.0-only OR BSD-2-Clause)

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.
+
+maintainers:

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 18

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host 
+controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":

The quotes seems not necessary.
This describes the name of the node.
The typical way to identify a node is using a compatible.

So I think that the right solution here is to drop "msm_dp".

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, power

supplies.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 23

Quoted 1 line
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
+

And start here.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's

registers.
This description is generic and can be omitted.
But it would be good with a descrition of the individual registers like this:

reg:
items:
- description: AHB bla bla
- description: aux bla bla

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The required

region

Quoted 9 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the

device.
items:
- description: aux clock bla bla
- description: ref clock bla bla

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks

property.

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +5 -0
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 74

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.

Add type (phandle)

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 87

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.

Add type, goes for all *-settings

Quoted 56 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +56 -0
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+
+     aux-cfg9-settings:
+       description: |
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the

chipset.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+
+     data-lanes:
+       description: Maximum number of lanes that can be used for Display

port.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 160

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.

Shall be named -gpios. Goes for all -gpio properties.
maxItems: 1 is good. Keep it.

Quoted 9 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 179

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface output.
+           Documentation/devicetree/bindings/graph.txt and
+           Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+  "dp_pll":

quotes should not be required here.

I looks like yo try to describe two differents nodes in the same file. Consider to split in two files.

Some of the comments from above applies here too.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 182

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+     type: object
+     description: Node contains properties of Display port pll and phy

driver.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 11 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and pll

registers.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The

required region

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by the

device.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       clock-names:
+         description: |
+           Device clock names in the same order as mentioned in clocks

property.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 218

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:

4 spaces as indent - good.
You have include files - good.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 226

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;

indent only four spaces

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 228

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,

Only one space after '=' - rememebr to adjust indent in following lines.

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 242

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";

Indent so names in following lines starts where names in previous lines starts.
Like this:

        reg-names = "dp_ahb", "dp_aux", "dp_link",
                    "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
                    "qfprom_physical", "dp_pll",
                    "usb3_dp_com", "hdcp_physical";

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 248

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,

Indent so '<' are aligned under each other. Like done above for reg =

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 261

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
+            "crypto_clk", "pixel_clk_rcg";

Fix indent

Quoted 83 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +64 -0
+
+        pll-node = <&dp_pll>;
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];
+
+        max-pclk-frequency-khz = <67500>;
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +3 -2
index 551ae26..7e99e45 100644
@@ -63,8 +63,9 @@ Required properties:
 	Documentation/devicetree/bindings/graph.txt
 	Documentation/devicetree/bindings/media/video-interfaces.txt
 
-	Port 0 -> DPU_INTF1 (DSI1)
-	Port 1 -> DPU_INTF2 (DSI2)
+	Port 0 -> DPU_INTF0 (DP)
+	Port 1 -> DPU_INTF1 (DSI1)
+	Port 2 -> DPU_INTF2 (DSI2)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate 

assignment @@ -125,13 +126,20 @@ Example:

Documentation/devicetree/bindings/display/msm/dpu.txt Example:

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -2
 				port@0 {
 					reg = <0>;
-					dpu_intf1_out: endpoint {
-						remote-endpoint =

<&dsi0_in>;

Documentation/devicetree/bindings/display/msm/dpu.txt Example:

Quoted 9 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +4 -0
+					dpu_intf0_out: endpoint {
+						remote-endpoint = <&dp_in>;
 					};
 				};
 
 				port@1 {
 					reg = <1>;
+					dpu_intf1_out: endpoint {
+						remote-endpoint =

<&dsi0_in>;

Documentation/devicetree/bindings/display/msm/dpu.txt Example:

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +5 -0
+					};
+				};
+
+				port@2 {
+					reg = <2>;
 					dpu_intf2_out: endpoint {
 						remote-endpoint =

<&dsi1_in>;

Quoted 7 lines

};
--
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Re: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Quoted 9 lines

Hi Tanmay

Reviewing the yaml bindings triggered a few comments. See below.

Sam

Thanks for reviews Sam. Apologies for delayed response. We are redesigning our driver according to upstream comments and had to go through multiple discussions before we post v6. Please find my comments in bindings according to new design.

Quoted 13 lines · Tanmay Shah
Quoted 12 lines

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort and
display-port PLL driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Quoted 9 lines
Quoted 5 lines

Changes in V5:
Moved dp.txt to yaml file.

As you handle the patch, thus the patch passed throgh you, you are supposed to sign-off the patch.

Yes sure. Patch-v5 was sent using my email-id due to configuration error. So I wasn't aware. However, I am taking care of Patch-v6 so I will sign-off in Patch-v6.

Quoted 3 lines

The changes to dpu.txt is not explained in the changelog.

Explained same in commint message of v6.

Quoted 9 lines
Quoted 9 lines
---
 .../devicetree/bindings/display/msm/dp-sc7180.yaml | 325 
+++++++++++++++++++++
 .../devicetree/bindings/display/msm/dpu.txt        |  16 +-
 2 files changed, 337 insertions(+), 4 deletions(-)
 create mode 100644 

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 9 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 1

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
new file mode 100644
index 0000000..761a01d
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only

For new bindings please use: (GPL-2.0-only OR BSD-2-Clause)

Added BSD-2-Clause as License Identifier in v6.

Quoted 25 lines
Quoted 15 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host 

controllers

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 18

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":

The quotes seems not necessary.
This describes the name of the node.
The typical way to identify a node is using a compatible.

So I think that the right solution here is to drop "msm_dp".

Quoted 7 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, 

power supplies.
+

And start here.

Dropped msm_dp name, type, description and started properties from here with indentation fixed.

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
Quoted 8 lines
Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's 

registers.

This description is generic and can be omitted.

Removed this description.

Quoted 7 lines

But it would be good with a descrition of the individual registers like this:

reg:
items:
- description: AHB bla bla
- description: aux bla bla

Now DP is accessed as one big register region. So added its description instead of individual modules.

Quoted 21 lines
Quoted 21 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The 

required region

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +15 -0
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the 

device.

items:
- description: aux clock bla bla
- description: ref clock bla bla

Removed all PLL, PHY and DP clocks.
Added description of of DP controller clocks as mentioned.

Quoted 15 lines
Quoted 15 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks 

property.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 74

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.

Add type (phandle)

According to new design, PLL/PHY will be accessed as part of DP driver. So removed this node so comment Not Applicable now.

Quoted 16 lines
Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.

Add type, goes for all *-settings

Squashed all aux-cfg[0-9]-settings properties and description into one pattern Property. Also these properties are optional now. Driver will be using default configuration if property is not mentioned in dts.

Quoted 80 lines
Quoted 80 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +5 -0
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg9-settings:
+       description: |
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +5 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the 

chipset.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+
+     data-lanes:
Quoted 9 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 160

Quoted 6 lines

+ description: Maximum number of lanes that can be used for
Display port.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.

Shall be named -gpios. Goes for all -gpio properties.
maxItems: 1 is good. Keep it.

GPIOs are redundant for now. so removed all gpio properties and we will be adding them if required in future.
Comment Not Applicable now.

Quoted 23 lines
Quoted 19 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +15 -0
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface 

output.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+           Documentation/devicetree/bindings/graph.txt and
+           

Documentation/devicetree/bindings/media/video-interfaces.txt.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+
+  "dp_pll":

quotes should not be required here.

Quoted 5 lines

I looks like yo try to describe two differents nodes in the same file. Consider to split in two files.

Some of the comments from above applies here too.

Now PLL related code will be part of DP driver,
so removed whole dp_pll node from bindings.
Comment Not Applicable now.

Quoted 57 lines
Quoted 36 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+     type: object
+     description: Node contains properties of Display port pll and 

phy driver.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and 

pll registers.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The 

required region

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by 

the device.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       clock-names:
+         description: |
+           Device clock names in the same order as mentioned in 

clocks property.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 218

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:

4 spaces as indent - good.
You have include files - good.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 226

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;
Quoted 2 lines

indent only four spaces

Removed gpio.h and qcom,rpmh.h as they are redundant now. Fixed indentation to four space.

Quoted 18 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 228

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,

Only one space after '=' - rememebr to adjust indent in following lines.

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 242

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";
Quoted 9 lines

Indent so names in following lines starts where names in previous lines starts.
Like this:

        reg-names = "dp_ahb", "dp_aux", "dp_link",
                    "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
                    "qfprom_physical", "dp_pll",
                    "usb3_dp_com", "hdcp_physical";

Now we have only one reg-name i.e "dp_controller" as we are accessing DP as one big register region. so only one reg-name is there. So indentation won't be required for each name.

Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 248

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,

Indent so '<' are aligned under each other. Like done above for reg =

Fixed indentation for clocks. removed PHY and PLL clocks.

Quoted 13 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 261

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
+            "crypto_clk", "pixel_clk_rcg";
Quoted 2 lines

Fix indent

Fixed indentation for clock-names and started name after = . Also removed redundant clk suffix from clock names.

Quoted 102 lines
Quoted 102 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +64 -0
+
+        pll-node = <&dp_pll>;
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];
+
+        max-pclk-frequency-khz = <67500>;
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +3 -2
index 551ae26..7e99e45 100644
@@ -63,8 +63,9 @@ Required properties:
 	Documentation/devicetree/bindings/graph.txt
 	Documentation/devicetree/bindings/media/video-interfaces.txt
 
-	Port 0 -> DPU_INTF1 (DSI1)
-	Port 1 -> DPU_INTF2 (DSI2)
+	Port 0 -> DPU_INTF0 (DP)
+	Port 1 -> DPU_INTF1 (DSI1)
+	Port 2 -> DPU_INTF2 (DSI2)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate 

assignment

Documentation/devicetree/bindings/display/msm/dpu.txt +9 -2
@@ -125,13 +126,20 @@ Example:
 
 				port@0 {
 					reg = <0>;
-					dpu_intf1_out: endpoint {
-						remote-endpoint = <&dsi0_in>;
+					dpu_intf0_out: endpoint {
+						remote-endpoint = <&dp_in>;
 					};
 				};
 
 				port@1 {
 					reg = <1>;
+					dpu_intf1_out: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
 					dpu_intf2_out: endpoint {
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -1
 						remote-endpoint = <&dsi1_in>;
 					};
--

1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

In reply to Tanmay Shah

Quoting Tanmay Shah (2020-03-31 17:30:27)

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 7

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
new file mode 100644
index 0000000..761a01d
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.

This title should be something like

"Qualcomm Display Port Controller"

Quoted 139 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +139 -0
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, power supplies.
+
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's registers.
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The required region
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the device.
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks property.
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg9-settings:
+       description: |

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 156

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register offset
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the chipset.
+
+     data-lanes:
+       description: Maximum number of lanes that can be used for Display port.

This should be an array of cells, not a single cell indicating the number of lanes.

Quoted 72 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +72 -0
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface output.
+           Documentation/devicetree/bindings/graph.txt and
+           Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+  "dp_pll":
+     type: object
+     description: Node contains properties of Display port pll and phy driver.
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and pll registers.
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The required region
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by the device.
+
+       clock-names:
+         description: |
+           Device clock names in the same order as mentioned in clocks property.
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 238

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;

This needs to be split up into at least two nodes. Any address above that starts in 88e needs to be put into a new node underneath the qmp phy. That is the "DP PHY" that lives in the power domain of the USB+DP combo phy. The qfprom_physical reg property should be removed from here and this binding should use the nvmem binding to reach into the qfprom to read out things (I guess there's some sort of HDCP key in the qfprom?).

After that I don't know why there are so many different reg properties for the DP controller here and why it needs to be split up. It looks like we should just map the register space from 0xae90000 up to 0xae91400 as one big register region and have the driver figure out how to operate on top of that. If it changes between SoC versions then we should have a more specific compatible that tells us what registers are in what place.

Quoted 15 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +15 -0
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 263

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
+            "crypto_clk", "pixel_clk_rcg";
+
+        pll-node = <&dp_pll>;

If the DP PLL and DP controller need to be controlled from two software entities, it may make sense to just combine that DP PLL into the controller node and have this node be a clk provider. The pll-node property is pretty ugly and should be removed.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 276

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];

This pile of properties is board specific configuration tuning or something? Can this go into the driver? Or can it be made more human readable? I seem to recall that the USB phy had similar properties and we made them into human readable properties when board integrators needed to change them. The easiest approach there is to put everything in the driver for now and then when something has to change for a board it gets punted out to the DT and that overrides the "default" settings that are used in the driver.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 278

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+
+        max-pclk-frequency-khz = <67500>;

What is this? Why isn't this in the driver?

Quoted 28 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +28 -0
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 316

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";

I guess the DP_PLL lives inside the qmp combo phy? That would match how the USB phy binding has been done there. This whole node should be combined with the DP phy node that will be placed as a child of the qmp phy wrapper (i.e. qcom,sc7180-qmp-usb3-phy compatible node). Might as well change that compatible from qcom,sc7180-qmp-usb3-phy to be qcom,sc7180-qmp-usb3-dp-phy too so that it can create the DP phy bits too.

Quoted 14 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -0
index 551ae26..7e99e45 100644

Documentation/devicetree/bindings/display/msm/dpu.txt Required properties: · line 68

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +3 -2
@@ -63,8 +63,9 @@ Required properties:
        Documentation/devicetree/bindings/graph.txt
        Documentation/devicetree/bindings/media/video-interfaces.txt
 
-       Port 0 -> DPU_INTF1 (DSI1)
-       Port 1 -> DPU_INTF2 (DSI2)
+       Port 0 -> DPU_INTF0 (DP)
+       Port 1 -> DPU_INTF1 (DSI1)
+       Port 2 -> DPU_INTF2 (DSI2)

DP should come last so that the port mapping doesn't have to change.

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -0
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
#7 lore raw

Re: [DPU PATCH v5 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Thanks for reviews Stephen. Please find my comments according to new design.

Quoted 18 lines · Stephen Boyd

Quoting Tanmay Shah (2020-03-31 17:30:27)

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +0 -0
new file mode 100644
index 0000000..761a01d

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
@@ -0,0 +1,325 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Description of Qualcomm Display Port dt properties.

This title should be something like

Quoted 2 lines

"Qualcomm Display Port Controller"

Changed title as suggested.

Quoted 165 lines
Quoted 165 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host

controllers

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  "msm_dp":
+    type: object
+    description: |
+      Node containing Display port register address bases, clocks, 

power
supplies.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+
+    properties:
+     compatible:
+       items:
+         - const: qcom,dp-display
+
+     cell-index:
+       description: Specifies the controller instance.
+
+     reg:
+       description: Physical base address and length of controller's

registers.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     reg-names:
+       description: |
+         Names for different register regions defined above. The 

required
region

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +19 -0
+         is mentioned below.
+       items:
+         - const: dp_ahb
+         - const: dp_aux
+         - const: dp_link
+         - const: dp_p0
+         - const: dp_phy
+         - const: dp_ln_tx0
+         - const: dp_ln_tx1
+         - const: afprom_physical
+         - const: dp_pll
+         - const: usb3_dp_com
+         - const: hdcp_physical
+
+     interrupts:
+       description: The interrupt signal from the DP block.
+
+     clocks:
+       description: List of clock specifiers for clocks needed by the

device.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+     clock-names:
+       description: |
+         Device clock names in the same order as mentioned in clocks

property.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +26 -0
+         The required clocks are mentioned below.
+       items:
+         - const: core_aux_clk
+         - const: core_ref_clk_src
+         - const: core_usb_ref_clk
+         - const: core_usb_cfg_ahb_clk
+         - const: core_usb_pipe_clk
+         - const: ctrl_link_clk
+         - const: ctrl_link_iface_clk
+         - const: ctrl_pixel_clk
+         - const: crypto_clk
+         - const: pixel_clk_rcg
+
+     pll-node:
+       description: phandle to DP PLL node.
+
+     vdda-1p2-supply:
+       description: phandle to vdda 1.2V regulator node.
+
+     vdda-0p9-supply:
+       description: phandle to vdda 0.9V regulator node.
+
+     aux-cfg0-settings:
+       description: |
+         Specifies the DP AUX configuration 0 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg1-settings:
+       description: |
+         Specifies the DP AUX configuration 1 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg2-settings:
+       description: |
+         Specifies the DP AUX configuration 2 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg3-settings:
+       description: |
+         Specifies the DP AUX configuration 3 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg4-settings:
+       description: |
+         Specifies the DP AUX configuration 4 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg5-settings:
+       description: |
+         Specifies the DP AUX configuration 5 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg6-settings:
+       description: |
+         Specifies the DP AUX configuration 6 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg7-settings:
+       description: |
+         Specifies the DP AUX configuration 7 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg8-settings:
+       description: |
+         Specifies the DP AUX configuration 8 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     aux-cfg9-settings:
+       description: |
+         Specifies the DP AUX configuration 9 settings.
+         The first entry in this array corresponds to the register 

offset

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +5 -0
+         within DP AUX, while the remaining entries indicate the
+         programmable values.
+
+     max-pclk-frequency-khz:
+       description: Maximum displayport pixel clock supported for the

chipset.

Quoted 9 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+
+     data-lanes:
+       description: Maximum number of lanes that can be used for 

Display
port.

This should be an array of cells, not a single cell indicating the number of lanes.

Done. Now data-lanes is array of integers and size of array represents maximum number of lanes supported.

Quoted 102 lines
Quoted 83 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +19 -0
+
+     usbplug-cc-gpio:
+       maxItems: 1
+       description: Specifies the usbplug orientation gpio.
+
+     aux-en-gpio:
+       maxItems: 1
+       description: Specifies the aux-channel enable gpio.
+
+     aux-sel-gpio:
+       maxItems: 1
+       description: Specifies the sux-channel select gpio.
+
+     ports:
+       description: |
+         Contains display port controller endpoint subnode.
+         remote-endpoint: |
+           For port@0, set to phandle of the connected panel/bridge's
+           input endpoint. For port@1, set to the DPU interface 

output.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+           Documentation/devicetree/bindings/graph.txt and
+           

Documentation/devicetree/bindings/media/video-interfaces.txt.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+  "dp_pll":
+     type: object
+     description: Node contains properties of Display port pll and 

phy
driver.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+
+     properties:
+       compatible:
+         items:
+           - const: qcom,dp-pll-10nm
+
+       cell-index:
+         description: Specifies the controller instance.
+
+       reg:
+         description: Physical base address and length of DP phy and 

pll
registers.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       reg-names:
+         description: |
+           Names for different register regions defined above. The

required region

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+           is mentioned below.
+         items:
+           - const: pll_base
+           - const: phy_base
+           - const: ln_tx0_base
+           - const: ln_tx1_base
+           - const: gdsc_base
+
+       clocks:
+         description: List of clock specifiers for clocks needed by 

the
device.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+       clock-names:
+         description: |
+           Device clock names in the same order as mentioned in 

clocks
property.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +18 -0
+           The required clocks are mentioned below.
+         items:
+           - const: iface
+           - const: ref
+           - const: cfg_ahb
+           - const: pipe
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/gpio/gpio.h>
+    msm_dp: displayport-controller@ae90000{
+                cell-index = <0>;
+        compatible = "qcom,dp-display";
+        reg =   <0 0xae90000 0 0x200>,

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 238

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+                <0 0xae90200 0 0x200>,
+                <0 0xae90400 0 0xc00>,
+                <0 0xae91000 0 0x400>,
+                <0 0x88eaa00 0 0x200>,
+                <0 0x88ea200 0 0x200>,
+                <0 0x88ea600 0 0x200>,
+                <0 0x780000 0 0x6228>,
+                <0 0x088ea000 0 0x40>,
+                <0 0x88e8000 0 0x20>,
+                <0 0x0aee1000 0 0x034>;

This needs to be split up into at least two nodes. Any address above that starts in 88e needs to be put into a new node underneath the qmp phy. That is the "DP PHY" that lives in the power domain of the USB+DP combo phy. The qfprom_physical reg property should be removed from here and this binding should use the nvmem binding to reach into the qfprom to read out things (I guess there's some sort of HDCP key in the qfprom?).

Quoted 8 lines

After that I don't know why there are so many different reg properties for the DP controller here and why it needs to be split up. It looks like we should just map the register space from 0xae90000 up to 0xae91400 as one big register region and have the driver figure out how to operate on top of that. If it changes between SoC versions then we should have a more specific compatible that tells us what registers are in what place.

Done. Only one register region is specified here now in new bindings i.e. dp_controller starting from 0xae90000 upto 0xae91400. Removed rest of the module offsets.
Driver will access each module using offset as required. Also PHY and USB3 DPCOM register bases are hard-coded in driver. Removed redundant qfprom and hdcp registers from bindings.

Quoted 22 lines
Quoted 22 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +22 -0
+        reg-names = "dp_ahb", "dp_aux", "dp_link",
+            "dp_p0", "dp_phy", "dp_ln_tx0", "dp_ln_tx1",
+            "qfprom_physical", "dp_pll",
+            "usb3_dp_com", "hdcp_physical";
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+            <&rpmhcc RPMH_CXO_CLK>,
+            <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+            <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+            <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_CRYPTO_CLK>,
+            <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux_clk", "core_ref_clk_src",
+            "core_usb_ref_clk", "core_usb_cfg_ahb_clk",
+            "core_usb_pipe_clk", "ctrl_link_clk",
+            "ctrl_link_iface_clk", "ctrl_pixel_clk",
Quoted 9 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 263

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+            "crypto_clk", "pixel_clk_rcg";
+
+        pll-node = <&dp_pll>;

If the DP PLL and DP controller need to be controlled from two software entities, it may make sense to just combine that DP PLL into the controller node and have this node be a clk provider. The pll-node property is pretty ugly and should be removed.

Done. Removed PLL as separate node and combined PLL as module of DP driver. Removed pll-node property as well.

Quoted 14 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 276

Quoted 13 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +13 -0
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        aux-cfg0-settings = [20 00];
+        aux-cfg1-settings = [24 13 23 1d];
+        aux-cfg2-settings = [28 24];
+        aux-cfg3-settings = [2c 00];
+        aux-cfg4-settings = [30 0a];
+        aux-cfg5-settings = [34 26];
+        aux-cfg6-settings = [38 0a];
+        aux-cfg7-settings = [3c 03];
+        aux-cfg8-settings = [40 bb];
+        aux-cfg9-settings = [44 03];
Quoted 9 lines

This pile of properties is board specific configuration tuning or something? Can this go into the driver? Or can it be made more human readable? I seem to recall that the USB phy had similar properties and we made them into human readable properties when board integrators needed to change them. The easiest approach there is to put everything in the driver for now and then when something has to change for a board it gets punted out to the DT and that overrides the "default" settings that are used in the driver.

Made aux-cfg[0-9]-settingsproperties optional in bindings. Added default configurations in driver and using them if these properties are not mentioned in dts.

Quoted 5 lines

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 278

Quoted 2 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +2 -0
+
+        max-pclk-frequency-khz = <67500>;

What is this? Why isn't this in the driver?

Done. Removed this property from bindings and setting default value in driver.

Quoted 39 lines
Quoted 28 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +28 -0
+        data-lanes = <2>;
+
+        aux-en-gpio = <&msmgpio 55 1>;
+        aux-sel-gpio = <&msmgpio 110 1>;
+        usbplug-cc-gpio = <&msmgpio 90 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
+
+    dp_pll: dp-pll@088ea000 {
+        compatible = "qcom,dp-pll-10nm";
+        label = "DP PLL";

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 316

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+        cell-index = <0>;
+        #clock-cells = <1>;
+
+        reg = <0 0x088ea000 0 0x200>,
+              <0 0x088eaa00 0 0x200>,
+              <0 0x088ea200 0 0x200>,
+              <0 0x088ea600 0 0x200>,
+              <0 0x08803000 0 0x8>;
+        reg-names = "pll_base", "phy_base", "ln_tx0_base",
+            "ln_tx1_base", "gdsc_base";
Quoted 8 lines

I guess the DP_PLL lives inside the qmp combo phy? That would match how the USB phy binding has been done there. This whole node should be combined with the DP phy node that will be placed as a child of the qmp phy wrapper (i.e. qcom,sc7180-qmp-usb3-phy compatible node). Might as well change that compatible from qcom,sc7180-qmp-usb3-phy to be qcom,sc7180-qmp-usb3-dp-phy too so that it can create the DP phy bits too.

Done. Removed whole dp_pll node from here and added PLL as module of DP driver. This required hard coding of few register bases in driver for now.

Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +9 -0
+
+        clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
+             <&gcc GCC_USB3_PRIM_CLKREF_CLK>,
+             <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+             <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+        clock-names = "iface_clk", "ref_clk",
+            "cfg_ahb_clk", "pipe_clk";
+    };
+
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -0
index 551ae26..7e99e45 100644
@@ -63,8 +63,9 @@ Required properties:
        Documentation/devicetree/bindings/graph.txt
        Documentation/devicetree/bindings/media/video-interfaces.txt
 
Quoted 8 lines

Documentation/devicetree/bindings/display/msm/dpu.txt Required properties: · line 68

Quoted 5 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +3 -2
-       Port 0 -> DPU_INTF1 (DSI1)
-       Port 1 -> DPU_INTF2 (DSI2)
+       Port 0 -> DPU_INTF0 (DP)
+       Port 1 -> DPU_INTF1 (DSI1)
+       Port 2 -> DPU_INTF2 (DSI2)

DP should come last so that the port mapping doesn't have to change.

Done. Reverted Port mapping to old one i.e. Port0->DSI1, Port1->DSI2 and Added Port2->DP mapping.

Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dpu.txt +0 -0
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate

assignment

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

PATCH v5 2/5 drm: add constant N value in helper file

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

The constant N value (0x8000) is used by multiple DP drivers. Define this value in header file and use this in the existing i915 display driver.

---
 drivers/gpu/drm/i915/display/intel_display.c | 2 +-
 include/drm/drm_dp_helper.h                  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
index effc425..3c016f3 100644
@@ -7618,7 +7618,7 @@ static void compute_m_n(unsigned int m, unsigned int n,
 	 * which the devices expect also in synchronous clock mode.
 	 */
 	if (constant_n)
-		*ret_n = 0x8000;
+		*ret_n = DP_LINK_CONSTANT_N_VALUE;
 	else
 		*ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);
 
include/drm/drm_dp_helper.h +2 -0
index 51ecb51..b509e74 100644
@@ -1455,6 +1455,8 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux,
 int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 				 u8 status[DP_LINK_STATUS_SIZE]);
 
+#define DP_LINK_CONSTANT_N_VALUE 0x8000
+
 int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
 				const u8 port_cap[4]);
 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
Signature · 1 line
1.9.1
#9 lore raw

Re: [DPU PATCH v5 2/5] drm: add constant N value in helper file

Quoting Tanmay Shah (2020-03-31 17:30:28)

Quoted 3 lines

From: Chandan Uddaraju <[email protected]>

The constant N value (0x8000) is used by multiple DP

There's one driver using it, not multiple.

Quoted 5 lines

drivers. Define this value in header file and use this in the existing i915 display driver.

#10 lore raw

Re: [DPU PATCH v5 2/5] drm: add constant N value in helper file

Quoted 7 lines · Stephen Boyd

Quoting Tanmay Shah (2020-03-31 17:30:28)

Quoted 3 lines

From: Chandan Uddaraju <[email protected]>

The constant N value (0x8000) is used by multiple DP

There's one driver using it, not multiple.

Changed commit message accordingly.

Quoted 5 lines
Quoted 5 lines

drivers. Define this value in header file and use this in the existing i915 display driver.

#11 lore raw

PATCH v5 3/5 drm/msm/dp: add displayPort driver support

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add the needed displayPort files to enable DP driver on msm target.

"dp_display" module is the main module that calls into other sub-modules. "dp_drm" file represents the interface between DRM framework and DP driver.

changes in v2:
-- Update copyright markings on all relevant files.
-- Change pr_err() to DRM_ERROR()
-- Use APIs directly instead of function pointers.
-- Use drm_display_mode structure to store link parameters. -- Use macros for register definitions instead of hardcoded values. -- Replace writel_relaxed/readl_relaxed with writel/readl
and remove memory barriers.
-- Remove unnecessary NULL checks.
-- Use drm helper functions for dpcd read/write.
-- Use DRM_DEBUG_DP for debug msgs.

changes in V3:
-- Removed changes in dpu_io_util.[ch]
-- Added locking around "is_connected" flag and removed atomic_set() -- Removed the argument validation checks in all the static functions
except initialization functions and few API across msm/dp files.
-- Removed hardcoded values for register reads/writes
-- Removed vreg related generic structures.
-- Added return values where ever necessary.
-- Updated dp_ctrl_on function.
-- Calling the ctrl specific catalog functions directly instead of
function pointers.
-- Added separate change that adds standard value in drm_dp_helper file. -- Added separate change in this list that is used to initialize DP. -- Added change to use drm_dp_get_adjust_request_voltage() function.

changes in V4:
-- Fix mvid, nvid calculation.
-- Shift video timings to align to bottom right. -- Fix register offsets for pixel_m and pixel_n. -- Fix TPG programming sequence.
-- Update DP ack override register to recommended value. -- Added code to log displayport registers.
-- Update aux setup with recommended settings. -- Fix TU calculations for all resolutions.
-- Limit linkrate to HBR2 until HBR3 support is added. -- Update DPCD read sequence.
-- Update code comments in dp_power_init() of V3. -- Remove extcon dependencies.
-- Move drm helper functions locally.

changes in V5:
-- Addressed comments from Jordan.

---
 drivers/gpu/drm/msm/Kconfig                        |    8 +
 drivers/gpu/drm/msm/Makefile                       |   12 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   20 +
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |    8 +
 drivers/gpu/drm/msm/dp/dp_aux.c                    |  531 ++++++
 drivers/gpu/drm/msm/dp/dp_aux.h                    |   35 +
 drivers/gpu/drm/msm/dp/dp_catalog.c                |  972 +++++++++++
 drivers/gpu/drm/msm/dp/dp_catalog.h                |   86 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   | 1707 ++++++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   35 +
 drivers/gpu/drm/msm/dp/dp_display.c                |  897 ++++++++++
 drivers/gpu/drm/msm/dp/dp_display.h                |   28 +
 drivers/gpu/drm/msm/dp/dp_drm.c                    |  170 ++
 drivers/gpu/drm/msm/dp/dp_drm.h                    |   19 +
 drivers/gpu/drm/msm/dp/dp_hpd.c                    |   69 +
 drivers/gpu/drm/msm/dp/dp_hpd.h                    |   79 +
 drivers/gpu/drm/msm/dp/dp_link.c                   | 1216 ++++++++++++++
 drivers/gpu/drm/msm/dp/dp_link.h                   |  132 ++
 drivers/gpu/drm/msm/dp/dp_panel.c                  |  490 ++++++
 drivers/gpu/drm/msm/dp/dp_panel.h                  |   95 ++
 drivers/gpu/drm/msm/dp/dp_parser.c                 |  480 ++++++
 drivers/gpu/drm/msm/dp/dp_parser.h                 |  218 +++
 drivers/gpu/drm/msm/dp/dp_power.c                  |  545 +++++++
 drivers/gpu/drm/msm/dp/dp_power.h                  |   46 +
 drivers/gpu/drm/msm/dp/dp_reg.h                    |  489 ++++++
 drivers/gpu/drm/msm/msm_drv.c                      |    2 +
 drivers/gpu/drm/msm/msm_drv.h                      |   53 +-
 27 files changed, 8439 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
drivers/gpu/drm/msm/Kconfig +8 -0
index 6deaa7d..ea3c4d0 100644
@@ -57,6 +57,14 @@ config DRM_MSM_HDMI_HDCP
 	help
 	  Choose this option to enable HDCP state machine
 
+config DRM_MSM_DP
+	bool "Enable DP support in MSM DRM driver"
+	depends on DRM_MSM
+	help
+	  Compile in support for DP driver in msm drm driver. DP external
+	  display support is enabled through this config option. It can
+	  be primary or secondary display on device.
+
 config DRM_MSM_DSI
 	bool "Enable DSI support in MSM DRM driver"
 	depends on DRM_MSM
drivers/gpu/drm/msm/Makefile +12 -0
index 1579cf0..3e078d5 100644
@@ -2,6 +2,7 @@
 ccflags-y := -I $(srctree)/$(src)
 ccflags-y += -I $(srctree)/$(src)/disp/dpu1
 ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
+ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp
 
 msm-y := \
 	adreno/adreno_device.o \
@@ -98,6 +99,17 @@ msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
 
 msm-$(CONFIG_DRM_MSM_GPU_STATE)	+= adreno/a6xx_gpu_state.o
 
+msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
+	dp/dp_catalog.o \
+	dp/dp_ctrl.o \
+	dp/dp_display.o \
+	dp/dp_drm.o \
+	dp/dp_hpd.o \
+	dp/dp_link.o \
+	dp/dp_panel.o \
+	dp/dp_parser.o \
+	dp/dp_power.o
+
 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
 msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +20 -0
index f8ac3bf..b063243 100644
@@ -978,6 +978,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 
 	trace_dpu_enc_mode_set(DRMID(drm_enc));
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp)
+		msm_dp_display_mode_set(priv->dp, drm_enc, mode, adj_mode);
+
 	list_for_each_entry(conn_iter, connector_list, head)
 		if (conn_iter->encoder == drm_enc)
 			conn = conn_iter;
@@ -1141,6 +1144,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 {
 	struct dpu_encoder_virt *dpu_enc = NULL;
 	int ret = 0;
+	struct msm_drm_private *priv;
 	struct drm_display_mode *cur_mode = NULL;
 
 	if (!drm_enc) {
@@ -1151,6 +1155,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 
 	mutex_lock(&dpu_enc->enc_lock);
 	cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
+	priv = drm_enc->dev->dev_private;
 
 	trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
 			     cur_mode->vdisplay);
@@ -1171,6 +1176,15 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 
 	_dpu_encoder_virt_enable_helper(drm_enc);
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
+		ret = msm_dp_display_enable(priv->dp,
+						drm_enc);
+		if (ret) {
+			DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n",
+				ret);
+			goto out;
+		}
+	}
 	dpu_enc->enabled = true;
 
 out:
@@ -1201,6 +1215,12 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
 	priv = drm_enc->dev->dev_private;
 	dpu_kms = to_dpu_kms(priv->kms);
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
+		if (msm_dp_display_disable(priv->dp, drm_enc)) {
+			DPU_ERROR_ENC(dpu_enc, "dp display disable failed\n");
+			return;
+		}
+	}
 	trace_dpu_enc_disable(DRMID(drm_enc));
 
 	/* wait for idle */
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +8 -0
index c71c18d..c1dfcc4 100644
@@ -100,6 +100,14 @@ static void drm_mode_to_intf_timing_params(
 	 * display_v_end -= mode->hsync_start - mode->hdisplay;
 	 * }
 	 */
+	/* for DP/EDP, Shift timings to align it to bottom right */
+	if ((phys_enc->hw_intf->cap->type == INTF_DP) ||
+		(phys_enc->hw_intf->cap->type == INTF_EDP)) {
+		timing->h_back_porch += timing->h_front_porch;
+		timing->h_front_porch = 0;
+		timing->v_back_porch += timing->v_front_porch;
+		timing->v_front_porch = 0;
+	}
 }
 
 static u32 get_horizontal_total(const struct intf_timing_params *timing)
drivers/gpu/drm/msm/dp/dp_aux.c new file +531 -0

531 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_aux.h new file +35 -0
new file mode 100644
index 0000000..18f560b
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DP_AUX_H_
+#define _DP_AUX_H_
+
+#include "dp_catalog.h"
+#include <drm/drm_dp_helper.h>
+
+#define DP_AUX_ERR_NONE		0
+#define DP_AUX_ERR_ADDR		-1
+#define DP_AUX_ERR_TOUT		-2
+#define DP_AUX_ERR_NACK		-3
+#define DP_AUX_ERR_DEFER	-4
+#define DP_AUX_ERR_NACK_DEFER	-5
+
+struct dp_aux {
+	struct drm_dp_aux *drm_aux;
+	struct dp_aux_cfg *cfg;
+};
+
+int dp_aux_register(struct dp_aux *aux);
+void dp_aux_unregister(struct dp_aux *aux);
+void dp_aux_isr(struct dp_aux *aux);
+void dp_aux_init(struct dp_aux *aux, struct dp_aux_cfg *aux_cfg);
+void dp_aux_deinit(struct dp_aux *aux);
+void dp_aux_reconfig(struct dp_aux *aux);
+
+struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
+			  struct dp_aux_cfg *aux_cfg);
+void dp_aux_put(struct dp_aux *aux);
+
+#endif /*__DP_AUX_H_*/
drivers/gpu/drm/msm/dp/dp_catalog.c new file +972 -0

972 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_catalog.h new file +86 -0

86 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_ctrl.c new file +1707 -0

1,274 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_ctrl.h new file +35 -0
new file mode 100644
index 0000000..63681e82

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_display.c new file +897 -0

897 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_display.h new file +28 -0
new file mode 100644
index 0000000..dad8610

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_drm.c new file +170 -0

170 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_drm.h new file +19 -0
new file mode 100644
index 0000000..a4ffdef

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_hpd.c new file +69 -0

69 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_hpd.h new file +79 -0

79 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_link.c new file +1216 -0

1,216 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_link.h new file +132 -0

132 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_panel.c new file +490 -0

490 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_panel.h new file +95 -0

95 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_parser.c new file +480 -0

480 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_parser.h new file +218 -0

218 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_power.c new file +545 -0

545 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_power.h new file +46 -0

46 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_reg.h new file +489 -0

489 lines not on this page · raw message

drivers/gpu/drm/msm/msm_drv.c +2 -0
index f50fefb..4b8bd2b 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/msm_drv.h +50 -3

53 lines not on this page · raw message

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

Signature · 1 line
1.9.1

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

#12 lore raw

PATCH v5 4/5 drm/msm/dp: add support for DP PLL driver

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add the needed DP PLL specific files to support
display port interface on msm targets.

The DP driver calls the DP PLL driver registration. The DP driver sets the link and pixel clock sources.

Changes in v2:
-- Update copyright markings on all relevant files. -- Use DRM_DEBUG_DP for debug msgs.

Changes in v4:
-- Update the DP link clock provider names

Changes in V5:
-- Addressed comments from Stephen Boyd, Rob clark.

---
 drivers/gpu/drm/msm/Kconfig                   |  13 +
 drivers/gpu/drm/msm/Makefile                  |   4 +
 drivers/gpu/drm/msm/dp/dp_catalog.c           |  34 +-
 drivers/gpu/drm/msm/dp/dp_display.c           |  46 +++
 drivers/gpu/drm/msm/dp/dp_display.h           |   3 +
 drivers/gpu/drm/msm/dp/dp_parser.c            |  37 +-
 drivers/gpu/drm/msm/dp/dp_parser.h            |   6 +-
 drivers/gpu/drm/msm/dp/dp_power.h             |  71 +++-
 drivers/gpu/drm/msm/dp/pll/dp_pll.c           | 127 +++++++
 drivers/gpu/drm/msm/dp/pll/dp_pll.h           |  57 +++
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c      | 401 ++++++++++++++++++++
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h      |  86 +++++
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c | 524 ++++++++++++++++++++++++++
 13 files changed, 1375 insertions(+), 34 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c
drivers/gpu/drm/msm/Kconfig +13 -0
index ea3c4d0..43544c1 100644
@@ -65,6 +65,19 @@ config DRM_MSM_DP
 	  display support is enabled through this config option. It can
 	  be primary or secondary display on device.
 
+config DRM_MSM_DP_PLL
+	bool "Enable DP PLL driver in MSM DRM"
+	depends on DRM_MSM_DP && COMMON_CLK
+	help
+	  Choose this option to enable DP PLL driver which provides DP
+	  source clocks under common clock framework.
+
+config DRM_MSM_DP_10NM_PLL
+	bool "Enable DP 10nm PLL driver in MSM DRM (used by SDM845)"
+	depends on DRM_MSM_DP_PLL
+	help
+	  Choose this option if DP PLL on SDM845 is used on the platform.
+
 config DRM_MSM_DSI
 	bool "Enable DSI support in MSM DRM driver"
 	depends on DRM_MSM
drivers/gpu/drm/msm/Makefile +4 -0
index 3e078d5..a6f68fb 100644
@@ -139,4 +139,8 @@ msm-$(CONFIG_DRM_MSM_DSI_14NM_PHY) += dsi/pll/dsi_pll_14nm.o
 msm-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/pll/dsi_pll_10nm.o
 endif
 
+msm-$(CONFIG_DRM_MSM_DP_PLL)+= dp/pll/dp_pll.o
+msm-$(CONFIG_DRM_MSM_DP_10NM_PLL)+= dp/pll/dp_pll_10nm.o \
+	dp/pll/dp_pll_10nm_util.o
+
 obj-$(CONFIG_DRM_MSM)	+= msm.o
drivers/gpu/drm/msm/dp/dp_catalog.c +25 -9
index 01e1833..0714868 100644
@@ -5,6 +5,7 @@
 
 #define pr_fmt(fmt)	"[drm-dp] %s: " fmt, __func__
 
+#include <linux/rational.h>
 #include <linux/delay.h>
 #include <linux/iopoll.h>
 #include <drm/drm_dp_helper.h>
@@ -121,11 +122,6 @@ static inline void dp_write_ahb(struct dp_catalog_private *catalog,
 	writel(data, catalog->io->dp_ahb.base + offset);
 }
 
-static inline u32 dp_read_cc(struct dp_catalog_private *catalog, u32 offset)
-{
-	return readl_relaxed(catalog->io->dp_cc_io.base + offset);
-}
-
 static inline void dp_write_phy(struct dp_catalog_private *catalog,
 			       u32 offset, u32 data)
 {
@@ -542,17 +538,37 @@ void dp_catalog_ctrl_config_msa(struct dp_catalog *dp_catalog,
 					bool fixed_nvid)
 {
 	u32 pixel_m, pixel_n;
-	u32 mvid, nvid;
+	u32 mvid, nvid, div, pixel_div = 0, dispcc_input_rate;
 	u32 const nvid_fixed = DP_LINK_CONSTANT_N_VALUE;
 	u32 const link_rate_hbr2 = 540000;
 	u32 const link_rate_hbr3 = 810000;
+	unsigned long den, num;
 
 	struct dp_catalog_private *catalog = container_of(dp_catalog,
 				struct dp_catalog_private, dp_catalog);
 
-	pixel_m = dp_read_cc(catalog, MMSS_DP_PIXEL_M);
-	pixel_n = dp_read_cc(catalog, MMSS_DP_PIXEL_N);
-	DRM_DEBUG_DP("pixel_m=0x%x, pixel_n=0x%x\n", pixel_m, pixel_n);
+	div = dp_read_phy(catalog, REG_DP_PHY_VCO_DIV);
+	div &= 0x03;
+
+	if (div == 0)
+		pixel_div = 6;
+	else if (div == 1)
+		pixel_div = 2;
+	else if (div == 2)
+		pixel_div = 4;
+	else
+		DRM_ERROR("Invalid pixel mux divider\n");
+
+	dispcc_input_rate = (rate * 10) / pixel_div;
+
+	rational_best_approximation(dispcc_input_rate, stream_rate_khz,
+			(unsigned long)(1 << 16) - 1,
+			(unsigned long)(1 << 16) - 1, &den, &num);
+
+	den = ~(den - num);
+	den = den & 0xFFFF;
+	pixel_m = num;
+	pixel_n = den;
 
 	mvid = (pixel_m & 0xFFFF) * 5;
 	nvid = (0xFFFF & (~pixel_n)) + (pixel_m & 0xFFFF);
drivers/gpu/drm/msm/dp/dp_display.c +46 -0

70 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_display.h +3 -0
index dad8610..4c53ed5 100644
@@ -25,4 +25,7 @@ int dp_display_get_modes(struct msm_dp *dp_display,
 bool dp_display_check_video_test(struct msm_dp *dp_display);
 int dp_display_get_test_bpp(struct msm_dp *dp_display);
 
+void __init msm_dp_pll_driver_register(void);
+void __exit msm_dp_pll_driver_unregister(void);
+
 #endif /* _DP_DISPLAY_H_ */
drivers/gpu/drm/msm/dp/dp_parser.c +15 -22
index 585b248..dbf64ee 100644
@@ -59,7 +59,6 @@ static void dp_parser_unmap_io_resources(struct dp_parser *parser)
 	msm_dss_iounmap(&io->ln_tx0_io);
 	msm_dss_iounmap(&io->ln_tx0_io);
 	msm_dss_iounmap(&io->dp_pll_io);
-	msm_dss_iounmap(&io->dp_cc_io);
 	msm_dss_iounmap(&io->usb3_dp_com);
 	msm_dss_iounmap(&io->qfprom_io);
 }
@@ -132,12 +131,6 @@ static int dp_parser_ctrl_res(struct dp_parser *parser)
 		goto err;
 	}
 
-	rc = msm_dss_ioremap_byname(pdev, &io->dp_cc_io, "dp_mmss_cc");
-	if (rc) {
-		DRM_ERROR("unable to remap dp MMSS_CC resources\n");
-		goto err;
-	}
-
 	if (msm_dss_ioremap_byname(pdev, &io->qfprom_io, "qfprom_physical"))
 		pr_warn("unable to remap dp qfprom resources\n");
 
@@ -151,25 +144,25 @@ static const char *dp_get_phy_aux_config_property(u32 cfg_type)
 {
 	switch (cfg_type) {
 	case PHY_AUX_CFG0:
-		return "qcom,aux-cfg0-settings";
+		return "aux-cfg0-settings";
 	case PHY_AUX_CFG1:
-		return "qcom,aux-cfg1-settings";
+		return "aux-cfg1-settings";
 	case PHY_AUX_CFG2:
-		return "qcom,aux-cfg2-settings";
+		return "aux-cfg2-settings";
 	case PHY_AUX_CFG3:
-		return "qcom,aux-cfg3-settings";
+		return "aux-cfg3-settings";
 	case PHY_AUX_CFG4:
-		return "qcom,aux-cfg4-settings";
+		return "aux-cfg4-settings";
 	case PHY_AUX_CFG5:
-		return "qcom,aux-cfg5-settings";
+		return "aux-cfg5-settings";
 	case PHY_AUX_CFG6:
-		return "qcom,aux-cfg6-settings";
+		return "aux-cfg6-settings";
 	case PHY_AUX_CFG7:
-		return "qcom,aux-cfg7-settings";
+		return "aux-cfg7-settings";
 	case PHY_AUX_CFG8:
-		return "qcom,aux-cfg8-settings";
+		return "aux-cfg8-settings";
 	case PHY_AUX_CFG9:
-		return "qcom,aux-cfg9-settings";
+		return "aux-cfg9-settings";
 	default:
 		return "unknown";
 	}
@@ -227,11 +220,11 @@ static int dp_parser_misc(struct dp_parser *parser)
 
 	parser->max_pclk_khz = DP_MAX_PIXEL_CLK_KHZ;
 	rc = of_property_read_u32(of_node,
-		"qcom,max-pclk-frequency-khz", &parser->max_pclk_khz);
+		"max-pclk-frequency-khz", &parser->max_pclk_khz);
 
 	parser->max_dp_lanes = DP_MAX_NUM_DP_LANES;
 	rc = of_property_read_u32(of_node,
-		"qcom,max-lanes-for-dp", &parser->max_dp_lanes);
+		"max-lanes-for-dp", &parser->max_dp_lanes);
 
 	return 0;
 }
@@ -273,21 +266,21 @@ static int dp_parser_gpio(struct dp_parser *parser)
 	struct device_node *of_node = dev->of_node;
 
 	parser->usbplug_cc_gpio = of_get_named_gpio(of_node,
-					"qcom,usbplug-cc-gpio", 0);
+					"usbplug-cc-gpio", 0);
 	if (!gpio_is_valid(parser->usbplug_cc_gpio)) {
 		DRM_ERROR("usbplug-cc-gpio not specified\n");
 		return -EINVAL;
 	}
 
 	parser->aux_en_gpio = of_get_named_gpio(of_node,
-					"qcom,aux-en-gpio", 0);
+					"aux-en-gpio", 0);
 	if (!gpio_is_valid(parser->aux_en_gpio)) {
 		DRM_ERROR("aux-en-gpio not specified\n");
 		return -EINVAL;
 	}
 
 	parser->aux_sel_gpio = of_get_named_gpio(of_node,
-					"qcom,aux-sel-gpio", 0);
+					"aux-sel-gpio", 0);
 	if (!gpio_is_valid(parser->aux_sel_gpio)) {
 		DRM_ERROR("aux-sel-gpio not specified\n");
 		return -EINVAL;
drivers/gpu/drm/msm/dp/dp_parser.h +4 -2
index 1dde473..1539866 100644
@@ -6,6 +6,8 @@
 #ifndef _DP_PARSER_H_
 #define _DP_PARSER_H_
 
+#include "pll/dp_pll.h"
+
 #define DP_LABEL "MDSS DP DISPLAY"
 #define AUX_CFG_LEN	10
 #define DP_MAX_PIXEL_CLK_KHZ	675000
@@ -60,7 +62,6 @@ struct dp_display_data {
  * @phy_io: phy's mapped memory address
  * @ln_tx0_io: USB-DP lane TX0's mapped memory address
  * @ln_tx1_io: USB-DP lane TX1's mapped memory address
- * @dp_cc_io: DP cc's mapped memory address
  * @qfprom_io: qfprom's mapped memory address
  * @dp_pll_io: DP PLL mapped memory address
  * @usb3_dp_com: USB3 DP PHY combo mapped memory address
@@ -74,7 +75,6 @@ struct dp_io {
 	struct dss_io_data phy_io;
 	struct dss_io_data ln_tx0_io;
 	struct dss_io_data ln_tx1_io;
-	struct dss_io_data dp_cc_io;
 	struct dss_io_data qfprom_io;
 	struct dss_io_data dp_pll_io;
 	struct dss_io_data usb3_dp_com;
@@ -193,6 +193,8 @@ struct dp_parser {
 	bool combo_phy_en;
 	struct dp_io io;
 	struct dp_display_data disp_data;
+	struct msm_dp_pll *pll;
+	struct device *pll_dev;
 	const struct dp_regulator_cfg *regulator_cfg;
 	u8 l_map[4];
 	struct dp_aux_cfg aux_cfg[AUX_CFG_LEN];
drivers/gpu/drm/msm/dp/dp_power.h +70 -1

90 lines not on this page · raw message

drivers/gpu/drm/msm/dp/pll/dp_pll.c new file +127 -0

127 lines not on this page · raw message

drivers/gpu/drm/msm/dp/pll/dp_pll.h new file +57 -0

57 lines not on this page · raw message

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +401 -0

401 lines not on this page · raw message

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h new file +86 -0

86 lines not on this page · raw message

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +524 -0

524 lines not on this page · raw message

Signature · 5 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#13 lore raw

Re: [DPU PATCH v5 4/5] drm/msm/dp: add support for DP PLL driver

Quoting Tanmay Shah (2020-03-31 17:30:30)

Quoted 49 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +43 -0
new file mode 100644
index 0000000..aa845d0
@@ -0,0 +1,401 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+ */
+
+/*
+ * Display Port PLL driver block diagram for branch clocks
+ *
+ *              +------------------------------+
+ *              |         DP_VCO_CLK           |
+ *              |                              |
+ *              |    +-------------------+     |
+ *              |    |   (DP PLL/VCO)    |     |
+ *              |    +---------+---------+     |
+ *              |              v               |
+ *              |   +----------+-----------+   |
+ *              |   | hsclk_divsel_clk_src |   |
+ *              |   +----------+-----------+   |
+ *              +------------------------------+
+ *                              |
+ *          +---------<---------v------------>----------+
+ *          |                                           |
+ * +--------v---------+                                 |
+ * |    dp_phy_pll    |                                 |
+ * |     link_clk     |                                 |
+ * +--------+---------+                                 |
+ *          |                                           |
+ *          |                                           |
+ *          v                                           v
+ * Input to DISPCC block                                |
+ * for link clk, crypto clk                             |
+ * and interface clock                                  |
+ *                                                      |
+ *                                                      |
+ *      +--------<------------+-----------------+---<---+
+ *      |                     |                 |
+ * +----v---------+  +--------v-----+  +--------v------+
+ * | vco_divided  |  | vco_divided  |  | vco_divided   |
+ * |    _clk_src  |  |    _clk_src  |  |    _clk_src   |
+ * |              |  |              |  |               |
+ * |divsel_six    |  |  divsel_two  |  |  divsel_four  |
+ * +-------+------+  +-----+--------+  +--------+------+
+ *         |                 |                  |

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c line 53

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +10 -0
+ *         v---->----------v-------------<------v
+ *                         |
+ *              +----------+---------+
+ *              |   dp_phy_pll_vco   |
+ *              |       div_clk      |
+ *              +---------+----------+
+ *                        |
+ *                        v
+ *              Input to DISPCC block
+ *              for DP pixel clock

I suspect this shouldn't be a complicated clk provider at all. Take a look at commit 42d068472ddf ("phy: Add DisplayPort configuration options") for how the phy should manage the link rate, etc. If the dispcc pixel clock needs to know what rate is coming in, then a single clk_hw can be implemented here that tells the consumer (i.e. dispcc) the rate that it will see at the output of this node. Otherwise, modeling the clk tree inside this PLL block like this is super overly complicated and wasteful. Don't do it.

Quoted 16 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +16 -0
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/regmap.h>
+
+#include "dp_pll_10nm.h"
+
+#define NUM_PROVIDED_CLKS              2
+
+#define DP_LINK_CLK_SRC                        0
+#define DP_PIXEL_CLK_SRC               1
+

[...]

Quoted 22 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +16 -0
new file mode 100644
index 0000000..fff2e8d
@@ -0,0 +1,524 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+ */
+
+#define pr_fmt(fmt)    "%s: " fmt, __func__
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/iopoll.h>
+#include <linux/kernel.h>
+
+#include "dp_hpd.h"
+#include "dp_pll.h"
+#include "dp_pll_10nm.h"
+

[...]

Quoted 11 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +11 -0
+
+static int dp_config_vco_rate_10nm(struct msm_dp_pll *pll,
+               unsigned long rate)
+{
+       u32 res = 0;
+       struct dp_pll_10nm *dp_res = to_dp_pll_10nm(pll);
+
+       res = dp_vco_pll_init_db_10nm(pll, rate);
+       if (res) {
+               DRM_ERROR("VCO Init DB failed\n");
+               return res;

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 125

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +10 -0
+       }
+
+       if (dp_res->lane_cnt != 4) {
+               if (dp_res->orientation == ORIENTATION_CC2)
+                       PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL, 0x6d);
+               else
+                       PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL, 0x75);
+       } else {
+               PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL, 0x7d);
+       }

For example, this part here can be done through the phy configuration ops. A lane count check in the set rate clk op is quite odd!

Quoted 5 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +5 -0
+
+long dp_vco_round_rate_10nm(struct clk_hw *hw, unsigned long rate,
+                       unsigned long *parent_rate)
+{
+       unsigned long rrate = rate;

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 517

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +10 -0
+       struct msm_dp_pll *pll = to_msm_dp_pll(hw);
+
+       if (rate <= pll->min_rate)
+               rrate = pll->min_rate;
+       else if (rate <= DP_VCO_HSCLK_RATE_2700MHZDIV1000)
+               rrate = DP_VCO_HSCLK_RATE_2700MHZDIV1000;
+       else if (rate <= DP_VCO_HSCLK_RATE_5400MHZDIV1000)
+               rrate = DP_VCO_HSCLK_RATE_5400MHZDIV1000;
+       else
+               rrate = pll->max_rate;

This is basically link rate setting through the clk framework. Calling clk_set_rate() on the pixel clk is complicated and opaque. I'd expect to see the DP controller driver set the link rate on the phy with phy_configure(), and then that can change the rate that is seen downstream at the pixel clk. Does the pixel clk need to do anything with the rate? Probably not? I suspect it can just enable the pixel clk when it needs to and disable it when it doesn't need it.

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 521

Quoted 4 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +4 -0
+
+       DRM_DEBUG_DP("%s: rrate=%ld\n", __func__, rrate);
+
+       *parent_rate = rrate;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw

Re: [Freedreno] [DPU PATCH v5 4/5] drm/msm/dp: add support for DP PLL driver

Quoted 63 lines · Stephen Boyd

Quoting Tanmay Shah (2020-03-31 17:30:30)

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c

Quoted 49 lines

new file mode 100644
index 0000000..aa845d0

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +3 -0
@@ -0,0 +1,401 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights 

reserved.
+ */

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +39 -0
+
+/*
+ * Display Port PLL driver block diagram for branch clocks
+ *
+ *              +------------------------------+
+ *              |         DP_VCO_CLK           |
+ *              |                              |
+ *              |    +-------------------+     |
+ *              |    |   (DP PLL/VCO)    |     |
+ *              |    +---------+---------+     |
+ *              |              v               |
+ *              |   +----------+-----------+   |
+ *              |   | hsclk_divsel_clk_src |   |
+ *              |   +----------+-----------+   |
+ *              +------------------------------+
+ *                              |
+ *          +---------<---------v------------>----------+
+ *          |                                           |
+ * +--------v---------+                                 |
+ * |    dp_phy_pll    |                                 |
+ * |     link_clk     |                                 |
+ * +--------+---------+                                 |
+ *          |                                           |
+ *          |                                           |
+ *          v                                           v
+ * Input to DISPCC block                                |
+ * for link clk, crypto clk                             |
+ * and interface clock                                  |
+ *                                                      |
+ *                                                      |
+ *      +--------<------------+-----------------+---<---+
+ *      |                     |                 |
+ * +----v---------+  +--------v-----+  +--------v------+
+ * | vco_divided  |  | vco_divided  |  | vco_divided   |
+ * |    _clk_src  |  |    _clk_src  |  |    _clk_src   |
+ * |              |  |              |  |               |
+ * |divsel_six    |  |  divsel_two  |  |  divsel_four  |
+ * +-------+------+  +-----+--------+  +--------+------+
+ *         |                 |                  |

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c line 53

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +10 -0
+ *         v---->----------v-------------<------v
+ *                         |
+ *              +----------+---------+
+ *              |   dp_phy_pll_vco   |
+ *              |       div_clk      |
+ *              +---------+----------+
+ *                        |
+ *                        v
+ *              Input to DISPCC block
+ *              for DP pixel clock
Quoted 9 lines

I suspect this shouldn't be a complicated clk provider at all. Take a look at commit 42d068472ddf ("phy: Add DisplayPort configuration options") for how the phy should manage the link rate, etc. If the dispcc pixel clock needs to know what rate is coming in, then a single clk_hw can be implemented here that tells the consumer (i.e. dispcc) the rate that it will see at the output of this node. Otherwise, modeling the clk tree inside this PLL block like this is super overly complicated and wasteful. Don't do it.

This will be taken care at later point of time. For now we have removed PLL bindings and made PLL as module of DP driver.

Quoted 61 lines
Quoted 16 lines

+ *
+ */

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c new file +14 -0
+
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/kernel.h>
+#include <linux/regmap.h>
+
+#include "dp_pll_10nm.h"
+
+#define NUM_PROVIDED_CLKS              2
+
+#define DP_LINK_CLK_SRC                        0
+#define DP_PIXEL_CLK_SRC               1
+

[...]

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c

Quoted 22 lines

new file mode 100644
index 0000000..fff2e8d

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +3 -0
@@ -0,0 +1,524 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights 

reserved.
+ */

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +12 -0
+
+#define pr_fmt(fmt)    "%s: " fmt, __func__
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/iopoll.h>
+#include <linux/kernel.h>
+
+#include "dp_hpd.h"
+#include "dp_pll.h"
+#include "dp_pll_10nm.h"
+

[...]

Quoted 6 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +6 -0
+
+static int dp_config_vco_rate_10nm(struct msm_dp_pll *pll,
+               unsigned long rate)
+{
+       u32 res = 0;
+       struct dp_pll_10nm *dp_res = to_dp_pll_10nm(pll);

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +10 -0
+
+       res = dp_vco_pll_init_db_10nm(pll, rate);
+       if (res) {
+               DRM_ERROR("VCO Init DB failed\n");
+               return res;
+       }
+
+       if (dp_res->lane_cnt != 4) {
+               if (dp_res->orientation == ORIENTATION_CC2)
+                       PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL,

0x6d);

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c

Quoted 2 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +2 -0
+               else
+                       PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL,
Quoted 8 lines

0x75);

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 125

Quoted 3 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +3 -0
+       } else {
+               PLL_REG_W(dp_res->phy_base, REG_DP_PHY_PD_CTL, 0x7d);
+       }

For example, this part here can be done through the phy configuration ops. A lane count check in the set rate clk op is quite odd!

Same here.

Quoted 16 lines
Quoted 5 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +5 -0
+
+long dp_vco_round_rate_10nm(struct clk_hw *hw, unsigned long rate,
+                       unsigned long *parent_rate)
+{
+       unsigned long rrate = rate;

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 517

Quoted 10 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +10 -0
+       struct msm_dp_pll *pll = to_msm_dp_pll(hw);
+
+       if (rate <= pll->min_rate)
+               rrate = pll->min_rate;
+       else if (rate <= DP_VCO_HSCLK_RATE_2700MHZDIV1000)
+               rrate = DP_VCO_HSCLK_RATE_2700MHZDIV1000;
+       else if (rate <= DP_VCO_HSCLK_RATE_5400MHZDIV1000)
+               rrate = DP_VCO_HSCLK_RATE_5400MHZDIV1000;
+       else
+               rrate = pll->max_rate;
Quoted 8 lines

This is basically link rate setting through the clk framework. Calling clk_set_rate() on the pixel clk is complicated and opaque. I'd expect to see the DP controller driver set the link rate on the phy with phy_configure(), and then that can change the rate that is seen downstream at the pixel clk. Does the pixel clk need to do anything with the rate? Probably not? I suspect it can just enable the pixel clk when it needs to and disable it when it doesn't need it.

Same here.

Quoted 8 lines

drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c line 521

Quoted 4 lines
drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c new file +4 -0
+
+       DRM_DEBUG_DP("%s: rrate=%ld\n", __func__, rrate);
+
+       *parent_rate = rrate;

_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

#15 lore raw

PATCH v5 5/5 drm/msm/dpu: add display port support in DPU

In reply to Tanmay Shah

From: Jeykumar Sankaran <[email protected]>

Add display port support in DPU by creating hooks for DP encoder enumeration and encoder mode initialization.

This change is based on the Snapdragon Display port driver changes[1].

changes in v2:
- rebase on [2] (Sean Paul)
- remove unwanted error checks and
switch cases (Jordan Crouse)

[1] https://lwn.net/Articles/768265/
[2] https://lkml.org/lkml/2018/11/17/87

changes in V3:
-- Moved this change as part of the DP driver changes. -- Addressed compilation issues on the latest code base.

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  8 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c     | 65 ++++++++++++++++++++++++-----
 2 files changed, 58 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +4 -4
index b063243..7c95f72 100644
@@ -2025,7 +2025,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 {
 	int ret = 0;
 	int i = 0;
-	enum dpu_intf_type intf_type;
+	enum dpu_intf_type intf_type = INTF_NONE;
 	struct dpu_enc_phys_init_params phys_params;
 
 	if (!dpu_enc) {
@@ -2047,9 +2047,9 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 	case DRM_MODE_ENCODER_DSI:
 		intf_type = INTF_DSI;
 		break;
-	default:
-		DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
-		return -EINVAL;
+	case DRM_MODE_ENCODER_TMDS:
+		intf_type = INTF_DP;
+		break;
 	}
 
 	WARN_ON(disp_info->num_of_h_tiles < 1);
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +54 -11

85 lines not on this page · raw message

Signature · 5 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on the v5 series
#16 lore raw
In reply to Tanmay Shah
Quoted 4 lines · Tanmay Shah

These patches add support for Display-Port driver on SnapDragon 845 hardware. It adds DP driver and DP PLL driver files along with the needed device-tree bindings.

I focused on patches 2, 3 & 5, seems like you have good feedback on the others by more qualified folks than me.

At a high level I don't have any major issues with the set. There are some rough edges that I noticed as I was reading it (as would any patch of this size), but I think it's probably not a good use of either of our time for me to nitpick 10k lines of code over multiple iterations.

So in the interest of not letting the perfect get in the way of the good, I suggest we apply the set and fix up as time and necessity allow.

Patches 2/3/5 are:

Sean

Quoted 116 lines

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +             | DISPLAY |+---+      |      |
     |             +-+-----+-+    |      |      |
     |               |     |      |      |      |
     |               |     |      |      |      |
     |               |     |      |      |      |
     v               v     v      v      v      v
 +------+          +---+ +----+ +----+ +---+ +-----+
 |  DP  |          |DP | | DP | | DP | |DP | | DP  |
 |PARSER|          |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+          +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+

These patches have dependency on clock driver changes mentioned below:
https://patchwork.kernel.org/patch/10632753/
https://patchwork.kernel.org/patch/10632757/

Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver

Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU

 .../devicetree/bindings/display/msm/dp-sc7180.yaml |  325 ++++
 .../devicetree/bindings/display/msm/dpu.txt        |   16 +-
 drivers/gpu/drm/i915/display/intel_display.c       |    2 +-
 drivers/gpu/drm/msm/Kconfig                        |   21 +
 drivers/gpu/drm/msm/Makefile                       |   16 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c        |   28 +-
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c   |    8 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c            |   65 +-
 drivers/gpu/drm/msm/dp/dp_aux.c                    |  531 ++++++
 drivers/gpu/drm/msm/dp/dp_aux.h                    |   35 +
 drivers/gpu/drm/msm/dp/dp_catalog.c                |  988 +++++++++++
 drivers/gpu/drm/msm/dp/dp_catalog.h                |   86 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c                   | 1707 ++++++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_ctrl.h                   |   35 +
 drivers/gpu/drm/msm/dp/dp_display.c                |  943 +++++++++++
 drivers/gpu/drm/msm/dp/dp_display.h                |   31 +
 drivers/gpu/drm/msm/dp/dp_drm.c                    |  170 ++
 drivers/gpu/drm/msm/dp/dp_drm.h                    |   19 +
 drivers/gpu/drm/msm/dp/dp_hpd.c                    |   69 +
 drivers/gpu/drm/msm/dp/dp_hpd.h                    |   79 +
 drivers/gpu/drm/msm/dp/dp_link.c                   | 1216 ++++++++++++++
 drivers/gpu/drm/msm/dp/dp_link.h                   |  132 ++
 drivers/gpu/drm/msm/dp/dp_panel.c                  |  490 ++++++
 drivers/gpu/drm/msm/dp/dp_panel.h                  |   95 ++
 drivers/gpu/drm/msm/dp/dp_parser.c                 |  473 ++++++
 drivers/gpu/drm/msm/dp/dp_parser.h                 |  220 +++
 drivers/gpu/drm/msm/dp/dp_power.c                  |  545 +++++++
 drivers/gpu/drm/msm/dp/dp_power.h                  |  115 ++
 drivers/gpu/drm/msm/dp/dp_reg.h                    |  489 ++++++
 drivers/gpu/drm/msm/dp/pll/dp_pll.c                |  127 ++
 drivers/gpu/drm/msm/dp/pll/dp_pll.h                |   57 +
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c           |  401 +++++
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h           |   86 +
 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c      |  524 ++++++
 drivers/gpu/drm/msm/msm_drv.c                      |    2 +
 drivers/gpu/drm/msm/msm_drv.h                      |   53 +-
 include/drm/drm_dp_helper.h                        |    2 +
 37 files changed, 10178 insertions(+), 23 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.c
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm.h
 create mode 100644 drivers/gpu/drm/msm/dp/pll/dp_pll_10nm_util.c

--
1.9.1