aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:40:31 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-09 08:40:31 +0000
commit6dc2c2ce970863a079f101d84a0c47b37b682c76 (patch)
treef7f4f9ac7691f27ac90a18bb0016899522ff8233 /src/target
parent2a8e37173ad93c6c63aef28e365cc341d4c06fdb (diff)
downloadriscv-openocd-6dc2c2ce970863a079f101d84a0c47b37b682c76.zip
riscv-openocd-6dc2c2ce970863a079f101d84a0c47b37b682c76.tar.gz
riscv-openocd-6dc2c2ce970863a079f101d84a0c47b37b682c76.tar.bz2
Encapsulate jtag_reset_config using accessors:
- Update handle_reset_config_command in tcl.c to use new helpers. - Replace direct accesses in JTAG interface and target drivers. git-svn-id: svn://svn.berlios.de/openocd/trunk@2161 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm7_9_common.c3
-rw-r--r--src/target/cortex_m3.c3
-rw-r--r--src/target/mips_m4k.c3
3 files changed, 7 insertions, 2 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 9ec3e6c..493cf02 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -905,6 +905,7 @@ int arm7_9_poll(target_t *target)
{
if (target->reset_halt)
{
+ enum reset_types jtag_reset_config = jtag_get_reset_config();
if ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0)
{
check_pc = 1;
@@ -975,6 +976,7 @@ int arm7_9_assert_reset(target_t *target)
LOG_DEBUG("target->state: %s",
Jim_Nvp_value2name_simple( nvp_target_state,target->state)->name);
+ enum reset_types jtag_reset_config = jtag_get_reset_config();
if (!(jtag_reset_config & RESET_HAS_SRST))
{
LOG_ERROR("Can't assert SRST");
@@ -1047,6 +1049,7 @@ int arm7_9_deassert_reset(target_t *target)
/* deassert reset lines */
jtag_add_reset(0, 0);
+ enum reset_types jtag_reset_config = jtag_get_reset_config();
if (target->reset_halt&&(jtag_reset_config & RESET_SRST_PULLS_TRST)!=0)
{
LOG_WARNING("srst pulls trst - can not reset into halted mode. Issuing halt after reset.");
diff --git a/src/target/cortex_m3.c b/src/target/cortex_m3.c
index efa94ea..ab2c8f8 100644
--- a/src/target/cortex_m3.c
+++ b/src/target/cortex_m3.c
@@ -544,7 +544,7 @@ int cortex_m3_halt(target_t *target)
if (target->state == TARGET_RESET)
{
- if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst())
+ if ((jtag_get_reset_config() & RESET_SRST_PULLS_TRST) && jtag_get_srst())
{
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
return ERROR_TARGET_FAILURE;
@@ -753,6 +753,7 @@ int cortex_m3_assert_reset(target_t *target)
LOG_DEBUG("target->state: %s",
Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+ enum reset_types jtag_reset_config = jtag_get_reset_config();
if (!(jtag_reset_config & RESET_HAS_SRST))
{
LOG_ERROR("Can't assert SRST");
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index 466e0a2..5e98a2a 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -235,7 +235,7 @@ int mips_m4k_halt(struct target_s *target)
if (target->state == TARGET_RESET)
{
- if ((jtag_reset_config & RESET_SRST_PULLS_TRST) && jtag_get_srst())
+ if ((jtag_get_reset_config() & RESET_SRST_PULLS_TRST) && jtag_get_srst())
{
LOG_ERROR("can't request a halt while in reset if nSRST pulls nTRST");
return ERROR_TARGET_FAILURE;
@@ -267,6 +267,7 @@ int mips_m4k_assert_reset(target_t *target)
LOG_DEBUG("target->state: %s",
Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+ enum reset_types jtag_reset_config = jtag_get_reset_config();
if (!(jtag_reset_config & RESET_HAS_SRST))
{
LOG_ERROR("Can't assert SRST");