cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure parallel lcd in linux and u-boot?

robin_elecgator
Associate II

I have a generic parallel LCD screen. 24 bits RGB, vsync, hsync, pclk, data_enable, disp_on,..

The examples I see on the wiki only shows the HDMI connection and DSI. How do you configure this for DPI?

Is this a good start? (In the device tree)

panel_backlight: panel-backlight {
	compatible = "gpio-backlight";
	gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>, <&gpioc 4 GPIO_ACTIVE_HIGH>;
	default-on;
	status = "okay";
};
 
lcd0: display@0 {
        compatible ="panel-dpi";
        label = "lcd";
		enable-gpios = <&gpioh 15 GPIO_ACTIVE_HIGH>;
        backlight = <&panel_backlight>;
 
        port {
            lcd_in: endpoint {
                    remote-endpoint = <&ltdc_out_rgb>;
            };
        };
 
        panel-timing {
                clock-frequency = <33000000>;
                hactive = <800>;
                vactive = <480>;
                hfront-porch = <40>;
                hback-porch = <40>;
                hsync-len = <24>;
                vback-porch = <29>;
                vfront-porch = <13>;
                vsync-len = <3>;
 
                hsync-active = <0>;
                vsync-active = <0>;
                de-active = <1>;
                pixelclk-active = <1>;
        };
};

and

&ltdc{
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&ltdc_pins_mx>;
    pinctrl-1 = <&ltdc_sleep_pins_mx>;
    status = "okay";
 
    /* USER CODE BEGIN ltdc */
	port {
		#address-cells = <1>;
		#size-cells = <0>;
 
		ltdc_out_rgb: endpoint {
		};
	};
    /* USER CODE END ltdc */
};

1 ACCEPTED SOLUTION

Accepted Solutions
Bernard PUEL
ST Employee

Hello Robin,

Thanks for all the details.

Yes EV1 and DK2 are using a DSI but LTDC is also used with DSI and DK2 is using for the HDMI bridge interface a parallel port.

So for reference of LTDC declaration, you can check in Kernel:

  • stm32mp157a-dk1.dts: parallel LTDC interface with HDMI bridge
  • stm32429i-eval.dts: panel declaration (in u-boot you can rely also on other stm32 series for LTDC reference)

Looking at your device tree, there are few issues and the main one being the first one listed below (so better start with it):

  • "panel-dpi" is related to old fbdev framework that should not be used. Better use drm/kms framework for display part. You will see many example of panel driver in "gpu/drm/panel/panel-simple.c" and you will see some minor difference of the device tree declaration (panel settings being into the driver instead of dts and backlight property to be added).
  • We don't see the status = ok in lcd0 node
  • you can rely on "devicetree/bindings/display/panel/simple-panel.txt" for documentation

View solution in original post

10 REPLIES 10
Bernard PUEL
ST Employee

Hello,

have a look on standard linux framework: https://wiki.st.com/stm32mpu/wiki/DRM_KMS_overview.

On HW side, you will see 2 'layers':

  • internal drivers: dsi or ltdc
  • external device: directly the panel if compatible or a bridge to do the interface

It seems your HW is compatible with ltdc interface. So you will find linked to this article some reference about device tree configuration and also the examples of running solution on ST boards (Disco and Eval board).

I don't really see what I'm doing wrong.

1) you configure the pinmux (CubeMX tool has done that for me)

2) you configure the LTDC, add the "port"

3) you define a panel, which I have done with panel-dpi

I don't see my mistake. The display examples use the DSI (serial port) instead of the parallel port.

I have included the device tree.

I have include also the output of dmesg and the boot process starting from tfa to uboot.

and "dmesg"

Bernard PUEL
ST Employee

Would you have more information about your LCD panel ?

I have included the datasheet.

Bernard PUEL
ST Employee

Hello Robin,

Thanks for all the details.

Yes EV1 and DK2 are using a DSI but LTDC is also used with DSI and DK2 is using for the HDMI bridge interface a parallel port.

So for reference of LTDC declaration, you can check in Kernel:

  • stm32mp157a-dk1.dts: parallel LTDC interface with HDMI bridge
  • stm32429i-eval.dts: panel declaration (in u-boot you can rely also on other stm32 series for LTDC reference)

Looking at your device tree, there are few issues and the main one being the first one listed below (so better start with it):

  • "panel-dpi" is related to old fbdev framework that should not be used. Better use drm/kms framework for display part. You will see many example of panel driver in "gpu/drm/panel/panel-simple.c" and you will see some minor difference of the device tree declaration (panel settings being into the driver instead of dts and backlight property to be added).
  • We don't see the status = ok in lcd0 node
  • you can rely on "devicetree/bindings/display/panel/simple-panel.txt" for documentation

It works under linux now! Great!

u-boot is still a problem, I don't see the same configuration in u-boot.

Bernard PUEL
ST Employee

Very good !

For u-boot it is a bit different:

Success !!