From: David B. <dbr...@us...> - 2009-11-26 01:38:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 2653b8030722c85393974cd6c0ebcdbd1ae27c72 (commit) via b715a81f5b95144118d8f946d4191f1dc844783a (commit) via ac06d41fc723c264e989673be16f9f21a1896518 (commit) via cc53ad81d3f7598eb06c216218734342d2d8e7e9 (commit) via 21378f58b604453262ac6f3cbf3d6b94b50251cf (commit) via 5d244b85e25e97768e66ec86f23ca58f6ab6c08b (commit) via 83568b6b62b3508f10aa3a51fe4ae86421ec5d27 (commit) from 49036463dbebcd4c5722f89b86dc6cec777bab0f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2653b8030722c85393974cd6c0ebcdbd1ae27c72 Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:38:08 2009 -0800 target: create and use target_name() Several of the sites now using target_type_name() really ought to be using an instance-specific name. Create a function called target_name(), accessing the instance's own (command) name. Use it in several places that really should be displaying instance-specific names. Also in several places which were already doing so, but which had no wrapper to call. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index f733e7b..bd1d047 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -774,7 +774,7 @@ int gdb_new_connection(struct connection *connection) gdb_actual_connections++; LOG_DEBUG("New GDB Connection: %d, Target %s, state: %s", gdb_actual_connections, - gdb_service->target->cmd_name, + target_name(gdb_service->target), target_state_name(gdb_service->target)); return ERROR_OK; @@ -792,7 +792,7 @@ int gdb_connection_closed(struct connection *connection) gdb_actual_connections--; LOG_DEBUG("GDB Close, Target: %s, state: %s, gdb_actual_connections=%d", - gdb_service->target->cmd_name, + target_name(gdb_service->target), target_state_name(gdb_service->target), gdb_actual_connections); @@ -2138,7 +2138,7 @@ int gdb_input_inner(struct connection *connection) watchpoint_clear_target(gdb_service->target); command_run_linef(connection->cmd_ctx, "ocd_gdb_restart %s", - target->cmd_name); + target_name(target)); break; default: /* ignore unkown packets */ @@ -2216,7 +2216,7 @@ int gdb_init(void) add_service("gdb", CONNECTION_PIPE, 0, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s using pipes", - target_type_name(target)); + target_name(target)); } else { @@ -2233,7 +2233,7 @@ int gdb_init(void) gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s at TCP port %i", - target_type_name(target), + target_name(target), port); target = target->next; port++; diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index df797e3..16ab7e0 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -157,7 +157,7 @@ void breakpoint_clear_target(struct target *target) struct breakpoint *breakpoint; LOG_DEBUG("Delete all breakpoints for target: %s", - target_type_name(target)); + target_name(target)); while ((breakpoint = target->breakpoints) != NULL) { breakpoint_free(target, breakpoint); @@ -294,7 +294,7 @@ void watchpoint_clear_target(struct target *target) struct watchpoint *watchpoint; LOG_DEBUG("Delete all watchpoints for target: %s", - target_type_name(target)); + target_name(target)); while ((watchpoint = target->watchpoints) != NULL) { watchpoint_free(target, watchpoint); diff --git a/src/target/etm.c b/src/target/etm.c index 2ea7345..520e22f 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1374,7 +1374,8 @@ COMMAND_HANDLER(handle_etm_config_command) arm = target_to_arm(target); if (!is_arm(arm)) { command_print(CMD_CTX, "target '%s' is '%s'; not an ARM", - target->cmd_name, target_type_name(target)); + target_name(target), + target_type_name(target)); return ERROR_FAIL; } diff --git a/src/target/target.c b/src/target/target.c index f46fc67..3de9f2c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -556,7 +556,7 @@ static int target_soft_reset_halt_imp(struct target *target) } if (!target->type->soft_reset_halt_imp) { LOG_ERROR("Target %s does not support soft_reset_halt", - target->cmd_name); + target_name(target)); return ERROR_FAIL; } return target->type->soft_reset_halt_imp(target); @@ -766,7 +766,7 @@ int target_init(struct command_context *cmd_ctx) if ((retval = target->type->init_target(cmd_ctx, target)) != ERROR_OK) { - LOG_ERROR("target '%s' init failed", target_type_name(target)); + LOG_ERROR("target '%s' init failed", target_name(target)); return retval; } @@ -1697,7 +1697,7 @@ DumpTargets: command_print(CMD_CTX, "%2d%c %-18s %-10s %-6s %-18s %s", target->target_number, marker, - target->cmd_name, + target_name(target), target_type_name(target), Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness)->name, @@ -3510,7 +3510,7 @@ void target_handle_event(struct target *target, enum target_event e) if (teap->event == e) { LOG_DEBUG("target: (%d) %s (%s) event: %d (%s) action: %s", target->target_number, - target->cmd_name, + target_name(target), target_type_name(target), e, Jim_Nvp_value2name_simple(nvp_target_event, e)->name, @@ -4139,7 +4139,7 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) || !target->type->deassert_reset) { Jim_SetResult_sprintf(interp, "No target-specific reset for %s", - target->cmd_name); + target_name(target)); return JIM_ERR; } /* determine if we should halt or not. */ @@ -4183,10 +4183,9 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) e = target_wait_state(target, n->value, a); if (e != ERROR_OK) { Jim_SetResult_sprintf(goi.interp, - "target: %s wait %s fails (%d) %s", - target->cmd_name, - n->name, - e, target_strerror_safe(e)); + "target: %s wait %s fails (%d) %s", + target_name(target), n->name, + e, target_strerror_safe(e)); return JIM_ERR; } else { return JIM_OK; @@ -4198,9 +4197,10 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { struct target_event_action *teap; teap = target->event_action; - command_print(cmd_ctx, "Event actions for target (%d) %s\n", - target->target_number, - target->cmd_name); + command_print(cmd_ctx, + "Event actions for target (%d) %s\n", + target->target_number, + target_name(target)); command_print(cmd_ctx, "%-25s | Body", "Event"); command_print(cmd_ctx, "------------------------- | ----------------------------------------"); while (teap) { @@ -4450,7 +4450,9 @@ static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters"); return JIM_ERR; } - Jim_SetResultString(goi.interp, get_current_target(cmd_ctx)->cmd_name, -1); + Jim_SetResultString(goi.interp, + target_name(get_current_target(cmd_ctx)), + -1); return JIM_OK; case TG_CMD_TYPES: if (goi.argc != 0) { @@ -4473,8 +4475,9 @@ static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv) target = all_targets; while (target) { Jim_ListAppendElement(goi.interp, - Jim_GetResult(goi.interp), - Jim_NewStringObj(goi.interp, target->cmd_name, -1)); + Jim_GetResult(goi.interp), + Jim_NewStringObj(goi.interp, + target_name(target), -1)); target = target->next; } return JIM_OK; @@ -4505,7 +4508,7 @@ static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv) "Target: number %d does not exist", (int)(w)); return JIM_ERR; } - Jim_SetResultString(goi.interp, target->cmd_name, -1); + Jim_SetResultString(goi.interp, target_name(target), -1); return JIM_OK; case TG_CMD_COUNT: if (goi.argc != 0) { diff --git a/src/target/target.h b/src/target/target.h index 61bc68a..15003c6 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -159,6 +159,12 @@ struct target long long halt_issued_time; /* Note time when halt was issued */ }; +/** Returns the instance-specific name of the specified target. */ +static inline const char *target_name(struct target *target) +{ + return target->cmd_name; +} + enum target_event { /* LD historical names commit b715a81f5b95144118d8f946d4191f1dc844783a Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:38:08 2009 -0800 target: target_get_name() --> target_type_name() There are two names that may matter on a per-target basis. One is a per-instance name (for example, "at91sam7s.cpu"). The other is the name of its type (for example, "arm7tdmi"), which is shared among multiple targets. Currently target_get_name() returns the type name, which is misleading and is rarely appropriate for target diagnostics. Rename that as target_type_name(). Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index cb14cc3..f733e7b 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2216,7 +2216,7 @@ int gdb_init(void) add_service("gdb", CONNECTION_PIPE, 0, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s using pipes", - target_get_name(target)); + target_type_name(target)); } else { @@ -2233,7 +2233,7 @@ int gdb_init(void) gdb_connection_closed, gdb_service); LOG_DEBUG("gdb service for target %s at TCP port %i", - target_get_name(target), + target_type_name(target), port); target = target->next; port++; diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 3ab1464..df797e3 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -155,7 +155,9 @@ void breakpoint_remove(struct target *target, uint32_t address) void breakpoint_clear_target(struct target *target) { struct breakpoint *breakpoint; - LOG_DEBUG("Delete all breakpoints for target: %s", target_get_name( target )); + + LOG_DEBUG("Delete all breakpoints for target: %s", + target_type_name(target)); while ((breakpoint = target->breakpoints) != NULL) { breakpoint_free(target, breakpoint); @@ -290,7 +292,9 @@ void watchpoint_remove(struct target *target, uint32_t address) void watchpoint_clear_target(struct target *target) { struct watchpoint *watchpoint; - LOG_DEBUG("Delete all watchpoints for target: %s", target_get_name( target )); + + LOG_DEBUG("Delete all watchpoints for target: %s", + target_type_name(target)); while ((watchpoint = target->watchpoints) != NULL) { watchpoint_free(target, watchpoint); diff --git a/src/target/embeddedice.c b/src/target/embeddedice.c index 3947e26..cca9cc0 100644 --- a/src/target/embeddedice.c +++ b/src/target/embeddedice.c @@ -281,8 +281,8 @@ embeddedice_build_reg_cache(struct target *target, struct arm7_9_common *arm7_9) * in some unusual bits. Let feroceon.c validate it * and do the appropriate setup itself. */ - if (strcmp(target_get_name(target), "feroceon") == 0 || - strcmp(target_get_name(target), "dragonite") == 0) + if (strcmp(target_type_name(target), "feroceon") == 0 || + strcmp(target_type_name(target), "dragonite") == 0) break; LOG_ERROR("unknown EmbeddedICE version " "(comms ctrl: 0x%8.8" PRIx32 ")", diff --git a/src/target/etm.c b/src/target/etm.c index 4e7f917..2ea7345 100644 --- a/src/target/etm.c +++ b/src/target/etm.c @@ -1374,7 +1374,7 @@ COMMAND_HANDLER(handle_etm_config_command) arm = target_to_arm(target); if (!is_arm(arm)) { command_print(CMD_CTX, "target '%s' is '%s'; not an ARM", - target->cmd_name, target_get_name(target)); + target->cmd_name, target_type_name(target)); return ERROR_FAIL; } diff --git a/src/target/target.c b/src/target/target.c index 97a93c0..f46fc67 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -522,7 +522,7 @@ int target_examine(void) } return retval; } -const char *target_get_name(struct target *target) +const char *target_type_name(struct target *target) { return target->type->name; } @@ -766,7 +766,7 @@ int target_init(struct command_context *cmd_ctx) if ((retval = target->type->init_target(cmd_ctx, target)) != ERROR_OK) { - LOG_ERROR("target '%s' init failed", target_get_name(target)); + LOG_ERROR("target '%s' init failed", target_type_name(target)); return retval; } @@ -1698,7 +1698,7 @@ DumpTargets: target->target_number, marker, target->cmd_name, - target_get_name(target), + target_type_name(target), Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness)->name, target->tap->dotted_name, @@ -3511,7 +3511,7 @@ void target_handle_event(struct target *target, enum target_event e) LOG_DEBUG("target: (%d) %s (%s) event: %d (%s) action: %s", target->target_number, target->cmd_name, - target_get_name(target), + target_type_name(target), e, Jim_Nvp_value2name_simple(nvp_target_event, e)->name, Jim_GetString(teap->body, NULL)); @@ -3585,16 +3585,20 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target) case TCFG_TYPE: /* not setable */ if (goi->isconfigure) { - Jim_SetResult_sprintf(goi->interp, "not setable: %s", n->name); + Jim_SetResult_sprintf(goi->interp, + "not settable: %s", n->name); return JIM_ERR; } else { no_params: if (goi->argc != 0) { - Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "NO PARAMS"); + Jim_WrongNumArgs(goi->interp, + goi->argc, goi->argv, + "NO PARAMS"); return JIM_ERR; } } - Jim_SetResultString(goi->interp, target_get_name(target), -1); + Jim_SetResultString(goi->interp, + target_type_name(target), -1); /* loop for more */ break; case TCFG_EVENT: diff --git a/src/target/target.h b/src/target/target.h index ee40209..61bc68a 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -280,11 +280,12 @@ struct target* get_current_target(struct command_context *cmd_ctx); struct target *get_target(const char *id); /** - * Get the target name. + * Get the target type name. * * This routine is a wrapper for the target->type->name field. + * Note that this is not an instance-specific name for his target. */ -const char *target_get_name(struct target *target); +const char *target_type_name(struct target *target); /** * Examine the specified @a target, letting it perform any diff --git a/src/target/target_type.h b/src/target/target_type.h index 9a0709d..333b58b 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -39,7 +39,7 @@ struct target_type { /** * Name of this type of target. Do @b not access this - * field directly, use target_get_name() instead. + * field directly, use target_type_name() instead. */ char *name; commit ac06d41fc723c264e989673be16f9f21a1896518 Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:19:53 2009 -0800 omap3530.cfg: yes we have SRAM! Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/target/omap3530.cfg b/tcl/target/omap3530.cfg index 45f3c01..0a83423 100644 --- a/tcl/target/omap3530.cfg +++ b/tcl/target/omap3530.cfg @@ -38,6 +38,9 @@ jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \ set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME cortex_a8 -chain-position $_CHIPNAME.dap +# SRAM: 64K at 0x4020.0000; use the first 16K +$_TARGETNAME configure -work-area-phys 0x40200000 -work-area-size 0x4000 + ################### # the reset sequence is event-driven commit cc53ad81d3f7598eb06c216218734342d2d8e7e9 Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:18:22 2009 -0800 ARM: minor armv4/armv5 cleanup Lines of 300+ characters are still bad; debug tweaks. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 7e5bb0a..b5e33ff 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -390,6 +390,10 @@ void arm_set_cpsr(struct arm *arm, uint32_t cpsr) state = ARMV4_5_STATE_ARM; } arm->core_state = state; + + LOG_DEBUG("set CPSR %#8.8x: %s mode, %s state", (unsigned) cpsr, + arm_mode_name(mode), + armv4_5_state_strings[arm->core_state]); } /** @@ -875,7 +879,13 @@ static int armv4_5_run_algorithm_completion(struct target *target, uint32_t exit return ERROR_OK; } -int armv4_5_run_algorithm_inner(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target *target, uint32_t exit_point, int timeout_ms, void *arch_info)) +int armv4_5_run_algorithm_inner(struct target *target, + int num_mem_params, struct mem_param *mem_params, + int num_reg_params, struct reg_param *reg_params, + uint32_t entry_point, uint32_t exit_point, + int timeout_ms, void *arch_info, + int (*run_it)(struct target *target, uint32_t exit_point, + int timeout_ms, void *arch_info)) { struct arm *armv4_5 = target_to_armv4_5(target); struct armv4_5_algorithm *armv4_5_algorithm_info = arch_info; @@ -885,6 +895,7 @@ int armv4_5_run_algorithm_inner(struct target *target, int num_mem_params, struc int exit_breakpoint_size = 0; int i; int retval = ERROR_OK; + LOG_DEBUG("Running algorithm"); if (armv4_5_algorithm_info->common_magic != ARMV4_5_COMMON_MAGIC) commit 21378f58b604453262ac6f3cbf3d6b94b50251cf Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:14:45 2009 -0800 ARM: comment tweaks in ADIv5 "OptimoDE DESS" is ARM's semicustom DSPish stuff. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 3d0b8f8..72408e1 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1007,12 +1007,15 @@ int ahbap_debugport_init(struct swjdp_common *swjdp) return ERROR_OK; } -/* CID interpretation -- see ARM IHI 0029B section 3 */ +/* CID interpretation -- see ARM IHI 0029B section 3 + * and ARM IHI 0031A table 13-3. + */ static const char *class_description[16] ={ "Reserved", "ROM table", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "Reserved", "CoreSight component", "Reserved", "Peripheral Test Block", - "Reserved", "DESS", "Generic IP component", "PrimeCell or System component" + "Reserved", "OptimoDE DESS", + "Generic IP component", "PrimeCell or System component" }; static bool commit 5d244b85e25e97768e66ec86f23ca58f6ab6c08b Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:11:26 2009 -0800 ARM7/9: shrink run_algorithm_inner() lines 300+ characters is unreasonable. So is half that. Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index c4775e8..f7b8669 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2659,7 +2659,13 @@ static const uint32_t dcc_code[] = 0xeafffff9 /* b w */ }; -int armv4_5_run_algorithm_inner(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info, int (*run_it)(struct target *target, uint32_t exit_point, int timeout_ms, void *arch_info)); +extern int armv4_5_run_algorithm_inner(struct target *target, + int num_mem_params, struct mem_param *mem_params, + int num_reg_params, struct reg_param *reg_params, + uint32_t entry_point, uint32_t exit_point, + int timeout_ms, void *arch_info, + int (*run_it)(struct target *target, uint32_t exit_point, + int timeout_ms, void *arch_info)); int arm7_9_bulk_write_memory(struct target *target, uint32_t address, uint32_t count, uint8_t *buffer) { @@ -2709,7 +2715,9 @@ int arm7_9_bulk_write_memory(struct target *target, uint32_t address, uint32_t c dcc_count = count; dcc_buffer = buffer; retval = armv4_5_run_algorithm_inner(target, 0, NULL, 1, reg_params, - arm7_9->dcc_working_area->address, arm7_9->dcc_working_area->address + 6*4, 20*1000, &armv4_5_info, arm7_9_dcc_completion); + arm7_9->dcc_working_area->address, + arm7_9->dcc_working_area->address + 6*4, + 20*1000, &armv4_5_info, arm7_9_dcc_completion); if (retval == ERROR_OK) { commit 83568b6b62b3508f10aa3a51fe4ae86421ec5d27 Author: David Brownell <dbr...@us...> Date: Wed Nov 25 16:05:35 2009 -0800 NEWS updates Signed-off-by: David Brownell <dbr...@us...> diff --git a/NEWS b/NEWS index a0bf43c..c5811bc 100644 --- a/NEWS +++ b/NEWS @@ -10,10 +10,20 @@ Boundary Scan: Target Layer: ARM - renamed "armv4_5" command prefix as "arm" + - recognize TrustZone "Secure Monitor" mode + - "arm regs" command output changed + - register names use "sp" not "r13" ARM11 - Preliminary ETM and ETB hookup - accelerated "flash erase_check" - accelerated GDB memory checksum + - support "arm regs" command + - can access all core modes and registers + Cortex-A8 + - support "arm regs" command + - can access all core modes and registers + Cortex-M3 + - Exposed DWT registers like cycle counter Flash Layer: 'flash bank' and 'nand device' take <bank_name> as first argument. ----------------------------------------------------------------------- Summary of changes: NEWS | 10 ++++++++ src/server/gdb_server.c | 10 ++++---- src/target/arm7_9_common.c | 12 ++++++++- src/target/arm_adi_v5.c | 7 ++++- src/target/armv4_5.c | 13 ++++++++++- src/target/breakpoints.c | 8 +++++- src/target/embeddedice.c | 4 +- src/target/etm.c | 3 +- src/target/target.c | 51 +++++++++++++++++++++++++------------------- src/target/target.h | 11 +++++++- src/target/target_type.h | 2 +- tcl/target/omap3530.cfg | 3 ++ 12 files changed, 94 insertions(+), 40 deletions(-) hooks/post-receive -- Main OpenOCD repository |