Skip to contentSkip to conversation

phy: cix: Add Sky1 DisplayPort PHY

PATCH Applied Luo Liu 3 participants 6 messages Nov 16 – Nov 20

Subsystems (3)
lore
Share & tools
lore

Luo Liu

author
#0 lore raw

v5 cover phy: cix: Add Sky1 DisplayPort PHY

Add the CIX Sky1 dedicated DisplayPort PHY: the binding, the driver, and the Sky1 devicetree node.

Changes in v5:

The binding and the devicetree node are unchanged. The driver changes address review comments:

- Drop .reset. phy_reset() pulses the block reset and does not rerun phy_init(), so the CDB and PMA programming stay cleared and a later configure or power-on can time out. phy_init() already pulses the reset before loading those registers. The DP controller pairs phy_init() and phy_exit().

- Rename is_edp to external_dp. The flag selects the higher swing table for an external connector. It is not Embedded DisplayPort.

- Call writel() directly. cix_dp_phy_write() only forwarded the write.

- Roll back a PLL enable that fails after the PLL reset is released. The original error is returned if the rollback itself fails.

- Drop the powered flag. A failed rate update left the PLL disabled while the flag stayed set. Every rate change now disables the PLL, programs the new dividers, and enables the PLL again.

Luo Liu (3):
dt-bindings: phy: Add CIX Sky1 DP PHY
phy: cix: Add Sky1 DP PHY driver
arm64: dts: cix: Add Sky1 DP PHY node

 .../bindings/phy/cix,sky1-dp-phy.yaml         |  67 ++
 MAINTAINERS                                   |   8 +
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts     |   4 +
 arch/arm64/boot/dts/cix/sky1.dtsi             |  10 +
 drivers/phy/Kconfig                           |   1 +
 drivers/phy/Makefile                          |   1 +
 drivers/phy/cix/Kconfig                       |  18 +
 drivers/phy/cix/Makefile                      |   2 +
 drivers/phy/cix/phy-cix-dp.c                  | 993 ++++++++++++++++++
 9 files changed, 1104 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/cix,sky1-dp-phy.yaml
 create mode 100644 drivers/phy/cix/Kconfig
 create mode 100644 drivers/phy/cix/Makefile
 create mode 100644 drivers/phy/cix/phy-cix-dp.c

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v5 1/3 dt-bindings: phy: Add CIX Sky1 DP PHY

Document the dedicated DisplayPort PHY on CIX Sky1, including the required APB clock shared with the DPTx controller, reset, and the optional cix,external-dp property to select the external DP swing table instead of the default low-voltage values.
Add a MAINTAINERS entry for the binding and driver.

---
Changes in v5:
- No changes.

 .../bindings/phy/cix,sky1-dp-phy.yaml         | 67 +++++++++++++++++++
 MAINTAINERS                                   |  8 +++
 2 files changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/phy/cix,sky1-dp-phy.yaml
Documentation/devicetree/bindings/phy/cix,sky1-dp-phy.yaml new file +67 -0
new file mode 100644
index 000000000000..ea19f0aa0b1c
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/cix,sky1-dp-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CIX Sky1 DisplayPort PHY
+
+maintainers:
+  - Luo Liu <[email protected]>
+
+description:
+  The CIX Sky1 DP PHY provides the PMA/CDB register interface for the
+  dedicated DisplayPort instance on CIX Sky1.
+
+  The PHY APB clock is physically shared with the DPTx controller.
+
+properties:
+  compatible:
+    const: cix,sky1-dp-phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: APB register interface clock
+
+  clock-names:
+    const: apb
+
+  resets:
+    maxItems: 1
+    description: PHY hardware reset
+
+  "#phy-cells":
+    const: 0
+
+  cix,external-dp:
+    type: boolean
+    description:
+      Use voltage swing values suitable for an external DisplayPort
+      connector instead of the default low-voltage values.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - resets
+  - "#phy-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/cix,sky1.h>
+    #include <dt-bindings/reset/cix,sky1-s5-system-control.h>
+
+    phy@1414c000 {
+        compatible = "cix,sky1-dp-phy";
+        reg = <0x1414c000 0x4000>;
+        clocks = <&scmi_clk CLK_TREE_DPC2_APBCLK>;
+        clock-names = "apb";
+        resets = <&s5_syscon SKY1_DP_PHY_RST_N>;
+        #phy-cells = <0>;
+    };
MAINTAINERS +8 -0
index 93abbb315065..d05771fe5bb2 100644
@@ -6522,6 +6522,14 @@ M:	Satish Kharat <[email protected]>
 S:	Supported
 F:	drivers/infiniband/hw/usnic/
 
+CIX SKY1 DISPLAYPORT PHY DRIVER
+M:	Luo Liu <[email protected]>
+R:	CIX Linux Kernel Upstream Group <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/phy/cix,sky1-dp-phy.yaml
+F:	drivers/phy/cix/
+
 CLANG CONTEXT ANALYSIS
 M:	Marco Elver <[email protected]>
 R:	Bart Van Assche <[email protected]>
Signature · 1 line
2.25.1
author
#2 lore raw

PATCH v5 2/3 phy: cix: Add Sky1 DP PHY driver

In reply to Luo Liu

Add a PHY driver for the CIX Sky1 dedicated DisplayPort PMA. Support link rate, lane count, SSC and voltage swing via the generic PHY DP ops. Enable the shared APB clock and toggle reset in phy_init, load PMA tables there, and enable the analog path in phy_power_on. A rate change disables the PLL, programs the new dividers, and enables the PLL again.

---
Changes in v5:
- Drop .reset. phy_init() already pulses the block reset, and phy_reset() does not rerun that setup.
- Rename is_edp to external_dp. It selects the external connector swing table, not Embedded DisplayPort.
- Call writel() instead of cix_dp_phy_write().
- Roll back a failed PLL enable and keep the original error.
- Drop the powered flag. Always disable the PLL, program the rate, and enable the PLL again.

 drivers/phy/Kconfig          |   1 +
 drivers/phy/Makefile         |   1 +
 drivers/phy/cix/Kconfig      |  18 +
 drivers/phy/cix/Makefile     |   2 +
 drivers/phy/cix/phy-cix-dp.c | 993 +++++++++++++++++++++++++++++++++++
 5 files changed, 1015 insertions(+)
 create mode 100644 drivers/phy/cix/Kconfig
 create mode 100644 drivers/phy/cix/Makefile
 create mode 100644 drivers/phy/cix/phy-cix-dp.c
drivers/phy/Kconfig +1 -0
index 105fbe408aa2..876e5857634c 100644
@@ -176,6 +176,7 @@ source "drivers/phy/axiado/Kconfig"
 source "drivers/phy/broadcom/Kconfig"
 source "drivers/phy/cadence/Kconfig"
 source "drivers/phy/canaan/Kconfig"
+source "drivers/phy/cix/Kconfig"
 source "drivers/phy/eswin/Kconfig"
 source "drivers/phy/freescale/Kconfig"
 source "drivers/phy/hisilicon/Kconfig"
drivers/phy/Makefile +1 -0
index c6dd02003bbe..5a31c5df1746 100644
@@ -28,6 +28,7 @@ obj-$(CONFIG_GENERIC_PHY)		+= allwinner/	\
 					   broadcom/	\
 					   cadence/	\
 					   canaan/	\
+					   cix/		\
 					   eswin/	\
 					   freescale/	\
 					   hisilicon/	\
drivers/phy/cix/Kconfig new file +18 -0
new file mode 100644
index 000000000000..fd3becae2b23
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Phy drivers for CIX PHYs
+#
+
+config PHY_CIX_DP
+	tristate "CIX Sky1 DP PHY driver"
+	depends on OF && HAS_IOMEM && COMMON_CLK
+	depends on ARCH_CIX || COMPILE_TEST
+	select GENERIC_PHY
+	help
+	  Say Y here to enable the dedicated DisplayPort PHY used by the CIX
+	  Sky1 DisplayPort controller. The PHY provides the physical layer
+	  used by the dedicated DisplayPort output and supports link rates
+	  up to HBR3.
+
+	  To compile this driver as a module, choose M here. The module will
+	  be called phy-cix-dp.
drivers/phy/cix/Makefile new file +2 -0
new file mode 100644
index 000000000000..cc56c7586ec5
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-$(CONFIG_PHY_CIX_DP) += phy-cix-dp.o
drivers/phy/cix/phy-cix-dp.c new file +993 -0

993 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#3 lore raw

PATCH v5 3/3 arm64: dts: cix: Add Sky1 DP PHY node

In reply to Luo Liu

Describe the Sky1 DP PHY in the SoC DTSI, including the DPC2 APB clock shared with the DisplayPort controller, so DisplayPort can consume it once the controller is enabled. Enable the PHY on the Radxa Orion O6 board.

---
Changes in v5:
- No changes.

 arch/arm64/boot/dts/cix/sky1-orion-o6.dts |  4 ++++
 arch/arm64/boot/dts/cix/sky1.dtsi         | 10 ++++++++++
 2 files changed, 14 insertions(+)
arch/arm64/boot/dts/cix/sky1-orion-o6.dts +4 -0
index e39c87774c12..b659c10f1f4d 100644
@@ -36,6 +36,10 @@ linux,cma {
 
 };
 
+&dp_phy {
+	status = "okay";
+};
+
 &fch_gpio0 {
 	status = "okay";
 };
arch/arm64/boot/dts/cix/sky1.dtsi +10 -0
index 0a820f45feb9..cbc14ac5b2b7 100644
@@ -762,6 +762,16 @@ ppi_partition1: interrupt-partition-1 {
 			};
 		};
 
+		dp_phy: phy@1414c000 {
+			compatible = "cix,sky1-dp-phy";
+			reg = <0x0 0x1414c000 0x0 0x4000>;
+			clocks = <&scmi_clk CLK_TREE_DPC2_APBCLK>;
+			clock-names = "apb";
+			resets = <&s5_syscon SKY1_DP_PHY_RST_N>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		s5_syscon: syscon@16000000 {
 			compatible = "cix,sky1-s5-system-control", "syscon";
 			reg = <0x0 0x16000000 0x0 0x1000>;
Signature · 1 line
2.25.1
maintainer Applied
#4 lore raw

Re: [PATCH v5 3/3] arm64: dts: cix: Add Sky1 DP PHY node

Quoted 9 lines · Luo Liu

Describe the Sky1 DP PHY in the SoC DTSI, including the DPC2 APB clock shared with the DisplayPort controller, so DisplayPort can consume it once the controller is enabled. Enable the PHY on the Radxa Orion O6 board.

---
Changes in v5:
- No changes.

Applied, thanks!

Best Regards
Gary

Quoted 44 lines
 arch/arm64/boot/dts/cix/sky1-orion-o6.dts |  4 ++++
 arch/arm64/boot/dts/cix/sky1.dtsi         | 10 ++++++++++
 2 files changed, 14 insertions(+)
arch/arm64/boot/dts/cix/sky1-orion-o6.dts +4 -0
index e39c87774c12..b659c10f1f4d 100644
@@ -36,6 +36,10 @@ linux,cma {
 
 };
 
+&dp_phy {
+	status = "okay";
+};
+
 &fch_gpio0 {
 	status = "okay";
 };
arch/arm64/boot/dts/cix/sky1.dtsi +10 -0
index 0a820f45feb9..cbc14ac5b2b7 100644
@@ -762,6 +762,16 @@ ppi_partition1: interrupt-partition-1 {
 			};
 		};
 
+		dp_phy: phy@1414c000 {
+			compatible = "cix,sky1-dp-phy";
+			reg = <0x0 0x1414c000 0x0 0x4000>;
+			clocks = <&scmi_clk CLK_TREE_DPC2_APBCLK>;
+			clock-names = "apb";
+			resets = <&s5_syscon SKY1_DP_PHY_RST_N>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
 		s5_syscon: syscon@16000000 {
 			compatible = "cix,sky1-s5-system-control", "syscon";
 			reg = <0x0 0x16000000 0x0 0x1000>;
Signature · 1 line
2.25.1
maintainer Applied
#5 lore raw

Re: (subset) [PATCH v5 0/3] phy: cix: Add Sky1 DisplayPort PHY

In reply to Luo Liu
Quoted 9 lines · Luo Liu

Add the CIX Sky1 dedicated DisplayPort PHY: the binding, the driver, and the Sky1 devicetree node.

Changes in v5:

The binding and the devicetree node are unchanged. The driver changes address review comments:

[...]

Applied, thanks!

[1/3] dt-bindings: phy: Add CIX Sky1 DP PHY

      commit: 804eb94ad72b4b896fde5c629f8f1b5f06301f96
[2/3] phy: cix: Add Sky1 DP PHY driver
      commit: 1ad6145fb8536810c25f8d9ee539a83b01296635

Best regards,

Signature · 1 line
~Vinod