jtag: move prototype of adapter init/quit and speed to adapter.h 43/6643/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 7 Oct 2021 12:30:43 +0000 (14:30 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 13 Nov 2021 10:49:59 +0000 (10:49 +0000)
After moved the code, align the include files.

Change-Id: I514a3020648816810d69f76c2ec4f6e52a1c57ab
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6643
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
src/jtag/adapter.h
src/jtag/drivers/amt_jtagaccel.c
src/jtag/drivers/cmsis_dap.c
src/jtag/drivers/parport.c
src/jtag/drivers/vsllink.c
src/jtag/jtag.h
src/jtag/tcl.c
src/openocd.c
src/target/mips32_pracc.c
src/target/mips64_pracc.c

index fe9a6318c4c8b523388a975a194235cabf284859..b2405e98425127988c796a34895eea9b5f5f9ced 100644 (file)
 #include <stddef.h>
 #include <stdint.h>
 
+struct command_context;
+
+/** Initialize debug adapter upon startup.  */
+int adapter_init(struct command_context *cmd_ctx);
+
+/** Shutdown the debug adapter upon program exit. */
+int adapter_quit(void);
+
 /** @returns true if adapter has been initialized */
 bool is_adapter_initialized(void);
 
@@ -19,4 +27,28 @@ const char *adapter_usb_get_location(void);
 /** @returns true if USB location string is "<dev_bus>-<port_path[0]>[.<port_path[1]>[...]]" */
 bool adapter_usb_location_equal(uint8_t dev_bus, uint8_t *port_path, size_t path_len);
 
+/** @returns The current JTAG speed setting. */
+int jtag_get_speed(int *speed);
+
+/**
+ * Given a @a speed setting, use the interface @c speed_div callback to
+ * adjust the setting.
+ * @param speed The speed setting to convert back to readable KHz.
+ * @returns ERROR_OK if the interface has not been initialized or on success;
+ *  otherwise, the error code produced by the @c speed_div callback.
+ */
+int jtag_get_speed_readable(int *speed);
+
+/** Attempt to configure the interface for the specified KHz. */
+int jtag_config_khz(unsigned khz);
+
+/**
+ * Attempt to enable RTCK/RCLK. If that fails, fallback to the
+ * specified frequency.
+ */
+int jtag_config_rclk(unsigned fallback_speed_khz);
+
+/** Retrieves the clock speed of the JTAG interface in KHz. */
+unsigned jtag_get_speed_khz(void);
+
 #endif /* OPENOCD_JTAG_ADAPTER_H */
index e9ff8dfa1db41b09ff7a53de19c0979cabb1a753..b73c661614fa9c6293352473c3e2b0c4d3112907 100644 (file)
@@ -20,6 +20,7 @@
 #include "config.h"
 #endif
 
+#include <jtag/adapter.h>
 #include <jtag/interface.h>
 
 #if PARPORT_USE_PPDEV == 1
index 9bd4cb73a4c8ed1f439757e400b566be9334966c..289ffcd92a9e0f0a72ce885928a26226601ed3cc 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <transport/transport.h>
 #include "helper/replacements.h"
+#include <jtag/adapter.h>
 #include <jtag/swd.h>
 #include <jtag/interface.h>
 #include <jtag/commands.h>
index d50d306d3234b7b11aa95db87a316b45bc2acc71..714cb1daadaed537db148139512bba38b0c55e39 100644 (file)
@@ -23,6 +23,7 @@
 #include "config.h"
 #endif
 
+#include <jtag/adapter.h>
 #include <jtag/interface.h>
 #include "bitbang.h"
 
index 7325f6abc47077e254e4651782d4ea59a726164b..5d771443cd96161cf74455bebe8d786de463aa53 100644 (file)
@@ -24,6 +24,7 @@
 #include "config.h"
 #endif
 
+#include <jtag/adapter.h>
 #include <jtag/interface.h>
 #include <jtag/commands.h>
 #include <jtag/swd.h>
index feb4614fa6fe5c6ff3cd06baf4cef70102c8f87c..d7d7d977c2dc72de9be436bb56251c5f473742bd 100644 (file)
@@ -217,31 +217,6 @@ int jtag_unregister_event_callback(jtag_event_handler_t f, void *x);
 
 int jtag_call_event_callbacks(enum jtag_event event);
 
-
-/** @returns The current JTAG speed setting. */
-int jtag_get_speed(int *speed);
-
-/**
- * Given a @a speed setting, use the interface @c speed_div callback to
- * adjust the setting.
- * @param speed The speed setting to convert back to readable KHz.
- * @returns ERROR_OK if the interface has not been initialized or on success;
- *     otherwise, the error code produced by the @c speed_div callback.
- */
-int jtag_get_speed_readable(int *speed);
-
-/** Attempt to configure the interface for the specified KHz. */
-int jtag_config_khz(unsigned khz);
-
-/**
- * Attempt to enable RTCK/RCLK. If that fails, fallback to the
- * specified frequency.
- */
-int jtag_config_rclk(unsigned fallback_speed_khz);
-
-/** Retrieves the clock speed of the JTAG interface in KHz. */
-unsigned jtag_get_speed_khz(void);
-
 enum reset_types {
        RESET_NONE            = 0x0,
        RESET_HAS_TRST        = 0x1,
@@ -285,12 +260,6 @@ void jtag_set_verify_capture_ir(bool enable);
 /** @returns True if IR scan verification will be performed. */
 bool jtag_will_verify_capture_ir(void);
 
-/** Initialize debug adapter upon startup.  */
-int adapter_init(struct command_context *cmd_ctx);
-
-/** Shutdown the debug adapter upon program exit. */
-int adapter_quit(void);
-
 /** Set ms to sleep after jtag_execute_queue() flushes queue. Debug purposes. */
 void jtag_set_flush_queue_sleep(int ms);
 
index 6d3fee43cdf940cda95087f737fdd4bd24270416..8bf4ea9c10d1140f1f0ad883a63ccc8723048009 100644 (file)
@@ -30,6 +30,7 @@
 #include "config.h"
 #endif
 
+#include "adapter.h"
 #include "jtag.h"
 #include "swd.h"
 #include "minidriver.h"
index 12bd52c585ddfe2ad03706bbb8600be0b6832ab0..e8c526bfd1f764c732b551b3ff411c1e0dd60eeb 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include "openocd.h"
+#include <jtag/adapter.h>
 #include <jtag/driver.h>
 #include <jtag/jtag.h>
 #include <transport/transport.h>
index 923cdf8772f405d414d718f6277723f0d451f57d..ebe02e66d29d083d20a52628047a7f339fa14d59 100644 (file)
@@ -70,6 +70,7 @@
 
 #include <helper/align.h>
 #include <helper/time_support.h>
+#include <jtag/adapter.h>
 
 #include "mips32.h"
 #include "mips32_pracc.h"
index bb2af228d36893d6882ea9d1b53b5637bab2dcf7..d68521d632106658888f457f6744ce332502d8ef 100644 (file)
@@ -21,6 +21,7 @@
 #include "mips64_pracc.h"
 
 #include <helper/time_support.h>
+#include <jtag/adapter.h>
 
 #define STACK_DEPTH    32
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)