aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.c
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2015-12-06 17:16:31 +0100
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2015-12-29 20:32:10 +0000
commite7d165f3dbff0fbe11f458becdccbb3d4fa8ccc4 (patch)
tree1277356692c41400ff7d5c237c413170c556e430 /src/target/arm_adi_v5.c
parentd84c7d91960bbba0079268d165f0bb29a0da4d86 (diff)
arm_adi_v5: Remove all cases of "restoring" previous dap_ap_select()
All AP operations should select the AP to use before calling it so there's no point in restoring the previous value afterwards. The explicit call to dap_ap_select() before all AP operations should be moved into dap_queue_ap_read/write() which then would have to take the AP as an argument instead of the DAP. Change-Id: Icacb0c76ef2a5ac36b4d2f26b52ec01a8850286e Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3156 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/target/arm_adi_v5.c')
-rw-r--r--src/target/arm_adi_v5.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 2ddb6b5f..a28bc154 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -842,10 +842,8 @@ int dap_get_debugbase(struct adiv5_ap *ap,
uint32_t *dbgbase, uint32_t *apid)
{
struct adiv5_dap *dap = ap->dap;
- uint32_t ap_old;
int retval;
- ap_old = dap_ap_get_select(dap);
dap_ap_select(dap, ap->ap_num);
retval = dap_queue_ap_read(dap, MEM_AP_REG_BASE, dbgbase);
@@ -858,21 +856,16 @@ int dap_get_debugbase(struct adiv5_ap *ap,
if (retval != ERROR_OK)
return retval;
- dap_ap_select(dap, ap_old);
-
return ERROR_OK;
}
int dap_lookup_cs_component(struct adiv5_ap *ap,
uint32_t dbgbase, uint8_t type, uint32_t *addr, int32_t *idx)
{
- struct adiv5_dap *dap = ap->dap;
- uint32_t ap_old;
uint32_t romentry, entry_offset = 0, component_base, devtype;
int retval;
*addr = 0;
- ap_old = dap_ap_get_select(dap);
do {
retval = mem_ap_read_atomic_u32(ap, (dbgbase&0xFFFFF000) |
@@ -916,8 +909,6 @@ int dap_lookup_cs_component(struct adiv5_ap *ap,
entry_offset += 4;
} while (romentry > 0);
- dap_ap_select(dap, ap_old);
-
if (!*addr)
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;