ARMv7-M: use AP_REG_* symbol
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 5 Jan 2010 06:11:34 +0000 (22:11 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 5 Jan 2010 06:11:34 +0000 (22:11 -0800)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/armv7m.c

index d0f58deecc4dccd879452e6c2b09e1fb65b19afe..9d8132d43b665c635f6ad506f1f30c836f9a48de 100644 (file)
@@ -731,7 +731,12 @@ COMMAND_HANDLER(handle_dap_baseaddr_command)
        if (apselsave != apsel)
                dap_ap_select(swjdp, apsel);
 
-       dap_ap_read_reg_u32(swjdp, 0xF8, &baseaddr);
+       /* NOTE:  assumes we're talking to a MEM-AP, which
+        * has a base address.  There are other kinds of AP,
+        * though they're not common for now.  This should
+        * use the ID register to verify it's a MEM-AP.
+        */
+       dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr);
        retval = swjdp_transaction_endcheck(swjdp);
        command_print(CMD_CTX, "0x%8.8" PRIx32 "", baseaddr);