diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2015-12-06 01:21:41 +0100 |
---|---|---|
committer | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2015-12-29 20:28:24 +0000 |
commit | beb843d28dd1dcf5ef4f761128bb2639913bfcfe (patch) | |
tree | 7f9c4e05a2e6eaf1a2cce1b35e2c199e3c5dbeb2 /src/target/cortex_m.c | |
parent | cd12c423dcc68c2a8ef3ba43a7b9f55e84de3d5d (diff) | |
download | riscv-openocd-beb843d28dd1dcf5ef4f761128bb2639913bfcfe.zip riscv-openocd-beb843d28dd1dcf5ef4f761128bb2639913bfcfe.tar.gz riscv-openocd-beb843d28dd1dcf5ef4f761128bb2639913bfcfe.tar.bz2 |
cortex_m: Discover the AP to use, just like Cortex-A
This required fixing the AP ID parsing in dap_find_ap() to
match IHI0031C. The AXI type was added too.
Change-Id: I44577a7848df37586e650dce0fb57ac26f5f858c
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3146
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r-- | src/target/cortex_m.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index ec5caa2..7a7194a 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1903,6 +1903,13 @@ int cortex_m_examine(struct target *target) struct adiv5_dap *swjdp = cortex_m->armv7m.arm.dap; struct armv7m_common *armv7m = target_to_armv7m(target); + /* Search for the MEM-AP */ + retval = dap_find_ap(swjdp, AP_TYPE_AHB_AP, &armv7m->debug_ap); + if (retval != ERROR_OK) { + LOG_ERROR("Could not find MEM-AP to control the core"); + return retval; + } + /* Leave (only) generic DAP stuff for debugport_init(); */ swjdp->ap[armv7m->debug_ap].memaccess_tck = 8; |