Commit e0c2e306 authored by drath's avatar drath
Browse files

- fixed libftdi initialization


git-svn-id: svn://svn.berlios.de/openocd/trunk@131 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 78ecef2a
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment