execute reset init upon power restore / srst deassert
[openocd.git] / src / target / arm7tdmi.c
index 56198d1cb7883d78869b8bcc07773dc7cf522cea..4528a83f56a8a665e3c6ad1545e4c10942a3fd7c 100644 (file)
@@ -2,6 +2,9 @@
  *   Copyright (C) 2005 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -94,6 +97,7 @@ target_type_t arm7tdmi_target =
 
 int arm7tdmi_examine_debug_reason(target_t *target)
 {
+       int retval = ERROR_OK;
        /* 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;
@@ -128,11 +132,17 @@ int arm7tdmi_examine_debug_reason(target_t *target)
                fields[1].in_handler = NULL;
                fields[1].in_handler_priv = NULL;
                
-               arm_jtag_scann(&arm7_9->jtag_info, 0x1);
+               if((retval = arm_jtag_scann(&arm7_9->jtag_info, 0x1)) != ERROR_OK)
+               {
+                       return retval;
+               }
                arm_jtag_set_instr(&arm7_9->jtag_info, arm7_9->jtag_info.intest_instr, NULL);
 
                jtag_add_dr_scan(2, fields, TAP_PD);
-               jtag_execute_queue();
+               if((retval = jtag_execute_queue()) != ERROR_OK)
+               {
+                       return retval;
+               }
                
                fields[0].in_value = NULL;
                fields[0].out_value = &breakpoint;
@@ -179,10 +189,14 @@ static __inline int arm7tdmi_clock_out(arm_jtag_t *jtag_info, u32 out, u32 *depr
 /* clock the target, reading the databus */
 int arm7tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in)
 {
+       int retval = ERROR_OK;
        scan_field_t fields[2];
 
        jtag_add_end_state(TAP_PD);
-       arm_jtag_scann(jtag_info, 0x1);
+       if((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK)
+       {
+               return retval;
+       }
        arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL);
        
        fields[0].device = jtag_info->chain_pos;
@@ -211,7 +225,10 @@ int arm7tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in)
        
 #ifdef _DEBUG_INSTRUCTION_EXECUTION_
 {
-               jtag_execute_queue();
+               if((retval = jtag_execute_queue()) != ERROR_OK)
+               {
+                       return retval;
+               }
                        
                if (in)
                {
@@ -233,10 +250,14 @@ int arm7tdmi_clock_data_in(arm_jtag_t *jtag_info, u32 *in)
  */ 
 int arm7tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size, int be)
 {
+       int retval = ERROR_OK;
        scan_field_t fields[2];
 
        jtag_add_end_state(TAP_PD);
-       arm_jtag_scann(jtag_info, 0x1);
+       if((retval = arm_jtag_scann(jtag_info, 0x1)) != ERROR_OK)
+       {
+               return retval;
+       }
        arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL);
        
        fields[0].device = jtag_info->chain_pos;
@@ -276,7 +297,10 @@ int arm7tdmi_clock_data_in_endianness(arm_jtag_t *jtag_info, void *in, int size,
        
 #ifdef _DEBUG_INSTRUCTION_EXECUTION_
 {
-               jtag_execute_queue();
+               if((retval = jtag_execute_queue()) != ERROR_OK)
+               {
+                       return retval;
+               }
                        
                if (in)
                {
@@ -848,16 +872,6 @@ int arm7tdmi_register_commands(struct command_context_s *cmd_ctx)
        
        retval = arm7_9_register_commands(cmd_ctx);
        
-       return ERROR_OK;
+       return retval;
 
 }
-
-
-
-
-/*
- * Local Variables: ***
- * c-basic-offset: 4 ***
- * tab-width: 4 ***
- * End: ***
- */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)