1. 一些描述
8x12平台和8x25平台的代码结构上还是有一些不同的,8x12平台的屏和TP都是通过 .dtsi文件管理的,QRD8X12_1935/bootable/bootloader/lk/dev/gcdb/display/include/
panel_hx8379a_wvga_video.h
- /*---------------------------------------------------------------------------
- * This file is autogenerated file using gcdb parser. Please do not edit it.
- * Update input XML file to add a new entry or update variable in this file
- * VERSION = "1.0"
- *---------------------------------------------------------------------------*/
- #ifndef _PANEL_HX8379A_WVGA_VIDEO_H_
- #define _PANEL_HX8379A_WVGA_VIDEO_H_
- /*---------------------------------------------------------------------------*/
- /* HEADER files */
- /*---------------------------------------------------------------------------*/
- #include "panel.h"
- /*---------------------------------------------------------------------------*/
- /* Panel configuration */
- /*---------------------------------------------------------------------------*/
- static struct panel_config hx8379a_wvga_video_panel_data = {
- "qcom,mdss_dsi_hx8379a_wvga_video", "dsi:0:", "qcom,mdss-dsi-panel",
- 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Panel resolution */
- /*---------------------------------------------------------------------------*/
- static struct panel_resolution hx8379a_wvga_video_panel_res = {
- 480, 800, 100, 94, 40, 0, 6, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Panel color information */
- /*---------------------------------------------------------------------------*/
- static struct color_info hx8379a_wvga_video_color = {
- 24, 0, 0xff, 0, 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Panel on/off command information */
- /*---------------------------------------------------------------------------*/
- static char hx8379a_wvga_video_on_cmd0[] = {
- 0x04, 0x00, 0x39, 0xC0,
- 0xB9, 0xFF, 0x83, 0x79,
- };
- static char hx8379a_wvga_video_on_cmd1[] = {
- 0x03, 0x00, 0x39, 0xC0,
- 0xBA, 0x51, 0x93, 0xFF,
- };
- static char hx8379a_wvga_video_on_cmd2[] = {
- 0x14, 0x00, 0x39, 0xC0,
- 0xB1, 0x00, 0x50, 0x44,
- 0xEA, 0x8D, 0x08, 0x11,
- 0x11, 0x11, 0x27, 0x2F,
- 0x9A, 0x1A, 0x42, 0x0B,
- 0x6E, 0xF1, 0x00, 0xE6,
- };
- static char hx8379a_wvga_video_on_cmd3[] = {
- 0x0E, 0x00, 0x39, 0xC0,
- 0xB2, 0x00, 0x00, 0x3C,
- 0x08, 0x04, 0x19, 0x22,
- 0x00, 0xFF, 0x08, 0x04,
- 0x19, 0x20, 0xFF, 0xFF,
- };
- static char hx8379a_wvga_video_on_cmd4[] = {
- 0x20, 0x00, 0x39, 0xC0,
- 0xB4, 0x80, 0x08, 0x00,
- 0x32, 0x10, 0x03, 0x32,
- 0x13, 0x70, 0x32, 0x10,
- 0x08, 0x37, 0x01, 0x28,
- 0x07, 0x37, 0x08, 0x35,
- 0x08, 0x3D, 0x44, 0x08,
- 0x00, 0x40, 0x08, 0x28,
- 0x08, 0x30, 0x30, 0x04,
- };
- static char hx8379a_wvga_video_on_cmd5[] = {
- 0x30, 0x00, 0x39, 0xC0,
- 0xD5, 0x00, 0x00, 0x0A,
- 0x00, 0x01, 0x05, 0x00,
- 0x03, 0x00, 0x88, 0x88,
- 0x88, 0x88, 0x23, 0x01,
- 0x67, 0x45, 0x02, 0x13,
- 0x88, 0x88, 0x88, 0x88,
- 0x88, 0x88, 0x88, 0x88,
- 0x88, 0x88, 0x54, 0x76,
- 0x10, 0x32, 0x31, 0x20,
- 0x88, 0x88, 0x88, 0x88,
- 0x88, 0x88, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- };
- static char hx8379a_wvga_video_on_cmd6[] = {
- 0x24, 0x00, 0x39, 0xC0,
- 0xE0, 0x79, 0x05, 0x0F,
- 0x14, 0x23, 0x24, 0x3F,
- 0x30, 0x46, 0x06, 0x10,
- 0x13, 0x16, 0x17, 0x16,
- 0x16, 0x13, 0x18, 0x05,
- 0x0F, 0x14, 0x23, 0x24,
- 0x3F, 0x30, 0x46, 0x06,
- 0x10, 0x13, 0x16, 0x17,
- 0x16, 0x16, 0x13, 0x18,
- };
- static char hx8379a_wvga_video_on_cmd7[] = {
- 0x80, 0x00, 0x39, 0xC0,
- 0xC1, 0x01, 0x00, 0x07,
- 0x10, 0x17, 0x1D, 0x2A,
- 0x33, 0x3A, 0x43, 0x4A,
- 0x52, 0x5B, 0x64, 0x6D,
- 0x78, 0x7F, 0x88, 0x90,
- 0x98, 0xA0, 0xA9, 0xB2,
- 0xB9, 0xC1, 0xC9, 0xD1,
- 0xD7, 0xDF, 0xE6, 0xED,
- 0xF4, 0xFA, 0xFD, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x08, 0x10, 0x18,
- 0x20, 0x28, 0x30, 0x38,
- 0x40, 0x47, 0x4F, 0x58,
- 0x60, 0x68, 0x70, 0x78,
- 0x80, 0x88, 0x90, 0x98,
- 0xA0, 0xA9, 0xB1, 0xB9,
- 0xC1, 0xC9, 0xD1, 0xD8,
- 0xE0, 0xE8, 0xF0, 0xF9,
- 0xFE, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08,
- 0x10, 0x18, 0x1E, 0x26,
- 0x2E, 0x34, 0x3A, 0x41,
- 0x49, 0x4F, 0x58, 0x5E,
- 0x67, 0x6F, 0x77, 0x80,
- 0x88, 0x8F, 0x97, 0x9F,
- 0xA7, 0xAF, 0xB8, 0xBF,
- 0xC7, 0xD1, 0xD8, 0xE3,
- 0xEA, 0xF6, 0xFF, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- };
- static char hx8379a_wvga_video_on_cmd8[] = {
- 0xcc, 0x02, 0x23, 0x80
- };
- static char hx8379a_wvga_video_on_cmd9[] = {
- 0x05, 0x00, 0x39, 0xC0,
- 0xB6, 0x00, 0x9C, 0x00,
- 0x9C, 0xFF, 0xFF, 0xFF,
- };
- static char hx8379a_wvga_video_on_cmd10[] = {
- 0x11, 0x00, 0x05, 0x80
- };
- static char hx8379a_wvga_video_on_cmd11[] = {
- 0x29, 0x00, 0x05, 0x80
- };
- static struct mipi_dsi_cmd hx8379a_wvga_video_on_command[] = {
- {0x8, hx8379a_wvga_video_on_cmd0, 0x00},
- {0x8, hx8379a_wvga_video_on_cmd1, 0x00},
- {0x18, hx8379a_wvga_video_on_cmd2, 0x00},
- {0x14, hx8379a_wvga_video_on_cmd3, 0x00},
- {0x24, hx8379a_wvga_video_on_cmd4, 0x00},
- {0x34, hx8379a_wvga_video_on_cmd5, 0x00},
- {0x28, hx8379a_wvga_video_on_cmd6, 0x00},
- {0x84, hx8379a_wvga_video_on_cmd7, 0x00},
- {0x4, hx8379a_wvga_video_on_cmd8, 0x00},
- {0xc, hx8379a_wvga_video_on_cmd9, 0x00},
- {0x4, hx8379a_wvga_video_on_cmd10, 0x96},
- {0x4, hx8379a_wvga_video_on_cmd11, 0x78}
- };
- #define HX8379A_WVGA_VIDEO_ON_COMMAND 12
- static char hx8379a_wvga_videooff_cmd0[] = {
- 0x28, 0x00, 0x05, 0x80
- };
- static char hx8379a_wvga_videooff_cmd1[] = {
- 0x10, 0x00, 0x05, 0x80
- };
- static struct mipi_dsi_cmd hx8379a_wvga_video_off_command[] = {
- {0x4, hx8379a_wvga_videooff_cmd0, 0x32},
- {0x4, hx8379a_wvga_videooff_cmd1, 0x78}
- };
- #define HX8379A_WVGA_VIDEO_OFF_COMMAND 2
- static struct command_state hx8379a_wvga_video_state = {
- 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Command mode panel information */
- /*---------------------------------------------------------------------------*/
- static struct commandpanel_info hx8379a_wvga_video_command_panel = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Video mode panel information */
- /*---------------------------------------------------------------------------*/
- static struct videopanel_info hx8379a_wvga_video_video_panel = {
- 1, 0, 0, 0, 1, 1, 2, 0, 0x9
- };
- /*---------------------------------------------------------------------------*/
- /* Lane configuration */
- /*---------------------------------------------------------------------------*/
- static struct lane_configuration hx8379a_wvga_video_lane_config = {
- 2, 1, 1, 1, 0, 0
- };
- /*---------------------------------------------------------------------------*/
- /* Panel timing */
- /*---------------------------------------------------------------------------*/
- static const uint32_t hx8379a_wvga_video_timings[] = {
- 0x78, 0x1B, 0x11, 0x00, 0x3E, 0x43, 0x16, 0x1E, 0x1D, 0x03, 0x04, 0x00
- };
- static struct panel_timing hx8379a_wvga_video_timing_info = {
- 0, 4, 0x04, 0x1b
- };
- /*---------------------------------------------------------------------------*/
- /* Panel reset sequence */
- /*---------------------------------------------------------------------------*/
- static struct panel_reset_sequence hx8379a_wvga_video_reset_seq = {
- {2, 0, 2, }, {20, 2, 20, }, 2
- };
- /*---------------------------------------------------------------------------*/
- /* Backlight setting */
- /*---------------------------------------------------------------------------*/
- static struct backlight hx8379a_wvga_video_backlight = {
- 0, 1, 255, 0, 1, 0
- };
- #endif /*_PANEL_HX8379A_WVGA_VIDEO_H_*/
参数的具体设置根据的屏而定,现在准备添加一块屏:
1. 上面的 .h文件是第一个需要更改的地方,比较重要的几个参数:lane_config, video_timings, video_command的格式,这些地方如果出错可能导致屏不亮
2. 第二个需要修改的地方是QRD8X12_1935/bootable/bootloader/lk/target/msm8610/oem_panel.c,之前的8x25平台应该是没有这个文件的,这个文件会调用上面写好的 .h文件,按照里面的格式添加一块新屏,需要注意的地方是,看你的平台走的什么版本(QCT QRD)等,因为默认加载的屏也是不同的(可以通过打log看看是什么版本的)
3. 第三个需要更改的地方是 QRD8X12_1935/kernel/arch/arm/boot/dts/dsi-panel-hx8379a-wvga-video.dtsi 这个文件里面的参数跟上边的.h文件内参数是对应的
- /*---------------------------------------------------------------------------
- * This file is autogenerated file using gcdb parser. Please do not edit it.
- * Update input XML file to add a new entry or update variable in this file
- * VERSION = "1.0"
- *---------------------------------------------------------------------------*/
- &mdss_mdp {
- dsi_hx8379a_wvga_vid: qcom,mdss_dsi_hx8379a_wvga_video {
- qcom,mdss-dsi-panel-name = "HX8379A wvga video mode dsi panel";
- qcom,mdss-dsi-panel-controller = <&mdss_dsi0>;
- qcom,mdss-dsi-panel-type = "dsi_video_mode";
- qcom,mdss-dsi-panel-destination = "display_1";
- qcom,mdss-dsi-panel-framerate = <60>;
- qcom,mdss-dsi-virtual-channel-id = <0>;
- qcom,mdss-dsi-stream = <0>;
- qcom,mdss-dsi-panel-width = <480>;
- qcom,mdss-dsi-panel-height = <800>;
- qcom,mdss-dsi-h-front-porch = <100>;
- qcom,mdss-dsi-h-back-porch = <94>;
- qcom,mdss-dsi-h-pulse-width = <40>;
- qcom,mdss-dsi-h-sync-skew = <0>;
- qcom,mdss-dsi-v-back-porch = <4>;
- qcom,mdss-dsi-v-front-porch = <6>;
- qcom,mdss-dsi-v-pulse-width = <6>;
- qcom,mdss-dsi-h-left-border = <0>;
- qcom,mdss-dsi-h-right-border = <0>;
- qcom,mdss-dsi-v-top-border = <0>;
- qcom,mdss-dsi-v-bottom-border = <0>;
- qcom,mdss-dsi-bpp = <24>;
- qcom,mdss-dsi-underflow-color = <0xff>;
- qcom,mdss-dsi-border-color = <0>;
- qcom,mdss-dsi-on-command = [
- 39 01 00 00 00 00 04
- B9 FF 83 79
- 39 01 00 00 00 00 03
- BA 51 93
- 39 01 00 00 00 00 14
- B1 00 50 44
- EA 8D 08 11
- 11 11 27 2F
- 9A 1A 42 0B
- 6E F1 00 E6
- 39 01 00 00 00 00 0E
- B2 00 00 3C
- 08 04 19 22
- 00 FF 08 04
- 19 20
- 39 01 00 00 00 00 20
- B4 80 08 00
- 32 10 03 32
- 13 70 32 10
- 08 37 01 28
- 07 37 08 35
- 08 3D 44 08
- 00 40 08 28
- 08 30 30 04
- 39 01 00 00 00 00 30
- D5 00 00 0A
- 00 01 05 00
- 03 00 88 88
- 88 88 23 01
- 67 45 02 13
- 88 88 88 88
- 88 88 88 88
- 88 88 54 76
- 10 32 31 20
- 88 88 88 88
- 88 88 00 00
- 00 00 00 00
- 39 01 00 00 00 00 24
- E0 79 05 0F
- 14 23 24 3F
- 30 46 06 10
- 13 16 17 16
- 16 13 18 05
- 0F 14 23 24
- 3F 30 46 06
- 10 13 16 17
- 16 16 13 18
- 39 01 00 00 00 00 80
- C1 01 00 07
- 10 17 1D 2A
- 33 3A 43 4A
- 52 5B 64 6D
- 78 7F 88 90
- 98 A0 A9 B2
- B9 C1 C9 D1
- D7 DF E6 ED
- F4 FA FD 00
- 00 00 00 00
- 00 00 00 00
- 00 08 10 18
- 20 28 30 38
- 40 47 4F 58
- 60 68 70 78
- 80 88 90 98
- A0 A9 B1 B9
- C1 C9 D1 D8
- E0 E8 F0 F9
- FE 00 00 00
- 00 00 00 00
- 00 00 00 08
- 10 18 1E 26
- 2E 34 3A 41
- 49 4F 58 5E
- 67 6F 77 80
- 88 8F 97 9F
- A7 AF B8 BF
- C7 D1 D8 E3
- EA F6 FF 00
- 00 00 00 00
- 00 00 00 00
- 23 01 00 00 00 00 02
- cc 02
- 39 01 00 00 00 00 05
- B6 00 9C 00
- 9C
- 05 01 00 00 96 00 02
- 11 00
- 05 01 00 00 78 00 02
- 29 00
- ];
- qcom,mdss-dsi-off-command = [05 01 00 00 32 00 02 28 00
- 05 01 00 00 78 00 02 10 00];
- qcom,mdss-dsi-on-command-state = "dsi_lp_mode";
- qcom,mdss-dsi-off-command-state = "dsi_lp_mode";
- qcom,mdss-dsi-h-sync-pulse = <1>;
- qcom,mdss-dsi-traffic-mode = "burst_mode";
- qcom,mdss-dsi-lane-map = "lane_map_3012";
- qcom,mdss-dsi-bllp-eof-power-mode;
- qcom,mdss-dsi-bllp-power-mode;
- qcom,mdss-dsi-lane-0-state;
- qcom,mdss-dsi-lane-1-state;
- qcom,mdss-dsi-panel-timings = [78 1B 11 00 3E 43 16 1E 1D 03 04 00];
- qcom,mdss-dsi-t-clk-post = <0x04>;
- qcom,mdss-dsi-t-clk-pre = <0x1b>;
- qcom,mdss-dsi-bl-min-level = <1>;
- qcom,mdss-dsi-bl-max-level = <255>;
- qcom,mdss-dsi-dma-trigger = "trigger_sw";
- qcom,mdss-dsi-mdp-trigger = "none";
- qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_wled";
- qcom,mdss-dsi-reset-sequence = <1 20>, <0 2>, <1 20>;
- };
- };
4. 第四个需要修改的地方是将kernel中屏的.dtsi文件include进msm8610-mdss-panel.dtsi中,否则编译过程中会提示错误。
5. 在例如msm8610-mtp.dtsi文件中加入屏的dsi-hx8379a-wvga-vid
否则编译过程中也会报错。
6.
实际开发中遇到的问题:
MIPI转LVDS的LCD,,lk方面:需要在AP/bootable/bootloader/lk/platform/msm_shared/mipi_dsi.c 文件中的数组sn65dis83_init_table[]={}修改初始化参数
kernie方面:AP/kernel/drivers/video/msm/mdss/mipi_sn65dsi83_dsi2lvds-i2c.c文件中的数组sn65dis83_init_table[]={}修改初始化参数
还有一些其他问题待续。。。。。