D1移植讯为7寸MIPI屏
-
1、修改驱动源码
内核源码驱动路径:tina-d1-open/lichee/linux-5.4/drivers/video/fbdev/sunxi/disp2/disp/lcd
uboot源码驱动路径:tina-d1-open/lichee/brandy-2.0/u-boot-2018/drivers/video/sunxi/disp2/disp/lcd
因为驱动框架是一样的,我们只需要修改屏幕初始化参数就可以了。这里我修改的就是tft08006.c文件修改内核源码
static void lcd_power_off(u32 sel) @@ -189,225 +191,69 @@ static void lcd_bl_close(u32 sel) struct LCM_setting_table { u8 cmd; u32 count; - u8 para_list[32]; + u8 para_list[64]; }; static struct LCM_setting_table lcm_tft08006_setting[] = { - {0xFF, 3, {0x98, 0x81, 0x03} }, - {0x01, 1, {0x00} }, - {0x02, 1, {0x00} }, - {0x03, 1, {0x53} }, - {0x04, 1, {0x53} }, - {0x05, 1, {0x13} }, - {0x06, 1, {0x04} }, - {0x07, 1, {0x02} }, - {0x08, 1, {0x02} }, - {0x09, 1, {0x00} }, - {0x0a, 1, {0x00} }, - …… - {0x11, 0, {} }, - {REGFLAG_DELAY, REGFLAG_DELAY, {120} }, - - {0x29, 0, {} }, - {REGFLAG_DELAY, REGFLAG_DELAY, {120} }, - - {REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} } + {0xE0, 2, {0xAB, 0xBA} }, + {0xE1, 2, {0xBA, 0xAB} }, + {0xB0, 1, {0x00} }, + {0xB1, 4, {0x10, 0x01, 0x47, 0xFF} }, + {0xB2, 6, {0x0C, 0x0E, 0x04, 0x14, 0x14, 0x14} }, + {0xB3, 3, {0x56, 0xD3, 0x00} }, + {0xB4, 3, {0x22, 0x30, 0x04} }, + {0xB5, 1, {0x00} }, + {0xB6, 7, {0xB0, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00} }, + {0xB7, 8, {0x0E, 0x00, 0xFF, 0x08, 0x08, 0xFF, 0xFF, 0x00} }, + {0xB8, 7, {0x05, 0x12, 0x29, 0x49, 0x48, 0x00, 0x00} }, + {0xB9, 38, {0x4D, 0x42, 0x38, 0x31, 0x33, 0x27, 0x2F, 0x1B, 0x36, 0x35, 0x35, 0x53, 0x41, 0x49, 0x3D, 0x3D, 0x33, 0x29, 0x26, 0x4C, 0x42, 0x39, 0x31, 0x33, 0x27, 0x2F, 0x1B, 0x36, 0x35, 0x35, 0x53, 0x41, 0x49, 0x3D, 0x3D, 0x33, 0x29, 0x26} }, + {0xBA, 8, {0x00, 0x00, 0x00, 0x44, 0x24, 0x00, 0x00, 0x00} }, + {0xBB, 3, {0x76, 0x00, 0x00} }, + {0xBC, 2, {0x00, 0x00} }, + {0xBD, 5, {0xFF, 0x00, 0x00, 0x00, 0x00} }, + {0xBE, 1, {0x00} }, + {0xC0, 16, {0x98, 0x76, 0x12, 0x34, 0x33, 0x33, 0x44, 0x44, 0x06, 0x04, 0x8A, 0x04, 0x0F, 0x00, 0x00, 0x00} }, + {0xC1, 10, {0x53, 0x94, 0x02, 0x85, 0x06, 0x04, 0x8A, 0x04, 0x54, 0x00} }, + {0xC2, 12, {0x37, 0x09, 0x08, 0x89, 0x08, 0x10, 0x22, 0x21, 0x44, 0xBB, 0x18, 0x00} }, + + {0xC3, 22, {0x9C, 0x1D, 0x1E, 0x1F, 0x10, 0x12, 0x0C, 0x0E, 0x05, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x07, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24} }, + {0xC4, 22, {0x1C, 0x1D, 0x1E, 0x1F, 0x11, 0x13, 0x0D, 0x0F, 0x04, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x06, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24} }, + {0xC5, 3, {0xE8, 0x85, 0x76} }, + {0xC6, 2, {0x20, 0x20} }, + {0xC7, 22, {0x41, 0x01, 0x0D, 0x11, 0x09, 0x15, 0x19, 0x4F, 0x10, 0xD7, 0xCF, 0x19, 0x1B, 0x1D, 0x03, 0x02, 0x25, 0x30, 0x00, 0x03, 0xFF, 0x00} }, + {0xC8, 6, {0x61, 0x00, 0x31, 0x42, 0x54, 0x16} }, + {0xC9, 5, {0xA1, 0x22, 0xFF, 0xCD, 0x23} }, + {0xCA, 2, {0x4B, 0x43} }, + {0xCC, 4, {0x2E, 0x02, 0x04, 0x08} }, + {0xCD, 8, {0x0E, 0x64, 0x64, 0x20, 0x1E, 0x6B, 0x06, 0x83} }, + {0xD0, 3, {0x27, 0x10, 0x80} }, + {0xD1, 4, {0x00, 0x0D, 0xFF, 0x0F} }, + {0xD2, 4, {0xE3, 0x2B, 0x38, 0x00} }, + {0xD4, 11,{0x00, 0x01, 0x00, 0x0E, 0x04, 0x44, 0x08, 0x10, 0x00, 0x07, 0x00} }, + {0xD5, 1, {0x00} }, + {0xD6, 2, {0x00, 0x00} }, + {0xD7, 4, {0x00, 0x00, 0x00, 0x00} }, + {0xE4, 3, {0x08, 0x55, 0x03} }, + {0xE6, 8, {0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} }, + {0xE7, 3, {0x00, 0x00, 0x00} }, + + {0xE8, 7, {0xD5, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00} }, + {0xE9, 1, {0xFF} }, + {0xF0, 5, {0x12, 0x03, 0x20, 0x00, 0xFF} }, + {0xF1, 26, {0xA6, 0xC8, 0xEA, 0xE6, 0xE4, 0xCC, 0xE4, 0xBE, 0xF0, 0xB2, 0xAA, 0xC7, 0xFF, 0x66, 0x98, 0xE3, 0x87, 0xC8, 0x99, 0xC8, 0x8C, 0xBE, 0x96, 0x91, 0x8F, 0xFF} }, + {0xF3, 1, {0x03} }, + {0xF4, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF5, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF6, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF7, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xF8, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xF9, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xFA, 25, {0x00, 0x84, 0x12, 0x21, 0x48, 0x48, 0x21, 0x12, 0x84, 0x69, 0x69, 0x5A, 0xA5, 0x96, 0x96, 0xA5, 0x5A, 0xB7, 0xDE, 0xED, 0x7B, 0x7B, 0xED, 0xDE, 0xB7} }, + {0xFB, 23, {0x00, 0x12, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x38, 0x40, 0x08, 0x70, 0x0B, 0x40, 0x19, 0x50, 0x21, 0xC0, 0x27, 0x60, 0x2D, 0x00, 0x00, 0x0F} }, + {0xE3, 2, {0x20, 0x21} }, + {0x11, 0, {0x00} }, + {REGFLAG_DELAY, REGFLAG_DELAY, {200}}, + {0x29, 0, {0x00} }, + + {REGFLAG_DELAY, REGFLAG_DELAY, {20}}, + {REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {}}
修改uboot源码
static void lcd_power_off(u32 sel) @@ -189,225 +191,69 @@ static void lcd_bl_close(u32 sel) struct LCM_setting_table { u8 cmd; u32 count; - u8 para_list[32]; + u8 para_list[64]; }; static struct LCM_setting_table lcm_tft08006_setting[] = { - {0xFF, 3, {0x98, 0x81, 0x03} }, - {0x01, 1, {0x00} }, - {0x02, 1, {0x00} }, - {0x03, 1, {0x53} }, - {0x04, 1, {0x53} }, - {0x05, 1, {0x13} }, - {0x06, 1, {0x04} }, - {0x07, 1, {0x02} }, - {0x08, 1, {0x02} }, - {0x09, 1, {0x00} }, - {0x0a, 1, {0x00} }, - …… - {0x11, 0, {} }, - {REGFLAG_DELAY, REGFLAG_DELAY, {120} }, - - {0x29, 0, {} }, - {REGFLAG_DELAY, REGFLAG_DELAY, {120} }, - - {REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {} } + {0xE0, 2, {0xAB, 0xBA} }, + {0xE1, 2, {0xBA, 0xAB} }, + {0xB0, 1, {0x00} }, + {0xB1, 4, {0x10, 0x01, 0x47, 0xFF} }, + {0xB2, 6, {0x0C, 0x0E, 0x04, 0x14, 0x14, 0x14} }, + {0xB3, 3, {0x56, 0xD3, 0x00} }, + {0xB4, 3, {0x22, 0x30, 0x04} }, + {0xB5, 1, {0x00} }, + {0xB6, 7, {0xB0, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00} }, + {0xB7, 8, {0x0E, 0x00, 0xFF, 0x08, 0x08, 0xFF, 0xFF, 0x00} }, + {0xB8, 7, {0x05, 0x12, 0x29, 0x49, 0x48, 0x00, 0x00} }, + {0xB9, 38, {0x4D, 0x42, 0x38, 0x31, 0x33, 0x27, 0x2F, 0x1B, 0x36, 0x35, 0x35, 0x53, 0x41, 0x49, 0x3D, 0x3D, 0x33, 0x29, 0x26, 0x4C, 0x42, 0x39, 0x31, 0x33, 0x27, 0x2F, 0x1B, 0x36, 0x35, 0x35, 0x53, 0x41, 0x49, 0x3D, 0x3D, 0x33, 0x29, 0x26} }, + {0xBA, 8, {0x00, 0x00, 0x00, 0x44, 0x24, 0x00, 0x00, 0x00} }, + {0xBB, 3, {0x76, 0x00, 0x00} }, + {0xBC, 2, {0x00, 0x00} }, + {0xBD, 5, {0xFF, 0x00, 0x00, 0x00, 0x00} }, + {0xBE, 1, {0x00} }, + {0xC0, 16, {0x98, 0x76, 0x12, 0x34, 0x33, 0x33, 0x44, 0x44, 0x06, 0x04, 0x8A, 0x04, 0x0F, 0x00, 0x00, 0x00} }, + {0xC1, 10, {0x53, 0x94, 0x02, 0x85, 0x06, 0x04, 0x8A, 0x04, 0x54, 0x00} }, + {0xC2, 12, {0x37, 0x09, 0x08, 0x89, 0x08, 0x10, 0x22, 0x21, 0x44, 0xBB, 0x18, 0x00} }, + + {0xC3, 22, {0x9C, 0x1D, 0x1E, 0x1F, 0x10, 0x12, 0x0C, 0x0E, 0x05, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x07, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24} }, + {0xC4, 22, {0x1C, 0x1D, 0x1E, 0x1F, 0x11, 0x13, 0x0D, 0x0F, 0x04, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x06, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24} }, + {0xC5, 3, {0xE8, 0x85, 0x76} }, + {0xC6, 2, {0x20, 0x20} }, + {0xC7, 22, {0x41, 0x01, 0x0D, 0x11, 0x09, 0x15, 0x19, 0x4F, 0x10, 0xD7, 0xCF, 0x19, 0x1B, 0x1D, 0x03, 0x02, 0x25, 0x30, 0x00, 0x03, 0xFF, 0x00} }, + {0xC8, 6, {0x61, 0x00, 0x31, 0x42, 0x54, 0x16} }, + {0xC9, 5, {0xA1, 0x22, 0xFF, 0xCD, 0x23} }, + {0xCA, 2, {0x4B, 0x43} }, + {0xCC, 4, {0x2E, 0x02, 0x04, 0x08} }, + {0xCD, 8, {0x0E, 0x64, 0x64, 0x20, 0x1E, 0x6B, 0x06, 0x83} }, + {0xD0, 3, {0x27, 0x10, 0x80} }, + {0xD1, 4, {0x00, 0x0D, 0xFF, 0x0F} }, + {0xD2, 4, {0xE3, 0x2B, 0x38, 0x00} }, + {0xD4, 11,{0x00, 0x01, 0x00, 0x0E, 0x04, 0x44, 0x08, 0x10, 0x00, 0x07, 0x00} }, + {0xD5, 1, {0x00} }, + {0xD6, 2, {0x00, 0x00} }, + {0xD7, 4, {0x00, 0x00, 0x00, 0x00} }, + {0xE4, 3, {0x08, 0x55, 0x03} }, + {0xE6, 8, {0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} }, + {0xE7, 3, {0x00, 0x00, 0x00} }, + + {0xE8, 7, {0xD5, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00} }, + {0xE9, 1, {0xFF} }, + {0xF0, 5, {0x12, 0x03, 0x20, 0x00, 0xFF} }, + {0xF1, 26, {0xA6, 0xC8, 0xEA, 0xE6, 0xE4, 0xCC, 0xE4, 0xBE, 0xF0, 0xB2, 0xAA, 0xC7, 0xFF, 0x66, 0x98, 0xE3, 0x87, 0xC8, 0x99, 0xC8, 0x8C, 0xBE, 0x96, 0x91, 0x8F, 0xFF} }, + {0xF3, 1, {0x03} }, + {0xF4, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF5, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF6, 26, {0xFF, 0xFE, 0xFC, 0xFA, 0xF8, 0xF4, 0xF0, 0xE8, 0xE0, 0xD0, 0xC0, 0xA0, 0x80, 0x7F, 0x5F, 0x3F, 0x2F, 0x1F, 0x17, 0x0F,0x0B, 0x07, 0x05, 0x03, 0x01, 0x00} }, + {0xF7, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xF8, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xF9, 7, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }, + {0xFA, 25, {0x00, 0x84, 0x12, 0x21, 0x48, 0x48, 0x21, 0x12, 0x84, 0x69, 0x69, 0x5A, 0xA5, 0x96, 0x96, 0xA5, 0x5A, 0xB7, 0xDE, 0xED, 0x7B, 0x7B, 0xED, 0xDE, 0xB7} }, + {0xFB, 23, {0x00, 0x12, 0x0F, 0xFF, 0xFF, 0xFF, 0x00, 0x38, 0x40, 0x08, 0x70, 0x0B, 0x40, 0x19, 0x50, 0x21, 0xC0, 0x27, 0x60, 0x2D, 0x00, 0x00, 0x0F} }, + {0xE3, 2, {0x20, 0x21} }, + {0x11, 0, {0x00} }, + {REGFLAG_DELAY, REGFLAG_DELAY, {200}}, + {0x29, 0, {0x00} }, + + {REGFLAG_DELAY, REGFLAG_DELAY, {20}}, + {REGFLAG_END_OF_TABLE, REGFLAG_END_OF_TABLE, {}}
2、修改设备树
这里只把重要的参数列出来了,内核设备树和uboot设备树要保持一致。
;---------------------------------------------- &lcd0 { lcd_used = <1>; lcd_driver_name = "tft08006"; lcd_backlight = <100>; lcd_if = <4>; lcd_x = <800>; lcd_y = <1280>; lcd_width = <80>; lcd_height = <80>; lcd_dclk_freq = <60>; lcd_pwm_used = <1>; lcd_pwm_ch = <2>; lcd_pwm_freq = <1000>; lcd_pwm_pol = <0>; lcd_pwm_max_limit = <255>; lcd_hbp = <40>; lcd_ht = <860>; lcd_hspw = <20>; lcd_vbp = <24>; lcd_vt = <1330>; lcd_vspw = <4>; lcd_dsi_if = <0>; lcd_dsi_lane = <4>;
3、触摸屏驱动配置
到Tina根目录下make kernel_menuconfig将下面驱动配置上
修改设备树
在twi0下增加触摸屏子节点
4、编译打包、测试
-
@yaoxiaoyao
这个屏可以直连? -
@jordonwu 不可以,线序不一样
-
请问tft08006.c文件哪里下载?
-
@lumen
修改前的在tina-d1-h/lichee/linux-5.4/driver/video/sunxi/fbdev/disp/disp/lcd -
大佬,求一个你这个mipi屏的购买链接
-
-
@q1215200171 楼主用的应该不是原厂的
-
@lumen 或许是 看着挺像
-
@lumen 讯为的MIPI屏 淘宝有卖的三四百吧
https://m.tb.cn/h.fqYJmck?tk=40Pf2hVcPMg -
-
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号