]> git.sur5r.net Git - openocd/blobdiff - src/target/arm_adi_v5.c
topic: add reset functions for SWD
[openocd] / src / target / arm_adi_v5.c
index 2203eb55d44e73f21d0f3e7f8d6cef8174080dc4..9a98f61d5652bde9925fb5e726128f85123e11b5 100644 (file)
@@ -69,6 +69,7 @@
 #include "config.h"
 #endif
 
+#include "jtag/interface.h"
 #include "arm.h"
 #include "arm_adi_v5.h"
 #include <helper/time_support.h>
@@ -977,10 +978,7 @@ int dap_syssec_kinetis_mdmap(struct adiv5_dap *dap)
                        /* we need to assert reset */
                        if (jtag_reset_config & RESET_HAS_SRST) {
                                /* default to asserting srst */
-                               if (jtag_reset_config & RESET_SRST_PULLS_TRST)
-                                       jtag_add_reset(1, 1);
-                               else
-                                       jtag_add_reset(0, 1);
+                               adapter_assert_reset();
                        } else {
                                LOG_DEBUG("SRST not configured");
                                dap_ap_select(dap, 0);
@@ -1098,6 +1096,14 @@ int ahbap_debugport_init(struct adiv5_dap *dap)
 
        LOG_DEBUG(" ");
 
+       /* test for initialized low level jtag hardware
+        * this always fails for stlink hardware
+        */
+       if (!dap->jtag_info) {
+               LOG_DEBUG("No low level jtag hardware found");
+               return ERROR_OK;
+       }
+
        /* JTAG-DP or SWJ-DP, in JTAG mode
         * ... for SWD mode this is patched as part
         * of link switchover