我是靠谱客的博主 狂野烧鹅,最近开发中收集的这篇文章主要介绍msm8953 mipi esd 流程分析,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

///dts里面
qcom,mdss-dsi-panel-status-check-mode   = "reg_read";
/代码流程
mdss_check_dsi_ctrl_status()  ------>>>> 
mdss_dsi_reg_status_check  ------>>>>
mdss_dsi_read_status  先读取寄存器状态----->
rc = mdss_dsi_cmdlist_put(ctrl, &cmdreq);
------->ret = ctrl->cmdlist_commit(ctrl, 0);
------->mdss_dsi_cmdlist_commit(ctrl_pdata, 1);
-------->ret = mdss_dsi_cmdlist_rx(ctrl, req);
----->len = mdss_dsi_cmds_rx(ctrl, req->cmds, req->rlen,(req->flags & CMD_REQ_DMA_TPG));
------>>>>后mdss_dsi_gen_read_status 比较寄存器状态

调试代码如下:

diff --git a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_cmd.c b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_cmd.c
index d07b504..b15cf26 100644
--- a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_cmd.c
+++ b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_cmd.c
@@ -774,7 +774,7 @@ int mdss_dsi_cmdlist_put(struct mdss_dsi_ctrl_pdata *ctrl,
         clist->tot--;
     }
 
-    pr_debug("%s: tot=%d put=%d get=%dn", __func__,
+    printk("%s: tot=%d put=%d get=%dn", __func__,
         clist->tot, clist->put, clist->get);
 
     mutex_unlock(&ctrl->cmdlist_mutex);
diff --git a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_host.c b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_host.c
index eda0e02..5877fa8 100644
--- a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_host.c
+++ b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_host.c
@@ -1110,10 +1110,18 @@ static int mdss_dsi_read_status(struct mdss_dsi_ctrl_pdata *ctrl)
         memset(&cmdreq, 0, sizeof(cmdreq));
         cmdreq.cmds = ctrl->status_cmds.cmds + i;
         cmdreq.cmds_cnt = 1;
+        //cmdreq.flags = CMD_REQ_COMMIT | CMD_REQ_RX;
         cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL | CMD_REQ_RX;
         cmdreq.rlen = ctrl->status_cmds_rlen[i];
         cmdreq.cb = NULL;
         cmdreq.rbuf = ctrl->status_buf.data;
+        printk("deanji  cmdreq.cmds %d %d %d %d %d %d %dn",(cmdreq.cmds->dchdr).dtype,(cmdreq.cmds->dchdr).last,(cmdreq.cmds->dchdr).vc,
+        (cmdreq.cmds->dchdr).ack,(cmdreq.cmds->dchdr).wait,(cmdreq.cmds->dchdr).dlen,cmdreq.cmds->payload[0]);
+        printk("deanji cmdreq.rlen:%d cmdreq.rbuf:%d n",cmdreq.rlen,cmdreq.rbuf[0]);
+        if (ctrl->status_cmds.link_state == DSI_LP_MODE){
+            printk("deanji DSI_LP_MODEn");
+        } else if(ctrl->status_cmds.link_state == DSI_HS_MODE)
+            printk("deanji DSI_HS_MODEn");
 
         if (ctrl->status_cmds.link_state == DSI_LP_MODE)
             cmdreq.flags  |= CMD_REQ_LP_MODE;
@@ -1156,6 +1164,7 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
     }
 
     pr_debug("%s: Checking Register statusn", __func__);
+    printk("deanji %s: Checking Register statusn", __func__);
 
     mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
               MDSS_DSI_ALL_CLKS, MDSS_DSI_CLK_ON);
@@ -1163,6 +1172,7 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
     sctrl_pdata = mdss_dsi_get_other_ctrl(ctrl_pdata);
     if (!mdss_dsi_sync_wait_enable(ctrl_pdata)) {
         ret = mdss_dsi_read_status(ctrl_pdata);
+        printk("deanji mdss_dsi_reg_status_check 111n");
     } else {
         /*
          * Read commands to check ESD status are usually sent at
@@ -1172,11 +1182,16 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
          * controller so that when the commands are triggered,
          * both controllers receive it at the same time.
          */
+
+         if(sctrl_pdata) printk("deanji sctrl_pdata is not NULL");
+         else printk("deanji sctrl_pdata is NULL");
         if (mdss_dsi_sync_wait_trigger(ctrl_pdata)) {
+        printk("deanji mdss_dsi_reg_status_check 222n");
             if (sctrl_pdata)
                 ret = mdss_dsi_read_status(sctrl_pdata);
             ret = mdss_dsi_read_status(ctrl_pdata);
         } else {
+        printk("deanji mdss_dsi_reg_status_check 333n");
             ret = mdss_dsi_read_status(ctrl_pdata);
             if (sctrl_pdata)
                 ret = mdss_dsi_read_status(sctrl_pdata);
@@ -1188,6 +1203,16 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
      * by the panel. Success value is greater than zero and failure
      * case returns zero.
      */
+    printk("deanji %s %dn",__func__,ret);
+/*    if(ret == 0){
+        printk("deanji  chongfa n");
+        if (!mdss_dsi_sync_wait_enable(ctrl_pdata)) {
+            ret = mdss_dsi_read_status(ctrl_pdata);
+            printk("deanji 4444 %s %dn",__func__,ret);
+        }
+    }
+*/
+
     if (ret > 0) {
         if (!mdss_dsi_sync_wait_enable(ctrl_pdata) ||
             mdss_dsi_sync_wait_trigger(ctrl_pdata))
@@ -1788,7 +1813,8 @@ int mdss_dsi_cmds_rx(struct mdss_dsi_ctrl_pdata *ctrl,
     struct dsi_buf *tp, *rp;
     char cmd;
     struct mdss_dsi_ctrl_pdata *mctrl = NULL;
-
+    int ii = 0;
+    printk("deanji mdss_dsi_cmds_rx use_dma_tpg is %x n",use_dma_tpg);
 
     if (ctrl->panel_data.panel_info.panel_ack_disabled) {
         pr_err("%s: ACK from Client not supportedn", __func__);
@@ -1823,6 +1849,8 @@ int mdss_dsi_cmds_rx(struct mdss_dsi_ctrl_pdata *ctrl,
         }
     }
 
+    printk("deanji %s rlen:%d n",__func__,rlen);
+
 do_send:
     ctrl->cmd_cfg_restore = __mdss_dsi_cmd_mode_config(ctrl, 1);
 
@@ -1847,7 +1875,7 @@ do_send:
     end = 0;
     mdss_dsi_buf_init(rp);
     while (!end) {
-        pr_debug("%s:  rlen=%d pkt_size=%d rx_byte=%dn",
+        printk("%s:  rlen=%d pkt_size=%d rx_byte=%dn",
                 __func__, rlen, pkt_size, rx_byte);
         /*
          * Skip max_pkt_size dcs cmd if
@@ -1884,7 +1912,7 @@ do_send:
             goto end;
         }
         ctrl->cur_max_pkt_size = pkt_size;
-        pr_debug("%s: max_pkt_size=%d sentn",
+        printk("%s: max_pkt_size=%d sentn",
                     __func__, pkt_size);
 
 skip_max_pkt_size:
@@ -1930,6 +1958,7 @@ skip_max_pkt_size:
          * after that dcs header lost during shift into registers
          */
         dlen = mdss_dsi_cmd_dma_rx(ctrl, rp, rx_byte);
+        printk("deanji mdss_dsi_cmd_dma_rx dlen=%d n",dlen);
 
         if (!dlen)
             goto end;
@@ -1956,7 +1985,7 @@ skip_max_pkt_size:
             else
                 pkt_size += data_byte;
         }
-        pr_debug("%s: rp data=%x len=%d dlen=%d diff=%dn",
+        printk("%s: rp data=%x len=%d dlen=%d diff=%dn",
              __func__, (int) (unsigned long) rp->data,
              rp->len, dlen, diff);
     }
@@ -1967,14 +1996,18 @@ skip_max_pkt_size:
      * data buffer to skip the bytes which are not
      * updated.
      */
+
     if (rp->read_cnt < 16 && !short_response)
         rp->data = rp->start + (16 - rp->read_cnt);
     else
         rp->data = rp->start;
+
+     printk("deanji %s rp->read_cnt is %d n",__func__,rp->read_cnt);
+     for(ii=0;ii<rp->read_cnt;ii++) printk("rp->data[%d]:%d n",ii,rp->data[ii]);
     cmd = rp->data[0];
     switch (cmd) {
     case DTYPE_ACK_ERR_RESP:
-        pr_debug("%s: rx ACK_ERR_PACLAGEn", __func__);
+        printk("%s: rx ACK_ERR_PACLAGEn", __func__);
         rp->len = 0;
         rp->read_cnt = 0;
     case DTYPE_GEN_READ1_RESP:
@@ -1991,6 +2024,7 @@ skip_max_pkt_size:
         break;
     default:
         pr_warning("%s:Invalid response cmdn", __func__);
+        printk("deanji Invalid response cmd:%dn",cmd);
         rp->len = 0;
         rp->read_cnt = 0;
     }
@@ -2505,6 +2539,8 @@ int mdss_dsi_cmdlist_rx(struct mdss_dsi_ctrl_pdata *ctrl,
     struct dsi_buf *rp;
     int len = 0;
 
+    printk("deanji %s entered n",__func__);
+
     if (req->rbuf) {
         rp = &ctrl->rx_buf;
         len = mdss_dsi_cmds_rx(ctrl, req->cmds, req->rlen,
@@ -2575,6 +2611,8 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
     bool hs_req = false;
     bool cmd_mutex_acquired = false;
 
+    printk("deanji %s entered n",__func__);
+
     if (from_mdp) {    /* from mdp kickoff */
         if (!ctrl->burst_mode_enabled) {
             mutex_lock(&ctrl->cmd_mutex);
@@ -2621,7 +2659,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
     if (req && (ctrl->shared_data->hw_rev < MDSS_DSI_HW_REV_103))
         req->flags &= ~CMD_REQ_DMA_TPG;
 
-    pr_debug("%s: ctrl=%d from_mdp=%d pid=%dn", __func__,
+    printk("%s: ctrl=%d from_mdp=%d pid=%dn", __func__,
                 ctrl->ndx, from_mdp, current->pid);
 
     if (from_mdp) { /* from mdp kickoff */
@@ -2647,7 +2685,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
 
     MDSS_XLOG(ctrl->ndx, req->flags, req->cmds_cnt, from_mdp, current->pid);
 
-    pr_debug("%s:  from_mdp=%d pid=%dn", __func__, from_mdp, current->pid);
+    printk("%s:  from_mdp=%d pid=%dn", __func__, from_mdp, current->pid);
 
     if (!(req->flags & CMD_REQ_DMA_TPG)) {
         /*
@@ -2693,6 +2731,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
         mdss_dsi_set_tx_power_mode(0, &ctrl->panel_data);
 
     if (req->flags & CMD_REQ_RX)
+//        ret = msm_dsi_cmdlist_rx(ctrl, req);
         ret = mdss_dsi_cmdlist_rx(ctrl, req);
     else
         ret = mdss_dsi_cmdlist_tx(ctrl, req);
diff --git a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_panel.c b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_panel.c
index c238c81..7f75280 100644
--- a/msm-3.18/drivers/video/msm/mdss/mdss_dsi_panel.c
+++ b/msm-3.18/drivers/video/msm/mdss/mdss_dsi_panel.c
@@ -943,7 +943,7 @@ static int mdss_dsi_parse_dcs_cmds(struct device_node *np,
             pcmds->link_state = DSI_LP_MODE;
     }
 
-    pr_debug("%s: dcs_cmd=%x len=%d, cmd_cnt=%d link_state=%dn", __func__,
+    printk("%s: dcs_cmd=%x len=%d, cmd_cnt=%d link_state=%dn", __func__,
         pcmds->buf[0], pcmds->blen, pcmds->cmd_cnt, pcmds->link_state);
 
     return 0;
@@ -1506,6 +1506,15 @@ static bool mdss_dsi_cmp_panel_reg_v2(struct mdss_dsi_ctrl_pdata *ctrl)
     for (i = 0; i < ctrl->status_cmds.cmd_cnt; i++)
         len += lenp[i];
 
+    printk("deanji mdss_dsi_cmp_panel_reg_v2 len:%d n",len);
+
+    for (j = 0; j < ctrl->groups; ++j) {
+        for (i = 0; i < len; ++i) {
+                printk("deanji ctrl->return_buf[]:%d  ctrl->status_value[group + i]%dn",
+                ctrl->return_buf[i],ctrl->status_value[group + i]);
+        }
+    }
+
     for (j = 0; j < ctrl->groups; ++j) {
         for (i = 0; i < len; ++i) {
             if (ctrl->return_buf[i] !=
@@ -1523,10 +1532,12 @@ static bool mdss_dsi_cmp_panel_reg_v2(struct mdss_dsi_ctrl_pdata *ctrl)
 
 static int mdss_dsi_gen_read_status(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
 {
+    printk("deanji %s enter n",__func__);
     if (!mdss_dsi_cmp_panel_reg_v2(ctrl_pdata)) {
         pr_err("%s: Read back value from panel is incorrectn",
                             __func__);
         return -EINVAL;
+        //return 1;
     } else {
         return 1;
     }
@@ -1725,6 +1736,9 @@ static void mdss_dsi_parse_esd_params(struct device_node *np,
     pinfo->esd_check_enabled = of_property_read_bool(np,
         "qcom,esd-check-enabled");
 
+    if (!pinfo->esd_check_enabled) printk("deanji esd is no n");
+    else printk("esd is ok n");
+
     if (!pinfo->esd_check_enabled)
         return;
 

 

最后

以上就是狂野烧鹅为你收集整理的msm8953 mipi esd 流程分析的全部内容,希望文章能够帮你解决msm8953 mipi esd 流程分析所遇到的程序开发问题。

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

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

评论列表共有 0 条评论

立即
投稿
返回
顶部