This is an automated email from Gerrit. Eric Katzfey ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/3703
-- gerrit commit b4e740adde9f81365959358ceada8969e9b1dfb8 Author: Eric Katzfey <[email protected]> Date: Wed Aug 17 12:17:24 2016 -0700 arm_adi_v5: Add ability to ignore the CSYSPWRUPACK bit The CTRL/STAT register in the ARM DAP DP has a debug power up ack bit and a system power up ack bit. Some Qualcomm devices only set the debug power up ack bit before the initial examine happens. The system power up bit is set later so this adds a way to ignore it during initial examination. Signed-off-by: Eric Katzfey <[email protected]> Change-Id: I3f060bb74d06703ace85ba5ba07de7acef91f60a style: fixed coding convention violation. Change-Id: I3f060bb74d06703ace85ba5ba07de7acef91f60a Signed-off-by: Eric Katzfey <[email protected]> diff --git a/doc/openocd.texi b/doc/openocd.texi index 8146654..a6d840b 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3726,6 +3726,12 @@ a TAP doesn't conform to the JTAG specification. to verify that instruction scans work correctly. Such scans are not used by OpenOCD except to verify that there seems to be no problems with JTAG scan chain operations. +@item @code{-ignore-syspwrupack} +@*Specify this to ignore the CSYSPWRUPACK bit in the ARM DAP DP CTRL/STAT +register during initial examination. This bit is normally checked after +setting the CSYSPWRUPREQ bit, but some Qualcomm devices do not set the ack +bit until later in the boot process and so the check will fail during initial +examination. @end itemize @end deffn diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 7702d6c..0499306 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -155,6 +155,10 @@ struct jtag_tap { struct jtag_tap *next_tap; /* dap instance if some null if no instance , initialized to 0 by calloc*/ struct adiv5_dap *dap; + /** Flag saying whether to ignore the syspwrupack flag in DAP. Some devices + * do not set this bit until later in the bringup sequence */ + bool ignore_syspwrupack; + /* private pointer to support none-jtag specific functions */ void *priv; }; diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index bc6bbf2..58aec2f 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -452,6 +452,7 @@ static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi, #define NTAP_OPT_DISABLED 4 #define NTAP_OPT_EXPECTED_ID 5 #define NTAP_OPT_VERSION 6 +#define NTAP_OPT_SYSPWRUPACK 7 static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi, struct jtag_tap *pTap) @@ -514,6 +515,7 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi) { .name = "-disable", .value = NTAP_OPT_DISABLED }, { .name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID }, { .name = "-ignore-version", .value = NTAP_OPT_VERSION }, + { .name = "-ignore-syspwrupack", .value = NTAP_OPT_SYSPWRUPACK }, { .name = NULL, .value = -1 }, }; @@ -599,6 +601,9 @@ static int jim_newtap_cmd(Jim_GetOptInfo *goi) case NTAP_OPT_VERSION: pTap->ignore_version = true; break; + case NTAP_OPT_SYSPWRUPACK: + pTap->ignore_syspwrupack = true; + break; } /* switch (n->value) */ } /* while (goi->argc) */ @@ -864,6 +869,7 @@ static const struct command_registration jtag_subcommand_handlers[] = { "['-enable'|'-disable'] " "['-expected_id' number] " "['-ignore-version'] " + "['-ignore-syspwrupack'] " "['-ircapture' number] " "['-mask' number] ", }, diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index f58afdc..b803c22 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -640,12 +640,14 @@ int dap_dp_init(struct adiv5_dap *dap) if (retval != ERROR_OK) continue; - LOG_DEBUG("DAP: wait CSYSPWRUPACK"); - retval = dap_dp_poll_register(dap, DP_CTRL_STAT, - CSYSPWRUPACK, CSYSPWRUPACK, - DAP_POWER_DOMAIN_TIMEOUT); - if (retval != ERROR_OK) - continue; + if (!dap->tap->ignore_syspwrupack) { + LOG_DEBUG("DAP: wait CSYSPWRUPACK"); + retval = dap_dp_poll_register(dap, DP_CTRL_STAT, + CSYSPWRUPACK, CSYSPWRUPACK, + DAP_POWER_DOMAIN_TIMEOUT); + if (retval != ERROR_OK) + continue; + } retval = dap_queue_dp_read(dap, DP_CTRL_STAT, NULL); if (retval != ERROR_OK) -- ------------------------------------------------------------------------------ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
