diff -NBur src/jtag/drivers/ft2232.c src/jtag/drivers/ft2232.c --- src/jtag/drivers/ft2232.c 2011-06-20 04:17:52.080078200 -0500 +++ src/jtag/drivers/ft2232.c 2011-06-20 04:26:28.521484400 -0500 @@ -177,6 +177,7 @@ static int icdi_jtag_init(void); static int olimex_jtag_init(void); static int flyswatter_init(void); +static int flyswatter2_init(void); static int minimodule_init(void); static int turtle_init(void); static int comstick_init(void); @@ -213,6 +214,7 @@ /* 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 turtle_jtag_blink(void); static void signalyzer_h_blink(void); static void ktlink_blink(void); @@ -263,6 +265,11 @@ .reset = flyswatter_reset, .blink = flyswatter_jtag_blink }, + { .name = "flyswatter2", + .init = flyswatter2_init, + .reset = flyswatter_reset, + .blink = flyswatter2_jtag_blink + }, { .name = "minimodule", .init = minimodule_init, .reset = minimodule_reset, @@ -2924,6 +2931,38 @@ return ERROR_OK; } +static int flyswatter2_init(void) +{ + low_output = 0x18; + low_direction = 0x7b; + + + /* initialize low byte for jtag */ + + if (ft2232_set_data_bits_low_byte(low_output,low_direction) != ERROR_OK) + { + 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 byte for jtag */ + if (ft2232_set_data_bits_high_byte(high_output,high_direction) != ERROR_OK) + { + 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) @@ -3215,6 +3254,18 @@ buffer_write(0x82); buffer_write(high_output); + 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); } diff -NBur tcl/interface/flyswatter.cfg tcl/interface/flyswatter.cfg --- tcl/interface/flyswatter.cfg 2011-06-20 04:17:52.945312500 -0500 +++ tcl/interface/flyswatter.cfg 2011-06-20 04:27:31.732421900 -0500 @@ -8,3 +8,4 @@ ft2232_device_desc "Flyswatter" ft2232_layout "flyswatter" ft2232_vid_pid 0x0403 0x6010 +adapter_khz 6000 \ No newline at end of file diff -NBur tcl/interface/flyswatter2.cfg tcl/interface/flyswatter2.cfg --- tcl/interface/flyswatter2.cfg 1969-12-31 18:00:00.000000000 -0600 +++ tcl/interface/flyswatter2.cfg 2011-06-11 17:59:03.671875000 -0500 @@ -0,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 +adapter_khz 15000