summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorAaron Carroll <aaronc@cse.unsw.edu.au>2011-02-02 18:16:25 +1100
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-02-02 08:32:10 +0100
commitefcea8306af922d867ff93073959dad774e10f0c (patch)
tree7d26e393532d7bd764457a6c2e71c4d4e2ec6ef6 /src/target
parent859ccccd8076910f7b022d712beeaffaf2f2fa9e (diff)
downloadopenocd+libswd-efcea8306af922d867ff93073959dad774e10f0c.tar.gz
openocd+libswd-efcea8306af922d867ff93073959dad774e10f0c.tar.bz2
openocd+libswd-efcea8306af922d867ff93073959dad774e10f0c.tar.xz
openocd+libswd-efcea8306af922d867ff93073959dad774e10f0c.zip
cortex_m3: allow scripts to override reset
If a handler for the reset-assert event it present, skip the usual reset handling. This is needed, for example, for board-level resets. Signed-off-by: Aaron Carroll <aaronc@cse.unsw.edu.au>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/cortex_m3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index f6918afa..5fd56e40 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -927,6 +927,16 @@ static int cortex_m3_assert_reset(struct target *target)
enum reset_types jtag_reset_config = jtag_get_reset_config();
+ if (target_has_event_action(target, TARGET_EVENT_RESET_ASSERT)) {
+ /* allow scripts to override the reset event */
+
+ target_handle_event(target, TARGET_EVENT_RESET_ASSERT);
+ register_cache_invalidate(cortex_m3->armv7m.core_cache);
+ target->state = TARGET_RESET;
+
+ return ERROR_OK;
+ }
+
/* Enable debug requests */
int retval;
retval = mem_ap_read_atomic_u32(swjdp, DCB_DHCSR, &cortex_m3->dcb_dhcsr);