This is an automated email from Gerrit.

Harishkumar V (harishpres...@gmail.com) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/2605

-- gerrit

commit eccfb9d5a8dce58745bf21482dd12e8f1abd48b7
Author: HarishKumar <harishpres...@gmail.com>
Date:   Sun Mar 15 19:33:15 2015 +0530

    Cortex-A: Revert back polling of CDBGPWRUPACK and CSYSPWRUPACK
    in ahbap_debugport_init() from the Openocd-0.8.0.
    
    Currently implemented timeout based polling fails to connect and less
    successfull compared to Openocd-0.8.0. Timeout happens.
    
    Openocd-0.8.0 able to connect all use case of target.
    bare-metal, u-boot and kernel.
    
    To the same hardware, Openocd-0.8.0 able to connect,
    whereas, the latest version does not able to connect.
    
    Change-Id: I41af43f7fa8751033fd7d059922f728c22e9d02e
    Signed-off-by: HarishKumar <harishpres...@gmail.com>

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 4f19e95..047e78f 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -642,6 +642,8 @@ extern const struct dap_ops jtag_dp_ops;
  */
 int ahbap_debugport_init(struct adiv5_dap *dap)
 {
+       uint32_t ctrlstat;
+       int cnt = 0;
        int retval;
 
        LOG_DEBUG(" ");
@@ -684,21 +686,36 @@ int ahbap_debugport_init(struct adiv5_dap *dap)
        if (retval != ERROR_OK)
                return retval;
 
-       /* Check that we have debug power domains activated */
-       LOG_DEBUG("DAP: wait CDBGPWRUPACK");
-       retval = dap_dp_poll_register(dap, DP_CTRL_STAT,
-                                     CDBGPWRUPACK, CDBGPWRUPACK,
-                                     DAP_POWER_DOMAIN_TIMEOUT);
+       retval = dap_queue_dp_read(dap, DP_CTRL_STAT, &ctrlstat);
        if (retval != ERROR_OK)
                return retval;
-
-       LOG_DEBUG("DAP: wait CSYSPWRUPACK");
-       retval = dap_dp_poll_register(dap, DP_CTRL_STAT,
-                                     CSYSPWRUPACK, CSYSPWRUPACK,
-                                     DAP_POWER_DOMAIN_TIMEOUT);
+       retval = dap_run(dap);
        if (retval != ERROR_OK)
                return retval;
 
+       /* Check that we have debug power domains activated */
+       while (!(ctrlstat & CDBGPWRUPACK) && (cnt++ < 10)) {
+               LOG_DEBUG("DAP: wait CDBGPWRUPACK");
+               retval = dap_queue_dp_read(dap, DP_CTRL_STAT, &ctrlstat);
+               if (retval != ERROR_OK)
+                       return retval;
+               retval = dap_run(dap);
+               if (retval != ERROR_OK)
+                       return retval;
+               alive_sleep(10);
+       }
+
+       while (!(ctrlstat & CSYSPWRUPACK) && (cnt++ < 10)) {
+               LOG_DEBUG("DAP: wait CSYSPWRUPACK");
+               retval = dap_queue_dp_read(dap, DP_CTRL_STAT, &ctrlstat);
+               if (retval != ERROR_OK)
+                       return retval;
+               retval = dap_run(dap);
+               if (retval != ERROR_OK)
+                       return retval;
+               alive_sleep(10);
+       }
+
        retval = dap_queue_dp_read(dap, DP_CTRL_STAT, NULL);
        if (retval != ERROR_OK)
                return retval;

-- 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to