From dc574aa1da291405c6778383c1ad3b252602aee7 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Sat, 14 Nov 2015 00:30:28 +0100 Subject: target/arm: Remove usage of struct arm_jtag in ARMv7 targets The Cortex-A and Cortex-M keeps an arm_jtag struct around just to be able to pass a pointer to it to one common JTAG function which anyway only uses the TAP field. Refactor the function to take a TAP directly, remove the legacy struct from cortex instances and store the TAP pointer only in the DAP. Cortex-M makes a call to arm_jtag_setup_connection() with the struct but the function does nothing useful for a Cortex-M target so remove the call. Change-Id: I3b33709ef55372ef14522ed4337e9f2e817ae3ab Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/3142 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- src/target/cortex_m.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/target/cortex_m.c') diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index f8a5132..ec5caa2 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2104,7 +2104,6 @@ static int cortex_m_handle_target_request(void *priv) static int cortex_m_init_arch_info(struct target *target, struct cortex_m_common *cortex_m, struct jtag_tap *tap) { - int retval; struct armv7m_common *armv7m = &cortex_m->armv7m; armv7m_init_arch_info(target, armv7m); @@ -2113,12 +2112,8 @@ static int cortex_m_init_arch_info(struct target *target, if (!tap->dap) { tap->dap = dap_init(); - /* prepare JTAG information for the new target */ - cortex_m->jtag_info.tap = tap; - cortex_m->jtag_info.scann_size = 4; - /* Leave (only) generic DAP stuff for debugport_init() */ - tap->dap->jtag_info = &cortex_m->jtag_info; + tap->dap->tap = tap; } /* default reset mode is to use srst if fitted @@ -2142,10 +2137,6 @@ static int cortex_m_init_arch_info(struct target *target, target_register_timer_callback(cortex_m_handle_target_request, 1, 1, target); - retval = arm_jtag_setup_connection(&cortex_m->jtag_info); - if (retval != ERROR_OK) - return retval; - return ERROR_OK; } -- cgit v1.1