From e8af4de0a7d224e1aa28e72f0de1ddf0bec5beb8 Mon Sep 17 00:00:00 2001 From: ntfreak Date: Thu, 10 May 2007 14:42:23 +0000 Subject: [PATCH] -- corrected embedded ice definitions -- changed arm966e to use standard arm9_7 reset handling git-svn-id: svn://svn.berlios.de/openocd/trunk@146 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/jtag/ft2232.c | 2 +- src/target/arm720t.c | 2 +- src/target/arm7_9_common.c | 2 +- src/target/arm920t.c | 2 +- src/target/arm926ejs.c | 2 +- src/target/arm966e.c | 79 ++------------------------------------ 6 files changed, 8 insertions(+), 81 deletions(-) diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index 858a6c1b..a6dbadc6 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -272,7 +272,7 @@ int ft2232_register_commands(struct command_context_s *cmd_ctx) return ERROR_OK; } -void ft2232_end_state(state) +void ft2232_end_state(enum tap_state state) { if (tap_move_map[state] != -1) end_state = state; diff --git a/src/target/arm720t.c b/src/target/arm720t.c index 1fa5ef11..a3c40d6f 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -372,7 +372,7 @@ int arm720t_soft_reset_halt(struct target_s *target) target->type->halt(target); } - while (buf_get_u32(dbg_stat->value, EICE_DBG_CONTROL_DBGACK, 1) == 0) + while (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { embeddedice_read_reg(dbg_stat); jtag_execute_queue(); diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index d28aca59..2c82c91e 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -785,7 +785,7 @@ int arm7_9_soft_reset_halt(struct target_s *target) target->type->halt(target); } - while (buf_get_u32(dbg_stat->value, EICE_DBG_CONTROL_DBGACK, 1) == 0) + while (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { embeddedice_read_reg(dbg_stat); jtag_execute_queue(); diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 805624ee..1bcca0ad 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -626,7 +626,7 @@ int arm920t_soft_reset_halt(struct target_s *target) target->type->halt(target); } - while (buf_get_u32(dbg_stat->value, EICE_DBG_CONTROL_DBGACK, 1) == 0) + while (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { embeddedice_read_reg(dbg_stat); jtag_execute_queue(); diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 4d43c17a..89fbfae3 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -566,7 +566,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target) target->type->halt(target); } - while (buf_get_u32(dbg_stat->value, EICE_DBG_CONTROL_DBGACK, 1) == 0) + while (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { embeddedice_read_reg(dbg_stat); jtag_execute_queue(); diff --git a/src/target/arm966e.c b/src/target/arm966e.c index 01d01d75..616fb946 100644 --- a/src/target/arm966e.c +++ b/src/target/arm966e.c @@ -43,8 +43,6 @@ int arm966e_register_commands(struct command_context_s *cmd_ctx); /* forward declarations */ -int arm966e_deassert_reset(target_t *target); -int arm966e_assert_reset(target_t *target); int arm966e_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target); int arm966e_init_target(struct command_context_s *cmd_ctx, struct target_s *target); int arm966e_quit(void); @@ -60,8 +58,8 @@ target_type_t arm966e_target = .resume = arm7_9_resume, .step = arm7_9_step, - .assert_reset = arm966e_assert_reset, - .deassert_reset = arm966e_deassert_reset, + .assert_reset = arm7_9_assert_reset, + .deassert_reset = arm7_9_deassert_reset, .soft_reset_halt = arm7_9_soft_reset_halt, .prepare_reset_halt = arm7_9_prepare_reset_halt, @@ -84,77 +82,6 @@ target_type_t arm966e_target = .quit = arm966e_quit, }; -int arm966e_assert_reset(target_t *target) -{ - int retval; - - DEBUG("target->state: %s", target_state_strings[target->state]); - - if (target->state == TARGET_HALTED || target->state == TARGET_UNKNOWN) - { - /* assert SRST and TRST */ - /* system would get ouf sync if we didn't reset test-logic, too */ - if ((retval = jtag_add_reset(1, 1)) != ERROR_OK) - { - if (retval == ERROR_JTAG_RESET_CANT_SRST) - { - WARNING("can't assert srst"); - return retval; - } - else - { - ERROR("unknown error"); - exit(-1); - } - } - jtag_add_sleep(5000); - if ((retval = jtag_add_reset(0, 1)) != ERROR_OK) - { - if (retval == ERROR_JTAG_RESET_WOULD_ASSERT_TRST) - { - WARNING("srst resets test logic, too"); - retval = jtag_add_reset(1, 1); - } - } - } - else - { - if ((retval = jtag_add_reset(0, 1)) != ERROR_OK) - { - if (retval == ERROR_JTAG_RESET_WOULD_ASSERT_TRST) - { - WARNING("srst resets test logic, too"); - retval = jtag_add_reset(1, 1); - } - - if (retval == ERROR_JTAG_RESET_CANT_SRST) - { - WARNING("can't assert srst"); - return retval; - } - else if (retval != ERROR_OK) - { - ERROR("unknown error"); - exit(-1); - } - } - } - - target->state = TARGET_RESET; - jtag_add_sleep(50000); - - armv4_5_invalidate_core_regs(target); - - return ERROR_OK; -} - -int arm966e_deassert_reset(target_t *target) -{ - arm7_9_deassert_reset( target ); - - return ERROR_OK; -} - int arm966e_init_target(struct command_context_s *cmd_ctx, struct target_s *target) { arm9tdmi_init_target(cmd_ctx, target); @@ -413,7 +340,7 @@ int arm966e_register_commands(struct command_context_s *cmd_ctx) int retval; command_t *arm966e_cmd; - retval = arm7_9_register_commands(cmd_ctx); + retval = arm9tdmi_register_commands(cmd_ctx); arm966e_cmd = register_command(cmd_ctx, NULL, "arm966e", NULL, COMMAND_ANY, "arm966e specific commands"); register_command(cmd_ctx, arm966e_cmd, "cp15", arm966e_handle_cp15_command, COMMAND_EXEC, "display/modify cp15 register [value]"); -- 2.39.5