100ASK_T113-PRO开发板适配4寸MIPI屏
0.前言
本章主要介绍如何在Tina SDK中适配4寸MIPI屏,购买链接为:https://item.taobao.com/item.htm?spm=a1z10.5-c-s.w4002-18944745104.11.135378a09F4YT3&id=706091265930
这里给大家提供一个资源包:source.zip (包含uboot屏驱动、kernel屏驱动、设备树)
1.设备树配置
1.1 修改内核设备树
修改内核设备树树,路径为:
tina-d1-h/device/config/chips/t113/configs/100ask/board.dts
修改lcd0节点
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "ili9806e";
lcd_backlight = <100>;
lcd_if = <4>;
lcd_x = <480>;
lcd_y = <800>;
lcd_width = <52>;
lcd_height = <52>;
lcd_dclk_freq = <25>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <7>;
lcd_pwm_freq = <1000>;
lcd_pwm_pol = <1>;
lcd_pwm_max_limit = <255>;
lcd_hbp = <10>;
lcd_ht = <515>;
lcd_hspw = <5>;
lcd_vbp = <20>;
lcd_vt = <830>;
lcd_vspw = <5>;
lcd_dsi_if = <0>;
lcd_dsi_lane = <2>;
lcd_dsi_format = <0>;
lcd_dsi_te = <0>;
lcd_dsi_eotp = <0>;
lcd_lvds_if = <0>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_io_phase = <0x0000>;
lcd_dsi_te = <0>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcd_fsync_en = <0>;
lcd_fsync_act_time = <1000>;
lcd_fsync_dis_time = <1000>;
lcd_fsync_pol = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&dsi4lane_pins_a>;
pinctrl-1 = <&dsi4lane_pins_b>;
};
1.2 修改uboot设备树
&lcd0 {
lcd_used = <1>;
lcd_driver_name = "ili9806e";
lcd_backlight = <100>;
lcd_if = <4>;
lcd_x = <480>;
lcd_y = <800>;
lcd_width = <52>;
lcd_height = <52>;
lcd_dclk_freq = <25>;
lcd_pwm_used = <1>;
lcd_pwm_ch = <7>;
lcd_pwm_freq = <1000>;
lcd_pwm_pol = <0>;
lcd_pwm_max_limit = <255>;
lcd_hbp = <10>;
lcd_ht = <515>;
lcd_hspw = <5>;
lcd_vbp = <20>;
lcd_vt = <830>;
lcd_vspw = <5>;
lcd_dsi_if = <0>;
lcd_dsi_lane = <2>;
lcd_lvds_if = <0>;
lcd_lvds_colordepth = <0>;
lcd_lvds_mode = <0>;
lcd_frm = <0>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_io_phase = <0x0000>;
lcd_dsi_te = <0>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcd_fsync_en = <0>;
lcd_fsync_act_time = <1000>;
lcd_fsync_dis_time = <1000>;
lcd_fsync_pol = <0>;
deu_mode = <0>;
lcdgamma4iep = <22>;
smart_color = <90>;
lcd_gpio_0 = <&pio PG 13 GPIO_ACTIVE_HIGH>;
pinctrl-0 = <&dsi4lane_pins_a>;
pinctrl-1 = <&dsi4lane_pins_b>;
};
2.修改配置文件
2.1 修改内核配置文件
进入内核目录,在Tina根目录下输入cd lichee/linux-5.4/
book@100ask:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h$ cd lichee/linux-5.4/
在内核目录中直接修改.config
文件,输入vi .config
book@100ask:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h/lichee/linux-5.4$ vi .config
修改该节点为
CONFIG_LCD_SUPPORT_TFT08006=y
2.2 修改uboot配置文件
进入uboot目录下,输入cd lichee/brandy-2.0/u-boot-2018/
book@100ask:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h$ cd lichee/brandy-2.0/u-boot-2018/
修改该目录下的配置文件.config
book@100ask:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h/lichee/brandy-2.0/u-boot-2018$ vi .config
使能DISP2和选择TFT08006屏驱动
CONFIG_DISP2_SUNXI=y
CONFIG_LCD_SUPPORT_TFT08006=y
3.增加屏驱动
uboot屏驱动和kernel屏驱动位于在前言中提供的资源包,可通过下载获取。
uboot屏驱动应该放在
tina-d1-h/lichee/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/lcd
kernel屏驱动应放在
tina-d1-h/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd
3.增加LVGL测试测试程序
在Tina根目录下,输入
book@100ask:~/DongshanNezhaSTU-TinaV2.0-SDK/tina-d1-h$ make menuconfig
进入Tina配置界面后,进入如下目录
> Gui
> Littlevgl
<*> lv_examples................................. lvgl examples use lvgl-8.0.1
输入Y选中lv_examples
,如下图所示:
保存退出并重新编译系统和打包
4.测试屏幕
上电前连接MIPI屏,将生成的新镜像烧写到T113开发板中,烧写后启动开发板,在串口终端输入
root@TinaLinux:/# lv_examples 0
wh=480x800, vwh=480x1600, bpp=32, rotated=0
FAQ
T113使能屏驱一定要使能uboot下的屏驱动,因为T113需要在uboot下对屏进行初始化