The aim of this section is to properly configure the LVDS settings.
The LVDS Display Bridge (LDB) is used to connect the IPU (Image Processing Unit) to the External LVDS Display Interface. Its purpose is to support the flow of synchronous RGB data from the IPU to external display devices through the LVDS interface.
Table of Contents |
---|
Device Tree Overlay
The 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 to the environment. The direct consequence is enabling/disabling the hardware components of the system.
The design process of a Device Tree Overlay includes three macro steps:
writing a Device Tree Overlay (.dts) file;
generating a *.dtbo file, output of *.dts file build;
enabling the overlay through *.dtbo file.
For further information on the Device Tree Overlay customization, please refer to the documentation available at following Kernel path:
Code Block |
---|
linux-seco/Documentation/devicetree/overlay-notes.txt |
Some devices are used in the overlays and those devices are pre-enabled by default in the source.
Below is the reference table for the pre-enabled Device Tree Overlay.
...
Boards Family
...
Peripherals
...
Device Tree Overlay
...
i.MX6
...
UART, LVDS, RGB, Audio, HDMI, Touch, GPIO, Pin header selection, etc.
Here 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, etc.
Here 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 boards use the fbdev interface for mode setting and output configuration.
There are two IPU units on the i.mx6q SoC, and only one IPU unit on the i.mx6dl 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.
Verify the signal timing specifications of the LCD in the datasheet and then calculate following parameters:
...
Parameter
...
Definition
...
hback-porch
...
hfront-porch
...
Horizontal Front Porch in pixels
...
vback-porch
...
vfront-porch
...
Vertical Front Porch in pixels
...
hsync-len
...
vsync-len
...
by using the open source reference available at the following path https://www.epanorama.net/faq/vga2rgb/calc.html .
To obtain the information about the ldb structure, you can refer to the documentation available into the Kernel:
Code Block |
---|
linux-seco/Documentation/devicetree/bindings/display/imx/ldb.txt
linux-seco/Documentation/devicetree/bindings/fb/fsl_ipuv3_fb.txt |
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>;
}; |
Below is the sample timing data for SVGA TFT LCD(800x600) 10.4 inches (BA104S01-100):
...
The aim of this section is to properly configure custom display: LVDS and eDP panels.
Table of Contents |
---|
Info |
---|
External references are available here: |
...
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, follow the steps below.
1. Kernel: Adding Custom LVDS support in Device tree file
The target file to be edited is linux-seco/arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi. This one contains the list of available LVDS resolutions.
Code Block |
---|
cd linux-seco/arch/arm/boot/dts
vi imx6qdl-seco_lvds_display.dtsi |
In order to add a new LVDS into the above mentioned list, timing structure must be modified to include it.
To obtain the information about the ldb (lvds bridge) structure, you can refer to the documentation available into the Kernel:
linux-seco/Documentation/devicetree/bindings/display/imx/ldb.txt
linux-seco/Documentation/devicetree/bindings/fb/fsl_ipuv3_fb.txt
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>;
}; |
Below is an example of ldb structure got for SVGA TFT LCD(800x600 BA104S01-100 ) 10.4 inches panel (datasheet avalaible here).
...
Code Block |
---|
name = LBD-SVGA-BA
Clock-frequency = 39600000
Hactive = 800
Vactive = 600
Hback = 45
Hfront = 45
Vback = 25
Vfront = 25
Hsync = 10
Vsync = 10 |
2. U-Boot: Adding Custom LVDS resolution into list
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:
The target file to be edited is u-boot-seco/cmd/cmd_seco_config.c. This one contains the list of available LVDS resolutions to pass to kernel via bootargs (selection is performed via seco_config command).
Code Block |
---|
cd u-boot-seco/cmd/
vi cmd_seco_config.c |
Add the custom resolution settings by appending new items into the following structure:
Code Block | ||
---|---|---|
| ||
static lvds_video_spec_t lvds_video_spec_list [] = {
{ "WVGA [800x480]", "LDB-WVGA", "RGB666", "datamap=spwg", "", 1 },
{ "SVGA [800x600]", "LDB-SVGA", "RGB666", "datamap=spwg", "", 1 },
{ "XGA [1024x768]", "LDB-XGA", "RGB666", "datamap=spwg", "", 1 },
{ "WXGA [1368x768]", "LDB-WXGA", "RGB24", "datamap=jeida", "", 1 },
{ "WXGAP60 [1280x800]", "LDB-1280P60", "RGB24,bpp=32","datamap=spwg", "", 1 },
{ "SXGA [1280x1024]", "LDB-SXGA", "RGB24", "datamap=jeida", "", 1 },
{ "HD1080 [1920x1080]", "LDB-1080P60", "RGB24", "datamap=spwg", "ldb=spl0", 2 },
{<DISPLAY NAME>, <KERNEL DISPLAY NAME>, <PIXEL FORMAT>, <DATA MAPPING>, "LDB SETTING", <CHANNEL NUMBER>}
}; |
The fields <DISPLAY NAME>, <KERNEL DISPLAY NAME>, <PIXEL FORMAT>, <DATA MAPPING>, "LDB SETTING", <CHANNEL NUMBER>
are 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:
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
After that, get into the device tree path (arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi
).
Please find below the ldb structure to be added in the imx6qdl-seco_lvds_display.dtsi
file.
Code Block |
---|
cd linux-seco/arch/arm/boot/dts
vi imx6qdl-seco_lvds_display.dtsi |
Now add the newly created lbd structure into the LVDS device tree file and save the file.
You can now check the Device Tree Overlay file whether the LVDS (LDB) is enabled or not. Below is the example to enable the ldb node.
Code Block |
---|
fragment@3 {
target = <&ldb>;
__overlay__ {
status = "okay";
};
}; |
Once the setup is done, you can compile the source.
Info |
---|
From BSP9.0 onwards, the LVDS is enabled by the Device Tree Overlay file, using seco_config tool to load the the device tree overlay in U-Boot level. |
Device tree display overlay for i.MX6
...
Board
...
Type of product
...
Peripheral
...
Overlays
...
Q7-928
...
Qseven module
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
...
μQ7-962
...
μQseven module
...
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
...
μQ7-A75-J
...
μQseven module
...
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
...
SBC-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
...
SBC-B08
...
SBC
...
LVDS
RGB
...
imx6sx-seco_SBC_B08_LVDS.dtbo
imx6sx-seco_SBC_B08_RGB.dtbo
...
SYS-B07-7
...
System
...
SBC-C23
...
SBC
...
LVDS
...
imx6sx-seco_SBC_C23_LVDS.dtbo
Info |
---|
From BSP9.0 onwards, our images comes with available pre-built overlays binaries as (.dtbo). |
In Linux BSP 9.0, you can list the available files on the boot partition.
For example, with the SBC-A62-J:
Code Block |
---|
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 it is done, you can boot the board using seco_config
tool to configure the Device Tree Overlay.
Below are the commands for the setup:
...
| |
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) |
3. U-Boot: Adding Custom LVDS resolution for Splash Screen
Also the U-Boot uses the Display to display the Splash Screen. So, if the scope is to use also the custom resolution at U-Boot level, this task have to be performed:
Editing the file board/seco/common/display.c
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 ... ____________________________________ 1) defalut 2) custom > 1______________ Saving Environment to MMC... Writing to MMC(1)... OK X6QDLS SBC-A62 U-Boot > saveenv Chose Saving Environment to MMC..Video Setting. 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:~# |
Tip |
---|
The board has now successfully been loaded with LVDS and Touch (st1232) dtbo file. |
LVDS Customization Guide for i.MX8
The MIPI DSI support on i.MX8-based boards is enabled via the device trees located in the Kernel source at 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 panels.
SECO boards with i.MX8 SoC support the following MIPI-DSI interfaces:
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 come with 2 display controllers, DCSS and LCDIF:
DCCS can be connected to HDMI, DP or MIPI-DSI and supports up to 4K resolution;
LCDIF can be connected only to MIPI-DSI and supports up to 1080p. resolution.
All the drivers on the boards enabled by the i.MX8, i.MX8M Mini, i.MX8M Nano, i.MX8X and i.MX8M Plus families of processors are integrated into the Linux kernel's DRM/KMS subsystem.
The Display Interface should be added in the Linux Device Tree overlay and the panel must be enabled in Device tree.
The process of designing a Device Tree Overlay includes the three following macro steps:
writing a Device Tree Overlay (.dts) file;
generating a *.dtbo file, output of *.dts file build;
enabling the overlay through *.dtbo file.
To obtain the information about the overlay device tree, you can refer to the documentation available into the kernel:
Code Block |
---|
linux-seco/Documentation/devicetree/overlay-notes.txt |
Using the documentation above you can customize the Device Tree Overlay, as well as enable and disable functionalities.
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 exactly what display resolution and timing 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 only from BSP 9 onwards);
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' (RIFORMULARE). Both panel-simple and panel-lvds driver can be used, as described below. NON CAPISCO SE QUI DOVREBBE ESSERCI UN SECONDO PUNTO ELENCO, MI SEMBRA CHE LE OPZIONI DA SPIEGARE SIANO 2.
Panel Simple
Set the compatible property to an existing or newly added panel from the panel-simple driver.
Code Block |
---|
linux-seco/drivers/gpu/drm/panel/panel-simple.c |
For more information onpanel-simple.txt
, please refer to the documentation available into the Kernel:
Code Block |
---|
linux-seco/Documentation/devicetree/bindings/display/panel/simple-panel.txt |
Configure the 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 (NON HO CAPITO)
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, __________________________________________________ 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 |
Tip |
---|
The board has now successfully been loaded with new custom LVDS resolution |
...
Display Customization Guide for i.MX8
The MIPI DSI support on i.MX8-based boards is configured via the overlays device trees and Kernel sources.
SECO boards with i.MX8 SoC support the following MIPI-DSI interface to LVDS / eDP bridges:
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 eLCDIF
i.MX8M boards come with 2 display controllers, DCSS and eLCDIF:
DCCS can be connected to HDMI, DP or MIPI-DSI and supports up to 4K resolution;
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 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 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 }, .enablehback_porch = 100{ 1, 85, 150 }, .vactive = { 1080, 1080, 1080 .unprepare}, = 100, .vfront_porch = { 3, 20, 50 }, .disable = 100, .vsync_len = { 6, 10,60 }, .busvback_formatporch = MEDIA_BUS_FMT_RGB888_1X24,//MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, }; static const struct of_device_id platform_of_match[] = { { }, { { 11, 20, 37 }, .flags = DISPLAY_FLAGS_HSYNC_LOW | .compatible = "auo,p215hca-high",DISPLAY_FLAGS_VSYNC_LOW | .data = &auo_p215hca_high, DISPLAY_FLAGS_DE_LOW | }, { /* 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. (NON HO CAPITO)
Please refer the respective SECO boards device tree (.dts)file. PER FARE COSA? QUELLO CHE è SCRITTO SOPRA?
E.g.: seco-imx8mm-c72.dts
Code Block |
---|
panel_lvds: lvds_panel {
compatible = "auo,p215hca-high";
#address-cells = <1>;
#size-cells = <0>;
}; |
After completing the panel configuration, you need to configure the bridge with the following file:
Code Block |
---|
linux-seco/arch/arm64/boot/dts/seco/overlays/seco-imx8mm-c72-lcdif-sn65dsi84-overlay.dts |
This is the content:
Code Block |
---|
target = <&adv_bridge>; DISPLAY_FLAGS_PIXDATA_NEGEDGE, }; static const struct panel_desc auo_p215hca_high = { .timings = &auo_p215hca_high_timing, .num_timings = 1, .bpc = 8, __overlay__.size = { .width = 68, #address-cells = <1>; .height = 121, }, #size-cells.delay = <0>;{ /* lvds,datamap = "jeida"; * The panel spec recommends one second delay lvds,dual-channel; * to the below items. However, it's a bit too lvds,channel-swap; * long in pratical. Based on tests, it turns lvds,preserve-dsi-timings; * out 100 milliseconds is fine. */ /*include/drm/drm_mipi_dsi.h*/ .prepare = 100, .enable = dsi100,mode-flags = <0x805>; /*MIPI_DSI_MODE_VIDEO*/ .unprepare = 100, clocks = <&si5351a 0>; .disable = 100, }, status.bus_format = "okay"; |
To complete the panel configuration, it is necessary to correctly configure the following parameters:
...
lvds,datamap: can be configured as jeida or spwg, other configurations are not supported.
...
Note |
---|
The above configurations can be useless in some cases and prevent the panel from turning 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
...
Board
...
Type of product
...
Peripheral
...
Overlays
...
SM-C12
...
SMARC module
...
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
...
SBC-C20
...
SBC
...
MIPI-DSI to LVDS
HDMI
...
seco-imx8mq-c20-hdmi.dtbo
seco-imx8mq-c20-edp.dtbo
seco-imx8mq-c20-dcss-sn65dsi84.dtbo
...
Q7-C25
...
Qseven module
...
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
...
Q7-C26
...
Qseven module
...
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
...
SBC-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
...
μQ7-C72
...
μQseven module
...
MIPI-DSI to LVDS
MIPI-DSI to eDP
...
seco-imx8mm-c72-lcdif-sn65dsi84.dtbo
seco-imx8mm-c72-lcdif-sn65dsi86.dtbo
...
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 the parameters configured in struct display_timing are derived from the panel datasheet.
After setting up the panel configuration, you need to check the following file for the LVDS (for the eDP this section can be skipped):
Code Block |
---|
linux-seco/arch/arm64/boot/dts/seco/overlays/seco-imx8mm-c61-lcdif-sn65dsi84-overlay.dts |
This is the content:
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:
lvds,datamap: can be configured as jeida or spwg, other configurations are not supported.
lvds,dual-channel:if inserted, it enables bridge dual channel output. The DSI video signal is splitted in LVDS channel A and LVDS channel B.
lvds,preserve-dsi-timings:this parameter is useful when the LVDS display timing is synchronized with Data Enable, while it should be removed if the panel is not DE sync. LVDS panels that are not synchronized with Data Enable must be configured without
lvds
,preserve-dsi-timing parameter
andclocks = <&si5351a 0>
should be commented out to ensure timing sync.
Note |
---|
The above configurations can be useless in some cases and prevent the panel from turning 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
Board | Type of product | Peripheral | Overlays | ||
---|---|---|---|---|---|
SM-C12 | SMARC module | MIPI-DSI to LVDS |
| ||
SBC-C20 | SBC | MIPI-DSI to LVDS MIPI-DSI to eDP |
| SBC-C57 | SBC |
Q7-C25 | Qseven module | MIPI-DSI to LVDS MIPI-DSI to eDPLVDS |
| ||
μQ7-C72 | μQseven module | MIPI-DSI to LVDS MIPI-DSI to eDP |
| ||
SMSBC-D16C61 | SMARC moduleSBC | MIPI-DSI to LVDS MIPI-DSI to eDP LVDS HDMI |
| ||
SBC-C57 | SBC | MIPI-DSI to eDP |
| ||
SM-D16 | SMARC module | MIPI-DSI to eDP |
|
Info |
---|
From BSP9.0 onwards, our images comes with available pre-built overlays binaries as (.dtbo). |
In Linux BSP 9.0, you can list the available files on the boot partition.
For example, with the μQ7SBC-C72C61:
Code Block |
---|
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-c72c61.dtb -rw-r--r-- 1 secospa secospa 2140 Sep 16 02:55 seco-imx8mm-c72c61-lcdif-sn65dsi84.dtbo -rw-r--r-- 1 secospa secospa 1797 Sep 16 02:55 seco-imx8mm-c72c61-lcdif-sn65dsi86.dtbo |
Once it is done, you can boot the board using seco_config
tool to configure the Device Tree Overlay.
Below are the commands for the setup:
Code Block |
---|
u-boot seco c72c61=> 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-imx8mqimx8mm-c12c61.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-c72c61-lcdif-sn65dsi86.dtbo 3) LVDS LCDIF-1920x1080 - seco-imx8mm-c72c61-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 The board will boot with your display configuration.
...