我在学习配置屏幕,板子默
认配置的7寸屏,但是想接这款4寸屏,需要配置哪些位置。
屏幕用的是下面这款
是按照这个教程配置设备树就可以了吗?
是的,可以阅读
https://tina.100ask.net/SdkModule/Linux_LCD_DevelopmentGuide-01/
https://tina.100ask.net/SdkModule/Linux_Display_DevelopmentGuide-01/
这是4寸屏对应的屏驱动tft08006_driver.zip (7.3 KB)可以将其重命名放到tina-v853-open/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/目录下,并在内核中选中编译。
具体步骤可以参考我在T113上点屏的过程。
实验环境:
百问网T113开发板、MIPI屏幕ILI9806E。
1.获取百问网提供的T113资料,链接:http://download.100ask.org/boards/Allwinner/T113/index.html
2.阅读T113开发手册《嵌入式Linux应用开发完全手册V5.1_T113开发板》,完成配置交叉编译工具链等操作。
3.根据文档的第三篇的第六章获取buildroot源码工程,完成文档相应操作。
驱动存放位置:
/home/book/buildroot_100ask_t113-pro/buildroot/output/build/uboot-dabbfb0147a925f4950130f3efe7b7565e84a02c/drivers/video/sunxi/disp2/disp/lcd
驱动存放位置:
/home/book/buildroot_100ask_t113-pro/buildroot/output/build/linux-origin_master/drivers/video/fbdev/sunxi/disp2/disp/lcd
驱动程序名:tft08006.c
设备树存放地址:
/home/book/buildroot_100ask_t113-pro/buildroot/output/build/uboot-dabbfb0147a925f4950130f3efe7b7565e84a02c/arch/arm/dts/sun8iw20p1-uboot-100ask-t113-pro.dts
设备树存放地址:
/home/book/buildroot_100ask_t113-pro/buildroot/output/build/linux-origin_master/arch/arm/boot/dts/sun8iw20p1–100ask-t113-pro.dts
&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>;
};
1.修改uboot配置
在/home/book/buildroot_100ask_t113-pro/buildroot目录下,执行
make uboot-menuconfig
进入上述目录
输入Y选中tft08006。保存退出。
2.修改kernel配置
在/home/book/buildroot_100ask_t113-pro/buildroot目录下,执行
make linux-menuconfig
进入上述目录
输入Y选中tft08006。保存退出。
1.编译sdCard系统固件
在/home/book/buildroot_100ask_t113-pro/buildroot目录下输入
make -j4
重新编译系统,编译后生成系统固件在/home/book/buildroot_100ask_t113-pro/buildroot/output/images目录下的100ask-t113-pro_sdcard.img。
2.将编译好的系统烧录到sd卡中,启动T113开发板。
查看屏幕信息
cat /sys/class/disp/disp/attr/sys
root@TinaLinux:/# cat /sys/class/disp/disp/attr/sys
screen 0:
de_rate 300000000 hz, ref_fps:58
mgr0: 480x800 fmt[rgb] cs[0x204] range[full] eotf[0x4] bits[8bits] err[1] force_sync[0] unblank direct_show[false] iommu[1]
dmabuf: cache[0] cache max[0] umap skip[0] umap skip max[120]
lcd output backlight(100) fps:58.8 480x 800
err:0 skip:570 irq:67737 vsync:0 vsync_skip:0
BUF enable ch[1] lyr[0] z[16] prem[N] a[pixel 255] fmt[ 0] fb[ 480, 800; 480, 800; 480, 800] crop[ 0, 800, 480, 800] frame[ 0, 0, 480, 800] addr[48400000, 0, 0] flags[0x 0] trd[0,0]
depth[ 0] COLOR enable ch[2] lyr[0] z[0] prem[N] a[pixel 0] fmt[ 0] fb[ 0, 0; 0, 0; 0, 0] crop[ 0, 0, 120, 800] frame[ 0, 0, 120, 800] addr[ffff0000, 0, 0] flags[0x 0] trd[0,0]
depth[ 0] COLOR enable ch[2] lyr[1] z[0] prem[N] a[pixel 0] fmt[ 0] fb[ 0, 0; 0, 0; 0, 0] crop[ 120, 0, 120, 800] frame[ 120, 0, 120, 800] addr[ff00ff00, 0, 0] flags[0x 0] trd[0,0]
depth[ 0] COLOR enable ch[2] lyr[2] z[0] prem[N] a[pixel 0] fmt[ 0] fb[ 0, 0; 0, 0; 0, 0] crop[ 240, 0, 120, 800] frame[ 240, 0, 120, 800] addr[ff0000ff, 0, 0] flags[0x 0] trd[0,0]
depth[ 0] COLOR enable ch[2] lyr[3] z[0] prem[N] a[pixel 0] fmt[ 0] fb[ 0, 0; 0, 0; 0, 0] crop[ 360, 0, 120, 800] frame[ 360, 0, 120, 800] addr[ffffff00, 0, 0] flags[0x 0] trd[0,0]
重置屏幕
mount -t debugfs none /sys/kernel/debug;
cd /sys/kernel/debug/dispdbg;
echo suspend> command; echo disp0 > name; echo 1 > start
echo resume > command; echo disp0 > name; echo 1 > start
显示条纹
echo 0 > /sys/class/disp/disp/attr/disp
echo 8 > /sys/class/disp/disp/attr/colorbar
我现在将驱动放到了–~/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/
disp2/disp/lcd# 这个位置
同目录下
这个文件该怎么改,
现在我也在做MIPI屏的文档,可以给你一个思路,我拿ili9341驱动为例,看一下这个驱动会在那些地方定义,先看.c文件,里面有设备树文件,包含的头文件和驱动程序,驱动程序这里就不探讨,我们再去看头文件里的内容
可以看到有着几部分内容,这里又包含了panels.h说明我们还需要在panels.h中修改
panels.h又会被panels.c使用,所以还需要修改panels.c的内容
你可以参考原来tina内置驱动的格式去进行修改
在内核中没有tft08006这个屏驱动,但是在uboot目录下有。你也可以参考tina-v853-open/brandy/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/lcd/目录中的panels.h和panels.c
4:Makefile
&lcd0 {
base_config_start = <1>;
lcd_used = <1>;
lcd_driver_name = "tft08006";
lcd_bl_0_percent = <0>;
lcd_bl_40_percent = <23>;
lcd_bl_100_percent = <100>;
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_dsi_format = <0>;
lcd_dsi_te = <0>;
lcd_dsi_eotp = <0>;
lcd_frm = <0>;
lcd_io_phase = <0x0000>;
lcd_hv_clk_phase = <0>;
lcd_hv_sync_polarity= <0>;
lcd_gamma_en = <0>;
lcd_bright_curve_en = <0>;
lcd_cmap_en = <0>;
lcdgamma4iep = <22>;
lcd_gpio_0 = <&pio PD 19 1 0 3 1>;
lcd_gpio_1 = <&pio PD 20 1 0 3 1>;
pinctrl-0 = <&dsi4lane_pins_a>;
pinctrl-1 = <&dsi4lane_pins_b>;
base_config_end = <1>;
};
这几个文件的路径分别是:
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.c
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.h
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/tft08006.c
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/tft08006.h
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig
/root/tina-v853-docker/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/Makefile
注意要在内核配置中选中新增的LCD屏驱动,可以正常编译烧写系统了嘛,如果正常可以编译烧写系统,需要在开发板上查看打印信息,可以根据LCD调试指南进行调试:调试方法 - 全志Linux Tina-SDK开发完全手册
那看来是正常的,中断和背光都正常,看一下启动信息的lcd驱动是否初始正常,如果正常就得继续一步步debug了
可以了。原来是设备数的背光 lcd_pwm_ch = <9>;
这个没设置正确
是的,背光引脚需要使用pwm9
请问一下,您这两个控制的是什么引脚呢,我用的T113的板子,不知道这应该配置什么脚
您尝试过重置屏幕了吗?
mount -t debugfs none /sys/kernel/debug;
cd /sys/kernel/debug/dispdbg;
echo suspend> command; echo disp0 > name; echo 1 > start
echo resume > command; echo disp0 > name; echo 1 > start
我之前配置时发现T113都需要重置屏幕后,才拿正常显示