18c2ecf20Sopenharmony_ciDevice-Tree bindings for LVDS Display Bridge (ldb)
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciLVDS Display Bridge
48c2ecf20Sopenharmony_ci===================
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciThe LVDS Display Bridge device tree node contains up to two lvds-channel
78c2ecf20Sopenharmony_cinodes describing each of the two LVDS encoder channels of the bridge.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciRequired properties:
108c2ecf20Sopenharmony_ci - #address-cells : should be <1>
118c2ecf20Sopenharmony_ci - #size-cells : should be <0>
128c2ecf20Sopenharmony_ci - compatible : should be "fsl,imx53-ldb" or "fsl,imx6q-ldb".
138c2ecf20Sopenharmony_ci                Both LDB versions are similar, but i.MX6 has an additional
148c2ecf20Sopenharmony_ci                multiplexer in the front to select any of the four IPU display
158c2ecf20Sopenharmony_ci                interfaces as input for each LVDS channel.
168c2ecf20Sopenharmony_ci - gpr : should be <&gpr> on i.MX53 and i.MX6q.
178c2ecf20Sopenharmony_ci         The phandle points to the iomuxc-gpr region containing the LVDS
188c2ecf20Sopenharmony_ci         control register.
198c2ecf20Sopenharmony_ci- clocks, clock-names : phandles to the LDB divider and selector clocks and to
208c2ecf20Sopenharmony_ci                        the display interface selector clocks, as described in
218c2ecf20Sopenharmony_ci                        Documentation/devicetree/bindings/clock/clock-bindings.txt
228c2ecf20Sopenharmony_ci        The following clocks are expected on i.MX53:
238c2ecf20Sopenharmony_ci                "di0_pll" - LDB LVDS channel 0 mux
248c2ecf20Sopenharmony_ci                "di1_pll" - LDB LVDS channel 1 mux
258c2ecf20Sopenharmony_ci                "di0" - LDB LVDS channel 0 gate
268c2ecf20Sopenharmony_ci                "di1" - LDB LVDS channel 1 gate
278c2ecf20Sopenharmony_ci                "di0_sel" - IPU1 DI0 mux
288c2ecf20Sopenharmony_ci                "di1_sel" - IPU1 DI1 mux
298c2ecf20Sopenharmony_ci        On i.MX6q the following additional clocks are needed:
308c2ecf20Sopenharmony_ci                "di2_sel" - IPU2 DI0 mux
318c2ecf20Sopenharmony_ci                "di3_sel" - IPU2 DI1 mux
328c2ecf20Sopenharmony_ci        The needed clock numbers for each are documented in
338c2ecf20Sopenharmony_ci        Documentation/devicetree/bindings/clock/imx5-clock.yaml, and in
348c2ecf20Sopenharmony_ci        Documentation/devicetree/bindings/clock/imx6q-clock.yaml.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciOptional properties:
378c2ecf20Sopenharmony_ci - pinctrl-names : should be "default" on i.MX53, not used on i.MX6q
388c2ecf20Sopenharmony_ci - pinctrl-0 : a phandle pointing to LVDS pin settings on i.MX53,
398c2ecf20Sopenharmony_ci               not used on i.MX6q
408c2ecf20Sopenharmony_ci - fsl,dual-channel : boolean. if it exists, only LVDS channel 0 should
418c2ecf20Sopenharmony_ci   be configured - one input will be distributed on both outputs in dual
428c2ecf20Sopenharmony_ci   channel mode
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciLVDS Channel
458c2ecf20Sopenharmony_ci============
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ciEach LVDS Channel has to contain either an of graph link to a panel device node
488c2ecf20Sopenharmony_cior a display-timings node that describes the video timings for the connected
498c2ecf20Sopenharmony_ciLVDS display as well as the fsl,data-mapping and fsl,data-width properties.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciRequired properties:
528c2ecf20Sopenharmony_ci - reg : should be <0> or <1>
538c2ecf20Sopenharmony_ci - port: Input and output port nodes with endpoint definitions as defined in
548c2ecf20Sopenharmony_ci   Documentation/devicetree/bindings/graph.txt.
558c2ecf20Sopenharmony_ci   On i.MX5, the internal two-input-multiplexer is used. Due to hardware
568c2ecf20Sopenharmony_ci   limitations, only one input port (port@[0,1]) can be used for each channel
578c2ecf20Sopenharmony_ci   (lvds-channel@[0,1], respectively).
588c2ecf20Sopenharmony_ci   On i.MX6, there should be four input ports (port@[0-3]) that correspond
598c2ecf20Sopenharmony_ci   to the four LVDS multiplexer inputs.
608c2ecf20Sopenharmony_ci   A single output port (port@2 on i.MX5, port@4 on i.MX6) must be connected
618c2ecf20Sopenharmony_ci   to a panel input port. Optionally, the output port can be left out if
628c2ecf20Sopenharmony_ci   display-timings are used instead.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciOptional properties (required if display-timings are used):
658c2ecf20Sopenharmony_ci - ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
668c2ecf20Sopenharmony_ci - display-timings : A node that describes the display timings as defined in
678c2ecf20Sopenharmony_ci   Documentation/devicetree/bindings/display/panel/display-timing.txt.
688c2ecf20Sopenharmony_ci - fsl,data-mapping : should be "spwg" or "jeida"
698c2ecf20Sopenharmony_ci                      This describes how the color bits are laid out in the
708c2ecf20Sopenharmony_ci                      serialized LVDS signal.
718c2ecf20Sopenharmony_ci - fsl,data-width : should be <18> or <24>
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ciexample:
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_cigpr: iomuxc-gpr@53fa8000 {
768c2ecf20Sopenharmony_ci	/* ... */
778c2ecf20Sopenharmony_ci};
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_cildb: ldb@53fa8008 {
808c2ecf20Sopenharmony_ci	#address-cells = <1>;
818c2ecf20Sopenharmony_ci	#size-cells = <0>;
828c2ecf20Sopenharmony_ci	compatible = "fsl,imx53-ldb";
838c2ecf20Sopenharmony_ci	gpr = <&gpr>;
848c2ecf20Sopenharmony_ci	clocks = <&clks IMX5_CLK_LDB_DI0_SEL>,
858c2ecf20Sopenharmony_ci		 <&clks IMX5_CLK_LDB_DI1_SEL>,
868c2ecf20Sopenharmony_ci		 <&clks IMX5_CLK_IPU_DI0_SEL>,
878c2ecf20Sopenharmony_ci		 <&clks IMX5_CLK_IPU_DI1_SEL>,
888c2ecf20Sopenharmony_ci		 <&clks IMX5_CLK_LDB_DI0_GATE>,
898c2ecf20Sopenharmony_ci		 <&clks IMX5_CLK_LDB_DI1_GATE>;
908c2ecf20Sopenharmony_ci	clock-names = "di0_pll", "di1_pll",
918c2ecf20Sopenharmony_ci		      "di0_sel", "di1_sel",
928c2ecf20Sopenharmony_ci		      "di0", "di1";
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci	/* Using an of-graph endpoint link to connect the panel */
958c2ecf20Sopenharmony_ci	lvds-channel@0 {
968c2ecf20Sopenharmony_ci		#address-cells = <1>;
978c2ecf20Sopenharmony_ci		#size-cells = <0>;
988c2ecf20Sopenharmony_ci		reg = <0>;
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci		port@0 {
1018c2ecf20Sopenharmony_ci			reg = <0>;
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci			lvds0_in: endpoint {
1048c2ecf20Sopenharmony_ci				remote-endpoint = <&ipu_di0_lvds0>;
1058c2ecf20Sopenharmony_ci			};
1068c2ecf20Sopenharmony_ci		};
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci		port@2 {
1098c2ecf20Sopenharmony_ci			reg = <2>;
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci			lvds0_out: endpoint {
1128c2ecf20Sopenharmony_ci				remote-endpoint = <&panel_in>;
1138c2ecf20Sopenharmony_ci			};
1148c2ecf20Sopenharmony_ci		};
1158c2ecf20Sopenharmony_ci	};
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	/* Using display-timings and fsl,data-mapping/width instead */
1188c2ecf20Sopenharmony_ci	lvds-channel@1 {
1198c2ecf20Sopenharmony_ci		#address-cells = <1>;
1208c2ecf20Sopenharmony_ci		#size-cells = <0>;
1218c2ecf20Sopenharmony_ci		reg = <1>;
1228c2ecf20Sopenharmony_ci		fsl,data-mapping = "spwg";
1238c2ecf20Sopenharmony_ci		fsl,data-width = <24>;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci		display-timings {
1268c2ecf20Sopenharmony_ci			/* ... */
1278c2ecf20Sopenharmony_ci		};
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci		port@1 {
1308c2ecf20Sopenharmony_ci			reg = <1>;
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci			lvds1_in: endpoint {
1338c2ecf20Sopenharmony_ci				remote-endpoint = <&ipu_di1_lvds1>;
1348c2ecf20Sopenharmony_ci			};
1358c2ecf20Sopenharmony_ci		};
1368c2ecf20Sopenharmony_ci	};
1378c2ecf20Sopenharmony_ci};
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_cipanel: lvds-panel {
1408c2ecf20Sopenharmony_ci	/* ... */
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci	port {
1438c2ecf20Sopenharmony_ci		panel_in: endpoint {
1448c2ecf20Sopenharmony_ci			remote-endpoint = <&lvds0_out>;
1458c2ecf20Sopenharmony_ci		};
1468c2ecf20Sopenharmony_ci	};
1478c2ecf20Sopenharmony_ci};
148