From: Øyvind H. <go...@us...> - 2010-03-01 13:34:13
|
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 afbf92766348a32a700d62a29b9a6c92537b9271 (commit) via 761d4555b8f8c8eb2b899dee16584656a43b6444 (commit) from 409e23e39b955d92c8e879143d2b979b7de799e9 (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 afbf92766348a32a700d62a29b9a6c92537b9271 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Mar 1 08:25:57 2010 +0100 zy1000: add jtag_add_tms_seq support Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index e21104c..b730b72 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2007-2009 by Ãyvind Harboe * + * Copyright (C) 2007-2010 by Ãyvind Harboe * * * * 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 * @@ -763,18 +763,52 @@ int interface_jtag_add_sleep(uint32_t us) return ERROR_OK; } +int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state) +{ + /*wait for the fifo to be empty*/ + waitIdle(); + + for (unsigned i = 0; i < num_bits; i++) + { + int tms; + + if (((seq[i/8] >> (i % 8)) & 1) == 0) + { + tms = 0; + } + else + { + tms = 1; + } + + waitIdle(); + ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, tms); + } + + waitIdle(); + if (state != TAP_INVALID) + { + ZY1000_POKE(ZY1000_JTAG_BASE + 0x20, state); + } else + { + /* this would be normal if we are switching to SWD mode */ + } + return ERROR_OK; +} + int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) { int state_count; int tms = 0; - /*wait for the fifo to be empty*/ - waitIdle(); - state_count = 0; tap_state_t cur_state = cmd_queue_cur_state; + uint8_t seq[16]; + memset(seq, 0, sizeof(seq)); + assert(num_states < (sizeof(seq) * 8)); + while (num_states) { if (tap_state_transition(cur_state, false) == path[state_count]) @@ -791,28 +825,14 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) exit(-1); } - waitIdle(); - ZY1000_POKE(ZY1000_JTAG_BASE + 0x28, tms); + seq[state_count/8] = seq[state_count/8] | (tms << (state_count % 8)); cur_state = path[state_count]; state_count++; num_states--; } - waitIdle(); - ZY1000_POKE(ZY1000_JTAG_BASE + 0x20, cur_state); - return ERROR_OK; -} - -int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq) -{ - /* FIXME just implement this, like pathmove but without - * JTAG-specific state transition checking. Then update - * zy1000_interface to report that it's supported. - * - * Eventually interface_jtag_add_pathmove() could vanish. - */ - return ERROR_JTAG_NOT_IMPLEMENTED; + return interface_add_tms_seq(state_count, seq, cur_state); } void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, uint8_t *buffer, int little, int count) @@ -963,6 +983,7 @@ static const struct command_registration zy1000_commands[] = { struct jtag_interface zy1000_interface = { .name = "ZY1000", + .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = NULL, .speed = zy1000_speed, .commands = zy1000_commands, commit 761d4555b8f8c8eb2b899dee16584656a43b6444 Author: Ãyvind Harboe <oyv...@zy...> Date: Mon Mar 1 08:22:12 2010 +0100 jtag: the post TAP state is now passed to the drivers after clocking out a tms sequence, then the TAP will be in some state. This state is now handed to the drivers. TAP_INVALID is a possible state after a TMS sequence if switching to SWD. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/jtag/core.c b/src/jtag/core.c index 7f417b7..d43bd1c 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -512,7 +512,7 @@ int jtag_add_tms_seq(unsigned nbits, const uint8_t *seq, enum tap_state state) jtag_checks(); cmd_queue_cur_state = state; - retval = interface_add_tms_seq(nbits, seq); + retval = interface_add_tms_seq(nbits, seq, state); jtag_set_error(retval); return retval; } diff --git a/src/jtag/drivers/driver.c b/src/jtag/drivers/driver.c index 14efe96..ca59239 100644 --- a/src/jtag/drivers/driver.c +++ b/src/jtag/drivers/driver.c @@ -388,7 +388,7 @@ int interface_jtag_add_tlr(void) return ERROR_OK; } -int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq) +int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state) { struct jtag_command *cmd; diff --git a/src/jtag/minidriver.h b/src/jtag/minidriver.h index 5caec58..810bb0e 100644 --- a/src/jtag/minidriver.h +++ b/src/jtag/minidriver.h @@ -67,7 +67,8 @@ int interface_jtag_add_tlr(void); int interface_jtag_add_pathmove(int num_states, const tap_state_t* path); int interface_jtag_add_runtest(int num_cycles, tap_state_t endstate); -int interface_add_tms_seq(unsigned num_bits, const uint8_t *bits); +int interface_add_tms_seq(unsigned num_bits, + const uint8_t *bits, enum tap_state state); /** * This drives the actual srst and trst pins. srst will always be 0 diff --git a/src/jtag/minidummy/minidummy.c b/src/jtag/minidummy/minidummy.c index 6410c2d..705f1b4 100644 --- a/src/jtag/minidummy/minidummy.c +++ b/src/jtag/minidummy/minidummy.c @@ -147,7 +147,7 @@ int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) return ERROR_OK; } -int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq) +int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state) { /* synchronously do the operation here */ ----------------------------------------------------------------------- Summary of changes: src/jtag/core.c | 2 +- src/jtag/drivers/driver.c | 2 +- src/jtag/minidriver.h | 3 +- src/jtag/minidummy/minidummy.c | 2 +- src/jtag/zy1000/zy1000.c | 61 +++++++++++++++++++++++++++------------- 5 files changed, 46 insertions(+), 24 deletions(-) hooks/post-receive -- Main OpenOCD repository |