diff mbox series

[v5,19/23] arm64: dts: rockchip: rk3568-evb: Enable VOP2 and hdmi

Message ID 20220209095350.2104049-20-s.hauer@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series drm/rockchip: RK356x VOP2 support | expand

Commit Message

Sascha Hauer Feb. 9, 2022, 9:53 a.m. UTC
This enabled the VOP2 display controller along with hdmi and the
required port routes which is enough to get a picture out of the
hdmi port of the board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---

Notes:
    Changes since v4:
    - Sort nodes alphabetically
    
    Changes since v3:
    - Fix HDMI connector type

 .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)

Comments

Johan Jonker Feb. 10, 2022, 12:10 a.m. UTC | #1
Hi Sascha,

Something with port and endpoint gives notifications.
Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
options were checked/covered (see rk3328 and rk3568).

Allow multiple vop:
port or
port@0
1x vop -> endpoint

2x vop -> endpoint@0
       -> endpoint@1

Also allow for connector:
(not all existing DT have this yet)
port@1
      -> endpoint

See also at graph.yaml
===

dtc -I dtb -O dts rk3568-evb1-v10.dtb
<stdout>: Warning (avoid_unnecessary_addr_size):
/hdmi@fe0a0000/ports/port@1: unnecessary #address-cells/#size-cells
without "ranges" or child "reg" property
<stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@0:
graph node has single child node 'endpoint@0',
#address-cells/#size-cells are not necessary
<stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@1:
graph node has single child node 'endpoint', #address-cells/#size-cells
are not necessary

===

ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

  DTC     arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml
  CHECK   arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml
/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dt.yaml: hdmi@fe0a0000:
ports: 'port' is a required property
	From schema:
/home/user/Downloads/linux-next-20220202/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
  DTC     arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml
  CHECK   arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml
/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml: hdmi@fe0a0000:
ports: 'port' is a required property
	From schema:
/home/user/Downloads/linux-next-20220202/Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

===

On 2/9/22 10:53, Sascha Hauer wrote:
> This enabled the VOP2 display controller along with hdmi and the
> required port routes which is enough to get a picture out of the
> hdmi port of the board.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> 
> Notes:
>     Changes since v4:
>     - Sort nodes alphabetically
>     
>     Changes since v3:
>     - Fix HDMI connector type
> 
>  .../boot/dts/rockchip/rk3568-evb1-v10.dts     | 48 +++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> index 184e2aa2416a..18f0f5abddcf 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
> @@ -7,6 +7,7 @@
>  /dts-v1/;
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/pinctrl/rockchip.h>
> +#include <dt-bindings/soc/rockchip,vop2.h>
>  #include "rk3568.dtsi"
>  
>  / {
> @@ -33,6 +34,17 @@ dc_12v: dc-12v {
>  		regulator-max-microvolt = <12000000>;
>  	};
>  
> +	hdmi-con {
> +		compatible = "hdmi-connector";
> +		type = "a";
> +
> +		port {
> +			hdmi_con_in: endpoint {
> +				remote-endpoint = <&hdmi_out_con>;
> +			};
> +		};
> +	};
> +
>  	vcc3v3_sys: vcc3v3-sys {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vcc3v3_sys";
> @@ -106,6 +118,25 @@ &gmac1m1_rgmii_clk
>  	status = "okay";
>  };
>  
> +&hdmi {
> +	avdd-0v9-supply = <&vdda0v9_image>;
> +	avdd-1v8-supply = <&vcca1v8_image>;
> +	status = "okay";
> +};
> +
> +&hdmi_in {
> +	hdmi_in_vp0: endpoint@0 {
> +		reg = <0>;
> +		remote-endpoint = <&vp0_out_hdmi>;
> +	};
> +};
> +
> +&hdmi_out {
> +	hdmi_out_con: endpoint {
> +		remote-endpoint = <&hdmi_con_in>;
> +	};
> +};
> +
>  &i2c0 {
>  	status = "okay";
>  
> @@ -390,3 +421,20 @@ &sdmmc0 {
>  &uart2 {
>  	status = "okay";
>  };
> +
> +&vop {
> +	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
> +	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
> +	status = "okay";
> +};
> +
> +&vop_mmu {
> +	status = "okay";
> +};
> +
> +&vp0 {
> +	vp0_out_hdmi: endpoint@RK3568_VOP2_EP_HDMI {
> +		reg = <RK3568_VOP2_EP_HDMI>;
> +		remote-endpoint = <&hdmi_in_vp0>;
> +	};
> +};
Sascha Hauer Feb. 10, 2022, 11:47 a.m. UTC | #2
On Thu, Feb 10, 2022 at 01:10:32AM +0100, Johan Jonker wrote:
> Hi Sascha,
> 
> Something with port and endpoint gives notifications.
> Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
> options were checked/covered (see rk3328 and rk3568).
> 
> Allow multiple vop:
> port or
> port@0
> 1x vop -> endpoint
> 
> 2x vop -> endpoint@0
>        -> endpoint@1
> 
> Also allow for connector:
> (not all existing DT have this yet)
> port@1
>       -> endpoint
> 
> See also at graph.yaml

Ok, let me see if I get this right. The HDMI can either have one or two
ports. It has one when the HDMI connector is not described in the device
tree and two when it is. Also the first (or only) port can have one or
two endpoints. It has one endpoint when the SoC has a single VOP and two
endpoints when the SoC has two VOPs.

It's been a painful morning because my YAML knowledge is fairly limited,
but here's what I came up with:

  ports:
    $ref: /schemas/graph.yaml#/properties/ports
    unevaluatedProperties: false
    patternProperties:
      "^port(@0)?$":
        $ref: /schemas/graph.yaml#/properties/port
        description: Input of the DWC HDMI TX
        properties:
          endpoint:
            description: Connection to the VOP
          endpoint@0:
            description: Connection to the VOPB
          endpoint@1:
            description: Connection to the VOPL
    properties:
      port@1:
        $ref: /schemas/graph.yaml#/properties/port
        description: Output of the DWC HDMI TX

Does this look sane to you? With this a make dtbs_check on this binding
doesn't generate warnings anymore, and even better it does generate
warnings when I add some wrong nodes/properties to the dts files.

> ===
> 
> dtc -I dtb -O dts rk3568-evb1-v10.dtb
> <stdout>: Warning (avoid_unnecessary_addr_size):
> /hdmi@fe0a0000/ports/port@1: unnecessary #address-cells/#size-cells
> without "ranges" or child "reg" property
> <stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@0:
> graph node has single child node 'endpoint@0',
> #address-cells/#size-cells are not necessary
> <stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@1:
> graph node has single child node 'endpoint', #address-cells/#size-cells
> are not necessary

That's easy. I dropped the @0 suffix and reg property from the node.

Sascha
Johan Jonker Feb. 10, 2022, 1:15 p.m. UTC | #3
On 2/10/22 12:47, Sascha Hauer wrote:
> On Thu, Feb 10, 2022 at 01:10:32AM +0100, Johan Jonker wrote:
>> Hi Sascha,
>>
>> Something with port and endpoint gives notifications.
>> Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
>> options were checked/covered (see rk3328 and rk3568).
>>
>> Allow multiple vop:
>> port or
>> port@0
>> 1x vop -> endpoint
>>
>> 2x vop -> endpoint@0
>>        -> endpoint@1
>>
>> Also allow for connector:
>> (not all existing DT have this yet)
>> port@1
>>       -> endpoint
>>
>> See also at graph.yaml
> 
> Ok, let me see if I get this right. The HDMI can either have one or two
> ports. It has one when the HDMI connector is not described in the device
> tree and two when it is. Also the first (or only) port can have one or
> two endpoints. It has one endpoint when the SoC has a single VOP and two
> endpoints when the SoC has two VOPs.
> 
> It's been a painful morning because my YAML knowledge is fairly limited,
> but here's what I came up with:
> 
>   ports:
>     $ref: /schemas/graph.yaml#/properties/ports
>     unevaluatedProperties: false
>     patternProperties:
>       "^port(@0)?$":
>         $ref: /schemas/graph.yaml#/properties/port
>         description: Input of the DWC HDMI TX
>         properties:
>           endpoint:
>             description: Connection to the VOP
>           endpoint@0:
>             description: Connection to the VOPB
>           endpoint@1:
>             description: Connection to the VOPL
>     properties:
>       port@1:
>         $ref: /schemas/graph.yaml#/properties/port
>         description: Output of the DWC HDMI TX
> 
> Does this look sane to you? With this a make dtbs_check on this binding
> doesn't generate warnings anymore, and even better it does generate
> warnings when I add some wrong nodes/properties to the dts files.

Hi,

Send a patch to rob+dt and he will let you know... ;)

Also could you test the ARM branch as well just for sure with:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make  dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

Could you group your serie a bit:
dt-bindings
drm patches
dts changes

Johan

> 
>> ===
>>
>> dtc -I dtb -O dts rk3568-evb1-v10.dtb
>> <stdout>: Warning (avoid_unnecessary_addr_size):
>> /hdmi@fe0a0000/ports/port@1: unnecessary #address-cells/#size-cells
>> without "ranges" or child "reg" property
>> <stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@0:
>> graph node has single child node 'endpoint@0',
>> #address-cells/#size-cells are not necessary
>> <stdout>: Warning (graph_child_address): /hdmi@fe0a0000/ports/port@1:
>> graph node has single child node 'endpoint', #address-cells/#size-cells
>> are not necessary
> 
> That's easy. I dropped the @0 suffix and reg property from the node.
> 
> Sascha
>
Sascha Hauer Feb. 10, 2022, 1:37 p.m. UTC | #4
On Thu, Feb 10, 2022 at 02:15:17PM +0100, Johan Jonker wrote:
> 
> 
> On 2/10/22 12:47, Sascha Hauer wrote:
> > On Thu, Feb 10, 2022 at 01:10:32AM +0100, Johan Jonker wrote:
> >> Hi Sascha,
> >>
> >> Something with port and endpoint gives notifications.
> >> Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
> >> options were checked/covered (see rk3328 and rk3568).
> >>
> >> Allow multiple vop:
> >> port or
> >> port@0
> >> 1x vop -> endpoint
> >>
> >> 2x vop -> endpoint@0
> >>        -> endpoint@1
> >>
> >> Also allow for connector:
> >> (not all existing DT have this yet)
> >> port@1
> >>       -> endpoint
> >>
> >> See also at graph.yaml
> > 
> > Ok, let me see if I get this right. The HDMI can either have one or two
> > ports. It has one when the HDMI connector is not described in the device
> > tree and two when it is. Also the first (or only) port can have one or
> > two endpoints. It has one endpoint when the SoC has a single VOP and two
> > endpoints when the SoC has two VOPs.
> > 
> > It's been a painful morning because my YAML knowledge is fairly limited,
> > but here's what I came up with:
> > 
> >   ports:
> >     $ref: /schemas/graph.yaml#/properties/ports
> >     unevaluatedProperties: false
> >     patternProperties:
> >       "^port(@0)?$":
> >         $ref: /schemas/graph.yaml#/properties/port
> >         description: Input of the DWC HDMI TX
> >         properties:
> >           endpoint:
> >             description: Connection to the VOP
> >           endpoint@0:
> >             description: Connection to the VOPB
> >           endpoint@1:
> >             description: Connection to the VOPL
> >     properties:
> >       port@1:
> >         $ref: /schemas/graph.yaml#/properties/port
> >         description: Output of the DWC HDMI TX
> > 
> > Does this look sane to you? With this a make dtbs_check on this binding
> > doesn't generate warnings anymore, and even better it does generate
> > warnings when I add some wrong nodes/properties to the dts files.
> 
> Hi,
> 
> Send a patch to rob+dt and he will let you know... ;)

;)

> 
> Also could you test the ARM branch as well just for sure with:
> ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make  dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml

That works fine except for iahb and isfr clocks in the wrong order in
arch/arm/boot/dts/rk322x.dtsi.

> 
> Could you group your serie a bit:
> dt-bindings
> drm patches
> dts changes

That's the order I originally had. Heiko asked me to put the
bindings, dts changes and driver patches together dor each topic.

Sascha
Heiko Stuebner Feb. 10, 2022, 1:51 p.m. UTC | #5
Am Donnerstag, 10. Februar 2022, 14:37:59 CET schrieb Sascha Hauer:
> On Thu, Feb 10, 2022 at 02:15:17PM +0100, Johan Jonker wrote:
> > 
> > 
> > On 2/10/22 12:47, Sascha Hauer wrote:
> > > On Thu, Feb 10, 2022 at 01:10:32AM +0100, Johan Jonker wrote:
> > >> Hi Sascha,
> > >>
> > >> Something with port and endpoint gives notifications.
> > >> Somehow with the conversion of rockchip,dw-hdmi.txt to YAML not all SoC
> > >> options were checked/covered (see rk3328 and rk3568).
> > >>
> > >> Allow multiple vop:
> > >> port or
> > >> port@0
> > >> 1x vop -> endpoint
> > >>
> > >> 2x vop -> endpoint@0
> > >>        -> endpoint@1
> > >>
> > >> Also allow for connector:
> > >> (not all existing DT have this yet)
> > >> port@1
> > >>       -> endpoint
> > >>
> > >> See also at graph.yaml
> > > 
> > > Ok, let me see if I get this right. The HDMI can either have one or two
> > > ports. It has one when the HDMI connector is not described in the device
> > > tree and two when it is. Also the first (or only) port can have one or
> > > two endpoints. It has one endpoint when the SoC has a single VOP and two
> > > endpoints when the SoC has two VOPs.
> > > 
> > > It's been a painful morning because my YAML knowledge is fairly limited,
> > > but here's what I came up with:
> > > 
> > >   ports:
> > >     $ref: /schemas/graph.yaml#/properties/ports
> > >     unevaluatedProperties: false
> > >     patternProperties:
> > >       "^port(@0)?$":
> > >         $ref: /schemas/graph.yaml#/properties/port
> > >         description: Input of the DWC HDMI TX
> > >         properties:
> > >           endpoint:
> > >             description: Connection to the VOP
> > >           endpoint@0:
> > >             description: Connection to the VOPB
> > >           endpoint@1:
> > >             description: Connection to the VOPL
> > >     properties:
> > >       port@1:
> > >         $ref: /schemas/graph.yaml#/properties/port
> > >         description: Output of the DWC HDMI TX
> > > 
> > > Does this look sane to you? With this a make dtbs_check on this binding
> > > doesn't generate warnings anymore, and even better it does generate
> > > warnings when I add some wrong nodes/properties to the dts files.
> > 
> > Hi,
> > 
> > Send a patch to rob+dt and he will let you know... ;)
> 
> ;)
> 
> > 
> > Also could you test the ARM branch as well just for sure with:
> > ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make  dtbs_check
> > DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/rockchip/rockchip,dw-hdmi.yaml
> 
> That works fine except for iahb and isfr clocks in the wrong order in
> arch/arm/boot/dts/rk322x.dtsi.
> 
> > 
> > Could you group your serie a bit:
> > dt-bindings
> > drm patches
> > dts changes
> 
> That's the order I originally had. Heiko asked me to put the
> bindings, dts changes and driver patches together dor each topic.

with the background being that I can judge which parts are essentially
ready and possibly apply parts of a larger series without waiting
for everything to be ready.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
index 184e2aa2416a..18f0f5abddcf 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
@@ -7,6 +7,7 @@ 
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3568.dtsi"
 
 / {
@@ -33,6 +34,17 @@  dc_12v: dc-12v {
 		regulator-max-microvolt = <12000000>;
 	};
 
+	hdmi-con {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+
 	vcc3v3_sys: vcc3v3-sys {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc3v3_sys";
@@ -106,6 +118,25 @@  &gmac1m1_rgmii_clk
 	status = "okay";
 };
 
+&hdmi {
+	avdd-0v9-supply = <&vdda0v9_image>;
+	avdd-1v8-supply = <&vcca1v8_image>;
+	status = "okay";
+};
+
+&hdmi_in {
+	hdmi_in_vp0: endpoint@0 {
+		reg = <0>;
+		remote-endpoint = <&vp0_out_hdmi>;
+	};
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -390,3 +421,20 @@  &sdmmc0 {
 &uart2 {
 	status = "okay";
 };
+
+&vop {
+	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+	status = "okay";
+};
+
+&vop_mmu {
+	status = "okay";
+};
+
+&vp0 {
+	vp0_out_hdmi: endpoint@RK3568_VOP2_EP_HDMI {
+		reg = <RK3568_VOP2_EP_HDMI>;
+		remote-endpoint = <&hdmi_in_vp0>;
+	};
+};