* - 213x
* - 214x
* - 2101|2|3
+ * - 2364|6|8
+ * - 2378
*/
int lpc2000_register_commands(struct command_context_s *cmd_ctx);
case 256 * 1024:
num_sectors = 15;
break;
+ case 512 * 1024:
case 500 * 1024:
num_sectors = 27;
break;
#include "jtag.h"
+#if 1
+#define _DEBUG_GW16012_IO_
+#endif
+
/* system includes */
/* system includes */
{
value = (value & 0x7f) | gw16012_msb;
gw16012_msb ^= 0x80; /* toggle MSB */
+
+#ifdef _DEBUG_GW16012_IO_
+ DEBUG("%2.2x", value);
+#endif
#if PARPORT_USE_PPDEV == 1
ioctl(device_handle, PPWDATA, &value);
{
gw16012_control_value = value;
+#ifdef _DEBUG_GW16012_IO_
+ DEBUG("%2.2x", gw16012_control_value);
+#endif
+
#if PARPORT_USE_PPDEV == 1
ioctl(device_handle, PPWCONTROL, &gw16012_control_value);
#else
#else
*value = inb(gw16012_port + 1);
#endif
+
+#ifdef _DEBUG_GW16012_IO_
+ DEBUG("%2.2x", *value);
+#endif
}
/* (1) assert or (0) deassert reset lines */
cur_state = end_state;
}
+void gw16012_path_move(pathmove_command_t *cmd)
+{
+ int num_states = cmd->num_states;
+ int state_count;
+
+ state_count = 0;
+ while (num_states)
+ {
+ gw16012_control(0x0); /* single-bit mode */
+ if (tap_transitions[cur_state].low == cmd->path[state_count])
+ {
+ gw16012_data(0x0); /* TCK cycle with TMS low */
+ }
+ else if (tap_transitions[cur_state].high == cmd->path[state_count])
+ {
+ gw16012_data(0x2); /* TCK cycle with TMS high */
+ }
+ else
+ {
+ ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_strings[cur_state], tap_state_strings[cmd->path[state_count]]);
+ exit(-1);
+ }
+
+ cur_state = cmd->path[state_count];
+ state_count++;
+ num_states--;
+ }
+
+ end_state = cur_state;
+}
+
void gw16012_runtest(int num_cycles)
{
enum tap_state saved_end_state = end_state;
gw16012_end_state(cmd->cmd.statemove->end_state);
gw16012_state_move();
break;
+ case JTAG_PATHMOVE:
+#ifdef _DEBUG_JTAG_IO_
+ DEBUG("pathmove: %i states, end in %i", cmd->cmd.pathmove->num_states, cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]);
+#endif
+ gw16012_path_move(cmd->cmd.pathmove);
+ break;
case JTAG_SCAN:
if (cmd->cmd.scan->end_state != -1)
gw16012_end_state(cmd->cmd.scan->end_state);
{TAP_SDS, TAP_RTI} /* UI */
};
+char* jtag_event_strings[] =
+{
+ "SRST asserted",
+ "TRST asserted",
+ "SRST released",
+ "TRST released"
+};
+
enum tap_state end_state = TAP_TLR;
enum tap_state cur_state = TAP_TLR;
int jtag_trst = 0;
int jtag_speed = -1;
/* forward declarations */
+int jtag_add_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
+int jtag_add_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
+int jtag_add_plain_ir_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
+int jtag_add_plain_dr_scan(int num_fields, scan_field_t *fields, enum tap_state endstate);
+int jtag_add_statemove(enum tap_state endstate);
+int jtag_add_pathmove(int num_states, enum tap_state *path);
+int jtag_add_runtest(int num_cycles, enum tap_state endstate);
+int jtag_add_reset(int trst, int srst);
+int jtag_add_end_state(enum tap_state endstate);
+int jtag_add_sleep(u32 us);
+int jtag_execute_queue(void);
+int jtag_cancel_queue(void);
/* jtag commands */
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
{
jtag_event_callback_t *callback = jtag_event_callbacks;
- DEBUG("jtag event: %i", event);
+ DEBUG("jtag event: %s", jtag_event_strings[event]);
while (callback)
{
int i;
int bit_count;
int device_count = 0;
- u8 valid = 0x0;
+ u8 zero_check = 0x0;
+ u8 one_check = 0xff;
field.device = 0;
field.num_bits = sizeof(idcode_buffer) * 8;
for (i = 0; i < JTAG_MAX_CHAIN_SIZE * 4; i++)
{
- valid |= idcode_buffer[i];
+ zero_check |= idcode_buffer[i];
+ one_check &= idcode_buffer[i];
}
- /* if there wasn't a single non-zero bit, the scan isn't valid */
- if (!valid)
+ /* if there wasn't a single non-zero bit or if all bits were one, the scan isn't valid */
+ if ((zero_check == 0x00) || (one_check == 0xff))
{
ERROR("JTAG communication failure, check connection, JTAG interface, target power etc.");
exit(-1);
#include "command.h"
-#if 0
+#if 1
#define _DEBUG_JTAG_IO_
#endif
JTAG_TRST_RELEASED,
};
+extern char* jtag_event_strings[];
+
extern int jtag_trst;
extern int jtag_srst;
{ "dlc5", 0x10, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x10 },
{ "triton", 0x80, 0x08, 0x04, 0x01, 0x02, 0x00, 0x00, 0x80, 0x00 },
{ "lattice", 0x40, 0x10, 0x04, 0x02, 0x01, 0x08, 0x00, 0x00, 0x18 },
- { "flashlink", 0x20, 0x10, 0x02, 0x01, 0x04, 0x20,0x30, 0x20, 0x00 },
+ { "flashlink", 0x20, 0x10, 0x02, 0x01, 0x04, 0x20, 0x30, 0x20, 0x00 },
{ NULL, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
};
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#define OPENOCD_VERSION "Open On-Chip Debugger (2006-01-26 13:30 CET)"
+#define OPENOCD_VERSION "Open On-Chip Debugger (2007-01-31 12:00 CET)"
#ifdef HAVE_CONFIG_H
#include "config.h"