Skip to main content
Visitor II
June 16, 2019
Solved

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

  • June 16, 2019
  • 4 replies
  • 8747 views

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 */
};

    This topic has been closed for replies.
    Best answer by Bernard PUEL

    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

    4 replies

    Technical Moderator
    June 17, 2019

    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).

    Visitor II
    June 17, 2019

    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.

    Technical Moderator
    June 18, 2019

    Would you have more information about your LCD panel ?

    Visitor II
    June 18, 2019

    I have included the datasheet.

    Technical Moderator
    June 20, 2019

    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

    Visitor II
    June 21, 2019

    It works under linux now! Great!

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

    Visitor II
    August 4, 2020

    Hi

    CAN YOU SHARE simple panel ltdc dts configuration, and what drivers you enabled,

    i am getting following error

    [  27.659534] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPBLOB

    [  27.659547] [drm:drm_mode_object_put.part.0] OBJ ID: 34 (2)

    [  27.769469] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETRESOURCES

    [  27.769513] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETRESOURCES

    [  27.769550] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR

    [  27.769575] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:29:DPI-1]

    [  27.769640] [drm:drm_mode_debug_printmodeline] Modeline 35:"800x480" 0 24000 800 1056 1057 1058 480 525 528 529 0x48 0x200000

    [  27.769655] [drm:drm_mode_prune_invalid] Not using 800x480 mode: BAD

    [  27.769678] [drm:drm_mode_object_put.part.0] OBJ ID: 29 (2)

    [  27.769700] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETCONNECTOR

    [  27.769724] [drm:drm_mode_object_put.part.0] OBJ ID: 29 (2)

    [  27.770042] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_OBJ_GETPROPERTIES

    [  27.770070] [drm:drm_mode_object_put.part.0] OBJ ID: 29 (2)

    [  27.770094] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_OBJ_GETPROPERTIES

    [  27.770114] [drm:drm_mode_object_put.part.0] OBJ ID: 29 (2)

    [  27.770142] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770161] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770186] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770207] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770238] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770257] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770283] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770301] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770323] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770342] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETPROPERTY

    [  27.770387] [drm:drm_ioctl] pid=799, dev=0xe200, auth=1, DRM_IOCTL_MODE_GETENCODER

    [  27.770402] [drm:drm_ioctl] pid=799, ret = -2

    [  34.320078] random: crng init done

    Technical Moderator
    June 21, 2019

    Very good !

    For u-boot it is a bit different:

    Success !!