Versions Compared

Key

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

The aim of this section is to properly configure custom display: LVDS and eDP panels.

Table of Contents

Info

External references are available here:

https://git.seco.com/pub/i.mx/yocto/4.x/u-boot-seco

https://git.seco.com/pub/i.mx/yocto/4.x/linux-seco

...

Standard Display Timings

Verify the signal timing specifications of the LCD in the datasheet and then calculate following parameters:

...

Parameter

Definition

hback-porch

Horizontal Back Porch (HBP) - Number of pixel clock pulses between HSYNC signal and the first valid pixel data.

hfront-porch

Horizontal Front porch (HFP) - Number of pixel clock pulses between the last valid pixel data in the line and the next HSYNC pulse.

vback-porch

Vertical Back Porch (VBP) - Number of lines (HSYNC pulses) from a VSYNC signal to the first valid line.

vfront-porch

Vertical Front Porch (VFP) - Number of lines (HSYNC pulses) between the last valid line of the frame and the next VSYNC pulse.

hsync-len

Number of PIXCLK pulses when a HSYNC signal is active.

vsync-len

Number of HSYNC pulses when a VSYNC signal is active.

...

LVDS Customization Guide for i.MX6

In order to bring up a custom display following steps are needed:, follow the steps below.

1. Kernel: Adding Custom LVDS support in Device tree file

The target file to edit be edited is linux-seco/arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi. This last one contains the list of available LVDS resolutions.

...

  • linux-seco/Documentation/devicetree/bindings/display/imx/ldb.txt

  • linux-seco/Documentation/devicetree/bindings/fb/fsl_ipuv3_fb.txt

Here below Below is the data timing structure:

Code Block
        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 below Below is an example of ldb structure got for SVGA TFT LCD(800x600 BA104S01-100 ) 10.4 inches panel (datasheet avalaible here).

...

The resolution to use is passed from U-Boot to the kernel via bootargs. The seco_config command help the user to perform the selection of the video settings and resolution.
In order to add a new custom LVDS resolution, please follow the steps described below described:

  • The target file to edit be edited is u-boot-seco/cmd/cmd_seco_config.c. This last one contains the list of available LVDS resolutions to pass to kernel via bootargs (selection is performed via seco_config command).

...

The fields <DISPLAY NAME>, <KERNEL DISPLAY NAME>, <PIXEL FORMAT>, <DATA MAPPING>, "LDB SETTING", <CHANNEL NUMBER> are here described in the table below:

Field

Description

DISPLAY NAME

Name shown into the resolution list when seco_config command is used

KERNEL DISPLAY NAME

Name of the resolution added into the kernel file arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi ($name variable)

PIXEL FORMAT

Display interface pixel format:

Code Block
    RGB666          IPU_PIX_FMT_RGB666
    RGB565          IPU_PIX_FMT_RGB565
    RGB24           IPU_PIX_FMT_RGB24
    BGR24           IPU_PIX_FMT_BGR24
    GBR24           IPU_PIX_FMT_GBR24
    YUV444          IPU_PIX_FMT_YUV444
    YUYV            IPU_PIX_FMT_YUYV
    UYVY            IPU_PIX_FMT_UYVY
    YVYV            IPU_PIX_FMT_YVYU
    VYUY            IPU_PIX_FMT_VYUY

DATA MAPPING

Color signals mapping order [ jeida | spwg | vesa ]

LDB SETTING

i.MX6 LVDS setting. Leave empty to use the default (display single channel)

(ldb=spl0 -> split mode, used for display dual channel)

CHANNEL NUMBER

Number of channel to use (leave 1 for default configuration)

...

A new node into struct display_info_t const displays[] must to be added.
Starting from the above structure (data timings structure), edit the sub-structure "mode" by considering the following fields:

Field

Description

name

name of the resolution, to use at U-Boot level

refresh

refrash rate of the panel (pixecl clock / [ ( tot horiz. pixel) * (tot vert. pixel) ]

xres

horizontal active area

yres

vertical active area

pixclock

pixel clock in pico seconds

left_margin

horizontal back porch

right_margin

horizontal fromt porch

upper_margin

vertical back porch

lower_margin

vertical fromt porch

hsync_len

horizontal SYNC

vsync_len

vertical SYNC

Code Block
}, {
        .bus    = -1,
        .addr   = -1,
        .pixfmt = IPU_PIX_FMT_RGB24,
        .detect = NULL,
        .enable = enable_lvds,
        .mode   = {
                // Rif. Panel 1024x768 Panel UMSH-8596MD-15T
                .name           = "LDB-1280P60",
                .refresh        = 60,
                .xres           = 1280,
                .yres           = 800,
                .pixclock       = 15128,
                .left_margin    = 220,
                .right_margin   = 40,
                .upper_margin   = 21,
                .lower_margin   = 7,
                .hsync_len      = 60,
                .vsync_len      = 10,
                .sync           = 0,
                .vmode          = FB_VMODE_NONINTERLACED
        }
  }, {
        .bus    = -1,
        .addr   = -1,
        .pixfmt = IPU_PIX_FMT_RGB24,
        .detect = NULL,
        .enable = enable_lvds,
        .mode   = {
                // new data structure 
                .name           = "NEW CUSTOM RESOLUTION",
                .refresh        = <custom refresh>,
                .xres           = <custom horiz. resolution>,
                .yres           = <custom vert. resolution>,
                .pixclock       = <pixel clock in us>,
                .left_margin    = <horiz. back porch>,
                .right_margin   = <horiz. front porch>,
                .upper_margin   = <vert. back porch>,
                .lower_margin   = <vert. front porch>,
                .hsync_len      = <horiz. SYNC lenght>,
                .vsync_len      = <vert. SYNC lenght>,
                .sync           = 0,
                .vmode          = FB_VMODE_NONINTERLACED
        }

4. Boot with new resolution

  • Set the right resolution at U-Boot:

Code Block
setenv panel "<resolution name>
saveen
  • Set the right resolution at kernel, using seco_config command:

Code Block
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]
8) NEW_RESOLUTION
> 8

...

Saving Environment to MMC... Writing to MMC(1)... OK

...

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

  2. eLCDIF can be connected only to MIPI-DSI and supports up to 1080p resolution.

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

The panel is configured by the following nodes located in the board device tree, for example arch/arm64/boot/dts/seco/seco-imx8mm-c61.dts:

Code Block
panel_edp: edp_panel {
      compatible = "boe,ev156fhm";
      #address-cells = <1>;
      #size-cells = <0>;
};

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

These nodes represent the links between the device tree and the panel-simple.c structure through the compatibleproperty to an existing or newly added panel from the panel-simple driver.

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

Example: Configure the custom display timing for AUO Panel model p215hca

In the Seco SECO BSP's the references panels are configured and tested with 10000 on/off cycle. Below is the panel structure from drivers/gpu/drm/panel/panel-simple.c for LVDS 1920x1080 from Seco SECO BSP9:

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

In this case the configured panel is the: auo,p215hca-high, all . All the parameters configured in struct display_timing are derived from the panel datasheet.

After setup setting up the panel configuration, you need to check for LVDS the following file for the LVDS (for the eDP this part section can be skipped):

Code Block
linux-seco/arch/arm64/boot/dts/seco/overlays/seco-imx8mm-c61-lcdif-sn65dsi84-overlay.dts

...

Code Block
target = <&adv_bridge>;
      __overlay__ {
              #address-cells = <1>;
              #size-cells = <0>;
              lvds,datamap = "jeida";
              lvds,dual-channel;
              lvds,channel-swap;
              lvds,preserve-dsi-timings;
                                      /*include/drm/drm_mipi_dsi.h*/
              dsi,mode-flags = <0x805>; /*MIPI_DSI_MODE_VIDEO*/
              clocks = <&si5351a 0>;
              status = "okay";
        };

To complete the bridge configuration, it is necessary to correctly configure the following parameters:

...

Note

The above configurations can be useless in some cases and prevent the panel from turning on.
This is due to the i.MX8 DSI video driver that recalculates the panel timing to adapt them to the i.MX8 DSI video output. In these cases, a fine tuning in the admitted panel timing is necessary: clocks, front and back porch until the LVDS panel turns on.

SECO preconfigured Panels

Below are some pre-built Device Tree Overlay files for i.MX8-based boards.

Once the setup has been defined, the Kernel, including LVDS display resolution, can be built. After compiling, please copy the file into the device and boot the board by setting up the custom device tree file with the support of seco_config file.

Device tree display overlay for i.MX8

...