jtag_get_device() now returns NULL and reports error instead of invoking exit()
[openocd.git] / src / target / xscale.c
index 6b033cbd3e80f3c4bb9778154c25c79d5ec1f80c..ce40c685cc0a086643b09c9d58987b8b6bf5efec 100644 (file)
@@ -2,7 +2,7 @@
  *   Copyright (C) 2006, 2007 by Dominic Rath                              *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
- *   Copyright (C) 2007,2008 Øyvind Harboe                                      *
+ *   Copyright (C) 2007,2008 Øyvind Harboe                                 *
  *   oyvind.harboe@zylin.com                                               *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -115,7 +115,7 @@ target_type_t xscale_target =
        .bulk_write_memory = xscale_bulk_write_memory,
        .checksum_memory = arm7_9_checksum_memory,
        .blank_check_memory = arm7_9_blank_check_memory,
-       
+
        .run_algorithm = armv4_5_run_algorithm,
 
        .add_breakpoint = xscale_add_breakpoint,
@@ -127,7 +127,7 @@ target_type_t xscale_target =
        .target_create = xscale_target_create,
        .init_target = xscale_init_target,
        .quit = xscale_quit,
-       
+
        .virt2phys = xscale_virt2phys,
        .mmu = xscale_mmu
 };
@@ -215,6 +215,8 @@ int xscale_get_arch_pointers(target_t *target, armv4_5_common_t **armv4_5_p, xsc
 int xscale_jtag_set_instr(int chain_pos, u32 new_instr)
 {
        jtag_device_t *device = jtag_get_device(chain_pos);
+       if (device==NULL)
+               return ERROR_FAIL;
 
        if (buf_get_u32(device->cur_instr, 0, device->ir_length) != new_instr)
        {
@@ -312,7 +314,7 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words)
 {
        if (num_words==0)
                return ERROR_INVALID_ARGUMENTS;
-       
+
        int retval=ERROR_OK;
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
@@ -412,7 +414,7 @@ int xscale_receive(target_t *target, u32 *buffer, int num_words)
                                break;
                        }
                }
-               
+
                words_done += words_scheduled;
        }
 
@@ -455,7 +457,7 @@ int xscale_read_tx(target_t *target, int consume)
        noconsume_path[3] = TAP_PD;
        noconsume_path[4] = TAP_E2D;
        noconsume_path[5] = TAP_SD;
-       
+
        fields[0].device = xscale->jtag_info.chain_pos;
        fields[0].num_bits = 3;
        fields[0].out_value = NULL;
@@ -524,7 +526,7 @@ int xscale_read_tx(target_t *target, int consume)
                {
                        keep_alive();
                }
-       } 
+       }
        done:
 
        if (!(field0_in & 1))
@@ -613,7 +615,7 @@ int xscale_write_rx(target_t *target)
                }
        }
        done:
-       
+
        /* set rx_valid */
        field2 = 0x1;
        jtag_add_dr_scan(3, fields, TAP_RTI);
@@ -638,7 +640,7 @@ int xscale_send(target_t *target, u8 *buffer, int count, int size)
        int retval;
 
        int done_count = 0;
-       
+
        jtag_add_end_state(TAP_RTI);
 
        xscale_jtag_set_instr(xscale->jtag_info.chain_pos, xscale->jtag_info.dbgrx);
@@ -678,7 +680,7 @@ int xscale_send(target_t *target, u8 *buffer, int count, int size)
                        LOG_ERROR("BUG: size neither 4, 2 nor 1");
                        exit(-1);
                }
-               jtag_add_dr_out(xscale->jtag_info.chain_pos, 
+               jtag_add_dr_out(xscale->jtag_info.chain_pos,
                                3,
                                bits,
                                t,
@@ -1021,7 +1023,7 @@ int xscale_poll(target_t *target)
                        /* here we "lie" so GDB won't get stuck and a reset can be perfomed */
                        target->state = TARGET_HALTED;
                }
-               
+
                /* debug_entry could have overwritten target state (i.e. immediate resume)
                 * don't signal event handlers in that case
                 */
@@ -1054,7 +1056,7 @@ int xscale_debug_entry(target_t *target)
        xscale->external_debug_break = 0;
        if ((retval=xscale_read_dcsr(target))!=ERROR_OK)
                return retval;
-       
+
        /* get r0, pc, r1 to r7 and cpsr */
        if ((retval=xscale_receive(target, buffer, 10))!=ERROR_OK)
                return retval;
@@ -1099,10 +1101,10 @@ int xscale_debug_entry(target_t *target)
        else
                armv4_5->core_state = ARMV4_5_STATE_ARM;
 
-       
+
        if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
                return ERROR_FAIL;
-       
+
        /* get banked registers, r8 to r14, and spsr if not in USR/SYS mode */
        if ((armv4_5->core_mode != ARMV4_5_MODE_USR) && (armv4_5->core_mode != ARMV4_5_MODE_SYS))
        {
@@ -1225,7 +1227,7 @@ int xscale_halt(target_t *target)
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
 
-       LOG_DEBUG("target->state: %s", 
+       LOG_DEBUG("target->state: %s",
                  Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
 
        if (target->state == TARGET_HALTED)
@@ -1260,6 +1262,7 @@ int xscale_enable_single_step(struct target_s *target, u32 next_pc)
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale= armv4_5->arch_info;
        reg_t *ibcr0 = &xscale->reg_cache->reg_list[XSCALE_IBCR0];
+       int retval;
 
        if (xscale->ibcr0_used)
        {
@@ -1276,7 +1279,8 @@ int xscale_enable_single_step(struct target_s *target, u32 next_pc)
                }
        }
 
-       xscale_set_reg_u32(ibcr0, next_pc | 0x1);
+       if ((retval=xscale_set_reg_u32(ibcr0, next_pc | 0x1))!=ERROR_OK)
+               return retval;
 
        return ERROR_OK;
 }
@@ -1286,8 +1290,10 @@ int xscale_disable_single_step(struct target_s *target)
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale= armv4_5->arch_info;
        reg_t *ibcr0 = &xscale->reg_cache->reg_list[XSCALE_IBCR0];
+       int retval;
 
-       xscale_set_reg_u32(ibcr0, 0x0);
+       if ((retval=xscale_set_reg_u32(ibcr0, 0x0))!=ERROR_OK)
+               return retval;
 
        return ERROR_OK;
 }
@@ -1448,46 +1454,15 @@ int xscale_resume(struct target_s *target, int current, u32 address, int handle_
        return ERROR_OK;
 }
 
-int xscale_step(struct target_s *target, int current, u32 address, int handle_breakpoints)
+static int xscale_step_inner(struct target_s *target, int current, u32 address, int handle_breakpoints)
 {
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
-       breakpoint_t *breakpoint = target->breakpoints;
 
        u32 current_pc, next_pc;
-       int i;
        int retval;
+       int i;
 
-       if (target->state != TARGET_HALTED)
-       {
-               LOG_WARNING("target not halted");
-               return ERROR_TARGET_NOT_HALTED;
-       }
-
-       /* current = 1: continue on current pc, otherwise continue at <address> */
-       if (!current)
-               buf_set_u32(armv4_5->core_cache->reg_list[15].value, 0, 32, address);
-
-       current_pc = buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32);
-
-       /* if we're at the reset vector, we have to simulate the step */
-       if (current_pc == 0x0)
-       {
-               arm_simulate_step(target, NULL);
-               current_pc = buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32);
-
-               target->debug_reason = DBG_REASON_SINGLESTEP;
-               target_call_event_callbacks(target, TARGET_EVENT_HALTED);
-
-               return ERROR_OK;
-       }
-
-       /* the front-end may request us not to handle breakpoints */
-       if (handle_breakpoints)
-               if ((breakpoint = breakpoint_find(target, buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32))))
-               {
-                       xscale_unset_breakpoint(target, breakpoint);
-               }
 
        target->debug_reason = DBG_REASON_SINGLESTEP;
 
@@ -1497,52 +1472,110 @@ int xscale_step(struct target_s *target, int current, u32 address, int handle_br
                u32 current_opcode;
                target_read_u32(target, current_pc, &current_opcode);
                LOG_ERROR("BUG: couldn't calculate PC of next instruction, current opcode was 0x%8.8x", current_opcode);
+               return retval;
        }
 
        LOG_DEBUG("enable single-step");
-       xscale_enable_single_step(target, next_pc);
+       if ((retval=xscale_enable_single_step(target, next_pc))!=ERROR_OK)
+               return retval;
 
        /* restore banked registers */
-       xscale_restore_context(target);
+       if ((retval=xscale_restore_context(target))!=ERROR_OK)
+               return retval;
 
        /* send resume request (command 0x30 or 0x31)
         * clean the trace buffer if it is to be enabled (0x62) */
        if (xscale->trace.buffer_enabled)
        {
-               xscale_send_u32(target, 0x62);
-               xscale_send_u32(target, 0x31);
+               if ((retval=xscale_send_u32(target, 0x62))!=ERROR_OK)
+                       return retval;
+               if ((retval=xscale_send_u32(target, 0x31))!=ERROR_OK)
+                       return retval;
        }
        else
-               xscale_send_u32(target, 0x30);
+               if ((retval=xscale_send_u32(target, 0x30))!=ERROR_OK)
+                       return retval;
 
        /* send CPSR */
-       xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32));
+       if ((retval=xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32)))!=ERROR_OK)
+               return retval;
        LOG_DEBUG("writing cpsr with value 0x%8.8x", buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32));
 
        for (i = 7; i >= 0; i--)
        {
                /* send register */
-               xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[i].value, 0, 32));
+               if ((retval=xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[i].value, 0, 32)))!=ERROR_OK)
+                       return retval;
                LOG_DEBUG("writing r%i with value 0x%8.8x", i, buf_get_u32(armv4_5->core_cache->reg_list[i].value, 0, 32));
        }
 
        /* send PC */
-       xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32));
+       if ((retval=xscale_send_u32(target, buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32)))!=ERROR_OK)
+               return retval;
        LOG_DEBUG("writing PC with value 0x%8.8x", buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32));
 
        target_call_event_callbacks(target, TARGET_EVENT_RESUMED);
 
        /* registers are now invalid */
-       armv4_5_invalidate_core_regs(target);
+       if ((retval=armv4_5_invalidate_core_regs(target))!=ERROR_OK)
+               return retval;
 
        /* wait for and process debug entry */
-       xscale_debug_entry(target);
+       if ((retval=xscale_debug_entry(target))!=ERROR_OK)
+               return retval;
 
        LOG_DEBUG("disable single-step");
-       xscale_disable_single_step(target);
+       if ((retval=xscale_disable_single_step(target))!=ERROR_OK)
+               return retval;
 
        target_call_event_callbacks(target, TARGET_EVENT_HALTED);
 
+       return ERROR_OK;
+}
+
+int xscale_step(struct target_s *target, int current, u32 address, int handle_breakpoints)
+{
+       armv4_5_common_t *armv4_5 = target->arch_info;
+       breakpoint_t *breakpoint = target->breakpoints;
+
+       u32 current_pc;
+       int retval;
+
+       if (target->state != TARGET_HALTED)
+       {
+               LOG_WARNING("target not halted");
+               return ERROR_TARGET_NOT_HALTED;
+       }
+
+       /* current = 1: continue on current pc, otherwise continue at <address> */
+       if (!current)
+               buf_set_u32(armv4_5->core_cache->reg_list[15].value, 0, 32, address);
+
+       current_pc = buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32);
+
+       /* if we're at the reset vector, we have to simulate the step */
+       if (current_pc == 0x0)
+       {
+               if ((retval=arm_simulate_step(target, NULL))!=ERROR_OK)
+                       return retval;
+               current_pc = buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32);
+
+               target->debug_reason = DBG_REASON_SINGLESTEP;
+               target_call_event_callbacks(target, TARGET_EVENT_HALTED);
+
+               return ERROR_OK;
+       }
+
+       /* the front-end may request us not to handle breakpoints */
+       if (handle_breakpoints)
+               if ((breakpoint = breakpoint_find(target, buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32))))
+               {
+                       if ((retval=xscale_unset_breakpoint(target, breakpoint))!=ERROR_OK)
+                               return retval;
+               }
+
+       retval = xscale_step_inner(target, current, address, handle_breakpoints);
+
        if (breakpoint)
        {
                xscale_set_breakpoint(target, breakpoint);
@@ -1559,7 +1592,7 @@ int xscale_assert_reset(target_t *target)
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
 
-       LOG_DEBUG("target->state: %s", 
+       LOG_DEBUG("target->state: %s",
                  Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
 
        /* select DCSR instruction (set endstate to R-T-I to ensure we don't
@@ -1675,7 +1708,7 @@ int xscale_deassert_reset(target_t *target)
 
                        if ((retval = fileio_read(&debug_handler, 32, buffer, &buf_cnt)) != ERROR_OK)
                        {
-                               
+
                        }
 
                        for (i = 0; i < buf_cnt; i += 4)
@@ -2142,6 +2175,7 @@ void xscale_enable_mmu_caches(target_t *target, int mmu, int d_u_cache, int i_ca
 
 int xscale_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
 {
+       int retval;
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
 
@@ -2151,9 +2185,6 @@ int xscale_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (xscale->force_hw_bkpts)
-               breakpoint->type = BKPT_HARD;
-
        if (breakpoint->set)
        {
                LOG_WARNING("breakpoint already set");
@@ -2186,16 +2217,28 @@ int xscale_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                if (breakpoint->length == 4)
                {
                        /* keep the original instruction in target endianness */
-                       target->type->read_memory(target, breakpoint->address, 4, 1, breakpoint->orig_instr);
+                       if((retval = target->type->read_memory(target, breakpoint->address, 4, 1, breakpoint->orig_instr)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                        /* write the original instruction in target endianness (arm7_9->arm_bkpt is host endian) */
-                       target_write_u32(target, breakpoint->address, xscale->arm_bkpt);
+                       if((retval = target_write_u32(target, breakpoint->address, xscale->arm_bkpt)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                }
                else
                {
                        /* keep the original instruction in target endianness */
-                       target->type->read_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr);
+                       if((retval = target->type->read_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                        /* write the original instruction in target endianness (arm7_9->arm_bkpt is host endian) */
-                       target_write_u32(target, breakpoint->address, xscale->thumb_bkpt);
+                       if((retval = target_write_u32(target, breakpoint->address, xscale->thumb_bkpt)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                }
                breakpoint->set = 1;
        }
@@ -2215,12 +2258,6 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       if (xscale->force_hw_bkpts)
-       {
-               LOG_DEBUG("forcing use of hardware breakpoint at address 0x%8.8x", breakpoint->address);
-               breakpoint->type = BKPT_HARD;
-       }
-
        if ((breakpoint->type == BKPT_HARD) && (xscale->ibcr_available < 1))
        {
                LOG_INFO("no breakpoint unit available for hardware breakpoint");
@@ -2242,6 +2279,7 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
 
 int xscale_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
 {
+       int retval;
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
 
@@ -2276,11 +2314,17 @@ int xscale_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                /* restore original instruction (kept in target endianness) */
                if (breakpoint->length == 4)
                {
-                       target->type->write_memory(target, breakpoint->address, 4, 1, breakpoint->orig_instr);
+                       if((retval = target->type->write_memory(target, breakpoint->address, 4, 1, breakpoint->orig_instr)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                }
                else
                {
-                       target->type->write_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr);
+                       if((retval = target->type->write_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr)) != ERROR_OK)
+                       {
+                               return retval;
+                       }
                }
                breakpoint->set = 0;
        }
@@ -3070,8 +3114,6 @@ int xscale_init_arch_info(target_t *target, xscale_common_t *xscale, int chain_p
        xscale->hold_rst = 0;
        xscale->external_debug_break = 0;
 
-       xscale->force_hw_bkpts = 1;
-
        xscale->ibcr_available = 2;
        xscale->ibcr0_used = 0;
        xscale->ibcr1_used = 0;
@@ -3107,7 +3149,7 @@ int xscale_init_arch_info(target_t *target, xscale_common_t *xscale, int chain_p
        xscale->armv4_5_mmu.enable_mmu_caches = xscale_enable_mmu_caches;
        xscale->armv4_5_mmu.has_tiny_pages = 1;
        xscale->armv4_5_mmu.mmu_enabled = 0;
-       
+
        return ERROR_OK;
 }
 
@@ -3139,12 +3181,12 @@ int xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx, char
        if ((target = get_target_by_num(strtoul(args[0], NULL, 0))) == NULL)
        {
                LOG_ERROR("no target '%s' configured", args[0]);
-               return ERROR_OK;
+               return ERROR_FAIL;
        }
 
        if (xscale_get_arch_pointers(target, &armv4_5, &xscale) != ERROR_OK)
        {
-               return ERROR_OK;
+               return ERROR_FAIL;
        }
 
        handler_address = strtoul(args[1], NULL, 0);
@@ -3157,6 +3199,7 @@ int xscale_handle_debug_handler_command(struct command_context_s *cmd_ctx, char
        else
        {
                LOG_ERROR("xscale debug_handler <address> must be between 0x800 and 0x1fef800 or between 0xfe000800 and 0xfffff800");
+               return ERROR_FAIL;
        }
 
        return ERROR_OK;
@@ -3172,19 +3215,18 @@ int xscale_handle_cache_clean_address_command(struct command_context_s *cmd_ctx,
 
        if (argc < 2)
        {
-               LOG_ERROR("'xscale cache_clean_address <target#> <address>' command takes two required operands");
-               return ERROR_OK;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        if ((target = get_target_by_num(strtoul(args[0], NULL, 0))) == NULL)
        {
                LOG_ERROR("no target '%s' configured", args[0]);
-               return ERROR_OK;
+               return ERROR_FAIL;
        }
 
        if (xscale_get_arch_pointers(target, &armv4_5, &xscale) != ERROR_OK)
        {
-               return ERROR_OK;
+               return ERROR_FAIL;
        }
 
        cache_clean_address = strtoul(args[1], NULL, 0);
@@ -3224,8 +3266,8 @@ static int xscale_virt2phys(struct target_s *target, u32 virtual, u32 *physical)
        u32 cb;
        int domain;
        u32 ap;
-       
-       
+
+
        if ((retval = xscale_get_arch_pointers(target, &armv4_5, &xscale)) != ERROR_OK)
        {
                return retval;
@@ -3243,7 +3285,7 @@ static int xscale_mmu(struct target_s *target, int *enabled)
 {
        armv4_5_common_t *armv4_5 = target->arch_info;
        xscale_common_t *xscale = armv4_5->arch_info;
-       
+
        if (target->state != TARGET_HALTED)
        {
                LOG_ERROR("Target not halted");
@@ -3371,34 +3413,6 @@ int xscale_handle_vector_catch_command(command_context_t *cmd_ctx, char *cmd, ch
        return ERROR_OK;
 }
 
-int xscale_handle_force_hw_bkpts_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
-       target_t *target = get_current_target(cmd_ctx);
-       armv4_5_common_t *armv4_5;
-       xscale_common_t *xscale;
-
-       if (xscale_get_arch_pointers(target, &armv4_5, &xscale) != ERROR_OK)
-       {
-               return ERROR_OK;
-       }
-
-       if ((argc >= 1) && (strcmp("enable", args[0]) == 0))
-       {
-               xscale->force_hw_bkpts = 1;
-       }
-       else if ((argc >= 1) && (strcmp("disable", args[0]) == 0))
-       {
-               xscale->force_hw_bkpts = 0;
-       }
-       else
-       {
-               command_print(cmd_ctx, "usage: xscale force_hw_bkpts <enable|disable>");
-       }
-
-       command_print(cmd_ctx, "force hardware breakpoints %s", (xscale->force_hw_bkpts) ? "enabled" : "disabled");
-
-       return ERROR_OK;
-}
 
 int xscale_handle_trace_buffer_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
@@ -3609,12 +3623,12 @@ int xscale_handle_cp15(command_context_t *cmd_ctx, char *cmd, char **args, int a
        target_t *target = get_current_target(cmd_ctx);
        armv4_5_common_t *armv4_5;
        xscale_common_t *xscale;
-       
+
        if (xscale_get_arch_pointers(target, &armv4_5, &xscale) != ERROR_OK)
        {
                return ERROR_OK;
        }
-       
+
        if (target->state != TARGET_HALTED)
        {
                command_print(cmd_ctx, "target must be stopped for \"%s\" command", cmd);
@@ -3636,7 +3650,7 @@ int xscale_handle_cp15(command_context_t *cmd_ctx, char *cmd, char **args, int a
                        break;
                case 2:
                        reg_no = XSCALE_TTB;
-                       break; 
+                       break;
                case 3:
                        reg_no = XSCALE_DAC;
                        break;
@@ -3657,39 +3671,39 @@ int xscale_handle_cp15(command_context_t *cmd_ctx, char *cmd, char **args, int a
                        return ERROR_INVALID_ARGUMENTS;
                }
                reg = &xscale->reg_cache->reg_list[reg_no];
-               
+
        }
        if(argc == 1)
        {
                u32 value;
-               
+
                /* read cp15 control register */
                xscale_get_reg(reg);
                value = buf_get_u32(reg->value, 0, 32);
                command_print(cmd_ctx, "%s (/%i): 0x%x", reg->name, reg->size, value);
        }
        else if(argc == 2)
-       {   
+       {
 
                u32 value = strtoul(args[1], NULL, 0);
-               
+
                /* send CP write request (command 0x41) */
                xscale_send_u32(target, 0x41);
-               
+
                /* send CP register number */
                xscale_send_u32(target, reg_no);
-               
+
                /* send CP register value */
                xscale_send_u32(target, value);
-               
+
                /* execute cpwait to ensure outstanding operations complete */
                xscale_send_u32(target, 0x53);
        }
        else
        {
-               command_print(cmd_ctx, "usage: cp15 [register]<, [value]>");    
+               command_print(cmd_ctx, "usage: cp15 [register]<, [value]>");
        }
-       
+
        return ERROR_OK;
 }
 
@@ -3717,16 +3731,8 @@ int xscale_register_commands(struct command_context_s *cmd_ctx)
                COMMAND_EXEC, "load image from <file> [base address]");
 
        register_command(cmd_ctx, xscale_cmd, "cp15", xscale_handle_cp15, COMMAND_EXEC, "access coproc 15 <register> [value]");
-       
+
        armv4_5_register_commands(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)