aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-10-08 13:12:39 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-10-08 13:12:39 +0000
commitce8768f46345e3f88ca6f8f0b88603d79e22d89a (patch)
treee2699853fff61fbb58fd4579bb30e30789d894a6 /src/target
parent995326b6000773efd454e308d487dec0b9f564b5 (diff)
downloadriscv-openocd-ce8768f46345e3f88ca6f8f0b88603d79e22d89a.zip
riscv-openocd-ce8768f46345e3f88ca6f8f0b88603d79e22d89a.tar.gz
riscv-openocd-ce8768f46345e3f88ca6f8f0b88603d79e22d89a.tar.bz2
- cleaned up str7, str9 and stm32 flash drivers
- str7 flash driver now checks correct busy bits depending on device - str9 flash driver now disables ITCM order as per st programming manual - added str7 disable_jtag command - added gdb_detach command - updated arm966e cp15 support - fix crash on mingw build when enabling target_request debugmsgs git-svn-id: svn://svn.berlios.de/openocd/trunk@209 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm966e.c17
-rw-r--r--src/target/arm966e.h3
-rw-r--r--src/target/target.c4
-rw-r--r--src/target/target.h1
4 files changed, 22 insertions, 3 deletions
diff --git a/src/target/arm966e.c b/src/target/arm966e.c
index 80ccd61..53627a5 100644
--- a/src/target/arm966e.c
+++ b/src/target/arm966e.c
@@ -226,10 +226,16 @@ int arm966e_read_cp15(target_t *target, int reg_addr, u32 *value)
jtag_add_dr_scan(3, fields, -1, NULL);
- fields[0].in_value = (u8*)value;
+ fields[0].in_handler_priv = value;
+ fields[0].in_handler = arm_jtag_buf_to_u32;
jtag_add_dr_scan(3, fields, -1, NULL);
+#ifdef _DEBUG_INSTRUCTION_EXECUTION_
+ jtag_execute_queue();
+ DEBUG("addr: 0x%x value: %8.8x", reg_addr, *value);
+#endif
+
return ERROR_OK;
}
@@ -241,6 +247,9 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value)
scan_field_t fields[3];
u8 reg_addr_buf = reg_addr & 0x3f;
u8 nr_w_buf = 1;
+ u8 value_buf[4];
+
+ buf_set_u32(value_buf, 0, 32, value);
jtag_add_end_state(TAP_RTI);
arm_jtag_scann(jtag_info, 0xf);
@@ -248,7 +257,7 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value)
fields[0].device = jtag_info->chain_pos;
fields[0].num_bits = 32;
- fields[0].out_value = (u8*)&value;
+ fields[0].out_value = value_buf;
fields[0].out_mask = NULL;
fields[0].in_value = NULL;
fields[0].in_check_value = NULL;
@@ -278,6 +287,10 @@ int arm966e_write_cp15(target_t *target, int reg_addr, u32 value)
jtag_add_dr_scan(3, fields, -1, NULL);
+#ifdef _DEBUG_INSTRUCTION_EXECUTION_
+ DEBUG("addr: 0x%x value: %8.8x", reg_addr, value);
+#endif
+
return ERROR_OK;
}
diff --git a/src/target/arm966e.h b/src/target/arm966e.h
index d4624f6..7169820 100644
--- a/src/target/arm966e.h
+++ b/src/target/arm966e.h
@@ -35,4 +35,7 @@ typedef struct arm966e_common_s
u32 cp15_control_reg;
} arm966e_common_t;
+extern int arm966e_read_cp15(target_t *target, int reg_addr, u32 *value);
+extern int arm966e_write_cp15(target_t *target, int reg_addr, u32 value);
+
#endif /* ARM966E_H */
diff --git a/src/target/target.c b/src/target/target.c
index 71ad1e4..f471167 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1013,7 +1013,9 @@ int handle_target_command(struct command_context_s *cmd_ctx, char *cmd, char **a
(*last_target_p)->trace_info->trace_history = NULL;
(*last_target_p)->trace_info->trace_history_pos = 0;
(*last_target_p)->trace_info->trace_history_overflowed = 0;
-
+
+ (*last_target_p)->dbgmsg = NULL;
+
(*last_target_p)->type->target_command(cmd_ctx, cmd, args, argc, *last_target_p);
found = 1;
diff --git a/src/target/target.h b/src/target/target.h
index f6c09c0..ae5fbc4 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -201,6 +201,7 @@ extern int target_register_commands(struct command_context_s *cmd_ctx);
extern int target_register_user_commands(struct command_context_s *cmd_ctx);
extern int target_init(struct command_context_s *cmd_ctx);
extern int handle_target(void *priv);
+extern int target_process_reset(struct command_context_s *cmd_ctx);
extern int target_register_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv);
extern int target_unregister_event_callback(int (*callback)(struct target_s *target, enum target_event event, void *priv), void *priv);