summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-02-20 13:47:32 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2007-02-20 13:47:32 +0000
commite0c2e30660bef422744e885ab32c26c58978a8a1 (patch)
treec6dc5562cbb1b7ee032c34e5fb8ef7bd5bde16dd
parent78ecef2aed5fcdc25ec669d6cc28b1bc495b0ff6 (diff)
downloadopenocd_libswd-e0c2e30660bef422744e885ab32c26c58978a8a1.tar.gz
openocd_libswd-e0c2e30660bef422744e885ab32c26c58978a8a1.tar.bz2
openocd_libswd-e0c2e30660bef422744e885ab32c26c58978a8a1.tar.xz
openocd_libswd-e0c2e30660bef422744e885ab32c26c58978a8a1.zip
- fixed libftdi initialization
git-svn-id: svn://svn.berlios.de/openocd/trunk@131 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/ft2232.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c
index 386da249..4a705b5e 100644
--- a/src/jtag/ft2232.c
+++ b/src/jtag/ft2232.c
@@ -1346,12 +1346,18 @@ int ft2232_init(void)
return ERROR_JTAG_INIT_FAILED;
/* context, vendor id, product id */
- if (ftdi_usb_open(&ftdic, ft2232_vid, ft2232_pid) < 0)
+ if (ftdi_usb_open_desc(&ftdic, ft2232_vid, ft2232_pid, ft2232_device_desc, ft2232_serial) < 0)
{
ERROR("unable to open ftdi device: %s", ftdic.error_str);
return ERROR_JTAG_INIT_FAILED;
}
+ if (ftdi_set_interface(&ftdic, INTERFACE_A) < 0)
+ {
+ ERROR("unable to select FT2232 channel A: %s", ftdic.error_str);
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
if (ftdi_usb_reset(&ftdic) < 0)
{
ERROR("unable to reset ftdi device");
@@ -1374,11 +1380,7 @@ int ft2232_init(void)
DEBUG("current latency timer: %i", latency_timer);
}
- ftdic.bitbang_mode = 0; /* Reset controller */
- ftdi_enable_bitbang(&ftdic, 0x0b); /* ctx, JTAG I/O mask */
-
- ftdic.bitbang_mode = 2; /* MPSSE mode */
- ftdi_enable_bitbang(&ftdic, 0x0b); /* ctx, JTAG I/O mask */
+ ftdi_set_bitmode(&ftdic, 0x0b, 2); /* ctx, JTAG I/O mask */
#endif
ft2232_buffer_size = 0;