diff -urN urjtag-svn-2039-trunk/urjtag/configure.ac urjtag-svn-2039-trunk-s2/urjtag/configure.ac --- urjtag-svn-2039-trunk/urjtag/configure.ac 2013-05-08 22:17:01.000000000 -0400 +++ urjtag-svn-2039-trunk-s2/urjtag/configure.ac 2013-10-22 20:41:48.046555401 -0400 @@ -612,6 +612,7 @@ bcm1250 blackfin bscoach + dlpc350 ejtag ejtag_dma fjmem diff -urN urjtag-svn-2039-trunk/urjtag/data/toshiba/dlpc350/dlpc350 urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/dlpc350/dlpc350 --- urjtag-svn-2039-trunk/urjtag/data/toshiba/dlpc350/dlpc350 1969-12-31 19:00:00.000000000 -0500 +++ urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/dlpc350/dlpc350 2013-10-23 15:41:18.000000000 -0400 @@ -0,0 +1,422 @@ +# mandatory data registers +register BSR 348 # Boundary Scan Register +register BR 1 # Bypass Register + +# optional data registers +register DIR 32 # Device Identification Register + +instruction length 4 + +# mandatory instructions +instruction EXTEST 0000 BSR +instruction SAMPLE 0010 BSR +instruction BYPASS 1111 BR + +# optional instructions +instruction IDCODE 0001 DIR + +endian little + +signal HEARTBEAT +signal FAULT_STATUS + +signal ADDR_0 +signal ADDR_1 +signal ADDR_2 +signal ADDR_3 +signal ADDR_4 +signal ADDR_5 +signal ADDR_6 +signal ADDR_7 +signal ADDR_8 +signal ADDR_9 +signal ADDR_10 +signal ADDR_11 +signal ADDR_12 +signal ADDR_13 +signal ADDR_14 +signal ADDR_15 +signal ADDR_16 +signal ADDR_17 +signal ADDR_18 +signal ADDR_19 +signal ADDR_20 +signal ADDR_21 +signal DATA_0 +signal DATA_1 +signal DATA_2 +signal DATA_3 +signal DATA_4 +signal DATA_5 +signal DATA_6 +signal DATA_7 +signal DATA_8 +signal DATA_9 +signal DATA_10 +signal DATA_11 +signal DATA_12 +signal DATA_13 +signal DATA_14 +signal DATA_15 +signal CS_N +signal OE_N +signal WE_N + +bit 347 C 1 * +bit 346 C 1 * +bit 345 C 1 * +bit 344 C 1 * +bit 343 C 1 * +bit 342 C 1 * +bit 341 C 1 * +bit 340 C 1 * +bit 339 C 1 * +bit 338 C 1 * +bit 337 C 1 * +bit 336 C 1 * +bit 335 C 1 * +bit 334 C 1 * +bit 333 C 1 * +bit 332 C 1 * +bit 331 C 1 * +bit 330 C 1 * +bit 329 C 1 * +bit 328 C 1 * +bit 327 C 1 * +bit 326 C 1 * +bit 325 C 1 * +bit 324 C 1 * +bit 323 C 1 * +bit 322 C 1 * +bit 321 C 1 * +bit 320 C 1 * +bit 319 C 1 * +bit 318 C 1 * +bit 317 C 1 * +bit 316 C 1 * +bit 315 C 1 * +bit 314 C 1 * +bit 313 C 1 * +bit 312 C 1 * +bit 311 C 1 * +bit 310 C 1 * +bit 309 C 1 * +bit 308 C 1 * +bit 307 C 1 * +bit 306 C 1 * +bit 305 C 1 * +bit 304 C 1 * +bit 303 C 1 * + +bit 302 C 1 * +bit 301 O 1 ADDR_0 302 1 Z +bit 300 C 1 * +bit 299 O 1 ADDR_1 300 1 Z +bit 298 C 1 * +bit 297 O 1 ADDR_2 298 1 Z +bit 296 C 1 * +bit 295 O 1 ADDR_3 296 1 Z +bit 294 C 1 * +bit 293 O 1 ADDR_4 294 1 Z +bit 292 C 1 * +bit 291 O 1 ADDR_5 292 1 Z +bit 290 C 1 * +bit 289 O 1 ADDR_6 290 1 Z +bit 288 C 1 * +bit 287 O 1 ADDR_7 288 1 Z +bit 286 C 1 * +bit 285 O 1 ADDR_8 286 1 Z +bit 284 C 1 * +bit 283 O 1 ADDR_9 284 1 Z +bit 282 C 1 * +bit 281 O 1 ADDR_10 282 1 Z +bit 280 C 1 * +bit 279 O 1 ADDR_11 280 1 Z +bit 278 C 1 * +bit 277 O 1 ADDR_12 278 1 Z +bit 276 C 1 * +bit 275 O 1 ADDR_13 276 1 Z +bit 274 C 1 * +bit 273 O 1 ADDR_14 274 1 Z +bit 272 C 1 * +bit 271 C 1 * +bit 270 O 1 ADDR_15 271 1 Z +bit 269 C 1 * +bit 268 O 1 ADDR_16 269 1 Z +bit 267 C 1 * +bit 266 O 1 ADDR_17 267 1 Z +bit 265 C 1 * +bit 264 O 1 ADDR_18 265 1 Z +bit 263 C 1 * +bit 262 O 1 ADDR_19 263 1 Z +bit 261 C 1 * +bit 260 O 1 ADDR_20 261 1 Z +bit 259 C 1 * +bit 258 B 1 ADDR_21 259 1 Z + +bit 257 C 1 * +bit 256 C 1 * + +bit 255 C 1 * +bit 254 O 1 WE_N 255 1 Z +bit 253 C 1 * +bit 252 O 1 OE_N 253 1 Z + +bit 251 C 1 * +bit 250 C 1 * + +bit 249 C 1 * +bit 248 O 1 CS_N 249 1 Z + +bit 247 C 1 * +bit 246 C 1 * + +bit 245 C 1 * +bit 244 B 1 DATA_0 245 1 Z +bit 243 C 1 * +bit 242 B 1 DATA_1 243 1 Z +bit 241 C 1 * +bit 240 B 1 DATA_2 241 1 Z +bit 239 C 1 * +bit 238 B 1 DATA_3 239 1 Z +bit 237 C 1 * +bit 236 B 1 DATA_4 237 1 Z +bit 235 C 1 * +bit 234 B 1 DATA_5 235 1 Z +bit 233 C 1 * +bit 232 B 1 DATA_6 233 1 Z +bit 231 C 1 * +bit 230 B 1 DATA_7 231 1 Z +bit 229 C 1 * +bit 228 B 1 DATA_8 229 1 Z +bit 227 C 1 * +bit 226 B 1 DATA_9 227 1 Z +bit 225 C 1 * +bit 224 B 1 DATA_10 225 1 Z +bit 223 C 1 * +bit 222 B 1 DATA_11 223 1 Z +bit 221 C 1 * +bit 220 B 1 DATA_12 221 1 Z +bit 219 C 1 * +bit 218 B 1 DATA_13 219 1 Z +bit 217 C 1 * +bit 216 B 1 DATA_14 217 1 Z +bit 215 C 1 * +bit 214 B 1 DATA_15 215 1 Z + +bit 213 C 1 * +bit 212 C 1 * +bit 211 C 1 * +bit 210 C 1 * +bit 209 C 1 * +bit 208 C 1 * +bit 207 C 1 * +bit 206 C 1 * +bit 205 C 1 * +bit 204 C 1 * +bit 203 C 1 * +bit 202 C 1 * +bit 201 C 1 * +bit 200 C 1 * +bit 199 C 1 * +bit 198 C 1 * +bit 197 C 1 * +bit 196 C 1 * +bit 195 C 1 * +bit 194 C 1 * +bit 193 C 1 * +bit 192 C 1 * +bit 191 C 1 * +bit 190 C 1 * +bit 189 C 1 * +bit 188 C 1 * +bit 187 C 1 * +bit 186 C 1 * +bit 185 C 1 * +bit 184 C 1 * +bit 183 C 1 * +bit 182 C 1 * +bit 181 C 1 * +bit 180 C 1 * +bit 179 C 1 * +bit 178 C 1 * +bit 177 C 1 * +bit 176 C 1 * +bit 175 C 1 * +bit 174 C 1 * +bit 173 C 1 * +bit 172 C 1 * +bit 171 C 1 * +bit 170 C 1 * +bit 169 C 1 * +bit 168 C 1 * +bit 167 C 1 * +bit 166 C 1 * +bit 165 C 1 * +bit 164 C 1 * +bit 163 C 1 * +bit 162 C 1 * +bit 161 C 1 * +bit 160 C 1 * +bit 159 C 1 * +bit 158 C 1 * +bit 157 C 1 * +bit 156 C 1 * +bit 155 C 1 * +bit 154 C 1 * +bit 153 C 1 * +bit 152 C 1 * +bit 151 C 1 * +bit 150 C 1 * +bit 149 C 1 * +bit 148 C 1 * +bit 147 C 1 * +bit 146 C 1 * +bit 145 C 1 * +bit 144 C 1 * +bit 143 C 1 * +bit 142 C 1 * +bit 141 C 1 * +bit 140 C 1 * +bit 139 C 1 * +bit 138 C 1 * +bit 137 C 1 * +bit 136 C 1 * +bit 135 C 1 * +bit 134 C 1 * +bit 133 C 1 * +bit 132 C 1 * +bit 131 C 1 * +bit 130 C 1 * +bit 129 C 1 * +bit 128 C 1 * +bit 127 C 1 * +bit 126 C 1 * +bit 125 C 1 * +bit 124 C 1 * +bit 123 C 1 * +bit 122 C 1 * +bit 121 C 1 * +bit 120 C 1 * +bit 119 C 1 * +bit 118 C 1 * +bit 117 C 1 * +bit 116 C 1 * +bit 115 C 1 * +bit 114 C 1 * +bit 113 C 1 * +bit 112 C 1 * +bit 111 C 1 * +bit 110 C 1 * +bit 109 C 1 * +bit 108 C 1 * +bit 107 C 1 * +bit 106 C 1 * +bit 105 C 1 * +bit 104 C 1 * +bit 103 C 1 * +bit 102 C 1 * +bit 101 C 1 * +bit 100 C 1 * +bit 99 C 1 * +bit 98 C 1 * +bit 97 C 1 * +bit 96 C 1 * +bit 95 C 1 * +bit 94 C 1 * +bit 93 C 1 * +bit 92 C 1 * +bit 91 C 1 * +bit 90 C 1 * +bit 89 C 1 * +bit 88 C 1 * + +bit 87 B 1 FAULT_STATUS 86 1 Z +bit 86 C 1 * +bit 85 B 1 HEARTBEAT 84 1 Z +bit 84 C 1 * + +bit 83 C 1 * +bit 82 C 1 * +bit 81 C 1 * +bit 80 C 1 * +bit 79 C 1 * +bit 78 C 1 * +bit 77 C 1 * +bit 76 C 1 * +bit 75 C 1 * +bit 74 C 1 * +bit 73 C 1 * +bit 72 C 1 * +bit 71 C 1 * +bit 70 C 1 * +bit 69 C 1 * +bit 68 C 1 * +bit 67 C 1 * +bit 66 C 1 * +bit 65 C 1 * +bit 64 C 1 * +bit 63 C 1 * +bit 62 C 1 * +bit 61 C 1 * +bit 60 C 1 * +bit 59 C 1 * +bit 58 C 1 * +bit 57 C 1 * +bit 56 C 1 * +bit 55 C 1 * +bit 54 C 1 * +bit 53 C 1 * +bit 52 C 1 * +bit 51 C 1 * +bit 50 C 1 * +bit 49 C 1 * +bit 48 C 1 * +bit 47 C 1 * +bit 46 C 1 * +bit 45 C 1 * +bit 44 C 1 * +bit 43 C 1 * +bit 42 C 1 * +bit 41 C 1 * +bit 40 C 1 * +bit 39 C 1 * +bit 38 C 1 * +bit 37 C 1 * +bit 36 C 1 * +bit 35 C 1 * +bit 34 C 1 * +bit 33 C 1 * +bit 32 C 1 * +bit 31 C 1 * +bit 30 C 1 * +bit 29 C 1 * +bit 28 C 1 * +bit 27 C 1 * +bit 26 C 1 * +bit 25 C 1 * +bit 24 C 1 * +bit 23 C 1 * +bit 22 C 1 * +bit 21 C 1 * +bit 20 C 1 * +bit 19 C 1 * +bit 18 C 1 * +bit 17 C 1 * +bit 16 C 1 * +bit 15 C 1 * +bit 14 C 1 * +bit 13 C 1 * +bit 12 C 1 * +bit 11 C 1 * +bit 10 C 1 * +bit 9 C 1 * +bit 8 C 1 * +bit 7 C 1 * +bit 6 C 1 * +bit 5 C 1 * +bit 4 C 1 * +bit 3 C 1 * +bit 2 C 1 * +bit 1 C 1 * +bit 0 C 1 * diff -urN urjtag-svn-2039-trunk/urjtag/data/toshiba/dlpc350/STEPPINGS urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/dlpc350/STEPPINGS --- urjtag-svn-2039-trunk/urjtag/data/toshiba/dlpc350/STEPPINGS 1969-12-31 19:00:00.000000000 -0500 +++ urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/dlpc350/STEPPINGS 2013-10-22 20:04:05.000000000 -0400 @@ -0,0 +1 @@ +0000 dlpc350 0 diff -urN urjtag-svn-2039-trunk/urjtag/data/toshiba/PARTS urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/PARTS --- urjtag-svn-2039-trunk/urjtag/data/toshiba/PARTS 2011-11-06 18:24:13.000000000 -0500 +++ urjtag-svn-2039-trunk-s2/urjtag/data/toshiba/PARTS 2013-10-22 20:44:00.000000000 -0400 @@ -28,3 +28,5 @@ # Same ID for TMPA900/901 and TMPA910/911/912/913, it seems. 0111100100100110 tmpa9xx TMPA9xx +# a TI part nominally... actually made by Toshiba +1001001000001001 dlpc350 DLPC350 diff -urN urjtag-svn-2039-trunk/urjtag/src/bus/buses_list.h urjtag-svn-2039-trunk-s2/urjtag/src/bus/buses_list.h --- urjtag-svn-2039-trunk/urjtag/src/bus/buses_list.h 2011-08-29 10:35:53.000000000 -0400 +++ urjtag-svn-2039-trunk-s2/urjtag/src/bus/buses_list.h 2013-10-22 20:43:27.652999069 -0400 @@ -58,6 +58,9 @@ #ifdef ENABLE_BUS_BSCOACH _URJ_BUS(bscoach) #endif +#ifdef ENABLE_BUS_DLPC350 +_URJ_BUS(dlpc350) +#endif #ifdef ENABLE_BUS_EJTAG _URJ_BUS(ejtag) _URJ_BUS(ejtag_dma) diff -urN urjtag-svn-2039-trunk/urjtag/src/bus/dlpc350.c urjtag-svn-2039-trunk-s2/urjtag/src/bus/dlpc350.c --- urjtag-svn-2039-trunk/urjtag/src/bus/dlpc350.c 1969-12-31 19:00:00.000000000 -0500 +++ urjtag-svn-2039-trunk-s2/urjtag/src/bus/dlpc350.c 2013-10-22 20:40:30.653980689 -0400 @@ -0,0 +1,269 @@ +/* + * $Id: dlpc350.c 2021 2012-03-02 06:21:56Z vapier $ + * + * Copyright (C) 2013 Bloomberg L.P. + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Stanislaw Skowronek , 2013. + * + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "buses.h" +#include "generic_bus.h" + +typedef struct +{ + urj_part_signal_t *oe_n; + urj_part_signal_t *we_n; + urj_part_signal_t *cs_n; + urj_part_signal_t *addr[21]; + urj_part_signal_t *data[16]; +} bus_params_t; + +#define OE_N ((bus_params_t *) bus->params)->oe_n +#define WE_N ((bus_params_t *) bus->params)->we_n +#define CS_N ((bus_params_t *) bus->params)->cs_n +#define ADDR ((bus_params_t *) bus->params)->addr +#define DATA ((bus_params_t *) bus->params)->data + +/** + * bus->driver->(*new_bus) + * + */ +static urj_bus_t * +dlpc350_bus_new (urj_chain_t *chain, const urj_bus_driver_t *driver, + const urj_param_t *cmd_params[]) +{ + urj_bus_t *bus; + urj_part_t *part; + char buff[15]; + int i; + int failed = 0; + + bus = urj_bus_generic_new (chain, driver, sizeof (bus_params_t)); + if (bus == NULL) + return NULL; + part = bus->part; + + failed |= urj_bus_generic_attach_sig (part, &(OE_N), "OE_N"); + failed |= urj_bus_generic_attach_sig (part, &(WE_N), "WE_N"); + failed |= urj_bus_generic_attach_sig (part, &(CS_N), "CS_N"); + + for (i = 0; i < 21; i++) + { + sprintf (buff, "ADDR_%d", i); + failed |= urj_bus_generic_attach_sig (part, &(ADDR[i]), buff); + } + + for (i = 0; i < 16; i++) + { + sprintf (buff, "DATA_%d", i); + failed |= urj_bus_generic_attach_sig (part, &(DATA[i]), buff); + } + + if (failed) + { + urj_bus_generic_free (bus); + return NULL; + } + + return bus; +} + +/** + * bus->driver->(*printinfo) + * + */ +static void +dlpc350_bus_printinfo (urj_log_level_t ll, urj_bus_t *bus) +{ + int i; + + for (i = 0; i < bus->chain->parts->len; i++) + if (bus->part == bus->chain->parts->parts[i]) + break; + urj_log (ll, _("TI DLPC350 bus driver (JTAG part No. %d)\n"), + i); +} + +/** + * bus->driver->(*area) + * + */ +static int +dlpc350_bus_area (urj_bus_t *bus, uint32_t adr, urj_bus_area_t *area) +{ + area->description = NULL; + area->start = UINT32_C (0x00000000); + area->length = UINT64_C (0x100000000); + area->width = 16; + + return URJ_STATUS_OK; +} + +static void +setup_address (urj_bus_t *bus, uint32_t a) +{ + int i; + urj_part_t *p = bus->part; + + for (i = 0; i < 21; i++) + urj_part_set_signal (p, ADDR[i], 1, (a >> (i + 1)) & 1); +} + +static void +set_data_in (urj_bus_t *bus) +{ + int i; + urj_part_t *p = bus->part; + + for (i = 0; i < 16; i++) + urj_part_set_signal_input (p, DATA[i]); +} + +static void +setup_data (urj_bus_t *bus, uint32_t d) +{ + int i; + urj_part_t *p = bus->part; + + for (i = 0; i < 16; i++) + urj_part_set_signal (p, DATA[i], 1, (d >> i) & 1); +} + +/** + * bus->driver->(*read_start) + * + */ +static int +dlpc350_bus_read_start (urj_bus_t *bus, uint32_t adr) +{ + urj_part_t *p = bus->part; + urj_chain_t *chain = bus->chain; + + urj_part_set_signal_low (p, CS_N); + setup_address (bus, adr); + urj_part_set_signal_low (p, OE_N); + urj_part_set_signal_high (p, WE_N); + + set_data_in (bus); + + urj_tap_chain_shift_data_registers (chain, 0); + + return URJ_STATUS_OK; +} + +/** + * bus->driver->(*read_next) + * + */ +static uint32_t +dlpc350_bus_read_next (urj_bus_t *bus, uint32_t adr) +{ + urj_part_t *p = bus->part; + urj_chain_t *chain = bus->chain; + int i; + uint32_t d = 0; + + setup_address (bus, adr); + urj_tap_chain_shift_data_registers (chain, 1); + + for (i = 0; i < 16; i++) + d |= (uint32_t) (urj_part_get_signal (p, DATA[i]) << i); + + return d; +} + +/** + * bus->driver->(*read_end) + * + */ +static uint32_t +dlpc350_bus_read_end (urj_bus_t *bus) +{ + urj_part_t *p = bus->part; + urj_chain_t *chain = bus->chain; + int i; + uint32_t d = 0; + + urj_part_set_signal_high (p, CS_N); + urj_part_set_signal_high (p, OE_N); + urj_part_set_signal_high (p, WE_N); + + urj_tap_chain_shift_data_registers (chain, 1); + + for (i = 0; i < 16; i++) + d |= (uint32_t) (urj_part_get_signal (p, DATA[i]) << i); + + return d; +} + +/** + * bus->driver->(*write) + * + */ +static void +dlpc350_bus_write (urj_bus_t *bus, uint32_t adr, uint32_t data) +{ + urj_part_t *p = bus->part; + urj_chain_t *chain = bus->chain; + + urj_part_set_signal_low (p, CS_N); + urj_part_set_signal_high (p, OE_N); + + setup_address (bus, adr); + setup_data (bus, data); + + urj_tap_chain_shift_data_registers (chain, 0); + + urj_part_set_signal_low (p, WE_N); + urj_tap_chain_shift_data_registers (chain, 0); + urj_part_set_signal_high (p, WE_N); + urj_part_set_signal_high (p, CS_N); + urj_tap_chain_shift_data_registers (chain, 0); +} + +const urj_bus_driver_t urj_bus_dlpc350_bus = { + "dlpc350", + N_("TI DLPC350 bus driver"), + dlpc350_bus_new, + urj_bus_generic_free, + dlpc350_bus_printinfo, + urj_bus_generic_prepare_extest, + dlpc350_bus_area, + dlpc350_bus_read_start, + dlpc350_bus_read_next, + dlpc350_bus_read_end, + urj_bus_generic_read, + urj_bus_generic_write_start, + dlpc350_bus_write, + urj_bus_generic_no_init, + urj_bus_generic_no_enable, + urj_bus_generic_no_disable, + URJ_BUS_TYPE_PARALLEL, +}; diff -urN urjtag-svn-2039-trunk/urjtag/src/bus/Makefile.am urjtag-svn-2039-trunk-s2/urjtag/src/bus/Makefile.am --- urjtag-svn-2039-trunk/urjtag/src/bus/Makefile.am 2011-08-31 23:26:45.000000000 -0400 +++ urjtag-svn-2039-trunk-s2/urjtag/src/bus/Makefile.am 2013-10-22 20:40:55.127632752 -0400 @@ -174,6 +174,10 @@ libbus_la_SOURCES += tx4925.c endif +if ENABLE_BUS_DLPC350 +libbus_la_SOURCES += dlpc350.c +endif + if ENABLE_BUS_ZEFANT_XS3 libbus_la_SOURCES += zefant-xs3.c endif diff -urN urjtag-svn-2039-trunk/urjtag/src/tap/cable/ft2232.c urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable/ft2232.c --- urjtag-svn-2039-trunk/urjtag/src/tap/cable/ft2232.c 2012-09-19 08:38:50.000000000 -0400 +++ urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable/ft2232.c 2013-10-22 19:44:53.166190950 -0400 @@ -189,6 +189,10 @@ #define BITMASK_FLYSWATTER_nOE1 (1 << BIT_FLYSWATTER_nOE1) #define BITMASK_FLYSWATTER_nOE2 (1 << BIT_FLYSWATTER_nOE2) +/* bit and bitmask definitions for FTDI C232HM cable */ +#define BIT_C232HM_nTRST 4 +#define BITMASK_C232HM_nTRST (1 << BIT_C232HM_nTRST) + /* --- Bit and bitmask definitions for usbScarab2 --- */ /* usbScarabeus2 is a design of Krzysztof Kajstura ( http://www.kristech.eu ). */ /* UrJTAG support added by Tomek Cedro ( http://www.tomek.cedro.info ) */ @@ -875,6 +879,40 @@ } static int +ft2232_c232hm_init (urj_cable_t *cable) +{ + params_t *params = cable->params; + urj_tap_cable_cx_cmd_root_t *cmd_root = ¶ms->cmd_root; + + if (urj_tap_usbconn_open (cable->link.usb) != URJ_STATUS_OK) + return URJ_STATUS_FAIL; + + params->low_byte_value = BITMASK_C232HM_nTRST; + params->low_byte_dir = BITMASK_C232HM_nTRST; + + /* Set Data Bits Low Byte + TCK = 0, TMS = 1, TDI = 0 */ + urj_tap_cable_cx_cmd_queue (cmd_root, 0); + urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_LOW); + urj_tap_cable_cx_cmd_push (cmd_root, + params->low_byte_value | BITMASK_TMS | BITMASK_TCK); + urj_tap_cable_cx_cmd_push (cmd_root, + params->low_byte_dir | BITMASK_TCK + | BITMASK_TDI | BITMASK_TMS); + + ft2232h_set_frequency (cable, FT2232H_MAX_TCK_FREQ); + + params->bit_trst = BIT_C232HM_nTRST; /* member of LOW byte */ + params->bit_reset = -1; /* not used */ + + params->last_tdo_valid = 0; + params->signals = URJ_POD_CS_TRST; + + + return URJ_STATUS_OK; +} + +static int ft2232_usbscarab2_init (urj_cable_t *cable) { params_t *params = cable->params; @@ -1449,6 +1487,24 @@ } static void +ft2232_c232hm_done (urj_cable_t *cable) +{ + params_t *params = cable->params; + urj_tap_cable_cx_cmd_root_t *cmd_root = ¶ms->cmd_root; + + /* Set Data Bits Low Byte + set all to input */ + urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_LOW); + urj_tap_cable_cx_cmd_push (cmd_root, 0); + urj_tap_cable_cx_cmd_push (cmd_root, 0); + + urj_tap_cable_cx_xfer (cmd_root, &imm_cmd, cable, + URJ_TAP_CABLE_COMPLETELY); + + urj_tap_cable_generic_usbconn_done (cable); +} + +static void ft2232_usbscarab2_done (urj_cable_t *cable) { params_t *params = cable->params; @@ -2495,6 +2551,26 @@ }; URJ_DECLARE_FTDX_CABLE(0x0403, 0x6010, "-mpsse", "Flyswatter", flyswatter) +const urj_cable_driver_t urj_tap_cable_ft2232_c232hm_driver = { + "C232HM", + N_("FTDI C232HM (FT232H) Cable"), + URJ_CABLE_DEVICE_USB, + { .usb = ft2232_connect, }, + urj_tap_cable_generic_disconnect, + ft2232_cable_free, + ft2232_c232hm_init, + ft2232_c232hm_done, + ft2232h_set_frequency, + ft2232_clock, + ft2232_get_tdo, + ft2232_transfer, + ft2232_set_signal, + urj_tap_cable_generic_get_signal, + ft2232_flush, + ftdx_usbcable_help +}; +URJ_DECLARE_FTDX_CABLE(0x0403, 0x6014, "-mpsse", "C232HM", c232hm) + const urj_cable_driver_t urj_tap_cable_ft2232_usbscarab2_driver = { "usbScarab2", N_("KrisTech usbScarabeus2 (FT2232) Cable"), diff -urN urjtag-svn-2039-trunk/urjtag/src/tap/cable/generic_usbconn_list.h urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable/generic_usbconn_list.h --- urjtag-svn-2039-trunk/urjtag/src/tap/cable/generic_usbconn_list.h 2012-04-10 22:56:05.000000000 -0400 +++ urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable/generic_usbconn_list.h 2013-10-22 19:37:28.900815096 -0400 @@ -50,6 +50,7 @@ _URJ_USB_FTDX(armusbocdtiny) _URJ_USB_FTDX(armusbtiny_h) _URJ_USB_FTDX(flyswatter) +_URJ_USB_FTDX(c232hm) _URJ_USB_FTDX(gnice) _URJ_USB_FTDX(gniceplus) _URJ_USB_FTDX(jtagkey) diff -urN urjtag-svn-2039-trunk/urjtag/src/tap/cable_list.h urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable_list.h --- urjtag-svn-2039-trunk/urjtag/src/tap/cable_list.h 2012-03-06 23:16:40.000000000 -0500 +++ urjtag-svn-2039-trunk-s2/urjtag/src/tap/cable_list.h 2013-10-22 19:31:01.334000122 -0400 @@ -50,6 +50,7 @@ _URJ_CABLE(ft2232_armusbocd) _URJ_CABLE(ft2232_armusbtiny_h) _URJ_CABLE(ft2232_flyswatter) +_URJ_CABLE(ft2232_c232hm) _URJ_CABLE(ft2232_gnice) _URJ_CABLE(ft2232_gniceplus) _URJ_CABLE(ft2232_jtagkey)