Skip to contentSkip to conversation

Add support for RK3588 HDMI/eDP Combo PHY

PATCH Applied Cristian Ciocaltea 2 participants 4 messages Feb 14, 2024 – Feb 16, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover Add support for RK3588 HDMI/eDP Combo PHY

Add driver and bindings to add initial support the Rockchip HDMI/eDP TX Combo PHY found on RK3588 SoC.

The PHY is based on a Samsung IP block and supports HDMI 2.1 TMDS, FRL and eDP links.

Please note that currently only the TMDS related functionality has been implemented. This has been tested on Radxa ROCK 5B and Rockchip EVB1 boards.

Changes in v4:
- Used consistent naming by replacing hdptx_*/rockchip_* with rk_hdptx_* (Johan)
- Link to v3:
https://lore.kernel.org/r/[email protected]

Changes in v3:
- Collected R-b & T-b tags from Heiko
- Converted all *_REG() args to lowercase (Vinod)
- Dropped unnecessary register read/write wrappers (Vinod)
- Added rate overflow check in hdptx_phy_clk_pll_calc() (Luis)
- Link to v2:
https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rebased series onto next-20240129
- Removed patch 'dt-bindings: soc: rockchip: Add rk3588 hdptxphy syscon' already applied by Heiko
- For consistency with SoC TRM, replaced all references to DP with eDP
- Updated PHY schema per Krzysztof's review; also collected his R-b tag
- Dropped FRL, EARC and 10-bit color depth functionality until the HDMI configuration options become available in PHY API
- Squashed lots of regmap_write operations via regmap_multi_reg_write (Sebastian)
- Introduced parametrized {CMN|SB|LNTOP|LANE}_REG() macros to replace the long list of register defines
- Optimized handling of the config arrays by using ARRAY_SIZE() (Sascha)
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Cristian Ciocaltea (2):
dt-bindings: phy: Add Rockchip HDMI/eDP Combo PHY schema
phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver

 .../bindings/phy/rockchip,rk3588-hdptx-phy.yaml    |   91 ++
 drivers/phy/rockchip/Kconfig                       |    8 +
 drivers/phy/rockchip/Makefile                      |    1 +
 drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c  | 1028 ++++++++++++++++++++
 4 files changed, 1128 insertions(+)

---
base-commit: 596764183be8ebb13352b281a442a1f1151c9b06
change-id: 20240128-phy-hdptx-8a98ab60d18e

#1 lore raw

PATCH v4 1/2 dt-bindings: phy: Add Rockchip HDMI/eDP Combo PHY schema

Add dt-binding schema for the HDMI/eDP Transmitter Combo PHY found on Rockchip RK3588 SoC.

---
 .../bindings/phy/rockchip,rk3588-hdptx-phy.yaml    | 91 ++++++++++++++++++++++
 1 file changed, 91 insertions(+)
Documentation/devicetree/bindings/phy/rockchip,rk3588-hdptx-phy.yaml new file +91 -0
new file mode 100644
index 000000000000..54e822c715f3
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/phy/rockchip,rk3588-hdptx-phy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip SoC HDMI/eDP Transmitter Combo PHY
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - rockchip,rk3588-hdptx-phy
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Reference clock
+      - description: APB clock
+
+  clock-names:
+    items:
+      - const: ref
+      - const: apb
+
+  "#phy-cells":
+    const: 0
+
+  resets:
+    items:
+      - description: PHY reset line
+      - description: APB reset line
+      - description: INIT reset line
+      - description: CMN reset line
+      - description: LANE reset line
+      - description: ROPLL reset line
+      - description: LCPLL reset line
+
+  reset-names:
+    items:
+      - const: phy
+      - const: apb
+      - const: init
+      - const: cmn
+      - const: lane
+      - const: ropll
+      - const: lcpll
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Some PHY related data is accessed through GRF regs.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - "#phy-cells"
+  - resets
+  - reset-names
+  - rockchip,grf
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/rockchip,rk3588-cru.h>
+    #include <dt-bindings/reset/rockchip,rk3588-cru.h>
+
+    soc {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      phy@fed60000 {
+        compatible = "rockchip,rk3588-hdptx-phy";
+        reg = <0x0 0xfed60000 0x0 0x2000>;
+        clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>, <&cru PCLK_HDPTX0>;
+        clock-names = "ref", "apb";
+        #phy-cells = <0>;
+        resets = <&cru SRST_HDPTX0>, <&cru SRST_P_HDPTX0>,
+                 <&cru SRST_HDPTX0_INIT>, <&cru SRST_HDPTX0_CMN>,
+                 <&cru SRST_HDPTX0_LANE>, <&cru SRST_HDPTX0_ROPLL>,
+                 <&cru SRST_HDPTX0_LCPLL>;
+        reset-names = "phy", "apb", "init", "cmn", "lane", "ropll", "lcpll";
+        rockchip,grf = <&hdptxphy_grf>;
+      };
+    };
Signature · 1 line
2.43.0
#2 lore raw

PATCH v4 2/2 phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver

In reply to Cristian Ciocaltea

Add driver for the HDMI/eDP TX Combo PHY found on Rockchip RK3588 SoC.

The PHY is based on a Samsung IP block and supports HDMI 2.1 TMDS, FRL and eDP links. The maximum data rate is 12Gbps (FRL), while the minimum is 250Mbps (TMDS).

Only the TMDS link is currently supported.

---
 drivers/phy/rockchip/Kconfig                      |    8 +
 drivers/phy/rockchip/Makefile                     |    1 +
 drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c | 1028 +++++++++++++++++++++
 3 files changed, 1037 insertions(+)
drivers/phy/rockchip/Kconfig +8 -0
index 94360fc96a6f..a34f67bb7e61 100644
@@ -83,6 +83,14 @@ config PHY_ROCKCHIP_PCIE
 	help
 	  Enable this to support the Rockchip PCIe PHY.
 
+config PHY_ROCKCHIP_SAMSUNG_HDPTX
+	tristate "Rockchip Samsung HDMI/eDP Combo PHY driver"
+	depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
+	select GENERIC_PHY
+	help
+	  Enable this to support the Rockchip HDMI/eDP Combo PHY
+	  with Samsung IP block.
+
 config PHY_ROCKCHIP_SNPS_PCIE3
 	tristate "Rockchip Snps PCIe3 PHY Driver"
 	depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST
drivers/phy/rockchip/Makefile +1 -0
index 7eab129230d1..3d911304e654 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI)	+= phy-rockchip-inno-hdmi.o
 obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2)	+= phy-rockchip-inno-usb2.o
 obj-$(CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY)	+= phy-rockchip-naneng-combphy.o
 obj-$(CONFIG_PHY_ROCKCHIP_PCIE)		+= phy-rockchip-pcie.o
+obj-$(CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX)	+= phy-rockchip-samsung-hdptx.o
 obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3)	+= phy-rockchip-snps-pcie3.o
 obj-$(CONFIG_PHY_ROCKCHIP_TYPEC)	+= phy-rockchip-typec.o
 obj-$(CONFIG_PHY_ROCKCHIP_USB)		+= phy-rockchip-usb.o
drivers/phy/rockchip/phy-rockchip-samsung-hdptx.c new file +1028 -0

1,028 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer Applied
#3 lore raw
In reply to Cristian Ciocaltea
Quoted 11 lines · Cristian Ciocaltea

Add driver and bindings to add initial support the Rockchip HDMI/eDP TX Combo PHY found on RK3588 SoC.

The PHY is based on a Samsung IP block and supports HDMI 2.1 TMDS, FRL and eDP links.

Please note that currently only the TMDS related functionality has been implemented. This has been tested on Radxa ROCK 5B and Rockchip EVB1 boards.

[...]

Applied, thanks!

[1/2] dt-bindings: phy: Add Rockchip HDMI/eDP Combo PHY schema

      commit: 3312a0e8f64ec68db695224fcc7457e7292426eb
[2/2] phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver
      commit: 553be2830c5f33308483e8118de748a2c69fe593

Best regards,

Signature · 1 line
~Vinod