...
In order to bring up custom display following steps are needed:
1. Kernel: Adding Custom LVDS support in Device tree file
...
The target file to edit is linux-seco/arch/arm/boot/dts/imx6qdl-seco_lvds_display.dtsi. This last contains the list of available LVDS resolutions.
Code Block |
---|
cd linux-seco/arch/arm/boot/dts
vi imx6qdl-seco_lvds_display.dtsi |
A newest one have to be enclosed into “timing” structure.
To obtain the information about the ldb structure, you can refer to the documentation available into the Kernel:
...
Below is the sample timing data for SVGA TFT LCD(800x600) 10.4 inches (BA104S01-100):
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:
The target file to edit is u-boot-seco/cmd/cmd_seco_config.c. This last contains the list of available LVDS resolutions to pass to kernel via bootargs (selection is performed via seco_config command).
Code Block |
---|
cd linuxu-boot-seco/arch/arm/bootcmd/dts vi imx6qdl-cmd_seco_lvds_displayconfig.dtsic |
Now add the newly created ldb structure into the LVDS device tree file and save the file.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. |
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 follow this step:
Edit file <u-boot src>/cmd/cmd_seco_config.c
This file contains the list of display setting to pass to kernel via bootargs.
The selection is performed via seco_config command.
Add the custom resolution setting with a new item into the follow structure:
...
language | c |
---|
...
Add the custom resolution setting appending new item 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 }, { "WVGAXGA [800x4801024x768]", "LDB-WVGAXGA", "RGB666", "datamap=spwg", "", 1 }, { "SVGAWXGA [800x6001368x768]", "LDB-SVGAWXGA", "RGB666RGB24", "datamap=spwgjeida", "", 1 }, { "XGA WXGAP60 [1024x7681280x800]", "LDB-XGA1280P60", "RGB666", "RGB24,bpp=32","datamap=spwg", "", 1 }, { "WXGASXGA [1368x7681280x1024]", "LDB-WXGASXGA", "RGB24", "datamap=jeida", "", 1 }, { "WXGAP60HD1080 [1280x8001920x1080]", "LDB-1280P601080P60", "RGB24,bpp=32", "datamap=spwg", "ldb=spl0", 2 1 }, { "SXGA [1280x1024]"<DISPLAY NAME>, <KERNEL DISPLAY NAME>, <PIXEL FORMAT>, <DATA MAPPING>, "LDB-SXGA SETTING", <CHANNEL "RGB24", NUMBER>} }; |
with:
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:
|
...
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
with:
Field | Description | |||||
---|---|---|---|---|---|---|
DISPLAY NAME | name show 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 | splay interface pixel format as below:
| DATA MAPPING | color signals mapping order [ jeida
| |||
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) |
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 |
---|
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:~# |
Tip |
---|
The board has now successfully been loaded with LVDS and Touch (st1232) dtbo file. |
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 also 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. Under the sub-structure
...
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. Under the sub-structure
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, .busyres = -1800, .pixclock .addr = -115128, .pixfmt = IPU_PIX_FMT_RGB24, .left_margin = 220, .detect = NULL, .enableright_margin = enable_lvds40, .mode = { .upper_margin = 21, // Rif. Panel 1024x768 Panel UMSH-8596MD-15T .lower_margin = 7, .name .hsync_len = "LDB-1280P60"60, .refresh .vsync_len = 6010, .xressync = 12800, .yresvmode = = 800,FB_VMODE_NONINTERLACED } .pixclock = 15128, .left_margin = 220, .right_margin = 40, .upper_margin = 21, .lower_margin = 7, .hsync_len = 60,}, |
Insert the new custom resolution, starting from the one above and edit the sub-structure "mode", 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 |
4. Boot with new resolution
Set right resolution at U-Boot:
Code Block |
---|
setenv panel "<resolution name>
saveen |
Set right resolution at kernel, using seco_config command:
Code Block |
---|
MX6QDLS SBC-A62 U-Boot > seco_config ... __________________________________________________ Chose Video Setting.vsync_len = 10, .sync = 0, __________________________________________________ 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.vmode = FB_VMODE_NONINTERLACED } }, |
Insert the new custom resolution, starting from the one above and edit the sub-structure "mode", 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
To select the right display resolution at run time, set the "panel" variable according to the associated name into structure above:
Code Block |
---|
setenv panel "<resolution name> saveen __________________________________________________ 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 LVDS |
...
Display Customization Guide for i.MX8
...