summaryrefslogtreecommitdiff
path: root/src/target/arm7tdmi.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-13 10:09:27 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-13 10:09:27 +0000
commitd9f50cb7d6a8b60cf425d8f87ba0907bffd15233 (patch)
tree99d915f5f68f724ce7353269feb9879649d16820 /src/target/arm7tdmi.c
parentfdd5582f7eb1c59c19aad5bf3af3363188acca28 (diff)
downloadopenocd+libswd-d9f50cb7d6a8b60cf425d8f87ba0907bffd15233.tar.gz
openocd+libswd-d9f50cb7d6a8b60cf425d8f87ba0907bffd15233.tar.bz2
openocd+libswd-d9f50cb7d6a8b60cf425d8f87ba0907bffd15233.tar.xz
openocd+libswd-d9f50cb7d6a8b60cf425d8f87ba0907bffd15233.zip
- Set up ICE registers after TRST
- Work in progress to allow launching GDB/telnet server *before* jtag chain enum, validate & examine git-svn-id: svn://svn.berlios.de/openocd/trunk@569 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm7tdmi.c')
-rw-r--r--src/target/arm7tdmi.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c
index f331bd2f..214eea05 100644
--- a/src/target/arm7tdmi.c
+++ b/src/target/arm7tdmi.c
@@ -738,26 +738,42 @@ void arm7tdmi_build_reg_cache(target_t *target)
reg_cache_t **cache_p = register_get_last_cache_p(&target->reg_cache);
/* get pointers to arch-specific information */
armv4_5_common_t *armv4_5 = target->arch_info;
- arm7_9_common_t *arm7_9 = armv4_5->arch_info;
- arm_jtag_t *jtag_info = &arm7_9->jtag_info;
(*cache_p) = armv4_5_build_reg_cache(target, armv4_5);
armv4_5->core_cache = (*cache_p);
-
- (*cache_p)->next = embeddedice_build_reg_cache(target, arm7_9);
- arm7_9->eice_cache = (*cache_p)->next;
-
- if (arm7_9->etm_ctx)
- {
- (*cache_p)->next->next = etm_build_reg_cache(target, jtag_info, arm7_9->etm_ctx);
- arm7_9->etm_ctx->reg_cache = (*cache_p)->next->next;
- }
}
int arm7tdmi_examine(struct command_context_s *cmd_ctx, struct target_s *target)
{
- target->type->examined = 1;
-
+ int retval;
+ armv4_5_common_t *armv4_5 = target->arch_info;
+ arm7_9_common_t *arm7_9 = armv4_5->arch_info;
+ if (!target->type->examined)
+ {
+ /* get pointers to arch-specific information */
+ reg_cache_t **cache_p = register_get_last_cache_p(&target->reg_cache);
+ reg_cache_t *t=embeddedice_build_reg_cache(target, arm7_9);
+ if (t==NULL)
+ return ERROR_FAIL;
+
+ (*cache_p) = t;
+ arm7_9->eice_cache = (*cache_p);
+
+ if (arm7_9->etm_ctx)
+ {
+ arm_jtag_t *jtag_info = &arm7_9->jtag_info;
+ (*cache_p)->next = etm_build_reg_cache(target, jtag_info, arm7_9->etm_ctx);
+ arm7_9->etm_ctx->reg_cache = (*cache_p)->next;
+ }
+ target->type->examined = 1;
+ }
+ if ((retval=embeddedice_setup(target))!=ERROR_OK)
+ return retval;
+ if (arm7_9->etm_ctx)
+ {
+ if ((retval=etm_setup(target))!=ERROR_OK)
+ return retval;
+ }
return ERROR_OK;
}