[v7,09/12] arm64: dts: rockchip: a64: Add endpoint@0 to dsi_in_tcon0

Message ID 20230329131615.1328366-10-jagan@amarulasolutions.com
State New
Headers show
Series
  • drm: sun4i: Convert Allwinner DSI to bridge
Related show

Commit Message

Jagan Teki March 29, 2023, 1:16 p.m. UTC
The DSI downstream devices are likely to be Panel, Bridge and
I2C-Configured Bridge.

It is possible to connect all three devices using upstream OF-graph port
or ports node however only Panel and Bridge are possible to connect via
child node but not possible to connect I2C-Configured Bridge via child
node since I2C-Configure bridges are child of I2C not upstream DSI hosts
and it must represent them via port or ports with endpoint linking.

Allwinner A64 DSI node already has a port so add endpoint 0 for input
tcon so that the downstream DSI devices can use endpoint 1 to connect
Panel or Bridge or I2C-Configured Bridge.

An example of the I2C-Configured downstream bridge representation is,

i2c1 {
       bridge@1b {
	     compatible = "ti,dlpc3433";

             ports {
                  port@0 {
                         reg = <0>;

                         bridge_in_dsi: endpoint {
                                remote-endpoint = <&dsi_out_bridge>;
                                data-lanes = <1 2 3 4>;
                         };
                  };

	          port@2 {
	                 reg = <2>;

                         bridge_out_dmd: endpoint {
                                remote-endpoint = <&dmd_out_bridge>;
                         };
                  };
             };
       };
};

dsi {
       compatible = "allwinner,sun50i-a64-mipi-dsi";

       port {
             dsi_in_tcon0: endpoint@0 {
	          reg = <0>;
		  remote-endpoint = <tcon0_out_dsi>;
	     };

	     dsi_out_bridge: endpoint@1 {
	   	  reg = <1>;
		  remote-endpoint = <&bridge_in_dsi>;
	     };
	};
};

Note that existing device bindings are untouched and still represent
the downstream devices via child nodes since the sun6i-mipi-dsi host
will migrate to a standardized single helper to lookup for a
downstream device via child or OF-graph port or port node.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v7:
- new patch

 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Maxime Ripard March 29, 2023, 3:02 p.m. UTC | #1
The commit title is wrong, it's not a rockchip device.

On Wed, Mar 29, 2023 at 06:46:15PM +0530, Jagan Teki wrote:
> The DSI downstream devices are likely to be Panel, Bridge and
> I2C-Configured Bridge.
> 
> It is possible to connect all three devices using upstream OF-graph port
> or ports node however only Panel and Bridge are possible to connect via
> child node but not possible to connect I2C-Configured Bridge via child
> node since I2C-Configure bridges are child of I2C not upstream DSI hosts
> and it must represent them via port or ports with endpoint linking.
> 
> Allwinner A64 DSI node already has a port so add endpoint 0 for input
> tcon so that the downstream DSI devices can use endpoint 1 to connect
> Panel or Bridge or I2C-Configured Bridge.
> 
> An example of the I2C-Configured downstream bridge representation is,
> 
> i2c1 {
>        bridge@1b {
> 	     compatible = "ti,dlpc3433";
> 
>              ports {
>                   port@0 {
>                          reg = <0>;
> 
>                          bridge_in_dsi: endpoint {
>                                 remote-endpoint = <&dsi_out_bridge>;
>                                 data-lanes = <1 2 3 4>;
>                          };
>                   };
> 
> 	          port@2 {
> 	                 reg = <2>;
> 
>                          bridge_out_dmd: endpoint {
>                                 remote-endpoint = <&dmd_out_bridge>;
>                          };
>                   };
>              };
>        };
> };
> 
> dsi {
>        compatible = "allwinner,sun50i-a64-mipi-dsi";
> 
>        port {
>              dsi_in_tcon0: endpoint@0 {
> 	          reg = <0>;
> 		  remote-endpoint = <tcon0_out_dsi>;
> 	     };
> 
> 	     dsi_out_bridge: endpoint@1 {
> 	   	  reg = <1>;
> 		  remote-endpoint = <&bridge_in_dsi>;
> 	     };
> 	};
> };
> 
> Note that existing device bindings are untouched and still represent
> the downstream devices via child nodes since the sun6i-mipi-dsi host
> will migrate to a standardized single helper to lookup for a
> downstream device via child or OF-graph port or port node.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> Changes for v7:
> - new patch
> 
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 77b5349f6087..3ed566dc2172 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -1189,7 +1189,11 @@ dsi: dsi@1ca0000 {
>  			#size-cells = <0>;
>  
>  			port {
> -				dsi_in_tcon0: endpoint {
> +				#address-cells = <1>;
> +				#size-cells = <0>;
> +
> +				dsi_in_tcon0: endpoint@0 {
> +					reg = <0>;
>  					remote-endpoint = <&tcon0_out_dsi>;
>  				};

That doesn't match the DT binding anymore, and why can't we add endpoint@1 there too?

Maxime
Jagan Teki March 29, 2023, 3:30 p.m. UTC | #2
On Wed, Mar 29, 2023 at 8:32 PM Maxime Ripard <maxime@cerno.tech> wrote:
>
> The commit title is wrong, it's not a rockchip device.

Thanks for the note, I will fix it in the next version.

>
> On Wed, Mar 29, 2023 at 06:46:15PM +0530, Jagan Teki wrote:
> > The DSI downstream devices are likely to be Panel, Bridge and
> > I2C-Configured Bridge.
> >
> > It is possible to connect all three devices using upstream OF-graph port
> > or ports node however only Panel and Bridge are possible to connect via
> > child node but not possible to connect I2C-Configured Bridge via child
> > node since I2C-Configure bridges are child of I2C not upstream DSI hosts
> > and it must represent them via port or ports with endpoint linking.
> >
> > Allwinner A64 DSI node already has a port so add endpoint 0 for input
> > tcon so that the downstream DSI devices can use endpoint 1 to connect
> > Panel or Bridge or I2C-Configured Bridge.
> >
> > An example of the I2C-Configured downstream bridge representation is,
> >
> > i2c1 {
> >        bridge@1b {
> >            compatible = "ti,dlpc3433";
> >
> >              ports {
> >                   port@0 {
> >                          reg = <0>;
> >
> >                          bridge_in_dsi: endpoint {
> >                                 remote-endpoint = <&dsi_out_bridge>;
> >                                 data-lanes = <1 2 3 4>;
> >                          };
> >                   };
> >
> >                 port@2 {
> >                        reg = <2>;
> >
> >                          bridge_out_dmd: endpoint {
> >                                 remote-endpoint = <&dmd_out_bridge>;
> >                          };
> >                   };
> >              };
> >        };
> > };
> >
> > dsi {
> >        compatible = "allwinner,sun50i-a64-mipi-dsi";
> >
> >        port {
> >              dsi_in_tcon0: endpoint@0 {
> >                 reg = <0>;
> >                 remote-endpoint = <tcon0_out_dsi>;
> >            };
> >
> >            dsi_out_bridge: endpoint@1 {
> >                 reg = <1>;
> >                 remote-endpoint = <&bridge_in_dsi>;
> >            };
> >       };
> > };
> >
> > Note that existing device bindings are untouched and still represent
> > the downstream devices via child nodes since the sun6i-mipi-dsi host
> > will migrate to a standardized single helper to lookup for a
> > downstream device via child or OF-graph port or port node.
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > ---
> > Changes for v7:
> > - new patch
> >
> >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > index 77b5349f6087..3ed566dc2172 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> > @@ -1189,7 +1189,11 @@ dsi: dsi@1ca0000 {
> >                       #size-cells = <0>;
> >
> >                       port {
> > -                             dsi_in_tcon0: endpoint {
> > +                             #address-cells = <1>;
> > +                             #size-cells = <0>;
> > +
> > +                             dsi_in_tcon0: endpoint@0 {
> > +                                     reg = <0>;
> >                                       remote-endpoint = <&tcon0_out_dsi>;
> >                               };
>
> That doesn't match the DT binding anymore, and why can't we add endpoint@1 there too?

Do you mean add endpoint@1 without any remote-endpoint like this?

dsi_out_bridge: endpoint@1 {
         reg = <1>;
};

I was supposed to add this, since dtbs_check doesn't give any error. I
have skipped this, as I thought it wouldn't be needed.

Thanks,
agan.

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 77b5349f6087..3ed566dc2172 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -1189,7 +1189,11 @@  dsi: dsi@1ca0000 {
 			#size-cells = <0>;
 
 			port {
-				dsi_in_tcon0: endpoint {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dsi_in_tcon0: endpoint@0 {
+					reg = <0>;
 					remote-endpoint = <&tcon0_out_dsi>;
 				};
 			};