Add support for RK3588 DisplayPort Controller
Subsystems (7)
Andy Yan
maintainerv5 cover Add support for RK3588 DisplayPort Controller
From: Andy Yan <[email protected]>
There are two DW DPTX based DisplayPort Controller on rk3588 which are compliant with the DisplayPort Specification Version 1.4 with the following features:
* DisplayPort 1.4a
* Main Link: 1/2/4 lanes
* Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps
* AUX channel 1Mbps
* Single Stream Transport(SST)
* Multistream Transport (MST)
* Type-C support (alternate mode)
* HDCP 2.2, HDCP 1.3
* Supports up to 8/10 bits per color component
* Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0
* Pixel clock up to 594MHz
* I2S, SPDIF audio interface
The current version of this patch series only supports basic display outputs. I conducted tests with DP0 in 1080p and 4K@60 YCbCr4:2:0 modes; the ALT/Type-C mode was tested on Rock 5B, DP1 was tested on Rock 5 ITX by Stephen and Piotr. HDCP and audio features remain unimplemented.
For RK3588, it's only support SST, while in the upcoming RK3576, it can support MST output.
Changes in v5:
- Use drm_dp_read_sink_count_cap instead of the private implementation.
- Add MAINTAINERS entry.
- Link to v4: https://lore.kernel.org/linux-rockchip/[email protected]/
Changes in v4:
- Drop unnecessary header files
- Switch to devm_drm_bridge_alloc
- Drop unused function
- Add platform_set_drvdata
- Link to v3: https://lore.kernel.org/linux-rockchip/[email protected]/
Changes in v3:
- Rebase on drm-misc-next
- Switch to common helpers to power up/down dp link
- Only pass parameters to phy that should be set
- First introduced in this version.
- First introduced in this version.
- Add RA620 into bridge chain.
- Link to v2: https://lore.kernel.org/linux-rockchip/[email protected]/
Changes in v2:
- Link to V1: https://lore.kernel.org/linux-rockchip/[email protected]/
- Fix a character encoding issue
- Fix compile error when build as module
- Add phy init
- Only use one dw_dp_link_train_set
- inline dw_dp_phy_update_vs_emph
- Use dp_sdp
- Check return value of drm_modeset_lock
- Merge code in atomic_pre_enable/mode_fixup to atomic_check
- Return NULL if can't find a supported output format
- Fix max_link_rate from plat_data
- no include uapi path
- switch to drmm_encoder_init
- Sort in alphabetical order
Andy Yan (10):
dt-bindings: display: rockchip: Add schema for RK3588 DPTX Controller drm/bridge: synopsys: Add DW DPTX Controller support library drm/rockchip: Add RK3588 DPTX output support
MAINTAINERS: Add entry for DW DPTX Controller bridge
dt-bindings: display: simple-bridge: Add ra620 compatible drm/birdge: simple-bridge: Add support for radxa ra620
arm64: dts: rockchip: Add DP0 for rk3588
arm64: dts: rockchip: Add DP1 for rk3588
arm64: dts: rockchip: Enable DisplayPort for rk3588s Cool Pi 4B
arm64: dts: rockchip: Enable DP2HDMI for ROCK 5 ITX
.../display/bridge/simple-bridge.yaml | 1 + .../display/rockchip/rockchip,dw-dp.yaml | 150 ++ MAINTAINERS | 8 + arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 30 + .../arm64/boot/dts/rockchip/rk3588-extra.dtsi | 30 + .../boot/dts/rockchip/rk3588-rock-5-itx.dts | 59 + .../boot/dts/rockchip/rk3588s-coolpi-4b.dts | 37 + drivers/gpu/drm/bridge/simple-bridge.c | 5 + drivers/gpu/drm/bridge/synopsys/Kconfig | 7 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2044 +++++++++++++++++ drivers/gpu/drm/rockchip/Kconfig | 9 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/dw_dp-rockchip.c | 150 ++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + include/drm/bridge/dw_dp.h | 20 + 17 files changed, 2554 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/rockchip/rockchip,dw-dp.yaml create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-dp.c create mode 100644 drivers/gpu/drm/rockchip/dw_dp-rockchip.c create mode 100644 include/drm/bridge/dw_dp.h
Signature · 4 lines
2.43.0 base-commit: 6085a45a069d2aeab6bb3e5f3fdd32e259703106 branch: rk3588-dp-upstream-v5
Andy Yan
maintainerPATCH v5 1/10 dt-bindings: display: rockchip: Add schema for RK3588 DPTX Controller
From: Andy Yan <[email protected]>
The Rockchip RK3588 SoC integrates the Synopsys DesignWare DPTX controller. And this DPTX controller need share a USBDP PHY with the USB 3.0 OTG controller during operation.
---
(no changes since v2)
Changes in v2:
- Link to V1: https://lore.kernel.org/linux-rockchip/[email protected]/
- Fix a character encoding issue
.../display/rockchip/rockchip,dw-dp.yaml | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/rockchip/rockchip,dw-dp.yaml
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-dp.yaml new file +150 -0
@@ -0,0 +1,150 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/rockchip/rockchip,dw-dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip DW DisplayPort Transmitter + +maintainers: + - Andy Yan <[email protected]> + +description: | + The Rockchip RK3588 SoC integrates the Synopsys DesignWare DPTX controller + which is compliant with the DisplayPort Specification Version 1.4 with the + following features: + + * DisplayPort 1.4a + * Main Link: 1/2/4 lanes + * Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps + * AUX channel 1Mbps + * Single Stream Transport(SST) + * Multistream Transport (MST) + * Type-C support (alternate mode) + * HDCP 2.2, HDCP 1.3 + * Supports up to 8/10 bits per color component + * Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0 + * Pixel clock up to 594MHz + * I2S, SPDIF audio interface + +allOf: + - $ref: /schemas/sound/dai-common.yaml# + +properties: + compatible: + enum: + - rockchip,rk3588-dp + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Peripheral/APB bus clock + - description: DisplayPort AUX clock + - description: HDCP clock + - description: I2S interface clock + - description: SPDIF interfce clock + + clock-names: + items: + - const: apb + - const: aux + - const: hdcp + - const: i2s + - const: spdif + + phys: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Video port for RGB/YUV input. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Video port for DP output. + + required: + - port@0 + - port@1 + + power-domains: + maxItems: 1 + + resets: + maxItems: 1 + + "#sound-dai-cells": + const: 0 + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - phys + - ports + - resets + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/rockchip,rk3588-cru.h> + #include <dt-bindings/phy/phy.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/power/rk3588-power.h> + #include <dt-bindings/reset/rockchip,rk3588-cru.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + dp@fde50000 { + compatible = "rockchip,rk3588-dp"; + reg = <0x0 0xfde50000 0x0 0x4000>; + interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&cru PCLK_DP0>, <&cru CLK_AUX16M_0>, + <&cru CLK_DP0>, <&cru MCLK_I2S4_8CH_TX>, + <&cru MCLK_SPDIF2_DP0>; + clock-names = "apb", "aux", "hdcp", "i2s", "spdif"; + assigned-clocks = <&cru CLK_AUX16M_0>; + assigned-clock-rates = <16000000>; + resets = <&cru SRST_DP0>; + phys = <&usbdp_phy0 PHY_TYPE_DP>; + power-domains = <&power RK3588_PD_VO0>; + #sound-dai-cells = <0>; + + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + dp0_in_vp2: endpoint { + remote-endpoint = <&vp2_out_dp0>; + }; + }; + + port@1 { + reg = <1>; + + dp0_out_con0: endpoint { + remote-endpoint = <&dp_con0_in>; + }; + }; + }; + }; + };
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 2/10 drm/bridge: synopsys: Add DW DPTX Controller support library
In reply to Andy YanFrom: Andy Yan <[email protected]>
The DW DP TX Controller is compliant with the DisplayPort Specification Version 1.4 with the following features:
* DisplayPort 1.4a
* Main Link: 1/2/4 lanes
* Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps
* AUX channel 1Mbps
* Single Stream Transport(SST)
* Multistream Transport (MST)
* Type-C support (alternate mode)
* HDCP 2.2, HDCP 1.3
* Supports up to 8/10 bits per color component
* Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0
* Pixel clock up to 594MHz
* I2S, SPDIF audio interface
Add library with common helpers to make it can be shared with other SoC.
---
Changes in v5:
- Use drm_dp_read_sink_count_cap instead of the private implementation.
Changes in v4:
- Drop unnecessary header files
- Switch to devm_drm_bridge_alloc
Changes in v3:
- Rebase on drm-misc-next
- Switch to common helpers to power up/down dp link
- Only pass parameters to phy that should be set
Changes in v2:
- Fix compile error when build as module
- Add phy init
- Only use one dw_dp_link_train_set
- inline dw_dp_phy_update_vs_emph
- Use dp_sdp
- Check return value of drm_modeset_lock
- Merge code in atomic_pre_enable/mode_fixup to atomic_check
- Return NULL if can't find a supported output format
- Fix max_link_rate from plat_data
drivers/gpu/drm/bridge/synopsys/Kconfig | 7 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2044 ++++++++++++++++++++++ include/drm/bridge/dw_dp.h | 20 + 4 files changed, 2072 insertions(+) create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-dp.c create mode 100644 include/drm/bridge/dw_dp.h
drivers/gpu/drm/bridge/synopsys/Kconfig +7 -0
@@ -1,4 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only +config DRM_DW_DP + tristate + select DRM_DISPLAY_HELPER + select DRM_DISPLAY_DP_HELPER + select DRM_KMS_HELPER + select REGMAP_MMIO + config DRM_DW_HDMI tristate select DRM_DISPLAY_HDMI_HELPER
drivers/gpu/drm/bridge/synopsys/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +obj-$(CONFIG_DRM_DW_DP) += dw-dp.o obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw-hdmi-ahb-audio.o obj-$(CONFIG_DRM_DW_HDMI_GP_AUDIO) += dw-hdmi-gp-audio.o
drivers/gpu/drm/bridge/synopsys/dw-dp.c new file +2044 -0
2,044 lines not on this page · raw message
include/drm/bridge/dw_dp.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* +* Copyright (c) 2025 Rockchip Electronics Co., Ltd. +*/ + +#ifndef __DW_DP__ +#define __DW_DP__ + +#include <linux/device.h> + +struct drm_encoder ; +struct dw_dp ; + +struct dw_dp_plat_data { +u32 max_link_rate; +}; + +struct dw_dp *dw_dp_bind (struct device *dev,struct drm_encoder *encoder, +const struct dw_dp_plat_data *plat_data); +#endif /* __DW_DP__ */
Signature · 1 line
2.43.0
Re: [PATCH v5 02/10] drm/bridge: synopsys: Add DW DPTX Controller support library
Quoted 77 lines · Andy Yan
From: Andy Yan <[email protected]>
The DW DP TX Controller is compliant with the DisplayPort Specification Version 1.4 with the following features:
* DisplayPort 1.4a
* Main Link: 1/2/4 lanes
* Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps
* AUX channel 1Mbps
* Single Stream Transport(SST)
* Multistream Transport (MST)
* Type-C support (alternate mode)
* HDCP 2.2, HDCP 1.3
* Supports up to 8/10 bits per color component
* Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0
* Pixel clock up to 594MHz
* I2S, SPDIF audio interfaceAdd library with common helpers to make it can be shared with other SoC.
Signed-off-by Andy Yan <[email protected]>---
Changes in v5:
- Usedrm_dp_read_sink_count_capinstead of the private implementation.Changes in v4:
- Drop unnecessary header files
- Switch todevm_drm_bridge_allocChanges in v3:
- Rebase on drm-misc-next
- Switch to common helpers to power up/down dp link
- Only pass parameters to phy that should be setChanges in v2:
- Fix compile error when build as module
- Add phy init
- Only use onedw_dp_link_train_set
- inlinedw_dp_phy_update_vs_emph
- Usedp_sdp
- Check return value ofdrm_modeset_lock
- Merge code in atomic_pre_enable/mode_fixup toatomic_check
- Return NULL if can't find a supported output format
- Fixmax_link_ratefromplat_datadrivers/gpu/drm/bridge/synopsys/Kconfig | 7 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2044 ++++++++++++++++++++++ include/drm/bridge/dw_dp.h | 20 + 4 files changed, 2072 insertions(+) create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-dp.c create mode 100644 include/drm/bridge/dw_dp.hdrivers/gpu/drm/bridge/synopsys/dw-dp.c new file +22
-0+ +static int dw_dp_link_parse (struct dw_dp *dp,struct drm_connector *connector) +{ +struct dw_dp_link *link = &dp->link; +u8 dpcd; +int ret; + +dw_dp_link_reset (link); + + ret =drm_dp_read_dpcd_caps (&dp->aux, link->dpcd); +if (ret <0 ) +return ret; + +drm_dp_read_desc (&dp->aux, &link->desc,drm_dp_is_branch (link->dpcd)); + +if (drm_dp_read_sink_count_cap (connector, link->dpcd, &link->desc)) { + ret =drm_dp_read_sink_count (&dp->aux); +if (ret <0 ) +return ret; + + link->sink_count = ret; +
drivers/gpu/drm/bridge/synopsys/dw-dp.c line 521
Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-dp.c new file +10
-0+/* Dongle connected, but no display */ +if (!link->sink_count) +return -ENODEV ; + } + + ret =drm_dp_dpcd_readb (&dp->aux,DP_DPRX_FEATURE_ENUMERATION_LIST , &dpcd); +if (ret <0 ) +return ret; + + link->vsc_sdp_supported = !!(dpcd &DP_VSC_SDP_EXT_FOR_COLORIMETRY_SUPPORTED );
drm_dp_vsc_sdp_supported()
Quoted 18 lines
drivers/gpu/drm/bridge/synopsys/dw-dp.c new file +18
-0+ + link->revision = link->dpcd[DP_DPCD_REV ]; + link->rate =min_t (u32,min (dp->plat_data.max_link_rate, + dp->phy->attrs.max_link_rate *100 ), +drm_dp_max_link_rate (link->dpcd)); + link->lanes =min_t (u8,phy_get_bus_width (dp->phy), +drm_dp_max_lane_count (link->dpcd)); + + link->caps.enhanced_framing =drm_dp_enhanced_frame_cap (link->dpcd); + link->caps.tps3_supported =drm_dp_tps3_supported (link->dpcd); + link->caps.tps4_supported =drm_dp_tps4_supported (link->dpcd); + link->caps.fast_training =drm_dp_fast_training_cap (link->dpcd); + link->caps.channel_coding =drm_dp_channel_coding_supported (link->dpcd); + link->caps.ssc = !!(link->dpcd[DP_MAX_DOWNSPREAD ] &DP_MAX_DOWNSPREAD_0_5 ); + +return 0 ; +} +
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v5 02/10] drm/bridge: synopsys: Add DW DPTX Controller support library
In reply to Andy YanQuoted 75 lines · Andy Yan
From: Andy Yan <[email protected]>
The DW DP TX Controller is compliant with the DisplayPort Specification Version 1.4 with the following features:
* DisplayPort 1.4a
* Main Link: 1/2/4 lanes
* Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps
* AUX channel 1Mbps
* Single Stream Transport(SST)
* Multistream Transport (MST)
* Type-C support (alternate mode)
* HDCP 2.2, HDCP 1.3
* Supports up to 8/10 bits per color component
* Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0
* Pixel clock up to 594MHz
* I2S, SPDIF audio interfaceAdd library with common helpers to make it can be shared with other SoC.
Signed-off-by Andy Yan <[email protected]>---
Changes in v5:
- Usedrm_dp_read_sink_count_capinstead of the private implementation.Changes in v4:
- Drop unnecessary header files
- Switch todevm_drm_bridge_allocChanges in v3:
- Rebase on drm-misc-next
- Switch to common helpers to power up/down dp link
- Only pass parameters to phy that should be setChanges in v2:
- Fix compile error when build as module
- Add phy init
- Only use onedw_dp_link_train_set
- inlinedw_dp_phy_update_vs_emph
- Usedp_sdp
- Check return value ofdrm_modeset_lock
- Merge code in atomic_pre_enable/mode_fixup toatomic_check
- Return NULL if can't find a supported output format
- Fixmax_link_ratefromplat_datadrivers/gpu/drm/bridge/synopsys/Kconfig | 7 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2044 ++++++++++++++++++++++ include/drm/bridge/dw_dp.h | 20 + 4 files changed, 2072 insertions(+) create mode 100644 drivers/gpu/drm/bridge/synopsys/dw-dp.c create mode 100644 include/drm/bridge/dw_dp.hdrivers/gpu/drm/bridge/synopsys/dw-dp.c new file +18
-0+ +/* +* Limits for the video timing for DP: +* 1. the hfp should be 2 pixels aligned; +* 2. the minimum hsync should be 9 pixel; +* 3. the minimum hbp should be 16 pixel; +*/ +static int dw_dp_bridge_atomic_check (struct drm_bridge *bridge, +struct drm_bridge_state *bridge_state, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state) +{ +struct dw_dp *dp =bridge_to_dp (bridge); +struct dw_dp_video *video = &dp->video; +struct drm_display_mode *m = &video->mode; +struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; +const struct dw_dp_output_format *fmt; +int min_hbp =16 ;
drivers/gpu/drm/bridge/synopsys/dw-dp.c line 1517
Quoted 10 lines
drivers/gpu/drm/bridge/synopsys/dw-dp.c new file +10
-0+int min_hsync =9 ; + + fmt =dw_dp_get_output_format (bridge_state->output_bus_cfg.format); +if (!fmt) +return -EINVAL ; + + video->video_mapping = fmt->video_mapping; + video->color_format = fmt->color_format; + video->bpc = fmt->bpc; + video->bpp = fmt->bpp;
This unfortunately is a bad part. You are updating your bridge structure from the atomic_check() callback. There is no guarantee that this state will be applied immediately. In fact there is no guarantee that this state needs to be applied at all (the state can be verified w/o comitting). So, these parts of dw_dp_video should be converted into a structure containing drm_bridge_state. You will have to update state allocation accordingly. Then you are safe to touch and change those fields in .atomic_check() and use them in other atomic_*() callbacks.
Quoted 19 lines
drivers/gpu/drm/bridge/synopsys/dw-dp.c new file +19
-0+ +if ((adjusted_mode->hsync_start - adjusted_mode->hdisplay) &0x1 ) { + adjusted_mode->hsync_start +=1 ; +dev_warn (dp->dev,"hfp is not 2 pixeel aligned, fixup to aligned hfp\n" ); + } +if (adjusted_mode->hsync_end - adjusted_mode->hsync_start < min_hsync) { + adjusted_mode->hsync_end = adjusted_mode->hsync_start + min_hsync; +dev_warn (dp->dev,"hsync is too narrow, fixup to min hsync:%d\n" , min_hsync); + } +if (adjusted_mode->htotal - adjusted_mode->hsync_end < min_hbp) { + adjusted_mode->htotal = adjusted_mode->hsync_end + min_hbp; +dev_warn (dp->dev,"hbp is too narrow, fixup to min hbp:%d\n" , min_hbp); + } + +drm_mode_copy (m, adjusted_mode); + +return 0 ; +} +
Signature · 2 lines
With best wishes Dmitry
Andy Yan
maintainerPATCH v5 3/10 drm/rockchip: Add RK3588 DPTX output support
In reply to Andy YanFrom: Andy Yan <[email protected]>
Add driver extension for Synopsys DesignWare DPTX IP used on Rockchip RK3588 SoC.
---
(no changes since v4)
Changes in v4:
- Drop unused function
- Add platform_set_drvdata
Changes in v2:
- no include uapi path
- switch to drmm_encoder_init
drivers/gpu/drm/rockchip/Kconfig | 9 ++ drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/dw_dp-rockchip.c | 150 ++++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + 5 files changed, 162 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/dw_dp-rockchip.c
drivers/gpu/drm/rockchip/Kconfig +9 -0
@@ -10,6 +10,7 @@ config DRM_ROCKCHIP select VIDEOMODE_HELPERS select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP select DRM_DISPLAY_DP_AUX_BUS if ROCKCHIP_ANALOGIX_DP + select DRM_DW_DP if ROCKCHIP_DW_DP select DRM_DW_HDMI if ROCKCHIP_DW_HDMI select DRM_DW_HDMI_QP if ROCKCHIP_DW_HDMI_QP select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
@@ -60,6 +61,14 @@ config ROCKCHIP_CDN_DP RK3399 based SoC, you should select this option. +config ROCKCHIP_DW_DP + bool "Rockchip specific extensions for Synopsys DW DP" + help + This selects support for Rockchip SoC specific extensions + to enable Synopsys DesignWare Cores based DisplayPort transmit + controller support on Rockchip SoC, If you want to enable DP on + rk3588 based SoC, you should select this option. + config ROCKCHIP_DW_HDMI bool "Rockchip specific extensions for Synopsys DW HDMI" help
drivers/gpu/drm/rockchip/Makefile +1 -0
@@ -14,6 +14,7 @@ rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI) += dw_hdmi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI_QP) += dw_hdmi_qp-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI2) += dw-mipi-dsi2-rockchip.o +rockchipdrm-$(CONFIG_ROCKCHIP_DW_DP) += dw_dp-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o rockchipdrm-$(CONFIG_ROCKCHIP_RGB) += rockchip_rgb.o
drivers/gpu/drm/rockchip/dw_dp-rockchip.c new file +150 -0
150 lines not on this page · raw message
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +1 -0
@@ -531,6 +531,7 @@ static int __init rockchip_drm_init(void)ADD_ROCKCHIP_SUB_DRIVER (rockchip_dp_driver,CONFIG_ROCKCHIP_ANALOGIX_DP );ADD_ROCKCHIP_SUB_DRIVER (cdn_dp_driver,CONFIG_ROCKCHIP_CDN_DP ); +ADD_ROCKCHIP_SUB_DRIVER (dw_dp_driver,CONFIG_ROCKCHIP_DW_DP );ADD_ROCKCHIP_SUB_DRIVER (dw_hdmi_rockchip_pltfm_driver,CONFIG_ROCKCHIP_DW_HDMI ); ADD_ROCKCHIP_SUB_DRIVER(dw_hdmi_qp_rockchip_pltfm_driver,
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +1 -0
@@ -87,6 +87,7 @@ int rockchip_drm_encoder_set_crtc_endpoint_id(struct rockchip_encoder *rencoder, struct device_node *np, int port, int reg);int rockchip_drm_endpoint_is_subdriver (struct device_node *ep);extern struct platform_driver cdn_dp_driver; +extern struct platform_driver dw_dp_driver;extern struct platform_driver dw_hdmi_rockchip_pltfm_driver;extern struct platform_driver dw_hdmi_qp_rockchip_pltfm_driver;extern struct platform_driver dw_mipi_dsi_rockchip_driver;
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 4/10 MAINTAINERS: Add entry for DW DPTX Controller bridge
In reply to Andy YanFrom: Andy Yan <[email protected]>
Add an entry for the DW DPTX Controller bridge driver.
---
Changes in v5:
- First included in this version.
MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -7880,6 +7880,14 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/synaptics,r63353.yaml F: drivers/gpu/drm/panel/panel-synaptics-r63353.c +DRM DRIVER FOR SYNOPSYS DESIGNWARE DISPLAYPORT BRIDGE +M: Andy Yan <[email protected]> +S: Maintained +T: git https://gitlab.freedesktop.org/drm/misc/kernel.git +F: Documentation/devicetree/bindings/display/rockchip/rockchip,dw-dp.yaml +F: drivers/gpu/drm/bridge/synopsys/dw-dp.c +F: include/drm/bridge/dw_dp.h + DRM DRIVER FOR TI DLPC3433 MIPI DSI TO DMD BRIDGE M: Jagan Teki <[email protected]> S: Maintained
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 5/10 dt-bindings: display: simple-bridge: Add ra620 compatible
In reply to Andy YanFrom: Andy Yan <[email protected]>
RA620 is a DP to HDMI bridge converter from RADXA, which first found be used on ROCK 5 ITX.
This chip can be used without involving software.
---
(no changes since v3)
Changes in v3:
- First introduced in this version.
.../devicetree/bindings/display/bridge/simple-bridge.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/bridge/simple-bridge.yaml +1 -0
@@ -28,6 +28,7 @@ properties: - enum: - adi,adv7123 - dumb-vga-dac + - radxa,ra620 - ti,opa362 - ti,ths8134 - ti,ths8135
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 6/10 drm/birdge: simple-bridge: Add support for radxa ra620
In reply to Andy YanFrom: Andy Yan <[email protected]>
The RA620 is an active DP to HDMI converter chip, basically no software is involved to drive it.
Add it to simple bridge to make it can be find by the drm bridge chain.
---
(no changes since v3)
Changes in v3:
- First introduced in this version.
drivers/gpu/drm/bridge/simple-bridge.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/bridge/simple-bridge.c +5 -0
@@ -261,6 +261,11 @@ static const struct of_device_id simple_bridge_match[] = { .timings = &default_bridge_timings, .connector_type = DRM_MODE_CONNECTOR_VGA, }, + }, { + .compatible = "radxa,ra620", + .data = &(const struct simple_bridge_info) { + .connector_type = DRM_MODE_CONNECTOR_HDMIA, + }, }, { .compatible = "ti,opa362", .data = &(const struct simple_bridge_info) {
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 7/10 arm64: dts: rockchip: Add DP0 for rk3588
In reply to Andy YanFrom: Andy Yan <[email protected]>
The DP0 is compliant with the DisplayPort Specification Version 1.4, and share the USBDP combo PHY0 with USB 3.1 HOST0 controller.
---
(no changes since v1)
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +30 -0
@@ -1536,6 +1536,36 @@ dsi1_out: port@1 { }; }; + dp0: dp@fde50000 { + compatible = "rockchip,rk3588-dp"; + reg = <0x0 0xfde50000 0x0 0x4000>; + interrupts = <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&cru PCLK_DP0>, <&cru CLK_AUX16M_0>, + <&cru CLK_DP0>, <&cru MCLK_I2S4_8CH_TX>, + <&cru MCLK_SPDIF2_DP0>; + clock-names = "apb", "aux", "hdcp", "i2s", "spdif"; + assigned-clocks = <&cru CLK_AUX16M_0>; + assigned-clock-rates = <16000000>; + resets = <&cru SRST_DP0>; + phys = <&usbdp_phy0 PHY_TYPE_DP>; + power-domains = <&power RK3588_PD_VO0>; + #sound-dai-cells = <0>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dp0_in: port@0 { + reg = <0>; + }; + + dp0_out: port@1 { + reg = <1>; + }; + }; + }; + hdmi0: hdmi@fde80000 { compatible = "rockchip,rk3588-dw-hdmi-qp"; reg = <0x0 0xfde80000 0x0 0x20000>;
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 8/10 arm64: dts: rockchip: Add DP1 for rk3588
In reply to Andy YanFrom: Andy Yan <[email protected]>
The DP1 is compliant with the DisplayPort Specification Version 1.4, and share the USBDP combo PHY1 with USB 3.1 HOST1 controller.
---
(no changes since v1)
.../arm64/boot/dts/rockchip/rk3588-extra.dtsi | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi +30 -0
@@ -210,6 +210,36 @@ i2s10_8ch: i2s@fde00000 { status = "disabled"; }; + dp1: dp@fde60000 { + compatible = "rockchip,rk3588-dp"; + reg = <0x0 0xfde60000 0x0 0x4000>; + interrupts = <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&cru PCLK_DP1>, <&cru CLK_AUX16M_1>, + <&cru CLK_DP1>, <&cru MCLK_I2S8_8CH_TX>, + <&cru MCLK_SPDIF5_DP1>; + clock-names = "apb", "aux", "hdcp", "i2s", "spdif"; + assigned-clocks = <&cru CLK_AUX16M_1>; + assigned-clock-rates = <16000000>; + resets = <&cru SRST_DP1>; + phys = <&usbdp_phy1 PHY_TYPE_DP>; + power-domains = <&power RK3588_PD_VO0>; + #sound-dai-cells = <0>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + dp1_in: port@0 { + reg = <0>; + }; + + dp1_out: port@1 { + reg = <1>; + }; + }; + }; + hdmi1: hdmi@fdea0000 { compatible = "rockchip,rk3588-dw-hdmi-qp"; reg = <0x0 0xfdea0000 0x0 0x20000>;
Signature · 1 line
2.43.0
Andy Yan
maintainerPATCH v5 9/10 arm64: dts: rockchip: Enable DisplayPort for rk3588s Cool Pi 4B
In reply to Andy YanFrom: Andy Yan <[email protected]>
Enable the Mini DisplayPort on this board.
Note that ROCKCHIP_VOP2_EP_DP0 is defined as 10 in dt-binding header, but it will trigger a dtc warning like "graph node unit address error, expected "a"" if we use it directly after endpoint, so we use "a" instead here.
---
(no changes since v2)
Changes in v2:
- Sort in alphabetical order
.../boot/dts/rockchip/rk3588s-coolpi-4b.dts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s-coolpi-4b.dts +37 -0
@@ -39,6 +39,18 @@ chosen { stdout-path = "serial2:1500000n8"; }; + dp-con { + compatible = "dp-connector"; + label = "DP OUT"; + type = "mini"; + + port { + dp_con_in: endpoint { + remote-endpoint = <&dp0_out_con>; + }; + }; + }; + hdmi-con { compatible = "hdmi-connector"; type = "d";
@@ -215,6 +227,24 @@ &cpu_b2 { cpu-supply = <&vdd_cpu_big1_s0>; }; +&dp0 { + status = "okay"; + pinctrl-0 = <&dp0m0_pins>; + pinctrl-names = "default"; +}; + +&dp0_in { + dp0_in_vp2: endpoint { + remote-endpoint = <&vp2_out_dp0>; + }; +}; + +&dp0_out { + dp0_out_con: endpoint { + remote-endpoint = <&dp_con_in>; + }; +}; + &gpu { mali-supply = <&vdd_gpu_s0>; status = "okay";
@@ -889,3 +919,10 @@ vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { remote-endpoint = <&hdmi0_in_vp0>; }; }; + +&vp2 { + vp2_out_dp0: endpoint@a { + reg = <ROCKCHIP_VOP2_EP_DP0>; + remote-endpoint = <&dp0_in_vp2>; + }; +};
Signature · 1 line
2.43.0
Re: [PATCH v5 09/10] arm64: dts: rockchip: Enable DisplayPort for rk3588s Cool Pi 4B
Quoted 12 lines · Andy Yan
From: Andy Yan <[email protected]>
Enable the Mini DisplayPort on this board.
Note thatROCKCHIP_VOP2_EP_DP0is defined as 10 in dt-binding header, but it will trigger a dtc warning like "graph node unit address error, expected "a"" if we use it directly after endpoint, so we use "a" instead here.Signed-off-by Andy Yan <[email protected]>---
Quoted 8 lines
(no changes since v2)
Changes in v2:
- Sort in alphabetical order.../boot/dts/rockchip/rk3588s-coolpi-4b.dts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+)
Signature · 2 lines
With best wishes Dmitry
Andy Yan
maintainerPATCH v5 10/10 arm64: dts: rockchip: Enable DP2HDMI for ROCK 5 ITX
In reply to Andy YanFrom: Andy Yan <[email protected]>
The HDMI0(Port next to Headphone Jack) is drived by DP1 on rk3588 via RA620(a dp2hdmi converter).
Add related dt nodes to enable it.
Note: ROCKCHIP_VOP2_EP_DP1 is defined as 11 in dt-binding header, but it will trigger a dtc warning like "graph node unit address error, expected "b"" if we use it directly after endpoint, so we use "b" instead here.
---
(no changes since v3)
Changes in v3:
- Add RA620 into bridge chain.
.../boot/dts/rockchip/rk3588-rock-5-itx.dts | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts +59 -0
@@ -57,6 +57,29 @@ analog-sound { "Headphone", "Headphones"; }; + bridge { + compatible = "radxa,ra620"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + hdmi_bridge_in: endpoint { + remote-endpoint = <&dp1_out_con>; + }; + }; + + port@1 { + reg = <1>; + + hdmi_bridge_out: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; + }; + }; + }; + gpio-leds { compatible = "gpio-leds"; pinctrl-names = "default";
@@ -73,6 +96,17 @@ hdd-led2 { }; }; + hdmi0-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_bridge_out>; + }; + }; + }; + hdmi1-con { compatible = "hdmi-connector"; type = "a";
@@ -268,6 +302,24 @@ &cpu_l3 { cpu-supply = <&vdd_cpu_lit_s0>; }; +&dp1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&dp1m0_pins>; +}; + +&dp1_in { + dp1_in_vp2: endpoint { + remote-endpoint = <&vp2_out_dp1>; + }; +}; + +&dp1_out { + dp1_out_con: endpoint { + remote-endpoint = <&hdmi_bridge_in>; + }; +}; + &gpu { mali-supply = <&vdd_gpu_s0>; status = "okay";
@@ -1261,3 +1313,10 @@ vp1_out_hdmi1: endpoint@ROCKCHIP_VOP2_EP_HDMI1 { remote-endpoint = <&hdmi1_in_vp1>; }; }; + +&vp2 { + vp2_out_dp1: endpoint@b { + reg = <ROCKCHIP_VOP2_EP_DP1>; + remote-endpoint = <&dp1_in_vp2>; + }; +};
Signature · 1 line
2.43.0
Re: [PATCH v5 10/10] arm64: dts: rockchip: Enable DP2HDMI for ROCK 5 ITX
Quoted 12 lines · Andy Yan
From: Andy Yan <[email protected]>
The HDMI0(Port next to Headphone Jack) is drived by DP1 on rk3588 via RA620(a dp2hdmi converter).
Add related dt nodes to enable it.
Note:
ROCKCHIP_VOP2_EP_DP1is defined as 11 in dt-binding header, but it will trigger a dtc warning like "graph node unit address error, expected "b"" if we use it directly after endpoint, so we use "b" instead here.
Quoted 6 lines
Signed-off-by Andy Yan <[email protected]>---
(no changes since v3)
Signature · 2 lines
With best wishes Dmitry
Andy Yan
maintainerHello Dmitry,
Could you please continue to review this patch series at your convenience? Thank you!
Quoted 105 lines · Andy Yan
From: Andy Yan <[email protected]>
There are two DW DPTX based DisplayPort Controller on rk3588 which are compliant with the DisplayPort Specification Version 1.4 with the following features:
* DisplayPort 1.4a
* Main Link: 1/2/4 lanes
* Main Link Support 1.62Gbps, 2.7Gbps, 5.4Gbps and 8.1Gbps
* AUX channel 1Mbps
* Single Stream Transport(SST)
* Multistream Transport (MST)
* Type-C support (alternate mode)
* HDCP 2.2, HDCP 1.3
* Supports up to 8/10 bits per color component
* Supports RBG, YCbCr4:4:4, YCbCr4:2:2, YCbCr4:2:0
* Pixel clock up to 594MHz
* I2S, SPDIF audio interfaceThe current version of this patch series only supports basic display outputs. I conducted tests with DP0 in 1080p and 4K@60 YCbCr4:2:0 modes; the ALT/Type-C mode was tested on Rock 5B, DP1 was tested on Rock 5 ITX by Stephen and Piotr. HDCP and audio features remain unimplemented.
For RK3588, it's only support SST, while in the upcoming RK3576, it can support MST output.Changes in v5:
- Usedrm_dp_read_sink_count_capinstead of the private implementation.
- AddMAINTAINERSentry.
- Link to v4: https://lore.kernel.org/linux-rockchip/[email protected]/Changes in v4:
- Drop unnecessary header files
- Switch todevm_drm_bridge_alloc
- Drop unused function
- Addplatform_set_drvdata
- Link to v3: https://lore.kernel.org/linux-rockchip/[email protected]/Changes in v3:
- Rebase on drm-misc-next
- Switch to common helpers to power up/down dp link
- Only pass parameters to phy that should be set
- First introduced in this version.
- First introduced in this version.
- Add RA620 into bridge chain.
- Link to v2: https://lore.kernel.org/linux-rockchip/[email protected]/Changes in v2:
- Link to V1: https://lore.kernel.org/linux-rockchip/[email protected]/
- Fix a character encoding issue
- Fix compile error when build as module
- Add phy init
- Only use onedw_dp_link_train_set
- inlinedw_dp_phy_update_vs_emph
- Usedp_sdp
- Check return value ofdrm_modeset_lock
- Merge code in atomic_pre_enable/mode_fixup toatomic_check
- Return NULL if can't find a supported output format
- Fixmax_link_ratefromplat_data
- no include uapi path
- switch todrmm_encoder_init
- Sort in alphabetical orderAndy Yan (10):
dt-bindings: display: rockchip: Add schema for RK3588 DPTX Controller drm/bridge: synopsys: Add DW DPTX Controller support library drm/rockchip: Add RK3588 DPTX output support
MAINTAINERS: Add entry for DW DPTX Controller bridge
dt-bindings: display: simple-bridge: Add ra620 compatible drm/birdge: simple-bridge: Add support for radxa ra620
arm64: dts: rockchip: Add DP0 for rk3588
arm64: dts: rockchip: Add DP1 for rk3588
arm64: dts: rockchip: Enable DisplayPort for rk3588s Cool Pi 4B
arm64: dts: rockchip: Enable DP2HDMI for ROCK 5 ITX.../display/bridge/simple-bridge.yaml | 1 + .../display/rockchip/rockchip,dw-dp.yaml | 150 ++ MAINTAINERS | 8 + arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 30 + .../arm64/boot/dts/rockchip/rk3588-extra.dtsi | 30 + .../boot/dts/rockchip/rk3588-rock-5-itx.dts | 59 + .../boot/dts/rockchip/rk3588s-coolpi-4b.dts | 37 + drivers/gpu/drm/bridge/simple-bridge.c | 5 + drivers/gpu/drm/bridge/synopsys/Kconfig | 7 + drivers/gpu/drm/bridge/synopsys/Makefile | 1 + drivers/gpu/drm/bridge/synopsys/dw-dp.c | 2044 +++++++++++++++++ drivers/gpu/drm/rockchip/Kconfig | 9 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/dw_dp-rockchip.c | 150 ++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + include/drm/bridge/dw_dp.h | 20 + 17 files changed, 2554 insertions(+)create mode 100644
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-dp.yamlcreate mode 100644drivers/gpu/drm/bridge/synopsys/dw-dp.c
create mode 100644drivers/gpu/drm/rockchip/dw_dp-rockchip.c
create mode 100644include/drm/bridge/dw_dp.hSignature · 4 lines
2.43.0 base-commit: 6085a45a069d2aeab6bb3e5f3fdd32e259703106 branch: rk3588-dp-upstream-v5