diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2010-01-02 15:53:18 -0800 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2010-01-02 15:53:18 -0800 |
commit | 858226aae27b262cb3cb8274c6c7459a0068cc8a (patch) | |
tree | ea0cdca146a6499b4dd22c9eb2851bf6d210a4ab /src/target | |
parent | 6105f2bc4a65e1e42a0fb238096cbc0577b994c0 (diff) | |
download | openocd_libswd-858226aae27b262cb3cb8274c6c7459a0068cc8a.tar.gz openocd_libswd-858226aae27b262cb3cb8274c6c7459a0068cc8a.tar.bz2 openocd_libswd-858226aae27b262cb3cb8274c6c7459a0068cc8a.tar.xz openocd_libswd-858226aae27b262cb3cb8274c6c7459a0068cc8a.zip |
ARM: dap info fix + tweaks
Fix: don't print the BASE address except if it's a MEM-AP;
that's an unlikely error, but there's no point getting it wrong.
Tweaks: comments, capitalization.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/arm_adi_v5.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 19154ce6..72a07cd6 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1075,7 +1075,7 @@ is_dap_cid_ok(uint32_t cid3, uint32_t cid2, uint32_t cid1, uint32_t cid0) int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp, int apsel) { - uint32_t dbgbase,apid; + uint32_t dbgbase, apid; int romtable_present = 0; uint8_t mem_ap; uint32_t apselold; @@ -1087,25 +1087,31 @@ int dap_info_command(struct command_context *cmd_ctx, struct swjdp_common *swjdp swjdp_transaction_endcheck(swjdp); /* Now we read ROM table ID registers, ref. ARM IHI 0029B sec */ mem_ap = ((apid&0x10000) && ((apid&0x0F) != 0)); - command_print(cmd_ctx, "ap identification register 0x%8.8" PRIx32 "", apid); + command_print(cmd_ctx, "AP ID register 0x%8.8" PRIx32, apid); if (apid) { switch (apid&0x0F) { case 0: - command_print(cmd_ctx, "\tType is jtag-ap"); + command_print(cmd_ctx, "\tType is JTAG-AP"); break; case 1: - command_print(cmd_ctx, "\tType is mem-ap AHB"); + command_print(cmd_ctx, "\tType is MEM-AP AHB"); break; case 2: - command_print(cmd_ctx, "\tType is mem-ap APB"); + command_print(cmd_ctx, "\tType is MEM-AP APB"); break; default: - command_print(cmd_ctx, "\tUnknown AP-type"); - break; + command_print(cmd_ctx, "\tUnknown AP type"); + break; } - command_print(cmd_ctx, "ap debugbase 0x%8.8" PRIx32 "", dbgbase); + + /* NOTE: a MEM-AP may have a single CoreSight component that's + * not a ROM table ... or have no such components at all. + */ + if (mem_ap) + command_print(cmd_ctx, "AP BASE 0x%8.8" PRIx32, + dbgbase); } else { |