How to configure parallel lcd in linux and u-boot?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-16 3:45 PM
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 = <<dc_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
<dc{
pinctrl-names = "default", "sleep";
pinctrl-0 = <<dc_pins_mx>;
pinctrl-1 = <<dc_sleep_pins_mx>;
status = "okay";
/* USER CODE BEGIN ltdc */
port {
#address-cells = <1>;
#size-cells = <0>;
ltdc_out_rgb: endpoint {
};
};
/* USER CODE END ltdc */
};
Solved! Go to Solution.
- Labels:
-
LCD-LTDC
-
STM32MP15 Lines
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-20 3:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-17 6:09 AM
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-17 11:22 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-17 3:06 PM
I have include also the output of dmesg and the boot process starting from tfa to uboot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-17 3:07 PM
and "dmesg"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-18 5:03 AM
Would you have more information about your LCD panel ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-18 5:09 AM
I have included the datasheet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-20 3:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-20 11:25 PM
It works under linux now! Great!
u-boot is still a problem, I don't see the same configuration in u-boot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-21 5:32 AM
Very good !
For u-boot it is a bit different:
- « stm32 » code is in « drivers/video/stm32 » i.e https://github.com/STMicroelectronics/u-boot/tree/v2018.11-stm32mp/drivers/video/stm32
- RGB // panels are in « drivers/video/simple_panel.c » i.e https://github.com/STMicroelectronics/u-boot/blob/v2018.11-stm32mp/drivers/video/simple_panel.c
- There is no exemple of RGB // for stm32mp1 (no hdmi on uboot), but f7 is there in « arch/arm/dts/stm32f746-disco-u-boot.dtsi » i.e https://github.com/STMicroelectronics/u-boot/blob/v2018.11-stm32mp/arch/arm/dts/stm32f746-disco.dts
- You will see the Panel timings are for the time being in uboot devicetree (not like the kernel in the driver)
Success !!
