This is an automated email from Gerrit.

Tomas Vanek ([email protected]) just uploaded a new patch set to Gerrit, which you 
can find at http://openocd.zylin.com/5210

-- gerrit

commit 661556415fe15b69377468434c03248afa324931
Author: Tomas Vanek <[email protected]>
Date:   Wed Jun 5 19:14:41 2019 +0200

    jtag/adapter: consolidate reset_config
    
    Change 'combined' option to 'trst_srst_tied'
    
    Do not output information not relevant to the current config.
    
    If reset_config none, any signal combination (separate...) is not relevant.
    
    If configured single line only (reset_config srst_only or trst_only),
    do not output single direction pulls (trst_pulls_srst and srst_pulls_trst)
    and use 'trst_srst_tied' instead.
    
    Change-Id: I59393ce5c954dc97962c1cf08de3e6bd932830e9
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c
index e11f4e9..ed63e73 100644
--- a/src/jtag/adapter.c
+++ b/src/jtag/adapter.c
@@ -244,9 +244,13 @@ COMMAND_HANDLER(handle_reset_config_command)
                        tmp |= RESET_SRST_PULLS_TRST;
                else if (strcmp(*CMD_ARGV, "trst_pulls_srst") == 0)
                        tmp |= RESET_TRST_PULLS_SRST;
-               else if (strcmp(*CMD_ARGV, "combined") == 0)
+               else if (strcmp(*CMD_ARGV, "trst_srst_tied") == 0)
                        tmp |= RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
-               else
+               else if (strcmp(*CMD_ARGV, "combined") == 0) {
+                       tmp |= RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST;
+                       LOG_WARNING("reset_config 'combined' option is 
deprecated. "
+                                               "Use 'trst_srst_tied' instead");
+               } else
                        m = 0;
                if (mask & m) {
                        LOG_ERROR("extra reset_config %s spec (%s)",
@@ -335,31 +339,33 @@ next:
        switch (new_cfg & (RESET_HAS_TRST | RESET_HAS_SRST)) {
                case RESET_HAS_SRST:
                        modes[0] = "srst_only";
+                       modes[1] = (new_cfg & RESET_SRST_PULLS_TRST) ? " 
trst_srst_tied" : " separate";
                        break;
                case RESET_HAS_TRST:
                        modes[0] = "trst_only";
+                       modes[1] = (new_cfg & RESET_TRST_PULLS_SRST) ? " 
trst_srst_tied" : " separate";
                        break;
                case RESET_TRST_AND_SRST:
                        modes[0] = "trst_and_srst";
-                       break;
-               default:
-                       modes[0] = "none";
-                       break;
-       }
 
-       /* normally SRST and TRST are decoupled; but bugs happen ... */
-       switch (new_cfg & (RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST)) {
-               case RESET_SRST_PULLS_TRST:
-                       modes[1] = "srst_pulls_trst";
-                       break;
-               case RESET_TRST_PULLS_SRST:
-                       modes[1] = "trst_pulls_srst";
-                       break;
-               case RESET_SRST_PULLS_TRST | RESET_TRST_PULLS_SRST:
-                       modes[1] = "combined";
+                       switch (new_cfg & (RESET_SRST_PULLS_TRST | 
RESET_TRST_PULLS_SRST)) {
+                               case RESET_SRST_PULLS_TRST:
+                                       modes[1] = " srst_pulls_trst";
+                                       break;
+                               case RESET_TRST_PULLS_SRST:
+                                       modes[1] = " trst_pulls_srst";
+                                       break;
+                               case RESET_SRST_PULLS_TRST | 
RESET_TRST_PULLS_SRST:
+                                       modes[1] = " trst_srst_tied";
+                                       break;
+                               default:
+                                       modes[1] = " separate";
+                                       break;
+                       }
                        break;
                default:
-                       modes[1] = "separate";
+                       modes[0] = "none";
+                       modes[1] = "";
                        break;
        }
 
@@ -394,7 +400,7 @@ next:
                modes[5] = "";
        }
 
-       command_print(CMD, "%s %s%s%s%s%s",
+       command_print(CMD, "%s%s%s%s%s%s",
                        modes[0], modes[1],
                        modes[2], modes[3], modes[4], modes[5]);
 
@@ -563,7 +569,7 @@ static const struct command_registration 
interface_command_handlers[] = {
                .mode = COMMAND_ANY,
                .help = "configure adapter reset behavior",
                .usage = "[none|trst_only|srst_only|trst_and_srst] "
-                       "[srst_pulls_trst|trst_pulls_srst|combined|separate] "
+                       
"[separate|srst_pulls_trst|trst_pulls_srst|trst_srst_tied] "
                        "[srst_gates_jtag|srst_nogate] "
                        "[trst_push_pull|trst_open_drain] "
                        "[srst_push_pull|srst_open_drain] "

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to