From: Øyvind H. <go...@us...> - 2010-01-13 12:16:55
|
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 b8e930e3bfc78f4a0582edb8b7cec44b5c9f4cad (commit) via ee519ab3562870aa5bb1bc79f3c24cb3b3074d65 (commit) via dc793455e9a04be556b0b25eb1513ecbb7be3f51 (commit) from 3e33393078105f25ebd591b5b76c7c1501ff41d5 (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 b8e930e3bfc78f4a0582edb8b7cec44b5c9f4cad Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jan 11 15:30:22 2010 +0100 arm7/9: enable check that DCC downloads have been enabled Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 2f51699..a5dde2c 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -578,4 +578,5 @@ struct target_type arm720t_target = .target_create = arm720t_target_create, .init_target = arm720t_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index a5a0f80..0f8f263 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2732,6 +2732,8 @@ int arm7_9_check_reset(struct target *target) { LOG_WARNING("NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'."); } + + return ERROR_OK; } COMMAND_HANDLER(handle_arm7_9_dbgrq_command) diff --git a/src/target/arm7tdmi.c b/src/target/arm7tdmi.c index d576d07..16f16b0 100644 --- a/src/target/arm7tdmi.c +++ b/src/target/arm7tdmi.c @@ -752,4 +752,5 @@ struct target_type arm7tdmi_target = .target_create = arm7tdmi_target_create, .init_target = arm7tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 29eb62d..e0b1c70 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -1476,4 +1476,5 @@ struct target_type arm920t_target = .target_create = arm920t_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index e099919..32ecf72 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -815,6 +815,7 @@ struct target_type arm926ejs_target = .target_create = arm926ejs_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, .virt2phys = arm926ejs_virt2phys, .mmu = arm926ejs_mmu, diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 86af0f6..2f5e390 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -294,4 +294,5 @@ struct target_type arm966e_target = .target_create = arm966e_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c index 823e962..761e7cf 100644 --- a/src/target/arm9tdmi.c +++ b/src/target/arm9tdmi.c @@ -975,4 +975,5 @@ struct target_type arm9tdmi_target = .target_create = arm9tdmi_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; diff --git a/src/target/fa526.c b/src/target/fa526.c index 7c6cae6..b6149e3 100644 --- a/src/target/fa526.c +++ b/src/target/fa526.c @@ -390,4 +390,5 @@ struct target_type fa526_target = .target_create = fa526_target_create, .init_target = arm9tdmi_init_target, .examine = arm7_9_examine, + .check_reset = arm7_9_check_reset, }; commit ee519ab3562870aa5bb1bc79f3c24cb3b3074d65 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jan 11 15:29:09 2010 +0100 arm7/9: add fn to check if dcc downloads have been enabled DCC downloads should be enabled for any self repecting openocd config file for arm7/9. Print out note about it otherwise. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 2f4c408..a5a0f80 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dom...@gm... * * * - * Copyright (C) 2007,2008 Ãyvind Harboe * + * Copyright (C) 2007-2009 Ãyvind Harboe * * oyv...@zy... * * * * Copyright (C) 2008 by Spencer Oliver * @@ -2723,6 +2723,17 @@ int arm7_9_examine(struct target *target) return retval; } + +int arm7_9_check_reset(struct target *target) +{ + struct arm7_9_common *arm7_9 = target_to_arm7_9(target); + + if (get_target_reset_nag() && !arm7_9->dcc_downloads) + { + LOG_WARNING("NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'."); + } +} + COMMAND_HANDLER(handle_arm7_9_dbgrq_command) { struct target *target = get_current_target(CMD_CTX); diff --git a/src/target/arm7_9_common.h b/src/target/arm7_9_common.h index 021238e..93bee07 100644 --- a/src/target/arm7_9_common.h +++ b/src/target/arm7_9_common.h @@ -157,5 +157,6 @@ int arm7_9_execute_sys_speed(struct target *target); int arm7_9_init_arch_info(struct target *target, struct arm7_9_common *arm7_9); int arm7_9_examine(struct target *target); +int arm7_9_check_reset(struct target *target); #endif /* ARM7_9_COMMON_H */ commit dc793455e9a04be556b0b25eb1513ecbb7be3f51 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Jan 11 15:28:18 2010 +0100 target: add check_reset hook Allow targets to run checks post reset. Used to check that e.g. DCC downloads have been enabled. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/target.c b/src/target/target.c index 7994aff..c56265c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -477,6 +477,11 @@ int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode /* We want any events to be processed before the prompt */ retval = target_call_timer_callbacks_now(); + struct target *target; + for (target = all_targets; target; target = target->next) { + target->type->check_reset(target); + } + return retval; } @@ -499,6 +504,12 @@ static int default_examine(struct target *target) return ERROR_OK; } +/* no check by default */ +static int default_check_reset(struct target *target) +{ + return ERROR_OK; +} + int target_examine_one(struct target *target) { return target->type->examine(target); @@ -708,6 +719,9 @@ static int target_init_one(struct command_context *cmd_ctx, if (type->examine == NULL) type->examine = default_examine; + if (type->check_reset== NULL) + type->check_reset = default_check_reset; + int retval = type->init_target(cmd_ctx, target); if (ERROR_OK != retval) { @@ -4887,6 +4901,20 @@ int target_register_commands(struct command_context *cmd_ctx) return register_commands(cmd_ctx, NULL, target_command_handlers); } +static bool target_reset_nag = true; + +bool get_target_reset_nag(void) +{ + return target_reset_nag; +} + +COMMAND_HANDLER(handle_target_reset_nag) +{ + return CALL_COMMAND_HANDLER(handle_command_parse_bool, + &target_reset_nag, "Nag after each reset about options to improve " + "performance"); +} + static const struct command_registration target_exec_command_handlers[] = { { .name = "fast_load_image", @@ -5088,6 +5116,14 @@ static const struct command_registration target_exec_command_handlers[] = { "and write the 8/16/32 bit values", .usage = "arrayname bitwidth address count", }, + { + .name = "reset_nag", + .handler = handle_target_reset_nag, + .mode = COMMAND_ANY, + .help = "Nag after each reset about options that could have been " + "enabled to improve performance. ", + .usage = "['enable'|'disable']", + }, COMMAND_REGISTRATION_DONE }; int target_register_user_commands(struct command_context *cmd_ctx) diff --git a/src/target/target.h b/src/target/target.h index 4151c22..da91d46 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dom...@gm... * * * - * Copyright (C) 2007,2008,2009 Ãyvind Harboe * + * Copyright (C) 2007-9 Ãyvind Harboe * * oyv...@zy... * * * * Copyright (C) 2008 by Spencer Oliver * @@ -483,4 +483,6 @@ void target_all_handle_event(enum target_event e); const char *target_strerror_safe(int err); +extern bool get_target_reset_nag(void); + #endif /* TARGET_H */ diff --git a/src/target/target_type.h b/src/target/target_type.h index 67041b3..70eb962 100644 --- a/src/target/target_type.h +++ b/src/target/target_type.h @@ -213,6 +213,13 @@ struct target_type int (*mmu)(struct target *target, int *enabled); + /* after reset is complete, the target can check if things are properly set up. + * + * This can be used to check if e.g. DCC memory writes have been enabled for + * arm7/9 targets, which they really should except in the most contrived + * circumstances. + */ + int (*check_reset)(struct target *target); }; #endif // TARGET_TYPE_H ----------------------------------------------------------------------- Summary of changes: src/target/arm720t.c | 1 + src/target/arm7_9_common.c | 15 ++++++++++++++- src/target/arm7_9_common.h | 1 + src/target/arm7tdmi.c | 1 + src/target/arm920t.c | 1 + src/target/arm926ejs.c | 1 + src/target/arm966e.c | 1 + src/target/arm9tdmi.c | 1 + src/target/fa526.c | 1 + src/target/target.c | 36 ++++++++++++++++++++++++++++++++++++ src/target/target.h | 4 +++- src/target/target_type.h | 7 +++++++ 12 files changed, 68 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |