]> git.sur5r.net Git - openocd/blobdiff - src/target/arm926ejs.c
retire unused code.
[openocd] / src / target / arm926ejs.c
index 75d43fd8a798991df45308ee2ff5e955a98f5a8c..1b3a17b0a976d0141d32908aebc0e7cd0e4ae42c 100644 (file)
@@ -173,7 +173,7 @@ int arm926ejs_cp15_read(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u3
        fields[3].in_handler = NULL;
        fields[3].in_handler_priv = NULL;
        
-       jtag_add_dr_scan(4, fields, -1, NULL);
+       jtag_add_dr_scan(4, fields, -1);
 
        fields[0].in_handler_priv = value;
        fields[0].in_handler = arm_jtag_buf_to_u32;
@@ -183,7 +183,7 @@ int arm926ejs_cp15_read(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u3
                /* rescan with NOP, to wait for the access to complete */
                access = 0;
                nr_w_buf = 0;
-               jtag_add_dr_scan(4, fields, -1, NULL);
+               jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
        } while (buf_get_u32(&access, 0, 1) != 1);
 
@@ -255,14 +255,14 @@ int arm926ejs_cp15_write(target_t *target, u32 op1, u32 op2, u32 CRn, u32 CRm, u
        fields[3].in_handler = NULL;
        fields[3].in_handler_priv = NULL;
        
-       jtag_add_dr_scan(4, fields, -1, NULL);
+       jtag_add_dr_scan(4, fields, -1);
 
        do
        {
                /* rescan with NOP, to wait for the access to complete */
                access = 0;
                nr_w_buf = 0;
-               jtag_add_dr_scan(4, fields, -1, NULL);
+               jtag_add_dr_scan(4, fields, -1);
                jtag_execute_queue();
        } while (buf_get_u32(&access, 0, 1) != 1);
 
@@ -337,9 +337,11 @@ int arm926ejs_examine_debug_reason(target_t *target)
                default:
                        ERROR("BUG: unknown debug reason: 0x%x", debug_reason);
                        target->debug_reason = DBG_REASON_DBGRQ;
+                       retval = ERROR_TARGET_FAILURE;
+                       break;
        }
        
-       return ERROR_OK;
+       return retval;
 }
 
 u32 arm926ejs_get_ttb(target_t *target)
@@ -576,10 +578,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target)
        arm926ejs_common_t *arm926ejs = arm9tdmi->arch_info;
        reg_t *dbg_stat = &arm7_9->eice_cache->reg_list[EICE_DBG_STAT];
        
-       if (target->state == TARGET_RUNNING)
-       {
-               target->type->halt(target);
-       }
+       target->type->halt(target);
        
        while (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
        {
@@ -702,6 +701,7 @@ int arm926ejs_target_command(struct command_context_s *cmd_ctx, char *cmd, char
        int chain_pos;
        char *variant = NULL;
        arm926ejs_common_t *arm926ejs = malloc(sizeof(arm926ejs_common_t));
+       memset(arm926ejs, 0, sizeof(*arm926ejs));
        
        if (argc < 4)
        {