高通平台点亮屏幕调试

Qualcomm - Android9.0

一、.XML Configure
1.一些主要的配置

<Version>"1.0"</Version>
  <PanelId>st7703-720p-video</PanelId>
  <PanelH>st7703_720p_video</PanelH>

0x29, 0x01, 0x00, 0x00, 0x00 = REGISTER
PayloadSize = Number+1
Payload = CMD,DATA,DATA,…

							  size   CMD    DATA
<OnCommand>					   |	  |      |    
0x29, 0x01, 0x00, 0x00, 0x00, 0x02,  0xFF,  0xEE,</OnCommand>

根据Excel2016工具计算

<!-- Panel Timing -->
   <PanelTimings>"0x76, 0x18, 0x10, 0x00, 0x3A, 0x3E, 0x14, 0x1C, 0x12, 0x03, 0x04, 0x00"</PanelTimings>

2.生成设备树文件和头文件

#perl parser.pl .xml panel

3.把文件移到相应的位置
kernel/msm-4.9/arch/arm64/boot/dts/qcom/XXXX.dtsi
bootable/bootloader/lk/dev/gcdb/display/include/XXXX.h

二、Configure Kernel
1.Include .dtsi files.
kernel/msm-4.9/arch/arm64/boot/dts/qcom/msm8953-mdss-panels.dtsi

+#include "dsi-panel-st7703-720p-video.dtsi"
......
+&dsi_st7703_720p_video {
+   qcom,mdss-dsi-panel-timings-phy-v2 = [
+       1e 1a 04 05 02 03 04 a0     /*Data 0*/
+        1e 1a 04 05 02 03 04 a0     /*Data 1*/
+        1e 1a 04 05 02 03 04 a0     /*Data 2*/
+        1e 1a 04 05 02 03 04 a0     /*Data 3*/
+        1e 0d 03 05 02 03 04 a0];   /*CLK lane*/
+};

kernel/msm-4.9/arch/arm64/boot/dts/qcom/msm8953-pmi632-panel-camera.dtsi

&mdss_dsi0 {
        qcom,dsi-pref-prim-pan = <&dsi_st7703_720p_video>;
        pinctrl-names = "mdss_default", "mdss_sleep";
        pinctrl-0 = <&mdss_dsi_active &mdss_te_active>;
        pinctrl-1 = <&mdss_dsi_suspend &mdss_te_suspend>;

        qcom,platform-te-gpio = <&tlmm 24 0>;
                qcom,platform-reset-gpio = <&tlmm 61 0>;
        qcom,platform-bklight-en-gpio = <&pm8953_gpios 4 0>;
        //qcom,platform-enable-gpio = <&pmi632_gpios 6 0>;
};

2.Configure the Backlight
kernel/msm-4.9/arch/arm64/boot/dts/qcom/msm8953-pmi632-panel-camera.dtsi

&dsi_st7703_720p_video {
        qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
        qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_pwm";
        qcom,mdss-dsi-bl-pmic-pwm-frequency = <100>;
        qcom,mdss-dsi-bl-pmic-bank-select = <0>;
        qcom,mdss-dsi-bl-pwm-pmi;
        pwms = <&pmi632_pwm 3 1000000>;
        qcom,mdss-dsi-pwm-gpio = <&pmi632_gpios 6 0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pwm_out_default>;
        //qcom,mdss-dsi-pwm-gpio = <&pm8953_mpps 4 0>;
};

If PWM backlight control is used on DSI0, please disable the DSI1 bridge.

&soc {
 //rid:add dsi1 bridge for dual mipi dsi
     qcom,dsi1_bridge {
-        compatible = "qcom,dsi1_bridge";
+        //compatible = "qcom,dsi1_bridge";
         instance_id = <0>;
         mdss-dsi-bl-pmic-pwm-frequency = <100>;
         mdss-dsi-bl-pmic-bank-select = <0>;

三、Configure LK
1Add several parameters to panel_hx8394f_720p_video.h to avoid compiling error

/*---------------------------------------------------------------------------*/
/* Panel configuration                                                       */
/*---------------------------------------------------------------------------*/
static struct panel_config st7703_720p_video_panel_data = {
	"qcom,mdss_dsi_st7703_720p_video", "dsi:0:", "qcom,mdss-dsi-panel",
    10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
};
/*---------------------------------------------------------------------------*/
/* Lane configuration                                                        */
/*---------------------------------------------------------------------------*/
static struct lane_configuration st7703_720p_video_lane_config = {
        4, 0, 1, 1, 1, 1, 0
};

2.Add the DSI PHY 2.0.0 timing config mentioned in
panel_hx8394f_720p_video.h.

static const uint32_t st7703_720p_video_timings[] = {
        0x76, 0x18, 0x10, 0x00, 0x3A, 0x3E, 0x14, 0x1C, 0x12, 0x03, 0x04, 0x00
};

/*-->add by rid, only for msm8953<--*/
static const uint32_t st7703_720p_14nm_video_timings[] = {
    0x1e, 0x1a, 0x4, 0x5, 0x2, 0x3, 0x4, 0xa0,
    0x1e, 0x1a, 0x4, 0x5, 0x2, 0x3, 0x4, 0xa0,
    0x1e, 0x1a, 0x4, 0x5, 0x2, 0x3, 0x4, 0xa0,
    0x1e, 0x1a, 0x4, 0x5, 0x2, 0x3, 0x4, 0xa0,
    0x1e, 0x0d, 0x3, 0x5, 0x2, 0x3, 0x4, 0xa0,
};

static struct panel_timing st7703_720p_video_timing_info = {
        0, 4, 0x04, 0x19
};

3 Add a new panel.
bootable/bootloader/lk/target/msm8953/oem_panel.c

+#include "include/panel_st7703_720p_video.h"

 /*---------------------------------------------------------------------------*/
 /* static panel selection variable                                           */
@@ -62,6 +63,7 @@
 static uint32_t auto_pan_loop = 0;

 enum {
+       ST7703_720P_VIDEO_PANEL,
        ILI9881D_720P_VIDEO_PANEL,
        HX8394F_720P_VIDEO_PANEL,
        ILI9881C_720P_VIDEO_PANEL,
@@ -80,6 +82,7 @@ enum {
  * Any panel in this list can be selected using fastboot oem command.
  */
 static struct panel_list supp_panels[] = {
+       {"st7703_720p_video", ST7703_720P_VIDEO_PANEL},
        {"ili9881d_720p_video", ILI9881D_720P_VIDEO_PANEL},
        {"hx8394f_720p_video", HX8394F_720P_VIDEO_PANEL},
        {"ili9881c_720p_video", ILI9881C_720P_VIDEO_PANEL},
@@ -127,6 +130,36 @@ static int init_panel_data(struct panel_struct *panelstruct,
        int pan_type = PANEL_TYPE_DSI;

        switch (panel_id) {
+       case ST7703_720P_VIDEO_PANEL:
+                panelstruct->paneldata    = &st7703_720p_video_panel_data;
+                panelstruct->paneldata->panel_with_enable_gpio = 0;
+                panelstruct->panelres     = &st7703_720p_video_panel_res;
+                panelstruct->color        = &st7703_720p_video_color;
+                panelstruct->videopanel   = &st7703_720p_video_video_panel;
+                panelstruct->commandpanel = &st7703_720p_video_command_panel;
+                panelstruct->state        = &st7703_720p_video_state;
+                panelstruct->laneconfig   = &st7703_720p_video_lane_config;
+                panelstruct->paneltiminginfo
+                        = &st7703_720p_video_timing_info;
+                panelstruct->panelresetseq
+                                         = &st7703_720p_video_reset_seq;
+                panelstruct->backlightinfo = &st7703_720p_video_backlight;
+                pinfo->mipi.panel_on_cmds
+                        = st7703_720p_video_on_command;
+                /*pinfo->mipi.panel_read_cmds
+                                = &st7703_720p_read_id_command;*/
+                pinfo->mipi.num_of_panel_on_cmds
+                        = ST7703_720P_VIDEO_ON_COMMAND;
+                pinfo->mipi.panel_off_cmds
+                        = st7703_720p_video_off_command;
+                pinfo->mipi.num_of_panel_off_cmds
+                        = ST7703_720P_VIDEO_OFF_COMMAND;
+                memcpy(phy_db->timing,
+                        st7703_720p_14nm_video_timings,
+                        MAX_TIMING_CONFIG * sizeof(uint32_t));
+                pinfo->mipi.signature = 0x7713;
+               break;
+
        case ILI9881D_720P_VIDEO_PANEL:
                panelstruct->paneldata    = &ili9881d_720p_video_panel_data;
                panelstruct->paneldata->panel_with_enable_gpio = 0;
@@ -484,6 +517,12 @@ int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
                        break;
                }
                if(auto_pan_loop == 2)
+               {
+                       panel_id = ST7703_720P_VIDEO_PANEL;
+                       auto_pan_loop++;
+                       break;
+               }
+               if(auto_pan_loop == 3)
                {
                        panel_id = ILI9881D_720P_VIDEO_PANEL;
                        break;

四、Configure Second Display
1.更改panel_st7703_720p_video.h

/*---------------------------------------------------------------------------*/
/* Panel configuration                                                       */
/*---------------------------------------------------------------------------*/
static struct panel_config st7703_720p_video_panel_data = {
        "qcom,mdss_dsi_st7703_720p_video", "dsi:0:", "qcom,mdss-dsi-panel",
        10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "qcom,mdss_dsi_st7703_720p_dsi1_video"
};

2.copy dsi-panel-st7703-720p-video.dtsi to dsi-panel-st7703-720p-dsi1-video.dtsi.

&mdss_mdp {
        dsi_st7703_720p_dsi1_video: qcom,mdss_dsi_st7703_720p_dsi1_video {
                qcom,mdss-dsi-panel-name = "st7703 720p dsi1 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>;

3.msm8953-mdss-panels.dtsi

+#include "dsi-panel-st7703-720p-dsi1-video.dtsi"
......
+&dsi_st7703_720p_dsi1_video {
+   qcom,mdss-dsi-panel-timings-phy-v2 = [
+        1e 1a 04 05 02 03 04 a0     /*Data 0*/
+        1e 1a 04 05 02 03 04 a0     /*Data 1*/
+        1e 1a 04 05 02 03 04 a0     /*Data 2*/
+        1e 1a 04 05 02 03 04 a0     /*Data 3*/
+        1e 0d 03 05 02 03 04 a0];   /*CLK lane*/
+};

4.msm8953-pmi632-panel-camera.dtsi

&mdss_dsi {
-       hw-config = "dual_dsi"; //"single_dsi";
+       hw-config = "dual_dsi";
+       //"single_dsi";
 };

 &mdss_dsi1 {
        status = "ok";
-       qcom,dsi-pref-prim-pan = <&dsi_ili9881d_720p_dsi1_video>;
+       qcom,dsi-pref-prim-pan = <&dsi_st7703_720p_dsi1_video>;
        pinctrl-names = "mdss_default", "mdss_sleep";
        pinctrl-0 = <&mdss_dsi1_active &mdss_te1_active>;
        pinctrl-1 = <&mdss_dsi1_suspend &mdss_te1_suspend>;

        qcom,bridge-index = <0>;
        qcom,pluggable;
-       qcom,platform-te-gpio = <&tlmm 25 0>;
-       qcom,platform-reset-gpio = <&tlmm 87 0>;
+       qcom,platform-te-gpio = <&tlmm 24 0>;
+       qcom,platform-reset-gpio = <&tlmm 61 0>;
 //     qcom,platform-bklight-en-gpio = <&tlmm 59 0>;
 };

+&dsi_st7703_720p_dsi1_video {
+        qcom,panel-supply-entries = <&dsi_panel_pwr_supply>;
+        qcom,dba-panel;
+        qcom,bridge-name = "dsi1-bridge";
+};

5 kernel/msm-4.9/include/uapi/video/msm_hdmi_modes.h

#define DEFAULT_VFRMT_TIMING                           \
        {DEFAULT_VFRMT, 720/*active_h*/, 40/*front_porch_h*/, 5/*pulse_width_h*/, 60/*back_porch_h*/, false,    \
         1280/*active_v*/, 15/*front_porch_v*/, 3/*pulse_width_v*/, 11/*back_porch_v*/, false, \
         71128/*pixel_freq/1000*/, 60000/*refresh_rate/1000*/, false, true, HDMI_RES_AR_16_9, 0}

你可能感兴趣的:(高通平台点亮屏幕调试)