Duane Ellis: "target as an [tcl] object" feature.
[openocd.git] / src / target / arm11.c
index 890b836bb29015916feff62da9db80d676b029f1..108194e5dc256b73b992369a2d97b39a03106d32 100644 (file)
@@ -1,5 +1,7 @@
 /***************************************************************************
  *   Copyright (C) 2008 digenius technology GmbH.                          *
+ *   
+ *   Copyright (C) 2008 Oyvind Harboe oyvind.harboe@zylin.com              *
  *                                                                         *
  *   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  *
 
 
 #if 0
-#define FNC_INFO    DEBUG("-")
+#define FNC_INFO    LOG_DEBUG("-")
 #else
 #define FNC_INFO
 #endif
 
 #if 1
-#define FNC_INFO_NOTIMPLEMENTED    do { DEBUG("NOT IMPLEMENTED"); /*exit(-1);*/ } while (0)
+#define FNC_INFO_NOTIMPLEMENTED    do { LOG_DEBUG("NOT IMPLEMENTED"); /*exit(-1);*/ } while (0)
 #else
 #define FNC_INFO_NOTIMPLEMENTED
 #endif
@@ -72,7 +74,6 @@ target_type_t arm11_target =
     ARM11_HANDLER(assert_reset),
     ARM11_HANDLER(deassert_reset),
     ARM11_HANDLER(soft_reset_halt),
-    ARM11_HANDLER(prepare_reset_halt),
        
     ARM11_HANDLER(get_gdb_reg_list),
        
@@ -91,8 +92,9 @@ target_type_t arm11_target =
     ARM11_HANDLER(run_algorithm),
        
     ARM11_HANDLER(register_commands),
-    ARM11_HANDLER(target_command),
+    ARM11_HANDLER(target_create),
     ARM11_HANDLER(init_target),
+    ARM11_HANDLER(examine),
     ARM11_HANDLER(quit),
 };
 
@@ -324,7 +326,7 @@ void arm11_check_init(arm11_common_t * arm11, u32 * dscr)
 
     if (!(*dscr & ARM11_DSCR_MODE_SELECT))
     {
-       DEBUG("Bringing target into debug mode");
+       LOG_DEBUG("Bringing target into debug mode");
 
        *dscr |= ARM11_DSCR_MODE_SELECT;                /* Halt debug-mode */
        arm11_write_DSCR(arm11, *dscr);
@@ -428,7 +430,7 @@ static void arm11_on_enter_debug_state(arm11_common_t * arm11)
                
        u32 dscr = arm11_read_DSCR(arm11);
 
-       DEBUG("DRAIN, DSCR %08x", dscr);
+       LOG_DEBUG("DRAIN, DSCR %08x", dscr);
 
        if (dscr & ARM11_DSCR_STICKY_IMPRECISE_DATA_ABORT)
        {
@@ -436,7 +438,7 @@ static void arm11_on_enter_debug_state(arm11_common_t * arm11)
 
            dscr = arm11_read_DSCR(arm11);
 
-           DEBUG("DRAIN, DSCR %08x (DONE)", dscr);
+           LOG_DEBUG("DRAIN, DSCR %08x (DONE)", dscr);
 
            break;
        }
@@ -502,7 +504,7 @@ static void arm11_on_enter_debug_state(arm11_common_t * arm11)
     {
        arm11->simulate_reset_on_next_halt = false;
 
-       DEBUG("Reset c1 Control Register");
+       LOG_DEBUG("Reset c1 Control Register");
 
        /* Write 0 (reset value) to Control register 0 to disable MMU/Cache etc. */
 
@@ -524,18 +526,18 @@ void arm11_dump_reg_changes(arm11_common_t * arm11)
        if (!arm11->reg_list[i].valid)
        {
            if (arm11->reg_history[i].valid)
-               INFO("%8s INVALID    (%08x)", arm11_reg_defs[i].name, arm11->reg_history[i].value);
+               LOG_INFO("%8s INVALID    (%08x)", arm11_reg_defs[i].name, arm11->reg_history[i].value);
        }
        else
        {
            if (arm11->reg_history[i].valid)
            {
                if (arm11->reg_history[i].value != arm11->reg_values[i])
-                   INFO("%8s %08x (%08x)", arm11_reg_defs[i].name, arm11->reg_values[i], arm11->reg_history[i].value);
+                   LOG_INFO("%8s %08x (%08x)", arm11_reg_defs[i].name, arm11->reg_values[i], arm11->reg_history[i].value);
            }
            else
            {
-               INFO("%8s %08x (INVALID)", arm11_reg_defs[i].name, arm11->reg_values[i]);
+               LOG_INFO("%8s %08x (INVALID)", arm11_reg_defs[i].name, arm11->reg_values[i]);
            }
        }
     }}
@@ -565,7 +567,7 @@ void arm11_leave_debug_state(arm11_common_t * arm11)
        /* MRC p14,0,r?,c0,c5,0 */
        arm11_run_instr_data_to_core1(arm11, 0xee100e15 | (i << 12), R(RX + i));
 
-//     DEBUG("RESTORE R" ZU " %08x", i, R(RX + i));
+//     LOG_DEBUG("RESTORE R" ZU " %08x", i, R(RX + i));
     }}
 
     arm11_run_instr_data_finish(arm11);
@@ -579,7 +581,7 @@ void arm11_leave_debug_state(arm11_common_t * arm11)
 
        if (DSCR & (ARM11_DSCR_RDTR_FULL | ARM11_DSCR_WDTR_FULL))
        {
-           ERROR("wDTR/rDTR inconsistent (DSCR %08x)", DSCR);
+           LOG_ERROR("wDTR/rDTR inconsistent (DSCR %08x)", DSCR);
        }
     }
 
@@ -667,7 +669,7 @@ int arm11_poll(struct target_s *target)
 
     u32        dscr = arm11_read_DSCR(arm11);
 
-    DEBUG("DSCR %08x", dscr);
+    LOG_DEBUG("DSCR %08x", dscr);
 
     arm11_check_init(arm11, &dscr);
 
@@ -677,7 +679,7 @@ int arm11_poll(struct target_s *target)
        {
            enum target_state old_state = target->state;
 
-           DEBUG("enter TARGET_HALTED");
+           LOG_DEBUG("enter TARGET_HALTED");
            target->state               = TARGET_HALTED;
            target->debug_reason        = arm11_get_DSCR_debug_reason(dscr);
            arm11_on_enter_debug_state(arm11);
@@ -690,7 +692,7 @@ int arm11_poll(struct target_s *target)
     {
        if (target->state != TARGET_RUNNING && target->state != TARGET_DEBUG_RUNNING)
        {
-           DEBUG("enter TARGET_RUNNING");
+           LOG_DEBUG("enter TARGET_RUNNING");
            target->state               = TARGET_RUNNING;
            target->debug_reason        = DBG_REASON_NOTHALTED;
        }
@@ -724,7 +726,8 @@ int arm11_halt(struct target_s *target)
 
     arm11_common_t * arm11 = target->arch_info;
 
-    DEBUG("target->state: %s", target_state_strings[target->state]);
+    LOG_DEBUG("target->state: %s", 
+             Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
 
     if (target->state == TARGET_UNKNOWN)
     {
@@ -733,8 +736,8 @@ int arm11_halt(struct target_s *target)
 
     if (target->state == TARGET_HALTED)
     {
-       WARNING("target was already halted");
-       return ERROR_OK;
+               LOG_DEBUG("target was already halted");
+               return ERROR_OK;
     }
 
     if (arm11->trst_active)
@@ -775,23 +778,25 @@ int arm11_resume(struct target_s *target, int current, u32 address, int handle_b
 {
     FNC_INFO;
 
-//    DEBUG("current %d  address %08x  handle_breakpoints %d  debug_execution %d",
+//    LOG_DEBUG("current %d  address %08x  handle_breakpoints %d  debug_execution %d",
 //     current, address, handle_breakpoints, debug_execution);
 
     arm11_common_t * arm11 = target->arch_info;
 
-    DEBUG("target->state: %s", target_state_strings[target->state]);
+    LOG_DEBUG("target->state: %s", 
+             Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+
 
     if (target->state != TARGET_HALTED)
-    {
-       WARNING("target was not halted");
-       return ERROR_TARGET_NOT_HALTED;
-    }
+       {
+               LOG_ERROR("Target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
 
     if (!current)
        R(PC) = address;
 
-    INFO("RESUME PC %08x%s", R(PC), !current ? "!" : "");
+    LOG_INFO("RESUME PC %08x%s", R(PC), !current ? "!" : "");
 
     /* clear breakpoints/watchpoints and VCR*/
     arm11_sc7_clear_vbw(arm11);
@@ -807,7 +812,7 @@ int arm11_resume(struct target_s *target, int current, u32 address, int handle_b
        {
            if (bp->address == R(PC))
            {
-               DEBUG("must step over %08x", bp->address);
+               LOG_DEBUG("must step over %08x", bp->address);
                arm11_step(target, 1, 0, 0);
                break;
            }
@@ -830,7 +835,7 @@ int arm11_resume(struct target_s *target, int current, u32 address, int handle_b
     
            arm11_sc7_run(arm11, brp, asizeof(brp));
 
-           DEBUG("Add BP " ZU " at %08x", brp_num, bp->address);
+           LOG_DEBUG("Add BP " ZU " at %08x", brp_num, bp->address);
 
            brp_num++;
        }
@@ -849,7 +854,7 @@ int arm11_resume(struct target_s *target, int current, u32 address, int handle_b
     {
        u32 dscr = arm11_read_DSCR(arm11);
 
-       DEBUG("DSCR %08x", dscr);
+       LOG_DEBUG("DSCR %08x", dscr);
 
        if (dscr & ARM11_DSCR_CORE_RESTARTED)
            break;
@@ -875,11 +880,12 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre
 {
     FNC_INFO;
 
-    DEBUG("target->state: %s", target_state_strings[target->state]);
+    LOG_DEBUG("target->state: %s", 
+             Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
 
     if (target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
@@ -888,7 +894,7 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre
     if (!current)
        R(PC) = address;
 
-    INFO("STEP PC %08x%s", R(PC), !current ? "!" : "");
+    LOG_INFO("STEP PC %08x%s", R(PC), !current ? "!" : "");
 
     /** \todo TODO: Thumb not supported here */
 
@@ -902,7 +908,7 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre
        R(PC) += 4;
        arm11->reg_list[ARM11_RC_PC].valid = 1;
        arm11->reg_list[ARM11_RC_PC].dirty = 0;
-       INFO("Skipping BKPT");
+       LOG_INFO("Skipping BKPT");
     }
     /* skip over Wait for interrupt / Standby */
     /* mcr     15, 0, r?, cr7, cr0, {4} */
@@ -911,12 +917,12 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre
        R(PC) += 4;
        arm11->reg_list[ARM11_RC_PC].valid = 1;
        arm11->reg_list[ARM11_RC_PC].dirty = 0;
-       INFO("Skipping WFI");
+       LOG_INFO("Skipping WFI");
     }
     /* ignore B to self */
     else if ((next_instruction & 0xFEFFFFFF) == 0xeafffffe)
     {
-       INFO("Not stepping jump to self");
+       LOG_INFO("Not stepping jump to self");
     }
     else
     {
@@ -956,7 +962,7 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre
        {
            u32 dscr = arm11_read_DSCR(arm11);
 
-           DEBUG("DSCR %08x", dscr);
+           LOG_DEBUG("DSCR %08x", dscr);
 
            if ((dscr & (ARM11_DSCR_CORE_RESTARTED | ARM11_DSCR_CORE_HALTED)) ==
                (ARM11_DSCR_CORE_RESTARTED | ARM11_DSCR_CORE_HALTED))
@@ -995,6 +1001,13 @@ int arm11_assert_reset(struct target_s *target)
     arm11->trst_active = true;
 #endif
 
+    if (target->reset_halt)
+    {
+       int retval;
+               if ((retval = target_halt(target))!=ERROR_OK)
+                       return retval;
+    }
+
     return ERROR_OK;
 }
 
@@ -1003,7 +1016,9 @@ int arm11_deassert_reset(struct target_s *target)
     FNC_INFO;
 
 #if 0
-    DEBUG("target->state: %s", target_state_strings[target->state]);
+    LOG_DEBUG("target->state: %s", 
+             Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+
 
     /* deassert reset lines */
     jtag_add_reset(0, 0);
@@ -1025,12 +1040,6 @@ int arm11_soft_reset_halt(struct target_s *target)
     return ERROR_OK;
 }
 
-int arm11_prepare_reset_halt(struct target_s *target)
-{
-    FNC_INFO_NOTIMPLEMENTED;
-
-    return ERROR_OK;
-}
 
 
 /* target register access for gdb */
@@ -1077,11 +1086,11 @@ int arm11_read_memory(struct target_s *target, u32 address, u32 size, u32 count,
 
     if (target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
-    DEBUG("ADDR %08x  SIZE %08x  COUNT %08x", address, size, count);
+    LOG_DEBUG("ADDR %08x  SIZE %08x  COUNT %08x", address, size, count);
 
     arm11_common_t * arm11 = target->arch_info;
 
@@ -1152,11 +1161,11 @@ int arm11_write_memory(struct target_s *target, u32 address, u32 size, u32 count
 
     if (target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
-    DEBUG("ADDR %08x  SIZE %08x  COUNT %08x", address, size, count);
+    LOG_DEBUG("ADDR %08x  SIZE %08x  COUNT %08x", address, size, count);
 
     arm11_common_t * arm11 = target->arch_info;
 
@@ -1230,13 +1239,13 @@ int arm11_write_memory(struct target_s *target, u32 address, u32 size, u32 count
 
        if (address + size * count != r0)
        {
-           ERROR("Data transfer failed. (%d)", (r0 - address) - size * count);
+           LOG_ERROR("Data transfer failed. (%d)", (r0 - address) - size * count);
 
            if (arm11_config_memwrite_burst)
-               ERROR("use 'arm11 memwrite burst disable' to disable fast burst mode");
+               LOG_ERROR("use 'arm11 memwrite burst disable' to disable fast burst mode");
 
            if (arm11_config_memwrite_error_fatal)
-               exit(-1);
+               return ERROR_FAIL;
        }
     }
 #endif
@@ -1258,7 +1267,7 @@ int arm11_bulk_write_memory(struct target_s *target, u32 address, u32 count, u8
 
     if (target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
@@ -1286,20 +1295,20 @@ int arm11_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
 #if 0
     if (breakpoint->type == BKPT_SOFT)
     {
-       INFO("sw breakpoint requested, but software breakpoints not enabled");
+       LOG_INFO("sw breakpoint requested, but software breakpoints not enabled");
        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
     }
 #endif
 
     if (!arm11->free_brps)
     {
-       INFO("no breakpoint unit available for hardware breakpoint");
+       LOG_INFO("no breakpoint unit available for hardware breakpoint");
        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
     }
 
     if (breakpoint->length != 4)
     {
-       INFO("only breakpoints of four bytes length supported");
+       LOG_INFO("only breakpoints of four bytes length supported");
        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
     }
 
@@ -1342,34 +1351,26 @@ int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t
     return ERROR_OK;
 }
 
-int arm11_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target)
+int arm11_target_create(struct target_s *target, Jim_Interp *interp)
 {
     FNC_INFO;
 
-    if (argc < 4)
-    {
-       ERROR("'target arm11' 4th argument <jtag chain pos>");
-       exit(-1);
-    }
-
-    int chain_pos = strtoul(args[3], NULL, 0);
-
     NEW(arm11_common_t, arm11, 1);
 
     arm11->target = target;
 
     /* prepare JTAG information for the new target */
-    arm11->jtag_info.chain_pos = chain_pos;
+    arm11->jtag_info.chain_pos = target->chain_position;
     arm11->jtag_info.scann_size        = 5;
 
     arm_jtag_setup_connection(&arm11->jtag_info);
 
-    jtag_device_t *device = jtag_get_device(chain_pos);
+    jtag_device_t *device = jtag_get_device(target->chain_position);
 
     if (device->ir_length != 5)
     {
-       ERROR("'target arm11' expects 'jtag_device 5 0x01 0x1F 0x1E'");
-       exit(-1);
+               LOG_ERROR("'target arm11' expects 'jtag_device 5 0x01 0x1F 0x1E'");
+               return ERROR_COMMAND_SYNTAX_ERROR;
     }
 
     target->arch_info = arm11;
@@ -1378,8 +1379,16 @@ int arm11_target_command(struct command_context_s *cmd_ctx, char *cmd, char **ar
 }
 
 int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target)
+{
+       /* Initialize anything we can set up without talking to the target */
+       return ERROR_OK;
+}
+
+/* talk to the target and set things up */
+int arm11_examine(struct target_s *target)
 {
     FNC_INFO;
+    int retval;
 
     arm11_common_t * arm11 = target->arch_info;
 
@@ -1406,18 +1415,19 @@ int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target
 
     arm11_add_dr_scan_vc(asizeof(chain0_fields), chain0_fields, TAP_RTI);
 
-    jtag_execute_queue();
+    if ((retval=jtag_execute_queue())!=ERROR_OK) 
+       return retval;
 
 
     switch (arm11->device_id & 0x0FFFF000)
     {
-    case 0x07B36000:   INFO("found ARM1136"); break;
-    case 0x07B56000:   INFO("found ARM1156"); break;
-    case 0x07B76000:   INFO("found ARM1176"); break;
+    case 0x07B36000:   LOG_INFO("found ARM1136"); break;
+    case 0x07B56000:   LOG_INFO("found ARM1156"); break;
+    case 0x07B76000:   LOG_INFO("found ARM1176"); break;
     default:
     {
-       ERROR("'target arm11' expects IDCODE 0x*7B*7****");
-       exit(-1);
+               LOG_ERROR("'target arm11' expects IDCODE 0x*7B*7****");
+               return ERROR_FAIL;
     }
     }
 
@@ -1426,8 +1436,8 @@ int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target
     if (arm11->debug_version != ARM11_DEBUG_V6 &&
        arm11->debug_version != ARM11_DEBUG_V61)
     {
-       ERROR("Only ARMv6 v6 and v6.1 architectures supported.");
-       exit(-1);
+       LOG_ERROR("Only ARMv6 v6 and v6.1 architectures supported.");
+       return ERROR_FAIL;
     }
 
 
@@ -1438,7 +1448,7 @@ int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target
     arm11->free_brps = arm11->brp;
     arm11->free_wrps = arm11->wrp;
 
-    DEBUG("IDCODE %08x IMPLEMENTOR %02x DIDR %08x",
+    LOG_DEBUG("IDCODE %08x IMPLEMENTOR %02x DIDR %08x",
        arm11->device_id,
        arm11->implementor,
        arm11->didr);
@@ -1453,6 +1463,8 @@ int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target
 
     arm11_check_init(arm11, NULL);
 
+    target->type->examined = 1;
+    
     return ERROR_OK;
 }
 
@@ -1472,7 +1484,7 @@ int arm11_get_reg(reg_t *reg)
 
     if (target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
@@ -1535,7 +1547,7 @@ void arm11_build_reg_cache(target_t *target)
        ARM11_REGCACHE_COUNT != asizeof(arm11_reg_defs) ||
        ARM11_REGCACHE_COUNT != ARM11_RC_MAX)
     {
-       ERROR("arm11->reg_values inconsistent (%d " ZU " " ZU " %d)", ARM11_REGCACHE_COUNT, asizeof(arm11->reg_values), asizeof(arm11_reg_defs), ARM11_RC_MAX);
+       LOG_ERROR("BUG: arm11->reg_values inconsistent (%d " ZU " " ZU " %d)", ARM11_REGCACHE_COUNT, asizeof(arm11->reg_values), asizeof(arm11_reg_defs), ARM11_RC_MAX);
        exit(-1);
     }
 
@@ -1566,7 +1578,7 @@ int arm11_handle_bool(struct command_context_s *cmd_ctx, char *cmd, char **args,
 {
     if (argc == 0)
     {
-       INFO("%s is %s.", name, *var ? "enabled" : "disabled");
+       LOG_INFO("%s is %s.", name, *var ? "enabled" : "disabled");
        return ERROR_OK;
     }
 
@@ -1592,7 +1604,7 @@ int arm11_handle_bool(struct command_context_s *cmd_ctx, char *cmd, char **args,
        break;
     }
 
-    INFO("%s %s.", *var ? "Enabled" : "Disabled", name);
+    LOG_INFO("%s %s.", *var ? "Enabled" : "Disabled", name);
 
     return ERROR_OK;
 }
@@ -1633,7 +1645,7 @@ int arm11_handle_vcr(struct command_context_s *cmd_ctx, char *cmd, char **args,
        return ERROR_COMMAND_SYNTAX_ERROR;
     }
 
-    INFO("VCR 0x%08X", arm11_vcr);
+    LOG_INFO("VCR 0x%08X", arm11_vcr);
     return ERROR_OK;
 }
 
@@ -1656,7 +1668,7 @@ arm11_common_t * arm11_find_target(const char * arg)
     size_t jtag_target         = strtoul(arg, NULL, 0);
 
     {target_t * t;
-    for (t = targets; t; t = t->next)
+    for (t = all_targets; t; t = t->next)
     {
        if (t->type != &arm11_target)
            continue;
@@ -1676,7 +1688,7 @@ int arm11_handle_mrc_mcr(struct command_context_s *cmd_ctx, char *cmd, char **ar
 {
     if (argc != (read ? 6 : 7))
     {
-       ERROR("Invalid number of arguments. %s", read ? arm11_mrc_syntax : arm11_mcr_syntax);
+       LOG_ERROR("Invalid number of arguments. %s", read ? arm11_mrc_syntax : arm11_mcr_syntax);
        return -1;
     }
 
@@ -1684,7 +1696,7 @@ int arm11_handle_mrc_mcr(struct command_context_s *cmd_ctx, char *cmd, char **ar
 
     if (!arm11)
     {
-       ERROR("Parameter 1 is not a the JTAG chain position of an ARM11 device. %s",
+       LOG_ERROR("Parameter 1 is not a the JTAG chain position of an ARM11 device. %s",
                read ? arm11_mrc_syntax : arm11_mcr_syntax);
 
        return -1;
@@ -1693,7 +1705,7 @@ int arm11_handle_mrc_mcr(struct command_context_s *cmd_ctx, char *cmd, char **ar
 
     if (arm11->target->state != TARGET_HALTED)
     {
-       WARNING("target was not halted");
+       LOG_WARNING("target was not halted");
        return ERROR_TARGET_NOT_HALTED;
     }
 
@@ -1707,8 +1719,8 @@ int arm11_handle_mrc_mcr(struct command_context_s *cmd_ctx, char *cmd, char **ar
 
        if (values[i] > arm11_coproc_instruction_limits[i])
        {
-           ERROR("Parameter %d out of bounds (%d max). %s",
-               i + 2, arm11_coproc_instruction_limits[i],
+           LOG_ERROR("Parameter %ld out of bounds (%d max). %s",
+                     (long)(i + 2), arm11_coproc_instruction_limits[i],
                read ? arm11_mrc_syntax : arm11_mcr_syntax);
            return -1;
        }
@@ -1732,14 +1744,14 @@ int arm11_handle_mrc_mcr(struct command_context_s *cmd_ctx, char *cmd, char **ar
        u32 result;     
        arm11_run_instr_data_from_core_via_r0(arm11, instr, &result);
 
-       INFO("MRC p%d, %d, R0, c%d, c%d, %d = 0x%08x (%d)",
+       LOG_INFO("MRC p%d, %d, R0, c%d, c%d, %d = 0x%08x (%d)",
            values[0], values[1], values[2], values[3], values[4], result, result);
     }
     else
     {
        arm11_run_instr_data_to_core_via_r0(arm11, instr, values[5]);
 
-       INFO("MRC p%d, %d, R0 (#0x%08x), c%d, c%d, %d",
+       LOG_INFO("MRC p%d, %d, R0 (#0x%08x), c%d, c%d, %d",
            values[0], values[1], 
            values[5],
            values[2], values[3], values[4]);
@@ -1791,3 +1803,11 @@ int arm11_register_commands(struct command_context_s *cmd_ctx)
 
     return ERROR_OK;
 }
+
+
+/*
+ * 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)