Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Ports Node When defining ports { } (meaning more than 1 port), you must set #address-cells = <1>; and #size-cells = <0>;. For more information, see the documentation in the kernel source: Documentation/devicetree/bindings/media/video-interfaces.txt
  • Resolution and Clock Definitions: An LCD Panel will have it's own separate driver. That driver will define the clock rate and resolution. The Renesas LCD driver will then get that information in order to set up the LCD controller (DU) output.
  • MIPI DSI Overview: Here is a good article explaining the MIPI DSI interface, packets and commands:  https://circuitcellar.com/resources/quickbits/mipi-display-serial-interface
  • MIPI DCS Commands: Many (most) MIPI DSI Panels require setup command (DCS) to be set over MIPI DSI to configure the panel's controller before pixel data can be sent. This is why there is usually a separate driver for each LCD since these commands are specific to each LCD panel.
  • Simple-Panel Driver: If your panel requires no special setup (no MIPI DSI DCS commands) or your system is configuring your LCD manually over I2C, or you are using a parallel RGB panel that typically requires no setup, you can use the kernel's "simple-panel" driver.
    • The main reason is that you need to tell the kernel about the resolution and pixel timing is of your panel, but that information is not described in a Device Tree, it must come from a source code driver file. The panel-simple driver is there as a way to do that by simply adding in a new entry for your custom panel.
    • Note that you will be required to edit the driver file (drivers/gpu/drm/panel/panel-simple.c) to add your specific panel resolution and timing that you want.
    • It is possible to set all your timing parameters in the Device Tree an not edit the panel-simple.c driver. You do this by specifying compatible = "panel-dpi". See example below
    • You must set CONFIG_DRM_PANEL_SIMPLE=y in your kernel to use this driver.
    • See kernel documentation Documentation/devicetree/bindings/panel/simple-panel.txt.
  • Parallel RGB LCD: Since a parallel LCD does not need any special setup, you can use simple-panel driver in the kernel.
  • Check Display Settings: You can use the command modetest -M rcar-du -c to check the status of your display driver. It will also show you the supported resolutions of your display (in the case that you are using an HDMI interface where it will read what is supported by the HDMI panel).
  • Check VBLANK Timings: You can use the command vbltest -M rcar-du to check the VBLANK timings. If your result is always around 60Hz, your panel is set correctly.

...

Expand
titleExample of Parallel(RGB) Panel on RZ/G2L (5.10)
  • Please use kernel version 5.10.201-cip41+
  • Configure pins
&pinctrl {
	du_pins: du {
		data {
			pinmux = <RZG2L_PORT_PINMUX(7, 2, 1)>,
				 <RZG2L_PORT_PINMUX(8, 0, 1)>,
				 <RZG2L_PORT_PINMUX(8, 1, 1)>,
				 <RZG2L_PORT_PINMUX(8, 2, 1)>,
				 <RZG2L_PORT_PINMUX(9, 0, 1)>,
				 <RZG2L_PORT_PINMUX(9, 1, 1)>,
				 <RZG2L_PORT_PINMUX(10, 0, 1)>,
				 <RZG2L_PORT_PINMUX(10, 1, 1)>,
				 <RZG2L_PORT_PINMUX(11, 0, 1)>,
				 <RZG2L_PORT_PINMUX(11, 1, 1)>,
				 <RZG2L_PORT_PINMUX(12, 0, 1)>,
				 <RZG2L_PORT_PINMUX(12, 1, 1)>,
				 <RZG2L_PORT_PINMUX(13, 0, 1)>,
				 <RZG2L_PORT_PINMUX(13, 1, 1)>,
				 <RZG2L_PORT_PINMUX(13, 2, 1)>,
				 <RZG2L_PORT_PINMUX(14, 0, 1)>,
				 <RZG2L_PORT_PINMUX(14, 1, 1)>,
				 <RZG2L_PORT_PINMUX(15, 0, 1)>,
				 <RZG2L_PORT_PINMUX(15, 1, 1)>,
				 <RZG2L_PORT_PINMUX(16, 0, 1)>,
				 <RZG2L_PORT_PINMUX(16, 1, 1)>,
				 <RZG2L_PORT_PINMUX(17, 0, 1)>,
				 <RZG2L_PORT_PINMUX(17, 1, 1)>,
				 <RZG2L_PORT_PINMUX(17, 2, 1)>;
		};

		sync {
			pinmux = <RZG2L_PORT_PINMUX(6, 1, 1)>, /* HSYNC */
				 <RZG2L_PORT_PINMUX(7, 0, 1)>; /* VSYNC */
		};

		de {
			pinmux = <RZG2L_PORT_PINMUX(7, 1, 1)>; /* DE */
		};

		clk {
			pinmux = <RZG2L_PORT_PINMUX(6, 0, 1)>; /* CLK */
		};
	};
};
  • We want to use simple panel driver and add the device node
panel_rgb: panel-rgb {
      		compatible = "arm,rtsm-display"; //<-- this property "arm,rtsm-display" is an example.
                                             // please fill in the correct information based on your panel spec.
      		port {
        		panel_in_rgb: endpoint {
          					remote-endpoint = <&du_out_rgb>;
       			};
     		};
};
  • Add endpoint for DU RGB out:
&du {
	pinctrl-0 = <&du_pins>;
	pinctrl-names = "default";
	status = "okay";

	ports {
		port@0 {
			du_out_rgb: endpoint {
						remote-endpoint = <&panel_in_rgb>;
			};
		};
	};
};
  • We want the MIPI DSI driver disabled
&dsi0 {
	status = "disabled";
};


Expand
titleSimple Panel Example using Device Tree only ("panel-dpi")

If you do not want to edit the panel-simple.c file, you can use compatible = "panel-dpi" and then enter your LCD timings in the Device Tree.

Here is an example of attaching a parallel RGB LCD to a RZ/G2L and using "panel-dpi" and only using the Device Tree. The driver panel-simple.c does not have to be modified.

Remember, the kernel configuration CONFIG_DRM_PANEL_SIMPLE=y must be set.


/ {
    panel_rgb: panel-rgb {
        compatible = "panel-dpi";

        /* panel-timing is used for "panel-dpi" compatible */
        panel-timing {
            clock-frequency = <9000000>;
            hactive = <480>;
            vactive = <272>;
            hsync-len = <43>;
            hfront-porch = <8>;
            hback-porch = <41>;
            vfront-porch = <4>;
            vback-porch = <10>;
            vsync-len = <21>;
        };

        port {
            panel_in_rgb: endpoint {
                remote-endpoint = <&du_out_rgb>;
            };
        };
    };
};

&pinctrl {
    du_pins: du {
        data {
            pinmux = <RZG2L_PORT_PINMUX(14, 1, 1)>,
            <RZG2L_PORT_PINMUX(15, 0, 1)>,
            <RZG2L_PORT_PINMUX(15, 1, 1)>,
            <RZG2L_PORT_PINMUX(16, 0, 1)>,
            <RZG2L_PORT_PINMUX(16, 1, 1)>,
            <RZG2L_PORT_PINMUX(17, 0, 1)>,
            <RZG2L_PORT_PINMUX(17, 1, 1)>,
            <RZG2L_PORT_PINMUX(17, 2, 1)>,
            <RZG2L_PORT_PINMUX(11, 0, 1)>,
            <RZG2L_PORT_PINMUX(11, 1, 1)>,
            <RZG2L_PORT_PINMUX(12, 0, 1)>,
            <RZG2L_PORT_PINMUX(12, 1, 1)>,
            <RZG2L_PORT_PINMUX(13, 0, 1)>,
            <RZG2L_PORT_PINMUX(13, 1, 1)>,
            <RZG2L_PORT_PINMUX(13, 2, 1)>,
            <RZG2L_PORT_PINMUX(14, 0, 1)>,
            <RZG2L_PORT_PINMUX(7, 2, 1)>,
            <RZG2L_PORT_PINMUX(8, 0, 1)>,
            <RZG2L_PORT_PINMUX(8, 1, 1)>,
            <RZG2L_PORT_PINMUX(8, 2, 1)>,
            <RZG2L_PORT_PINMUX(9, 0, 1)>,
            <RZG2L_PORT_PINMUX(9, 1, 1)>,
            <RZG2L_PORT_PINMUX(10, 0, 1)>,
            <RZG2L_PORT_PINMUX(10, 1, 1)>;
        };

        sync {
            pinmux = <RZG2L_PORT_PINMUX(6, 1, 1)>, /* HSYNC */
            <RZG2L_PORT_PINMUX(7, 0, 1)>; /* VSYNC */
        };

        de {
            pinmux = <RZG2L_PORT_PINMUX(7, 1, 1)>; /* DE */
        };

        clk {
            pinmux = <RZG2L_PORT_PINMUX(6, 0, 1)>; /* CLK */
        };
    };
};

&dsi0 {
    status = "disabled";
};

&du {
    pinctrl-0 = <&du_pins>;
    pinctrl-names = "default";
    status = "okay";

    ports {
        port@0 {
            du_out_rgb: endpoint {
                remote-endpoint = <&panel_in_rgb>;
            };
        };
    };
};




Expand
titleExample of RGB Panel on RZ/G2L (4.19 kernel only)
  • Configure pins
&pinctrl {
	du_pins: du {
		data {
			pinmux = <RZG2L_PORT_PINMUX(7,  2, 1)>,
				 <RZG2L_PORT_PINMUX(8,  0, 1)>,
				 <RZG2L_PORT_PINMUX(8,  1, 1)>,
				 <RZG2L_PORT_PINMUX(8,  2, 1)>,
				 <RZG2L_PORT_PINMUX(9,  0, 1)>,
				 <RZG2L_PORT_PINMUX(9,  1, 1)>,
				 <RZG2L_PORT_PINMUX(10, 0, 1)>,
				 <RZG2L_PORT_PINMUX(10, 1, 1)>,
				 <RZG2L_PORT_PINMUX(11, 0, 1)>,
				 <RZG2L_PORT_PINMUX(11, 1, 1)>,
				 <RZG2L_PORT_PINMUX(12, 0, 1)>,
				 <RZG2L_PORT_PINMUX(12, 1, 1)>,
				 <RZG2L_PORT_PINMUX(13, 0, 1)>,
				 <RZG2L_PORT_PINMUX(13, 1, 1)>,
				 <RZG2L_PORT_PINMUX(13, 2, 1)>,
				 <RZG2L_PORT_PINMUX(14, 0, 1)>,
				 <RZG2L_PORT_PINMUX(14, 1, 1)>,
				 <RZG2L_PORT_PINMUX(15, 0, 1)>,
				 <RZG2L_PORT_PINMUX(15, 1, 1)>,
				 <RZG2L_PORT_PINMUX(16, 0, 1)>,
				 <RZG2L_PORT_PINMUX(16, 1, 1)>,
				 <RZG2L_PORT_PINMUX(17, 0, 1)>,
				 <RZG2L_PORT_PINMUX(17, 1, 1)>,
				 <RZG2L_PORT_PINMUX(17, 2, 1)>;
		};

		sync {
			pinmux = <RZG2L_PORT_PINMUX(6, 1, 1)>, /* HSYNC */
				 <RZG2L_PORT_PINMUX(7, 0, 1)>; /* VSYNC */
		};

		de {
			pinmux = <RZG2L_PORT_PINMUX(7, 1, 1)>; /* DE */
		};
		
		clk {
			pinmux = <RZG2L_PORT_PINMUX(6, 0, 1)>; /* CLK */
		};
	};
};


  • Add a rgb-dummy device
	rgb-dummy {
		compatible = "renesas,rgb-dummy";
		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				rgb_in: endpoint {
					remote-endpoint = <&du_out_rgb>;
					};
				};
				port@1 {
					reg = <1>;
						rgb_out: endpoint {
							remote-endpoint = <&panel_in>;
						};
				};
			};
		};
  • Add panel device node:
panel {
	/* 
	* Define code for panel here such as compatible, backlight, power,...
	* Can refer drivers/gpu/drm/panel/panel-simple.c
	*/
	port {
		panel_in: endpoint {
			remote-endpoint = <&rgb_out>;
		};
	};
};


  • We want the MIPI DSI driver disabled
&dsi0 {
	status = "disabled";
};
  • Add endpoint for DU RGB out:
&du {
	pinctrl-0 = <&du_pins>;
	pinctrl-names = "default";

	ports {
		port@0 {
			du_out_rgb: endpoint {
				remote-endpoint = <&rgb_in>;
			};
		};
	};
 };

...