我是靠谱客的博主 乐观大象,最近开发中收集的这篇文章主要介绍MSM8909+Android5.1.1之BSP---增加ili9806e(display LCD)的支持(转),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述


 

Mobile display processor: MDP 3.05 for display processing

DCS (DisplayCommandSet):DCS是一个标准化的命令集,用于命令模式的显示模组

 

1.     硬件原理图


 

图1

 

GPIO_24引脚功能是MDP verticalsync – primary Configurable I/O,如果我们有第2个显示屏,还会用到GPIO_25引脚MDP vertical sync –secondary Configurable I/O,这里我们只用到GPIO_24。

 

TP和背光部分后面再介绍。

 

2.     支持ili9806e显示屏

 

Before starting any porting, verify thatyou are using the latest Android device tree and Qualcomm’s proprietary source.How to generate Panel dtsi/header file: Take these steps to update the XMLfiles for display.

参考deviceqcomcommondisplaytoolsREADME.txt

 

2.1   生成panel dtsi/头文件

参考device/qcom/common/display/tools/README.txt文件,以tools文件夹下的《dsi-panel-nt35596-1080p-video.dtsi》为样本,我们复制一份并命名为取名为panel_ili9806e_wvga_video.xml,根据ili9806e及原理图修改其中的内容然后用命令:perl parser.pl panel_ili9806e_wvga_video.xml panel生成dsi-panel-ili9806e-wvga-video.dtsi和panel_ili9806e-wvga-video.h文件

 

这里我们重点介绍如何根据显示屏驱动IC厂家给的初始化代码来填写panel_ili9806e_wvga_video.xml文件

 

(1)  上电初始化部分

//***************Page 1 Command******************************//

REGISTER,FF,5,FF,98,06,04,01     //Change to Page 1

REGISTER,08,1,10                 // output SDA

REGISTER,21,1,01                 // DE = 1 Active

REGISTER,30,1,02                 // 480 X 800

 

在bootable/bootloader/lk/dev/gcdb/display/include/找到自带的文件panel_ili9806e_fwvga_video.h可知初始化的mipi包数据类型为0x39,见下图:


图2

根据初始化代码填写的panel_ili9806e_wvga_video.xml上电初始化内容如下:


图3

上图对应的结构体如下:

kerneldriversvideomsmmdssmdss_dsi_cmd.h

struct dsi_ctrl_hdr {
chardtype;
/* data type */
charlast;
/* last in chain */
charvc; /* virtual chan */
charack;
/* ask ACK from peripheral */
charwait;
/* ms */
shortdlen;
/* 16 bits */
} __packed;
struct dsi_cmd_desc {
structdsi_ctrl_hdr dchdr;
char*payload;
};

(2)  MIPI DSI接口

根据原理图知道采用的是DSI接口,

采用MIPIDSI Interface接口

? DSI兼容的外设支持Command或Video操作模式,用哪个模式由外设的构架决定

? Command模式是指采用发送命令和数据到具有显示缓存的控制器。主机通过命令间接的控制外设。Command模式采用双向接口

? Video模式是指从主机传输到外设采用时实象素流。这种模式只能以高速传输。为减少复杂性和节约成本,只采用Video模式的系统可能只有一个单向数据路径

 

? Command Mode(类似于MPU接口)

   ? Video Mode(类似于RGB接口)- 必须用高速模式传输数据

command还是video模式由Driver IC RAM决定:

  1.带RAM IC可支持 command及video模式

  2.不带RAM IC只支持video模式

 ILI9806E不带RAM.

 

2.2   Lk支持ili9806e显示屏

(1)  增加显示屏头文件

拷贝上面生成的panel_ili9806e-wvga-video.h文件到

bootable/bootloader/lk/dev/gcdb/display/include/目录下。

 

(2)  bootablebootloaderlktargetmsm8909oem_panel.c增加对新显示屏的支持

#include "include/panel_ili9806e_wvga_video.h"
enum {
HX8394D_720P_VIDEO_PANEL,
SHARP_QHD_VIDEO_PANEL,
TRULY_WVGA_CMD_PANEL,
HX8379A_FWVGA_SKUA_VIDEO_PANEL,
ILI9806E_FWVGA_VIDEO_PANEL,
ILI9806E_WVGA_VIDEO_PANEL,//kandi add at 2015.11.26
HX8394D_QHD_VIDEO_PANEL,
HX8379C_FWVGA_VIDEO_PANEL,
NT35512_FWVGA_VIDEO_PANEL,
OTM9605A_QHD_VIDEO_PANEL,
OTM9605A_QHD_CB03_VIDEO_PANEL,
OTM9605AG_QHD_VIDEO_PANEL,
HX8389B_QHD_VIDEO_PANEL,
HX8389BG_QHD_VIDEO_PANEL,
JD9161BA_FWVGA_VIDEO_PANEL,
UNKNOWN_PANEL
};

init_panel_data()函数增加:

case ILI9806E_WVGA_VIDEO_PANEL:
panelstruct->paneldata
= &ili9806e_wvga_video_panel_data;
panelstruct->panelres
= &ili9806e_wvga_video_panel_res;
panelstruct->color
= &ili9806e_wvga_video_color;
panelstruct->videopanel
= &ili9806e_wvga_video_video_panel;
panelstruct->commandpanel =&ili9806e_wvga_video_command_panel;
panelstruct->state
= &ili9806e_wvga_video_state;
panelstruct->laneconfig
= &ili9806e_wvga_video_lane_config;
panelstruct->paneltiminginfo
=&ili9806e_wvga_video_timing_info;
panelstruct->panelresetseq
=&ili9806e_wvga_video_reset_seq;
panelstruct->backlightinfo =&ili9806e_wvga_video_backlight;
pinfo->mipi.panel_cmds
=ili9806e_wvga_video_on_command;
pinfo->mipi.num_of_panel_cmds
=ILI9806E_WVGA_VIDEO_ON_COMMAND;
memcpy(phy_db->timing,
ili9806e_wvga_video_timings, TIMING_SIZE);
pinfo->mipi.signature =ILI9806E_WVGA_VIDEO_SIGNATURE;
panelstruct->paneldata->panel_lp11_init= 1;
break;

oem_panel_select()函数的QRD_SKUE_CB03这case改为用新显示屏

case QRD_SKUE_CB03:
//panel_id= HX8389BG_QHD_VIDEO_PANEL;
//panel_id= OTM9605A_QHD_CB03_VIDEO_PANEL;
panel_id= ILI9806E_WVGA_VIDEO_PANEL; //kandi add at 2015.11.26
//panel_id= NT35512_FWVGA_VIDEO_PANEL;
break;

2.3   Kernel支持ili9806e显示屏

(1)  增加显示屏对应的设备树

拷贝上面生成的dsi-panel-ili9806e-wvga-video.dtsi到

kernelarcharmbootdtsqcom目录下

 

(2)  kernelarcharmbootdtsqcommsm8909-qrd-skue-cb03.dtsi需要包含dsi-panel-ili9806e-wvga-video.dtsi

#include"dsi-panel-ili9806e-wvga-video.dtsi"
&mdss_mdp {
qcom,mdss-pref-prim-intf= "dsi";//DSI设置成主要接口
};
//&dsi_otm9605a_qhd_video {
//
qcom,cont-splash-enabled;
//};
&pmx_mdss {
qcom,num-grp-pins= <1>;
qcom,pins= <&gp 8>;
};
&pmx_mdss_te {
qcom,num-grp-pins= <1>;
qcom,pins= <&gp 24>;
};
&mdss_dsi0 {
//
qcom,dsi-pref-prim-pan= <&dsi_otm9605a_qhd_video>;
qcom,dsi-pref-prim-pan= <&dsi_ili9806e_wvga_video>;//设置PANEL NODE
pinctrl-names= "mdss_default", "mdss_sleep";
pinctrl-0= <&mdss_dsi_active &mdss_te_active>;
pinctrl-1= <&mdss_dsi_suspend &mdss_te_suspend>;
qcom,platform-reset-gpio= <&msm_gpio 8 0>;
};

需要主要dsi_ili9806e_wvga_video需要和显示屏的dsi-panel-ili9806e-wvga-video.dtsi中的值一样,如下:

&mdss_mdp {
dsi_ili9806e_wvga_video:qcom,mdss_dsi_ili9806e_wvga_video {
qcom,mdss-dsi-panel-name= "ili9806e wvga video mode dsi panel";
…
}
}

(3)  kernelarcharmbootdtsqcommsm8909-mdss.dtsi

&soc {
mdss_mdp: qcom,mdss_mdp@fd900000 { //包含mdss_mdp
compatible = "qcom,mdss_mdp";
...
}
mdss_dsi0: qcom,mdss_dsi@fd922800 { //包含mdss_dsi0
compatible = "qcom,mdss-dsi-ctrl";
...
}
}

做上面的修改后分别编译bootloader和kernel

make aboot

make bootimage

 

 

相关帖子:

http://bbs.csdn.net/topics/391868488?page=1

最后

以上就是乐观大象为你收集整理的MSM8909+Android5.1.1之BSP---增加ili9806e(display LCD)的支持(转)的全部内容,希望文章能够帮你解决MSM8909+Android5.1.1之BSP---增加ili9806e(display LCD)的支持(转)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部