高通lcd移植文件(部分)
環境:IC 8937
高通關於lcd提供的完整的工具包
kernel部分
1.excel :80-NH713-1_R_DSI_Timing_Parameters_User_Interactive_Spreadsheet
2.xml : device/qcom/common/display/tools/panel_xxx_xxx_xx_.xml
主要修改畫紅圈部分。h_porch以及v_porch,以及螢幕解析度。
ctrl+j ;ctrl+k;重新計算t_clk_zero。
這裡面需要DSI PHY registers填充 PanelTimings;另外還要填充TClkPost以及TCIkPre。
<!-- Panel Timing -->
<PanelTimings>"0xDA, 0x34, 0x24, 0x00, 0x64, 0x68,
0x28, 0x38, 0x2A, 0x03, 0x04, 0x00"</PanelTimings>
<TClkPost>0x03</TClkPost>
<TClkPre>0x41</TClkPre>
需要注意的是CTRL_3一定是0.並且CTRL_11是第二塊螢幕的引數.如果沒有第二塊螢幕,置零。
將excel裡面的引數正確填寫並通過ctrl+j;ctrl+k生成完整資料;將資料按需填入xml;
<!-- Panel configuration --> <PanelType>0</PanelType> // 0 stands for video mode panel, 1 stands for command mode panel <PanelFrameRate>60</PanelFrameRate> <!-- Panel Resolution --> <PanelWidth>720</PanelWidth> <PanelHeight>1280</PanelHeight> <HFrontPorch>140</HFrontPorch> <HBackPorch>164</HBackPorch> <HPulseWidth>8</HPulseWidth> <HSyncSkew>0</HSyncSkew> <VBackPorch>4</VBackPorch> <VFrontPorch>8</VFrontPorch> <VPulseWidth>4</VPulseWidth> <!-- Panel Color Information --> <ColorFormat>24</ColorFormat> // 24bpp <!-- Panel Command information --> <OnCommand>"0x29, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0xEE, 0x29, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFB, 0x01, ... ... ... 0x29, 0x01, 0x00, 0x00, 0x78, 0x00, 0x02, 0x29, 0x00" </OnCommand> // add your panel on commands from LCD vendor <OffCommand>"0x05, 0x01, 0x00, 0x00, 0x32, 0x00, 0x02, 0x28, 0x00, ... ... ... 0x05, 0x01, 0x00, 0x00, 0x78, 0x00, 0x02, 0x10, 0x00" </OffCommand> // add your panel off commands from LCD vendor <OnCommandState>0</OnCommandState> // 0 stands for lp mode <OffCommandState>1</OffCommandState> // 1 stands for hs mode <!-- Video mode panel information --> <HSyncPulse>1</HSyncPulse> <BLLPEOFPowerMode>1</BLLPEOFPowerMode> <BLLPPowerMode>1</BLLPPowerMode> <TrafficMode>2</TrafficMode> <!-- Panel Reset Sequence --> <ResetSequence> <PinState1>1</PinState1> <PulseWidth1>20</PulseWidth1> <PinState2>0</PinState2> <PulseWidth2>2</PulseWidth2> <PinState3>1</PinState3> <PulseWidth3>20</PulseWidth3> </ResetSequence>
通過命令:perl parser.pl <sourec xml file OEM edit> panel ---->生成dsi-panel<vendor>-xxx-xxx.dtsi 和 panel_<vendor>_xxx_xxx.h
修改xxx-xxx.dtsi裡面 &mdss_dsi0裡面的qcom,dsi_pref_prim_pan 引數為&dsi_xx_xx_xx。
修改xxx-mdss-panels.dtsi。往裡面include perl生成的xxx.dtsi檔案。
##########################################################################
lk部分
將perl工具生成的dsi-panel-xxx-xxx-xxx.h複製到bootable/bootloader/lk/dev/gcdb/display/include資料夾下面
在bootable/bootloader/lk/target/msm8xxx/oem_panel.c裡面加入
#include “include/dsi-panel-xxx-xxx-xxx.h”
enum {
TOSHIBA_720P_VIDEO_PANEL,
NT35590_720P_CMD_PANEL,
NT35590_720P_VIDEO_PANEL,
HX8394A_720P_VIDEO_PANEL,
+NT35521_720P_VIDEO_PANEL,
UNKNOWN_PANEL
};
static struct panel_list supp_panels[] = {
{"toshiba_720p_video", TOSHIBA_720P_VIDEO_PANEL},
{"nt35590_720p_cmd", NT35590_720P_CMD_PANEL},
{"nt35590_720p_video", NT35590_720P_VIDEO_PANEL},
{"hx8394a_720p_video", HX8394A_720P_VIDEO_PANEL},
+{"nt35521_720p_video", NT35521_720P_VIDEO_PANEL},
};
static void init_panel_data(struct panel_struct *panelstruct,
struct msm_panel_info *pinfo,
struct mdss_dsi_phy_ctrl *phy_db)
{
switch (panel_id) {
+case NT35521_720P_VIDEO_PANEL:
+ panelstruct->paneldata = &nt35521_720p_video_panel_data;
+ panelstruct->panelres = &nt35521_720p_video_panel_res;
+ panelstruct->color = &nt35521_720p_video_color;
+ panelstruct->videopanel = &nt35521_720p_video_video_panel;
+ panelstruct->commandpanel = &nt35521_720p_video_command_panel;
+ panelstruct->state = &nt35521_720p_video_state;
+ panelstruct->laneconfig = &nt35521_720p_video_lane_config;
+ panelstruct->paneltiminginfo = &nt35521_720p_video_timing_info;
+ panelstruct->panelresetseq = &nt35521_720p_video_panel_reset_seq;
+ panelstruct->backlightinfo = &nt35521_720p_video_backlight;
+ pinfo->mipi.panel_cmds = nt35521_720p_video_on_command;
+ pinfo->mipi.num_of_panel_cmds
+ memcpy(phy_db->timing, = NT35521_720P_VIDEO_ON_COMMAND;
nt35521_720p_video_timings, TIMING_SIZE);
switch (hw_id) {//這裡應該是具體的probe邏輯。確認lcd的選擇。程式碼可能不完全一樣。但是要自己改好邏輯
case HW_PLATFORM_MTP:
case HW_PLATFORM_QRD:
if (hw_subtype == HW_PLATFORM_SUBTYPE_720P)
+
panel_id = NT35521_720P_VIDEO_PANEL;
else
panel_id = nt35590_panel_id;
break;
default:
dprintf(CRITICAL, "Display not enabled for %d HW type\n"
, hw_id);
return false;