From d84c7d91960bbba0079268d165f0bb29a0da4d86 Mon Sep 17 00:00:00 2001 From: Andreas Fritiofson Date: Sun, 6 Dec 2015 16:58:13 +0100 Subject: [PATCH] cortex: Set default memaccess_tck only during examine It's currently set during target creation but the AP that will be used for the target is not even known. Change-Id: I4502e7eb1fa8d90f746445b8cf8a4c21cb7d519e Signed-off-by: Andreas Fritiofson Reviewed-on: http://openocd.zylin.com/3155 Tested-by: jenkins Reviewed-by: Matthias Welwarsky --- src/target/cortex_a.c | 3 ++- src/target/cortex_m.c | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 11558b9a..5e3a1a4b 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2929,6 +2929,8 @@ static int cortex_a_examine_first(struct target *target) return retval; } + armv7a->debug_ap->memaccess_tck = 80; + /* Search for the AHB-AB. * REVISIT: We should search for AXI-AP as well and make sure the AP's MEMTYPE says it * can access system memory. */ @@ -3117,7 +3119,6 @@ static int cortex_a_init_arch_info(struct target *target, tap->dap->tap = tap; } - tap->dap->ap[dap_ap_get_select(tap->dap)].memaccess_tck = 80; armv7a->arm.dap = tap->dap; cortex_a->fast_reg_read = 0; diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index b813bd7e..d539a824 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2122,9 +2122,6 @@ static int cortex_m_init_arch_info(struct target *target, armv7m->arm.dap = tap->dap; - /* Leave (only) generic DAP stuff for debugport_init(); */ - tap->dap->ap[dap_ap_get_select(tap->dap)].memaccess_tck = 8; - /* register arch-specific functions */ armv7m->examine_debug_reason = cortex_m_examine_debug_reason; -- 2.39.5