Add support for RK3588 HDMI/eDP Combo PHY
Subsystems (3)
v3 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 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
PATCH v3 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
@@ -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
PATCH v3 2/2 phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver
In reply to Cristian CiocalteaAdd 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
@@ -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
@@ -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
Re: [PATCH v3 2/2] phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver
Quoted 6 lines · 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).
Quoted 7 lines
Only the TMDS link is currently supported.
Co-developed-by Algea Cao <[email protected]>Signed-off-by Algea Cao <[email protected]>Tested-by Heiko Stuebner <[email protected]>Signed-off-by Cristian Ciocaltea <[email protected]>---
For Linux FTRACE filters it is needed that all functions in a driver start with the same function prefix. Currently there's a mix of hdtpx_* and rockchip_*
Maybe use rk_hdtpx_* ??? similar to for example rk_nfc_* in rockchip-nand-controller.c
Johan
Re: [PATCH v3 2/2] phy: rockchip: Add Samsung HDMI/eDP Combo PHY driver
Quoted 3 lines · Johan Jonker
Quoted 1 line · Cristian Ciocaltea
Add driver for the HDMI/eDP TX Combo PHY found on Rockchip RK3588 SoC.
[...]
Quoted 3 lines
For Linux FTRACE filters it is needed that all functions in a driver start with the same function prefix. Currently there's a mix of hdtpx_* and rockchip_*
Maybe use rk_hdtpx_* ??? similar to for example rk_nfc_* inrockchip-nand-controller.c
Done in v4:
https://lore.kernel.org/all/[email protected]/
Thanks,
Cristian