Skip to contentSkip to conversation

Tweaked basic Synopsys DW HDMI QP TX driver for Rockchip RK3588

PATCH NAK Shimrra Shai 3 participants 14 messages Aug 30, 2024 – Aug 31, 2024

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

cover Tweaked basic Synopsys DW HDMI QP TX driver for Rockchip RK3588

Hi,

I saw Cristian Ciocaltea's proposed basic driver for the Synopsys DW HDMI QP transmit (TX) facility on the Rockchip RK3588 and noticed that it had seen some critique and thought I'd help it along a little by making some of the changes that others had suggested in the discussion thread. This package is mostly like his(?) original but features the following changes suggested by Conor Dooley and Heiko Stuebner:

* Documentation for the device tree bindings specifies the various clocks explicitly in both the general (synopsys,dw-hdmi-qp.yaml) and Rockchip-specific (rockchip,rk3588-dw-hdmi-qp.yaml) files.
* Changed the compatibles for the RK3588 VO0 and VO1 GRFs in the Device Trees (rk3588-base.dtsi) to reflect their different natures.

and some of my own changes:

* Tweaked the driver code slightly - mostly organizational, but also added a mutex around device access in the dw_hdmi_qp_... method that was present in the downstream BSP driver which might have been necessary to prevent thread bugs.
* Improved grammar & punctuation in some of the English on the Kconfigs and output messages.

Let me know how you like it. I hope this is suitable enough for kernel integration as I'd really like to be able to get some of the newest kernels having video bringup out of the box. I'm testing and developing on the Firefly ITX-3588J board; not sure if this will also work on the Rock 5B too, as I don't have one, but since little was done to the original driver I don't think it should break anything. Moreover, I wanna get the device tree bindings nailed on this point because I'd like to prepare a UEFI firmware package for this board that would be capable of booting mainline kernels from this (or a soon-to-be) version onward, without needing a separate device tree file with the kernel, like a "proper" PC. That naturally implies having at least all basic desktop functionality down, including video output, before the DT is "baked" into the firmware.

- Shimrra Shai

---
Link to Cristian's original w/previous versions' history: https://lore.kernel.org/linux-rockchip/20240819-b4-rk3588-bridge-upstream-v4-0-6417c72a2749@collabora.com/

Total changes:

 Documentation/devicetree/bindings/display/bridge/synopsys,dw-hdmi-qp.yaml          |  89 +++++++++++
 Documentation/devicetree/bindings/display/rockchip/rockchip,rk3588-dw-hdmi-qp.yaml | 171 ++++++++++++++++++++
 Documentation/devicetree/bindings/soc/rockchip/grf.yaml                            |   6 +-
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi                                      |  44 ++++-
 drivers/gpu/drm/bridge/synopsys/Kconfig                                            |   8 +
 drivers/gpu/drm/bridge/synopsys/Makefile                                           |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c                                       | 780 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.h                                       | 834 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/rockchip/Kconfig                                                   |   9 ++
 drivers/gpu/drm/rockchip/Makefile                                                  |   1 +
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c                                     | 431 +++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c                                        |   2 +
 drivers/gpu/drm/rockchip/rockchip_drm_drv.h                                        |   1 +
 include/drm/bridge/dw_hdmi_qp.h                                                    |  36 +++++
 14 files changed, 2409 insertions(+), 4 deletions(-)
#1 lore raw

PATCH 1/6 drm/bridge: synopsys: Add DW HDMI QP TX machine driver common code

drivers/gpu/drm/bridge/synopsys/Kconfig +8 -0
index 15fc182d0..58b42a2b9 100644
@@ -7,6 +7,14 @@ config DRM_DW_HDMI
 	select REGMAP_MMIO
 	select CEC_CORE if CEC_NOTIFIER
 
+config DRM_DW_HDMI_QP
+	tristate
+	select DRM_DISPLAY_HDMI_HELPER
+	select DRM_DISPLAY_HDMI_STATE_HELPER
+	select DRM_DISPLAY_HELPER
+	select DRM_KMS_HELPER
+	select REGMAP_MMIO
+
 config DRM_DW_HDMI_AHB_AUDIO
 	tristate "Synopsys Designware AHB Audio interface"
 	depends on DRM_DW_HDMI && SND
drivers/gpu/drm/bridge/synopsys/Makefile +1 -0
index ce715562e..aa3770670 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_DRM_DW_HDMI) += dw-hdmi.o
+obj-$(CONFIG_DRM_DW_HDMI_QP) += dw-hdmi-qp.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
 obj-$(CONFIG_DRM_DW_HDMI_I2S_AUDIO) += dw-hdmi-i2s-audio.o
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c new file +780 -0

780 lines not on this page · raw message

drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.h new file +834 -0

834 lines not on this page · raw message

include/drm/bridge/dw_hdmi_qp.h new file +36 -0
new file mode 100644
index 000000000..e83e4551b
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2021-2022 Rockchip Electronics Co., Ltd.
+ * Copyright (c) 2024 Collabora Ltd.
+ */
+
+#ifndef __DW_HDMI_QP__
+#define __DW_HDMI_QP__
+
+struct device;
+struct drm_display_info;
+struct drm_encoder;
+struct dw_hdmi_qp;
+struct platform_device;
+
+struct dw_hdmi_qp_phy_ops {
+	int (*init)(struct dw_hdmi_qp *hdmi, void *data,
+		    const struct drm_display_info *display);
+	void (*disable)(struct dw_hdmi_qp *hdmi, void *data);
+	enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi, void *data);
+	void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data);
+};
+
+struct dw_hdmi_qp_plat_data {
+	const struct dw_hdmi_qp_phy_ops *phy_ops;
+	void *phy_data;
+};
+
+int dw_hdmi_qp_set_refclk_rate(struct dw_hdmi_qp *hdmi, unsigned long rate);
+void dw_hdmi_qp_set_high_tmds_clock_ratio(struct dw_hdmi_qp *hdmi,
+					  const struct drm_display_info *display);
+struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
+				   struct drm_encoder *encoder,
+				   const struct dw_hdmi_qp_plat_data *plat_data);
+void dw_hdmi_qp_resume(struct device *dev, struct dw_hdmi_qp *hdmi);
+#endif /* __DW_HDMI_QP__ */
#2 lore raw

PATCH 2/6 drm/rockchip: Add RK3588-specific driver for DW HDMI QP TX

In reply to Shimrra Shai
drivers/gpu/drm/rockchip/Kconfig +9 -0
index 7df875e38..1cd8a3774 100644
@@ -8,6 +8,7 @@ config DRM_ROCKCHIP
 	select VIDEOMODE_HELPERS
 	select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_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
 	select GENERIC_PHY if ROCKCHIP_DW_MIPI_DSI
 	select GENERIC_PHY_MIPI_DPHY if ROCKCHIP_DW_MIPI_DSI
@@ -63,6 +64,14 @@ config ROCKCHIP_DW_HDMI
 	  enable HDMI on RK3288 or RK3399 based SoC, you should select
 	  this option.
 
+config ROCKCHIP_DW_HDMI_QP
+	bool "Rockchip specific extensions for Synopsys DW HDMI QP"
+	help
+	  This selects support for Rockchip SoC-specific extensions
+	  for the Synopsys DesignWare HDMI Quad-Pixel (QP) driver. If
+	  you want to enable HDMI on RK3588-based SoCs, you should
+	  select this option.
+
 config ROCKCHIP_DW_MIPI_DSI
 	bool "Rockchip specific extensions for Synopsys DW MIPI DSI"
 	select GENERIC_PHY_MIPI_DPHY
drivers/gpu/drm/rockchip/Makefile +1 -0
index 3ff7b21c0..3eab662a5 100644
@@ -11,6 +11,7 @@ rockchipdrm-$(CONFIG_ROCKCHIP_VOP) += rockchip_drm_vop.o rockchip_vop_reg.o
 rockchipdrm-$(CONFIG_ROCKCHIP_ANALOGIX_DP) += analogix_dp-rockchip.o
 rockchipdrm-$(CONFIG_ROCKCHIP_CDN_DP) += cdn-dp-core.o cdn-dp-reg.o
 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_INNO_HDMI) += inno_hdmi.o
 rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c new file +431 -0

431 lines not on this page · raw message

drivers/gpu/drm/rockchip/rockchip_drm_drv.c +2 -0
index 44d769d92..04ef7a2c3 100644
@@ -503,6 +503,8 @@ static int __init rockchip_drm_init(void)
 	ADD_ROCKCHIP_SUB_DRIVER(cdn_dp_driver, CONFIG_ROCKCHIP_CDN_DP);
 	ADD_ROCKCHIP_SUB_DRIVER(dw_hdmi_rockchip_pltfm_driver,
 				CONFIG_ROCKCHIP_DW_HDMI);
+	ADD_ROCKCHIP_SUB_DRIVER(dw_hdmi_qp_rockchip_pltfm_driver,
+				CONFIG_ROCKCHIP_DW_HDMI_QP);
 	ADD_ROCKCHIP_SUB_DRIVER(dw_mipi_dsi_rockchip_driver,
 				CONFIG_ROCKCHIP_DW_MIPI_DSI);
 	ADD_ROCKCHIP_SUB_DRIVER(inno_hdmi_driver, CONFIG_ROCKCHIP_INNO_HDMI);
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +1 -0
index bbb9e0bf6..d7f2f0fd0 100644
@@ -87,6 +87,7 @@ int rockchip_drm_encoder_set_crtc_endpoint_id(struct rockchip_encoder *rencoder,
 int rockchip_drm_endpoint_is_subdriver(struct device_node *ep);
 extern struct platform_driver cdn_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;
 extern struct platform_driver inno_hdmi_driver;
 extern struct platform_driver rockchip_dp_driver;
#3 lore raw

PATCH 3/6 dt-bindings: display: bridge: Add schema for Synopsys DW HDMI QP TX IP

In reply to Shimrra Shai
Documentation/devicetree/bindings/display/bridge/synopsys,dw-hdmi-qp.yaml new file +89 -0
new file mode 100644
index 000000000..141899ba2
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/synopsys,dw-hdmi-qp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common Properties for Synopsys DesignWare HDMI QP TX Controller IP
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+  - Shimrra Shai <[email protected]>
+
+description: |
+  The Synopsys DesignWare HDMI 2.1 Quad-Pixel (QP) TX Controller IP core
+  supports the following features, among others:
+
+  * Fixed Rate Link (FRL)
+  * Display Stream Compression (DSC)
+  * 4K@120Hz and 8K@60Hz video modes
+  * Variable Refresh Rate (VRR) including Quick Media Switching (QMS)
+  * Fast Vactive (FVA)
+  * SCDC I2C DDC access
+  * Multi-stream audio
+  * Enhanced Audio Return Channel (EARC)
+
+  Note this is not a full dt-binding specification, but is meant to be
+  referenced by platform-specific bindings for this IP core.
+
+properties:
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 4
+    maxItems: 6
+    items:
+      - description: Peripheral/APB bus clock
+      - description: EARC RX biphase clock
+      - description: Reference clock
+      - description: Audio interface clock
+    additionalItems: true
+
+  clock-names:
+    minItems: 4
+    maxItems: 6
+    items:
+      - const: pclk
+      - const: earc
+      - const: ref
+      - const: aud
+    additionalItems: true
+
+  interrupts:
+    minItems: 4
+    maxItems: 5
+    items:
+      - description: AVP Unit interrupt
+      - description: CEC interrupt
+      - description: eARC RX interrupt
+      - description: Main Unit interrupt
+    additionalItems: true
+
+  interrupt-names:
+    minItems: 4
+    maxItems: 5
+    items:
+      - const: avp
+      - const: cec
+      - const: earc
+      - const: main
+    additionalItems: true
+
+  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 HDMI/eDP output.
+
+    required:
+      - port@0
+      - port@1
+
+additionalProperties: true
#4 lore raw

Re: [PATCH v5? 3/6] dt-bindings: display: bridge: Add schema for Synopsys DW HDMI QP TX IP

Documentation/devicetree/bindings/display/bridge/synopsys,dw-hdmi-qp.yaml

Quoted 3 lines · Shimrra Shai
Documentation/devicetree/bindings/display/bridge/synopsys,dw-hdmi-qp.yaml new file +0 -0
new file mode 100644
index 000000000..141899ba2

What is this? Where is proper message?

Why are you sending someone's else work duplicating entire review effort?

Best regards,
Krzysztof

#5 lore raw

PATCH 4/6 dt-bindings: soc: rockchip: Document VO0/1 GRF compatible string changes

In reply to Shimrra Shai
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +4 -2
index 78c6d5b64..8fd539125 100644
@@ -31,7 +31,8 @@ properties:
               - rockchip,rk3588-pcie3-pipe-grf
               - rockchip,rk3588-usb-grf
               - rockchip,rk3588-usbdpphy-grf
-              - rockchip,rk3588-vo-grf
+              - rockchip,rk3588-vo0-grf
+              - rockchip,rk3588-vo1-grf
               - rockchip,rk3588-vop-grf
               - rockchip,rv1108-usbgrf
           - const: syscon
@@ -261,7 +262,8 @@ allOf:
         compatible:
           contains:
             enum:
-              - rockchip,rk3588-vo-grf
+              - rockchip,rk3588-vo0-grf
+              - rockchip,rk3588-vo1-grf
 
     then:
       required:
#6 lore raw

Re: [PATCH v5? 4/6] dt-bindings: soc: rockchip: Document VO0/1 GRF compatible string changes

Documentation/devicetree/bindings/soc/rockchip/grf.yaml properties: · line 36

Quoted 12 lines · Shimrra Shai
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +2 -1
index 78c6d5b64..8fd539125 100644
@@ -31,7 +31,8 @@ properties:
               - rockchip,rk3588-pcie3-pipe-grf
               - rockchip,rk3588-usb-grf
               - rockchip,rk3588-usbdpphy-grf
-              - rockchip,rk3588-vo-grf
+              - rockchip,rk3588-vo0-grf
+              - rockchip,rk3588-vo1-grf
               - rockchip,rk3588-vop-grf

NAK, this does not make any sense. Just random code changes...

Best regards,
Krzysztof

#7 lore raw

PATCH 5/6 dt-bindings: display: rockchip: Add schema for RK3588 DW HDMI QP TX machine

In reply to Shimrra Shai
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3588-dw-hdmi-qp.yaml new file +171 -0
new file mode 100644
index 000000000..e71544ced
@@ -0,0 +1,171 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/rockchip/rockchip,rk3588-dw-hdmi-qp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip DW HDMI QP TX Encoder
+
+maintainers:
+  - Cristian Ciocaltea <[email protected]>
+  - Shimrra Shai <[email protected]>
+
+description:
+  The Rockchip RK3588 SoC integrates the Synopsys DesignWare HDMI QP TX
+  controller IP and an HDMI/eDP TX Combo PHY based on a Samsung IP block.
+
+allOf:
+  - $ref: /schemas/display/bridge/synopsys,dw-hdmi-qp.yaml#
+  - $ref: /schemas/sound/dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - rockchip,rk3588-dw-hdmi-qp
+
+  clocks:
+    minItems: 4
+    items:
+      - description: Peripheral/APB bus clock
+      - description: EARC RX biphase clock
+      - description: Reference clock
+      - description: Audio interface clock
+      # The next clocks are optional, but shall be specified in this
+      # order when present.
+      - description: TMDS/FRL link clock
+      - description: Video datapath clock
+
+  clock-names:
+    minItems: 4
+    items:
+      - const: pclk
+      - const: earc
+      - const: ref
+      - const: aud
+      - enum: [hdp, hclk_vo1]
+      - const: hclk_vo1
+
+  interrupts:
+    items:
+      - description: AVP Unit interrupt
+      - description: CEC interrupt
+      - description: eARC RX interrupt
+      - description: Main Unit interrupt
+      - description: HPD interrupt
+
+  interrupt-names:
+    items:
+      - const: avp
+      - const: cec
+      - const: earc
+      - const: main
+      - const: hpd
+
+  phys:
+    maxItems: 1
+    description: The HDMI/eDP PHY.
+
+  phy-names:
+    const: hdmi
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    minItems: 2
+    maxItems: 2
+
+  reset-names:
+    items:
+      - const: ref
+      - const: hdp
+
+  "#sound-dai-cells":
+    const: 0
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Most HDMI QP related data is accessed through SYS GRF regs.
+
+  rockchip,vo1-grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Additional HDMI QP related data is accessed through VO1 GRF regs.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+  - phys
+  - phy-names
+  - ports
+  - resets
+  - reset-names
+  - rockchip,grf
+  - rockchip,vo1-grf
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/rockchip,rk3588-cru.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>;
+
+      hdmi@fde80000 {
+        compatible = "rockchip,rk3588-dw-hdmi-qp";
+        reg = <0x0 0xfde80000 0x0 0x20000>;
+        clocks = <&cru PCLK_HDMITX0>,
+                 <&cru CLK_HDMITX0_EARC>,
+                 <&cru CLK_HDMITX0_REF>,
+                 <&cru MCLK_I2S5_8CH_TX>,
+                 <&cru CLK_HDMIHDP0>,
+                 <&cru HCLK_VO1>;
+        clock-names = "pclk", "earc", "ref", "aud", "hdp", "hclk_vo1";
+        interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH 0>,
+                     <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>,
+                     <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH 0>,
+                     <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH 0>,
+                     <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH 0>;
+        interrupt-names = "avp", "cec", "earc", "main", "hpd";
+        phys = <&hdptxphy_hdmi0>;
+        phy-names = "hdmi";
+        power-domains = <&power RK3588_PD_VO1>;
+        resets = <&cru SRST_HDMITX0_REF>, <&cru SRST_HDMIHDP0>;
+        reset-names = "ref", "hdp";
+        rockchip,grf = <&sys_grf>;
+        rockchip,vo1-grf = <&vo1_grf>;
+        #sound-dai-cells = <0>;
+
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
+
+          port@0 {
+            reg = <0>;
+
+            hdmi0_in_vp0: endpoint {
+                remote-endpoint = <&vp0_out_hdmi0>;
+            };
+          };
+
+          port@1 {
+            reg = <1>;
+
+            hdmi0_out_con0: endpoint {
+                remote-endpoint = <&hdmi_con0_in>;
+            };
+          };
+        };
+      };
+    };
#8 lore raw

Re: [PATCH v5? 5/6] dt-bindings: display: rockchip: Add schema for RK3588 DW HDMI QP TX machine

Documentation/devicetree/bindings/display/rockchip/rockchip,rk3588-dw-hdmi-qp.yaml

Quoted 4 lines · Shimrra Shai
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3588-dw-hdmi-qp.yaml new file +0 -1
new file mode 100644
index 000000000..e71544ced
--- /dev/null

Nope, please carefully read submitting patches.

Best regards,
Krzysztof

#9 lore raw

PATCH 6/6 dts: rockchip: add HDMI0 entry for RK3588 and change VO0/1 GRF compatibles

In reply to Shimrra Shai
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +42 -2
index b6e4df180..76cb0f7f7 100644
@@ -582,13 +582,13 @@ vop_grf: syscon@fd5a4000 {
 	};
 
 	vo0_grf: syscon@fd5a6000 {
-		compatible = "rockchip,rk3588-vo-grf", "syscon";
+		compatible = "rockchip,rk3588-vo0-grf", "syscon";
 		reg = <0x0 0xfd5a6000 0x0 0x2000>;
 		clocks = <&cru PCLK_VO0GRF>;
 	};
 
 	vo1_grf: syscon@fd5a8000 {
-		compatible = "rockchip,rk3588-vo-grf", "syscon";
+		compatible = "rockchip,rk3588-vo1-grf", "syscon";
 		reg = <0x0 0xfd5a8000 0x0 0x100>;
 		clocks = <&cru PCLK_VO1GRF>;
 	};
@@ -1254,6 +1254,46 @@ i2s9_8ch: i2s@fddfc000 {
 		status = "disabled";
 	};
 
+	hdmi0: hdmi@fde80000 {
+		compatible = "rockchip,rk3588-dw-hdmi-qp";
+		reg = <0x0 0xfde80000 0x0 0x20000>;
+		clocks = <&cru PCLK_HDMITX0>,
+			 <&cru CLK_HDMITX0_EARC>,
+			 <&cru CLK_HDMITX0_REF>,
+			 <&cru MCLK_I2S5_8CH_TX>,
+			 <&cru CLK_HDMIHDP0>,
+			 <&cru HCLK_VO1>;
+		clock-names = "pclk", "earc", "ref", "aud", "hdp", "hclk_vo1";
+		interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH 0>,
+			     <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH 0>;
+		interrupt-names = "avp", "cec", "earc", "main", "hpd";
+		phys = <&hdptxphy_hdmi0>;
+		phy-names = "hdmi";
+		power-domains = <&power RK3588_PD_VO1>;
+		resets = <&cru SRST_HDMITX0_REF>, <&cru SRST_HDMIHDP0>;
+		reset-names = "ref", "hdp";
+		rockchip,grf = <&sys_grf>;
+		rockchip,vo1-grf = <&vo1_grf>;
+		#sound-dai-cells = <0>;
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			hdmi0_in: port@0 {
+				reg = <0>;
+			};
+
+			hdmi0_out: port@1 {
+				reg = <1>;
+			};
+		};
+	};
+
 	qos_gpu_m0: qos@fdf35000 {
 		compatible = "rockchip,rk3588-qos", "syscon";
 		reg = <0x0 0xfdf35000 0x0 0x20>;
#11 lore raw
In reply to Shimrra Shai

Hi Shimrra,

Quoted 8 lines · Shimrra Shai

Hi,

I saw Cristian Ciocaltea's proposed basic driver for the Synopsys DW HDMI QP transmit (TX) facility on the Rockchip RK3588 and noticed that it had seen some critique and thought I'd help it along a little by making some of the changes that others had suggested in the discussion thread. This package is mostly like his(?) original but features the following changes suggested by Conor Dooley and Heiko Stuebner:

Please stop doing this!

I appreciate your intention to help, but this is not the proper way of doing it. This is a work-in-progress series and you should have asked before taking over. Please do not interfere with other people's work without having a preliminary agreement with the author(s).

Additionally, before submitting any other patches, you should get familiar with the process - see [1] for a starting point.

Quoted 3 lines

* Documentation for the device tree bindings specifies the various clocks explicitly in both the general (synopsys,dw-hdmi-qp.yaml) and Rockchip-specific (rockchip,rk3588-dw-hdmi-qp.yaml) files.

Why? Did you read [2]?

Quoted 2 lines

* Changed the compatibles for the RK3588 VO0 and VO1 GRFs in the Device Trees (rk3588-base.dtsi) to reflect their different natures.

This has been already handled - see [3].

Quoted 9 lines

and some of my own changes:

* Tweaked the driver code slightly - mostly organizational, but also added a mutex around device access in the dw_hdmi_qp_... method that was present in the downstream BSP driver which might have been necessary to prevent thread bugs.
* Improved grammar & punctuation in some of the English on the Kconfigs and output messages.

Quoted 3 lines

Let me know how you like it. I hope this is suitable enough for kernel integration as I'd really like to be able to get some of the newest kernels having video bringup out of the box.

That's definitely not suitable as you made lots of other mistakes while preparing the patches, i.e. preserving authorship, missing commit descriptions, SoB tags, etc.

Regards,
Cristian

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html
[2] https://lore.kernel.org/lkml/[email protected]/
[3] https://lore.kernel.org/lkml/[email protected]/

#12 lore raw
Quoted 10 lines · Cristian Ciocaltea

Please stop doing this!

I appreciate your intention to help, but this is not the proper way of doing it. This is a work-in-progress series and you should have asked before taking over. Please do not interfere with other people's work without having a preliminary agreement with the author(s).

Additionally, before submitting any other patches, you should get familiar with the process - see [1] for a starting point.

Hi Cristian,

Sorry, I did not know what the rules/norms/customs were around this kind of thing here as I figured it was an open contribution space. I did not know that I should have asked for agreement with you beforehand. So go ahead and ignore this patch series if it goes against the rules/customs. Even more if these points have already been addressed, as redundant work is obviously not helpful.

That said, if there is some way to help along this project "the right way", I would like to for sure! Just tell me what you'd _really_ need help/assistance with to get this moved ahead and I'll see if I can give it.

Thank you!

- Shimrra

(BTW, I thought I read a lot of that stuff in your [1], but I guess I glossed over some of the finest details; unfortunately my mind tends to do that a lot [drop details], so I will not contest your complaint about the substance of the submission as containing mistakes, either.

And I only think I submitted one other patch before so I am not very experienced at this group, despite being much more experienced with coding. So again I apologize.)

#13 lore raw

Hi Shimrra,

Quoted 12 lines · Shimrra Shai
Quoted 10 lines · Cristian Ciocaltea

Please stop doing this!

I appreciate your intention to help, but this is not the proper way of doing it. This is a work-in-progress series and you should have asked before taking over. Please do not interfere with other people's work without having a preliminary agreement with the author(s).

Additionally, before submitting any other patches, you should get familiar with the process - see [1] for a starting point.

Quoted 8 lines

Hi Cristian,

Sorry, I did not know what the rules/norms/customs were around this kind of thing here as I figured it was an open contribution space. I did not know that I should have asked for agreement with you beforehand. So go ahead and ignore this patch series if it goes against the rules/customs. Even more if these points have already been addressed, as redundant work is obviously not helpful.

This is an open community and, obviously, anyone is free to contribute without asking for permission. However, taking over an ongoing work is nothing but a source of confusion. You may do this for work that is known to be abandoned, e.g. the author(s) explicitly mentioned that in one of their last posts, or when there is no sign of activity for long enough time (usually months, for sure not days or weeks). In the latter case, I find it reasonable to still ask for a confirmation that the submitter has no intention to continue or, at least, discuss the possibilities to join forces and help moving further.

Quoted 4 lines

That said, if there is some way to help along this project "the right way", I would like to for sure! Just tell me what you'd _really_ need help/assistance with to get this moved ahead and I'll see if I can give it.

Getting more testing on the series, reporting back the findings and/or providing fixes, would be much appreciated, for sure! The goal is to land the basic functionality first, hence any new features should be submitted afterwards.

Regards,
Cristian