diff -Ncr before/src/jtag/drivers/ft2232.c after/src/jtag/drivers/ft2232.c *** before/src/jtag/drivers/ft2232.c 2011-08-09 00:34:19.000000000 -0500 --- after/src/jtag/drivers/ft2232.c 2011-08-15 06:30:57.895053070 -0500 *************** *** 177,182 **** --- 177,184 ---- static int icdi_jtag_init(void); static int olimex_jtag_init(void); static int flyswatter_init(void); + static int flyswatter2_init(void); + static int flyswatter3_init(void); static int minimodule_init(void); static int turtle_init(void); static int comstick_init(void); *************** *** 198,203 **** --- 200,207 ---- static void jtagkey_reset(int trst, int srst); static void olimex_jtag_reset(int trst, int srst); static void flyswatter_reset(int trst, int srst); + static void flyswatter2_reset(int trst, int srst); + static void flyswatter3_reset(int trst, int srst); static void minimodule_reset(int trst, int srst); static void turtle_reset(int trst, int srst); static void comstick_reset(int trst, int srst); *************** *** 213,218 **** --- 217,224 ---- /* blink procedures for layouts that support a blinking led */ static void olimex_jtag_blink(void); static void flyswatter_jtag_blink(void); + static void flyswatter2_jtag_blink(void); + static void flyswatter3_jtag_blink(void); static void turtle_jtag_blink(void); static void signalyzer_h_blink(void); static void ktlink_blink(void); *************** *** 263,268 **** --- 269,284 ---- .reset = flyswatter_reset, .blink = flyswatter_jtag_blink }, + { .name = "flyswatter2", + .init = flyswatter2_init, + .reset = flyswatter2_reset, + .blink = flyswatter2_jtag_blink + }, + { .name = "flyswatter3", + .init = flyswatter3_init, + .reset = flyswatter3_reset, + .blink = flyswatter3_jtag_blink + }, { .name = "minimodule", .init = minimodule_init, .reset = minimodule_reset, *************** *** 1571,1576 **** --- 1587,1624 ---- LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction); } + static void flyswatter2_reset(int trst, int srst) + { + if (trst == 1) + { + low_output &= ~nTRST; + } + else if (trst == 0) + { + low_output |= nTRST; + } + + if (srst == 1) + { + low_output &= ~nSRST; + } + else if (srst == 0) + { + low_output |= nSRST; + } + + /* command "set data bits low byte" */ + buffer_write(0x80); + buffer_write(low_output); + buffer_write(low_direction); + LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction); + } + + static void flyswatter3_reset(int trst, int srst) + { + flyswatter2_reset(trst, srst); + } + static void minimodule_reset(int trst, int srst) { if (srst == 1) *************** *** 2936,2941 **** --- 2984,3076 ---- return ERROR_OK; } + static int flyswatter2_init(void) + { + uint8_t buf[3]; + uint32_t bytes_written; + + low_output = 0x18; + low_direction = 0x7b; + + /* initialize low byte for jtag */ + buf[0] = 0x80; /* command "set data bits low byte" */ + buf[1] = low_output; /* value (TMS = 1,TCK = 0, TDI = 0, nOE = 0) */ + buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE[12]=out, n[ST]srst = out */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'flyswatter2' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + nTRST = 0x10; + nTRSTnOE = 0x0; /* not output enable for nTRST */ + nSRST = 0x20; + nSRSTnOE = 0x00; /* no output enable for nSRST */ + + high_output = 0x00; + high_direction = 0x01; + + /* initialize high port */ + buf[0] = 0x82; /* command "set data bits high byte" */ + buf[1] = high_output; /* value */ + buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'flyswatter2' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + return ERROR_OK; + } + + //flyswatter3_init is currently identical to flyswatter2_init except for the error messages + static int flyswatter3_init(void) + { + uint8_t buf[3]; + uint32_t bytes_written; + + low_output = 0x18; + low_direction = 0x7b; + + /* initialize low byte for jtag */ + buf[0] = 0x80; /* command "set data bits low byte" */ + buf[1] = low_output; /* value (TMS = 1,TCK = 0, TDI = 0, nOE = 0) */ + buf[2] = low_direction; /* dir (output = 1), TCK/TDI/TMS = out, TDO = in, nOE[12]=out, n[ST]srst = out */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'flyswatter2' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + nTRST = 0x10; + nTRSTnOE = 0x0; /* not output enable for nTRST */ + nSRST = 0x20; + nSRSTnOE = 0x00; /* no output enable for nSRST */ + + high_output = 0x00; + high_direction = 0x01; + + /* initialize high port */ + buf[0] = 0x82; /* command "set data bits high byte" */ + buf[1] = high_output; /* value */ + buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'flyswatter2' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + return ERROR_OK; + } + static int minimodule_init(void) { low_output = 0x18;//check if srst should be 1 or 0 initially. (0x08) (flyswatter was 0x18) *************** *** 3230,3235 **** --- 3365,3387 ---- buffer_write(high_direction); } + static void flyswatter2_jtag_blink(void) + { + /* + * Flyswatter2 only has one LED connected to ACBUS2 + */ + high_output ^= 0x04; + + buffer_write(0x82); + buffer_write(high_output); + buffer_write(high_direction); + } + + static void flyswatter3_jtag_blink(void) + { + flyswatter2_jtag_blink(); + } + static void turtle_jtag_blink(void) { /* diff -Ncr before/tcl/board/hammer.cfg after/tcl/board/hammer.cfg *** before/tcl/board/hammer.cfg 2011-08-09 00:43:40.000000000 -0500 --- after/tcl/board/hammer.cfg 2011-08-15 07:56:15.080721335 -0500 *************** *** 1,6 **** --- 1,7 ---- # Target Configuration for the TinCanTools S3C2410 Based Hammer Module # http://www.tincantools.com + set CPUTAPID 0x0032409d source [find target/samsung_s3c2410.cfg] $_TARGETNAME configure -event reset-init { diff -Ncr before/tcl/board/olimex_pic32mx.cfg after/tcl/board/olimex_pic32mx.cfg *** before/tcl/board/olimex_pic32mx.cfg 1969-12-31 18:00:00.000000000 -0600 --- after/tcl/board/olimex_pic32mx.cfg 2011-08-07 04:43:51.000000000 -0500 *************** *** 0 **** --- 1,10 ---- + # Configuration for the Olimex PIC-32MX development board + # Config file supplied by TinCanTools + # http://www.tincantools.com + + jtag_khz 15000 + set CPUTAPID 0x50916053 + source [find target/pic32mx.cfg] + + + diff -Ncr before/tcl/interface/flyswatter2.cfg after/tcl/interface/flyswatter2.cfg *** before/tcl/interface/flyswatter2.cfg 1969-12-31 18:00:00.000000000 -0600 --- after/tcl/interface/flyswatter2.cfg 2011-08-07 04:39:05.082036568 -0500 *************** *** 0 **** --- 1,11 ---- + # + # TinCanTools Flyswatter + # + # http://www.tincantools.com/product.php?productid=16134 + # + + interface ft2232 + ft2232_device_desc "Flyswatter2" + ft2232_layout "flyswatter2" + ft2232_vid_pid 0x0403 0x6010 + jtag_khz 15000 diff -Ncr before/tcl/interface/flyswatter3.cfg after/tcl/interface/flyswatter3.cfg *** before/tcl/interface/flyswatter3.cfg 1969-12-31 18:00:00.000000000 -0600 --- after/tcl/interface/flyswatter3.cfg 2011-08-07 04:43:27.368739177 -0500 *************** *** 0 **** --- 1,8 ---- + # TinCanTools Flyswatter3 + # http://www.tincantools.com + + interface ft2232 + ft2232_device_desc "Flyswatter3" + ft2232_layout "flyswatter3" + ft2232_vid_pid 0x0403 0x6010 + jtag_khz 30000 diff -Ncr before/tcl/interface/flyswatter.cfg after/tcl/interface/flyswatter.cfg *** before/tcl/interface/flyswatter.cfg 2010-02-21 14:40:58.000000000 -0600 --- after/tcl/interface/flyswatter.cfg 2011-08-15 05:42:43.931435120 -0500 *************** *** 8,10 **** --- 8,11 ---- ft2232_device_desc "Flyswatter" ft2232_layout "flyswatter" ft2232_vid_pid 0x0403 0x6010 + jtag_khz 6000