summaryrefslogtreecommitdiff
path: root/src/target/arm_dpm.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-02 22:57:07 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-02 23:08:42 -0800
commitc2af99d4717837761b6df750e1fe75797c910b23 (patch)
treedcf33581014c399865334358a1e1f424a5d0d37a /src/target/arm_dpm.c
parentb123fd3cd9a11b2dfb79025fb137696135f5f898 (diff)
downloadopenocd+libswd-c2af99d4717837761b6df750e1fe75797c910b23.tar.gz
openocd+libswd-c2af99d4717837761b6df750e1fe75797c910b23.tar.bz2
openocd+libswd-c2af99d4717837761b6df750e1fe75797c910b23.tar.xz
openocd+libswd-c2af99d4717837761b6df750e1fe75797c910b23.zip
ARM DPM: tweak initialization
Move the initial breakpoint/watchpoint disable calls to arm_dpm_initialize(), and start using that routine. This split helps with arm11 support.
Diffstat (limited to 'src/target/arm_dpm.c')
-rw-r--r--src/target/arm_dpm.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c
index 7c09e064..434c63e1 100644
--- a/src/target/arm_dpm.c
+++ b/src/target/arm_dpm.c
@@ -807,18 +807,6 @@ int arm_dpm_setup(struct arm_dpm *dpm)
return ERROR_FAIL;
}
- /* Disable all breakpoints and watchpoints at startup. */
- if (dpm->bpwp_disable) {
- unsigned i;
-
- for (i = 0; i < dpm->nbp; i++)
- (void) dpm->bpwp_disable(dpm, i);
- for (i = 0; i < dpm->nwp; i++)
- (void) dpm->bpwp_disable(dpm, 16 + i);
- } else
- LOG_WARNING("%s: can't disable breakpoints and watchpoints",
- target_name(target));
-
LOG_INFO("%s: hardware has %d breakpoints, %d watchpoints",
target_name(target), dpm->nbp, dpm->nwp);
@@ -835,6 +823,17 @@ int arm_dpm_setup(struct arm_dpm *dpm)
*/
int arm_dpm_initialize(struct arm_dpm *dpm)
{
- /* FIXME -- nothing yet */
+ /* Disable all breakpoints and watchpoints at startup. */
+ if (dpm->bpwp_disable) {
+ unsigned i;
+
+ for (i = 0; i < dpm->nbp; i++)
+ (void) dpm->bpwp_disable(dpm, i);
+ for (i = 0; i < dpm->nwp; i++)
+ (void) dpm->bpwp_disable(dpm, 16 + i);
+ } else
+ LOG_WARNING("%s: can't disable breakpoints and watchpoints",
+ target_name(dpm->arm->target));
+
return ERROR_OK;
}