Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Introduction

Aim of this section is to properly configure LVDS settings.

LVDS Display Bridge (LDB) is used to connect the IPU (Image Processing Unit) to the External LVDS Display Interface. Its purpose is to support flow of synchronous RGB data from the IPU to external display devices through the LVDS interface.

Device Tree Overlay

Device Tree Overlays (DTO) provide a way to modify the overall device tree without re-compiling the complete device tree.
Overlays are fragments of a complete device tree that can be included or removed according with the environment. Direct consequence is enabling/disabling hardware components in the system.

The process of designing a Device Tree Overlay includes three macro steps:

  • writing a Device Tree Overlay (.dts) file;

  • Generating a *.dtbo file, output of *.dts file build;

  • enable the overlay through *.dtbo file.

For further information about overlay device tree customization, you can refer to the documentation available at following Kernel path:

linux-seco/Documentation/devicetree/overlay-notes.txt

Some devices are used in overlays and those devices are pre-enabled by default in the source, Below the reference table for pre-enabled device tree overlay.

Eg: display, touch, cpld, gpio available in overlay.

Boards family

Peripherals

Device tree overlay

i.MX6

UART, LVDS, RGB, Audio, HDMI, Touch, GPIO, Pin header selection…

You can find the pre-enabled device tree overlay

imx6qdl-seco_i.MX6XXX_uart4.dtbo ,imx6qdl-seco_i.MX6XXX_video_LVDS.dtbo,imx6qdl-seco_i.MX6XXX_ac97.dtbo,imx6qdl-seco_i.MX6XXX_video_HDMI.dtbo,imx6qdl-seco_i.MX6XXX_cpld_gpio_pwm.dtbo,imx6qdl-seco_i.MX6XXX_touch_st1232.dtbo,imx6sx-seco_i.MX6XXX_conn_j9.dtbo,imx6sx-seco_i.MX6XXX_RGB.dtbo

i.MX8

HDMI, Display Port, LVDS , Camera, hdmiin, lcdif, Modem, eDP, GPIO,CAN, RTC,PCIe, SPI, DCSS, WiFi/BT …

You can find the pre-enabled device tree overlay

seco-i.MX8XXX-hdmi.dtbo,seco-i.MX8XXX-dp.dtbo,seco-i.MX8XXX-lvds-dual.dtbo,seco-i.MX8XXX-ov5640-csi0.dtbo,seco-i.MX8XXX-hdmiin.dtbo,seco-i.MX8XXX-lcdif-sn65dsi86.dtbo,seco-i.MX8XXX-modem.dtbo,seco-i.MX8XXX-port1-can.dtbo,seco-i.MX8XXX-port1-rs232.dtbo,seco-i.MX8XXX-wilink.dtbo

LVDS Customization Guide for i.MX6

The i.MX6 based modules use the fbdev interface for mode setting and output configuration.
Two IPU units are on the imx6q SOC while only one IPU unit on the imx6dl SOC. Each IPU unit has two display interfaces. The Vivante X driver can only make use of the first framebuffer /dev/fb0 while the others can be used through the fbdev framebuffer interface.

The assignment of the possible display outputs to the framebuffers (scan-out engines) and their timing configuration can be done both through Kernel command line and within the device tree. The command line settings take precedence over the device tree.
The first and third video output has an additional overlay framebuffer configured.

Video output

IPU core

fb boot name

fb device

overlay fb device

First

IPU1

mxcfb0

/dev/fb0

/dev/fb1

Second

IPU1

mxcfb1

/dev/fb2

Third

IPU2

mxcfb2

/dev/fb3

/dev/fb4

Fourth

IPU2

mxcfb3

/dev/fb5

Adding Custom LVDS support in Device tree file for i.MX6

Please follow the steps below to add the custom display timing data into the imx6qdl-seco_lvds_display.dtsi file.

Refer the signal timing specifications of LCD in the datasheet & then calculate the parameters of using this open source reference, https://www.epanorama.net/faq/vga2rgb/calc.html

  1. hback-porch

  2. hfront-porch

  3. vback-porch

  4. vfront-porch

  5. hsync-len

  6. vsync-len

LDB Structure format:

To obtain information about the structure ldb, you can refer to the documentation presents into the kernel:

linux-seco/Documentation/devicetree/bindings/display/imx/ldb.txt
linux-seco/Documentation/devicetree/bindings/fb/fsl_ipuv3_fb.txt
        timing9: $name { 
		      clock-frequency = <$Clock-frequency>; 
			  hactive = <$Hactive>; 
			  vactive = <$Vactive>; 
			  hback-porch = <$Hback>; 
			  hfront-porch = <$Hfront>; 
			  vback-porch = <$Vback>; 
			  vfront-porch = <$Vfront>; 
			  hsync-len = <$Hsync>; 
			  vsync-len = <$Vsync>; 
		};

Here is the sample timing data for SVGA TFT LCD(800x600) 10.4 inches (BA104S01-100):

                     name = LBD-SVGA-BA
                     Clock-frequency = 39600000
                     Hactive = 800
                     Vactive = 600
                     Hback = 45
                     Hfront = 45
                     Vback = 25 
                     Vfront = 25 
                     Hsync = 10
                     Vsync = 10

Then getting into device tree path (arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi),Please find below ldb structure to be add in the imx6qdl-seco_lvds_display.dtsi file.

cd linux-seco/arch/arm/boot/dts
vi imx6qdl-seco_lvds_display.dtsi

Add the created new LDB structure into LVDS device tree file and save the file.

Now you can check the device tree overlay file whether LVDS (ldb) enabled or not. Below the example to enable the ldb node.

fragment@3 {
   		target = <&ldb>;
        __overlay__ {

            status      = "okay";

		};
	};

Once you are done the setup,you can compile the source.

Since BSP9.0 , LVDS is enabled by device tree overlay file, using seco_config tool to load the device tree overlay in u-boot level.

Device tree display overlay for i.MX6

Board

Module

Peripheral

Overlays

928

Q7

HDMI,

LVDS

imx6qdl-seco_quadmo747_928_video_LVDS.dtbo
imx6qdl-seco_quadmo747_928_video_LVDSx2_CLONE.dtbo
imx6qdl-seco_quadmo747_928_video_LVDSx2_DUAL.dtbo
imx6qdl-seco_quadmo747_928_video_HDMI.dtbo
imx6qdl-seco_quadmo747_928_video_LVDS_HDMI.dtbo
imx6qdl-seco_quadmo747_928_video_HDMI_LVDS.dtbo

962

μQ7

HDMI,

LVDS

imx6qdl-seco_uq7_962_video_LVDS.dtbo
imx6qdl-seco_uq7_962_video_LVDSx2_CLONE.dtbo
imx6qdl-seco_uq7_962_video_LVDSx2_DUAL.dtbo
imx6qdl-seco_uq7_962_video_HDMI.dtbo
imx6qdl-seco_uq7_962_video_LVDS_HDMI.dtbo
imx6qdl-seco_uq7_962_video_HDMI_LVDS.dtbo

A75-J

μQ7

HDMI,

LVDS

imx6qdl-seco_uQ7_J_A75_video_LVDS.dtbo
imx6qdl-seco_uQ7_J_A75_video_LVDSx2_CLONE.dtbo
imx6qdl-seco_uQ7_J_A75_video_LVDSx2_DUAL.dtbo
imx6qdl-seco_uQ7_J_A75_video_HDMI.dtbo
imx6qdl-seco_uQ7_J_A75_video_LVDS_HDMI.dtbo
imx6qdl-seco_uQ7_J_A75_video_HDMI_LVDS.dtbo

A62-J

SBC

HDMI,

LVDS,

Sitronix touch(st1232),

Goodix Touch(gt928)

imx6qdl-seco_SBC_A62_touch_gt928.dtbo
imx6qdl-seco_SBC_A62_touch_st1232.dtbo
imx6qdl-seco_SBC_A62_video_LVDS.dtbo
imx6qdl-seco_SBC_A62_video_LVDSx2_CLONE.dtbo
imx6qdl-seco_SBC_A62_video_LVDSx2_DUAL.dtbo
imx6qdl-seco_SBC_A62_video_HDMI.dtbo
imx6qdl-seco_SBC_A62_video_LVDS_HDMI.dtbo
imx6qdl-seco_SBC_A62_video_HDMI_LVDS.dtbo

B08

SBC & SYS

LVDS,

RGB

imx6sx-seco_SBC_B08_LVDS.dtbo
imx6sx-seco_SBC_B08_RGB.dtbo

C23

SBC

LVDS

imx6sx-seco_SBC_C23_LVDS.dtbo

BSP9.0 onwards,our images comes with pre-built available overlays binaries as (.dtbo).

In Linux BSP 9.0 you can list these files available on the boot partition,

For eg: A62

ls -l boot/
total 8532
-rw-r--r-- 1 secospa secospa   69897 Sep 16 13:17 imx6dl-seco_SBC_A62.dtb
-rw-r--r-- 1 secospa secospa      72 Sep 16 13:17 imx6qdl-seco_SBC_A62_conn_j8.dtbo
-rw-r--r-- 1 secospa secospa     307 Sep 16 13:17 imx6qdl-seco_SBC_A62_touch_gt928.dtbo
-rw-r--r-- 1 secospa secospa     311 Sep 16 13:17 imx6qdl-seco_SBC_A62_touch_st1232.dtbo
-rw-r--r-- 1 secospa secospa     942 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_HDMI.dtbo
-rw-r--r-- 1 secospa secospa    1556 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_HDMI_LVDS.dtbo
-rw-r--r-- 1 secospa secospa     812 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_LVDS.dtbo
-rw-r--r-- 1 secospa secospa    1556 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_LVDS_HDMI.dtbo
-rw-r--r-- 1 secospa secospa     955 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_LVDSx2_CLONE.dtbo
-rw-r--r-- 1 secospa secospa    1088 Sep 16 13:17 imx6qdl-seco_SBC_A62_video_LVDSx2_DUAL.dtbo
-rw-r--r-- 1 secospa secospa   71563 Sep 16 13:17 imx6q-seco_SBC_A62.dtb

Once done, you can boot the board using seco_config tool to configure the Device tree overlay, Below are the commands to setup,

MX6QDLS SBC-A62 U-Boot > seco_config
 __________________________________________________
                     Chose Video Setting.
 __________________________________________________
1) no display
2) LVDS
3) HDMI
4) LVDS - LVDS (clone)
5) LVDS - LVDS (dual)
6) LVDS - HDMI
7) HDMI - LVDS
> 2

 __________________________________________________
        Chose LVDS resolution for LVDS1.
 __________________________________________________
1) WVGA	   [800x480]
2) SVGA	   [800x600]
3) XGA	   [1024x768]
4) WXGA	   [1368x768]
5) WXGAP60 [1280x800]
6) SXGA	   [1280x1024]
7) HD1080  [1920x1080]
> 1

 __________________________________________________
     Chose FDT overlay option for touch screen controller.
 __________________________________________________
1) not use
2) st1232
3) gt928
> 2

 __________________________________________________
     Chose FDT overlay option for J8 Expansion Connector configurator.
 __________________________________________________
1) defalut
2) custom
> 1


Saving Environment to MMC... Writing to MMC(1)... OK
X6QDLS SBC-A62 U-Boot > saveenv  
Saving Environment to MMC... Writing to MMC(1)... OK
MX6QDLS SBC-A62 U-Boot > printenv fdt_file      
fdt_file=imx6q-seco_SBC_A62.dtb
MX6QDLS SBC-A62 U-Boot > printenv fdt_overlay_video_list 
fdt_overlay_video_list=imx6qdl-seco_SBC_A62_video_LVDS.dtbo
MX6QDLS SBC-A62 U-Boot > printenv fdt_overlay_per_list   
fdt_overlay_per_list=imx6qdl-seco_SBC_A62_touch_st1232.dtbo 
MX6QDLS SBC-A62 U-Boot > boot
SECO i.MX Distro with XWayload backend 4.19-warrior secoboards ttymxc1

secoboards login: root
password:
ast login: Thu Sep 16 06:50:45 UTC 2021 on tty7
root@secoboards:~# 

Successfully Board has been loaded with LVDS and Touch (st1232) dtbo file.

LVDS Customization Guide for i.MX8

The MIPI DSI support on i.MX8 is enabled through the device trees located in the kernel source in arch/arm64/boot/dts/seco. MIPI-DSI on i.MX8 with IPU is supported with Synopsys hardware while i.MX8 uses the Mixel and the Advantec pane

The SECO boards with i.MX8 SoC supports MIPI-DSI interface,

  • Texas Instruments SN65DSI84 MIPI® DSI bridge to FlatLink™ LVDS single-channel DSI to dual-link LVDS bridge

  • Texas Instruments SN65DSI86 Dual-channel MIPI® DSI to embedded DisplayPort™ (eDP ) bridge.

DCSS vs LCDIF

i.MX8M boards comes with 2 display controllers: DCSS and LCDIF.

  1. DCCS can be connected to HDMI, DP or MIPI-DSI and supports resolutions up to 4K.

  2. LCDIF can be connected only to MIPI-DSI and supports resolutions up to 1080p..

All drivers on the i.MX8,i.MX8M Mini,i.MX8M Nano,i.MX8X and i.MX8M Plus family modules are integrated into the Linux kernel's DRM/KMS subsystem.

Display Interface should be added in the Linux Device Tree overlay and Panel enabled in Device tree.

The process of designing a Device Tree Overlay includes three macro steps:

  • writing a Device Tree Overlay (.dts) file;

  • generating a *.dtbo file, output of *.dts file build;

  • enable the overlay through *.dtbo file.

To obtain information about overlay device tree, you can refer to the documentation presents into the kernel:

linux-seco/Documentation/devicetree/overlay-notes.txt

Using the above document you can customize the device tree overlay enable and disable functionality.

Embedded displays often do not have a dedicated DDC (e.g. parallel RGB, LVDS, or similar display links), and therefore the system needs to be told what exact display resolution and timings have to be supplied.

Embedded displays without DDC channel (parallel RGB/LVDS) use a fixed mode provided by the driver, this can be either:

  • display modes from a display driver (used for kernel mode settings (KMS) e.g. from panel-simple.c, e.g. i.MX8 DRM driver);

  • display modes from a specific devicetree overlay (support available just from BSP 9 on);

  • KMS interface (Kernel Mode Setting, part of the Direct Rendering Manager (DRM) interface, kernel argument, through Xorg/RandR using modesetting driver).

Adding Custom LVDS support in panel-simple.c for i.MX8*

The connected panel is represented in the device tree in its own node. That node references the used LDB/LVDS channel through its node 'port'.One can either use the panel-simple or the panel-lvds driver, both options are outlined below.

Panel Simple

Set the property 'compatible' to an existing or newly added panel from the panel-simple driver.

linux-seco/drivers/gpu/drm/panel/panel-simple.c

To obtain information about panel-simple.txt, you can refer to the documentation presents into the kernel:

linux-seco/Documentation/devicetree/bindings/display/panel/simple-panel.txt

To configure custom display timing for  AUO Panel model p215

The kernel writes Timing in panel-simple.c and directly matches with short strings. There are the following statements in the drivers/gpu/drm/panel/panel-simple.c file

static const struct display_timing auo_p215hca_high_timing = {
        .pixelclock = { 139000000, 160000000, 165000000 },
        .hactive = { 1920, 1920, 1920 },
        .hfront_porch = { 1, 85, 90 },
        .hsync_len = { 1, 10, 45 },
        .hback_porch = { 1, 85, 150 },
        .vactive = { 1080, 1080, 1080 },
        .vfront_porch = { 3, 20, 50 },
        .vsync_len = { 6, 10,60  },
        .vback_porch = { 11, 20, 37 },
        .flags = DISPLAY_FLAGS_HSYNC_LOW |
                   DISPLAY_FLAGS_VSYNC_LOW |
                   DISPLAY_FLAGS_DE_LOW |
                   DISPLAY_FLAGS_PIXDATA_NEGEDGE,
};

static const struct panel_desc auo_p215hca_high = {
        .timings = &auo_p215hca_high_timing,
        .num_timings = 1,
        .bpc = 8,
        .size = {
                .width = 68,
                .height = 121,
        },
        .delay = {
                /*
                 * The panel spec recommends one second delay
                 * to the below items.  However, it's a bit too
                 * long in pratical.  Based on tests, it turns
                 * out 100 milliseconds is fine.
                 */
                .prepare = 100,
                .enable = 100,
                .unprepare = 100,
                .disable = 100,
        },
        .bus_format = MEDIA_BUS_FMT_RGB888_1X24,//MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
};

static const struct of_device_id platform_of_match[] = {
	{
    }, {
                .compatible = "auo,p215hca-high",
                .data = &auo_p215hca_high,
       }, {
		/* sentinel */
	}
};
MODULE_DEVICE_TABLE(of, platform_of_match);

MODULE_DEVICE_TABLE(of, platform_of_match); The timing parameters are configured in the structure

auo,p215hca-high.

After the timing parameter need to call the device tree file with compatible device on the panel.

Please refer the respective SECO boards device tree (.dts)file.

For eg: SECO-imx8MM-c72.dts

panel_lvds: lvds_panel {
		compatible = "auo,p215hca-high";
		#address-cells = <1>;
		#size-cells = <0>;
	};

Most of the i.MX8 is configured in SN65DSI84 Bridge for LVDS, so you can find the Device tree overlay to enable and disable the display file without disturbing main device tree.

linux-seco/arch/arm64/boot/dts/seco/overlays/seco-imx8mm-c72-lcdif-sn65dsi84-overlay.dts

In below some pre-built device tree overlay file for i.MX8 boards and listed Once you done the setup , you can compile the kernel with added LVDS display resolution. after the compilation please copy the file into device and boot the board and setting up the custom device tree file with support of seco_config file.

Device tree display overlay for i.MX8

Board

Module

Peripheral

Overlays

C12

SMARC

MIPI-DSI to LVDS,

HDMI

seco-imx8mq-c12-lcdif-sn65dsi84.dtbo
seco-imx8mq-c12-dcss-sn65dsi84.dtbo
seco-imx8mq-c12-dual-display.dtbo
seco-imx8mq-c12-hdmi.dtbo
seco-imx8mq-c12-dcss-sn65dsi84-800x480.dtbo

C20

SBC

MIPI-DSI to LVDS,

HDMI

seco-imx8mq-c20-hdmi.dtbo
seco-imx8mq-c20-edp.dtbo
seco-imx8mq-c20-dcss-sn65dsi84.dtbo

C25

Q7

MIPI-DSI to LVDS,

MIPI-DSI to eDP,

HDMI

seco-imx8mq-c25-hdmi.dtbo
seco-imx8mq-c25-dcss-sn65dsi84.dtbo
seco-imx8mq-c25-dcss-sn65dsi84-800x480.dtbo
seco-imx8mq-c25-dcss-sn65dsi86.dtbo
seco-imx8mq-c25-dp.dtbo

C26

Q7

LVDS,

DP,

HDMI

seco-imx8qm-c26-hdmi.dtbo
seco-imx8qm-c26-dp.dtbo
seco-imx8qm-c26-lvds-single.dtbo
seco-imx8qm-c26-lvds-dual.dtbo
seco-imx8qm-c26-hdmi-lvds.dtbo
seco-imx8qm-c26-dp-lvds.dtbo
seco-imx8qm-c26-hdmiin.dtbo

C43

SBC

MIPI-DSI to eDP,

LVDS,

HDMI

seco-imx8qm-c43-hdmi.dtbo
seco-imx8qm-c43-hdmi-lvds.dtbo
seco-imx8qm-c43-dp-lvds.dtbo
seco-imx8qm-c43-sn65dsi86.dtbo
seco-imx8qm-c43-hdmi-sn65dsi86.dtbo
seco-imx8qm-c43-hdmi-lvds-sn65dsi86.dtbo
seco-imx8qm-c43-lvds-single.dtbo
seco-imx8qm-c43-lvds-dual.dtbo
seco-imx8qm-c43-hdmiin.dtbo

C72

μQ7

MIPI-DSI to LVDS,

MIPI-DSI to eDP

seco-imx8mm-c72-lcdif-sn65dsi84.dtbo
seco-imx8mm-c72-lcdif-sn65dsi86.dtbo

C61

SBC

MIPI-DSI to LVDS,

MIPI-DSI to eDP

seco-imx8mm-c61-lcdif-sn65dsi86.dtbo
seco-imx8mm-c61-lcdif-sn65dsi84.dtbo

C57

SBC

MIPI-DSI to eDP,

LVDS

seco-imx8qxp-c57-800x600-lvds.dtbo
seco-imx8qxp-c57-1280x800-lvds.dtbo
seco-imx8qxp-c57-1920x1080-dual-channel-lvds.dtbo
seco-imx8qxp-c57-1920x1200-dual-channel-lvds.dtbo
seco-imx8qxp-c57-sn65dsi86-edp.dtbo
seco-imx8qxp-c57-sn65dsi86-edp.dtbo

D16

SMARC

MIPI-DSI to eDP,

LVDS,

HDMI

seco-imx8qxp-d16-sn65dsi86-edp.dtbo
seco-imx8qxp-d16-adv7535-hdmi.dtbo
seco-imx8qxp-d16-lvds0-single.dtbo
seco-imx8qxp-d16-lvds0-dual.dtbo
seco-imx8qxp-d16-hdmi-edp.dtbo

Since BSP9.0 , Our images comes with pre-built available overlays binaries as (.dtbo).

In Linux BSP 9.0 you can list these files available on the boot partition,

For eg: C72

ls -l boot/
total 25604
-rw-r--r-- 1 secospa secospa 26073600 Sep 16 02:55 Image
-rw-r--r-- 1 secospa secospa     6000 Sep 16 02:55 imx8mm_m4_TCM_hello_world.bin
-rw-r--r-- 1 secospa secospa    16528 Sep 16 02:55 imx8mm_m4_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin
-rw-r--r-- 1 secospa secospa    16028 Sep 16 02:55 imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.bin
-rw-r--r-- 1 secospa secospa    40092 Sep 16 02:55 imx8mm_m4_TCM_sai_low_power_audio.bin
-rw-r--r-- 1 secospa secospa    53688 Sep 16 02:55 seco-imx8mm-c72.dtb
-rw-r--r-- 1 secospa secospa     2140 Sep 16 02:55 seco-imx8mm-c72-lcdif-sn65dsi84.dtbo
-rw-r--r-- 1 secospa secospa     1797 Sep 16 02:55 seco-imx8mm-c72-lcdif-sn65dsi86.dtbo

Once done, you can boot the board using seco_config tool to configure the Device tree overlay, Below are the commands to setup,

u-boot seco c72=> seco_config
__________________________________________________
Choose boot Device for Kernel.
__________________________________________________
1) eMMC onboard
2) uSD onboard
3) TFTP
4) USB
> 1
Choose the partition
> 1
Path of the Kernel (enter for default Image) >
__________________________________________________
Choose boot Device for FDT.
__________________________________________________
1) eMMC onboard
2) uSD onboard
3) TFTP
4) USB
> 1
Choose the partition
> 1
Path of the FDT (enter for default seco-imx8mq-c12.dtb) >
__________________________________________________
Choose boot Device for FileSystem.
__________________________________________________
1) eMMC onboard
2) uSD onboard
3) NFS
4) USB
> 1
Choose the partition
> 2
__________________________________________________
Choose Video Output Configuration.
__________________________________________________
1) no video - no dtbo
2) eDP LCDIF-1920x1080 - seco-imx8mm-c72-lcdif-sn65dsi86.dtbo
3) LVDS LCDIF-1920x1080 - seco-imx8mm-c72-lcdif-sn65dsi84.dtbo
> 2
__________________________________________________
Choose Board Options.
__________________________________________________
1) No addons
> 1
Saving Environment to MMC... Writing to MMC(0)... OK

By selecting the dtbo to perform the board boot up with your display configuration.

Successfully board has been booted with selected display device tree.

  • No labels