- remove enable-ft2232-highspeed configure option, high speed ftdi support is now detected during the configure stage
- warning now issued if high speed ftdi device found and openocd was built using an old driver git-svn-id: svn://svn.berlios.de/openocd/trunk@2599 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
028e535604
commit
ef30f22fd3
4
README
4
README
|
@ -215,10 +215,6 @@ options may be available there:
|
||||||
FTD2XX
|
FTD2XX
|
||||||
--enable-ft2232_ftd2xx Enable building support for FT2232 based devices
|
--enable-ft2232_ftd2xx Enable building support for FT2232 based devices
|
||||||
using the FTD2XX driver from ftdichip.com
|
using the FTD2XX driver from ftdichip.com
|
||||||
--enable-ft2232-highspeed
|
|
||||||
Enable building support for FT2232H and
|
|
||||||
FT4232H-based devices (requires >=libftd2xx-0.4.16
|
|
||||||
or >=libftdi-0.16)
|
|
||||||
|
|
||||||
--enable-gw16012 Enable building support for the Gateworks GW16012
|
--enable-gw16012 Enable building support for the Gateworks GW16012
|
||||||
JTAG Programmer
|
JTAG Programmer
|
||||||
|
|
20
configure.in
20
configure.in
|
@ -323,10 +323,6 @@ AC_ARG_ENABLE(ft2232_ftd2xx,
|
||||||
AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com]),
|
AS_HELP_STRING([--enable-ft2232_ftd2xx], [Enable building support for FT2232 based devices using the FTD2XX driver from ftdichip.com]),
|
||||||
[build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
|
[build_ft2232_ftd2xx=$enableval], [build_ft2232_ftd2xx=no])
|
||||||
|
|
||||||
AC_ARG_ENABLE(ft2232_highspeed,
|
|
||||||
AS_HELP_STRING([--enable-ft2232-highspeed], [Enable building support for FT2232H and FT4232H-based devices (requires >=libftd2xx-0.4.16 or >=libftdi-0.16)]),
|
|
||||||
[want_ft2232_highspeed=$enableval], [want_ft2232_highspeed=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(amtjtagaccel,
|
AC_ARG_ENABLE(amtjtagaccel,
|
||||||
AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
|
AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]),
|
||||||
[build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
|
[build_amtjtagaccel=$enableval], [build_amtjtagaccel=no])
|
||||||
|
@ -834,9 +830,6 @@ main( int argc, char **argv )
|
||||||
AC_MSG_RESULT([Skipping as we are cross-compiling])
|
AC_MSG_RESULT([Skipping as we are cross-compiling])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build ftd2xx highspeed device support])
|
|
||||||
AC_MSG_RESULT([$want_ft2232_highspeed])
|
|
||||||
if test $want_ft2232_highspeed != no; then
|
|
||||||
AC_MSG_CHECKING([for ftd2xx highspeed device support])
|
AC_MSG_CHECKING([for ftd2xx highspeed device support])
|
||||||
AC_COMPILE_IFELSE([
|
AC_COMPILE_IFELSE([
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
@ -855,9 +848,8 @@ DWORD x = FT_DEVICE_4232H;
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT([$build_ft2232_highspeed])
|
AC_MSG_RESULT([$build_ft2232_highspeed])
|
||||||
|
|
||||||
if test $want_ft2232_highspeed = yes -a $build_ft2232_highspeed = no; then
|
if test $build_ft2232_highspeed = no; then
|
||||||
AC_MSG_ERROR([You need a newer FTD2XX driver (version 0.4.16 or later).])
|
AC_MSG_WARN([You need a newer FTD2XX driver (version 2.04.16 or later).])
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LDFLAGS=$LDFLAGS_SAVE
|
LDFLAGS=$LDFLAGS_SAVE
|
||||||
|
@ -903,9 +895,6 @@ main( int argc, char **argv )
|
||||||
AC_MSG_RESULT([Skipping as we are cross-compiling])
|
AC_MSG_RESULT([Skipping as we are cross-compiling])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to build libftdi highspeed device support])
|
|
||||||
AC_MSG_RESULT([$want_ft2232_highspeed])
|
|
||||||
if test $want_ft2232_highspeed != no; then
|
|
||||||
AC_MSG_CHECKING([for libftdi highspeed device support])
|
AC_MSG_CHECKING([for libftdi highspeed device support])
|
||||||
AC_COMPILE_IFELSE([
|
AC_COMPILE_IFELSE([
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -920,9 +909,8 @@ enum ftdi_chip_type x = TYPE_2232H;
|
||||||
])
|
])
|
||||||
AC_MSG_RESULT([$build_ft2232_highspeed])
|
AC_MSG_RESULT([$build_ft2232_highspeed])
|
||||||
|
|
||||||
if test $want_ft2232_highspeed = yes -a $build_ft2232_highspeed = no; then
|
if test $build_ft2232_highspeed = no; then
|
||||||
AC_MSG_ERROR([You need a newer libftdi version (0.16 or later).])
|
AC_MSG_WARN([You need a newer libftdi version (0.16 or later).])
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore the 'unexpanded ldflags'
|
# Restore the 'unexpanded ldflags'
|
||||||
|
|
|
@ -68,8 +68,15 @@
|
||||||
/* this speed value tells that RTCK is requested */
|
/* this speed value tells that RTCK is requested */
|
||||||
#define RTCK_SPEED -1
|
#define RTCK_SPEED -1
|
||||||
|
|
||||||
static int ft2232_execute_queue(void);
|
#ifndef BUILD_FT2232_HIGHSPEED
|
||||||
|
#if BUILD_FT2232_FTD2XX == 1
|
||||||
|
enum { FT_DEVICE_2232H = 6, FT_DEVICE_4232H };
|
||||||
|
#elif BUILD_FT2232_LIBFTDI == 1
|
||||||
|
enum { TYPE_2232H = 4, TYPE_4232H = 5 };
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int ft2232_execute_queue(void);
|
||||||
static int ft2232_speed(int speed);
|
static int ft2232_speed(int speed);
|
||||||
static int ft2232_speed_div(int speed, int* khz);
|
static int ft2232_speed_div(int speed, int* khz);
|
||||||
static int ft2232_khz(int khz, int* jtag_speed);
|
static int ft2232_khz(int khz, int* jtag_speed);
|
||||||
|
@ -416,15 +423,11 @@ static int ft2232_read(uint8_t* buf, uint32_t size, uint32_t* bytes_read)
|
||||||
|
|
||||||
static bool ft2232_device_is_highspeed(void)
|
static bool ft2232_device_is_highspeed(void)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_FT2232_HIGHSPEED
|
|
||||||
#if BUILD_FT2232_FTD2XX == 1
|
#if BUILD_FT2232_FTD2XX == 1
|
||||||
return (ftdi_device == FT_DEVICE_2232H) || (ftdi_device == FT_DEVICE_4232H);
|
return (ftdi_device == FT_DEVICE_2232H) || (ftdi_device == FT_DEVICE_4232H);
|
||||||
#elif BUILD_FT2232_LIBFTDI == 1
|
#elif BUILD_FT2232_LIBFTDI == 1
|
||||||
return (ftdi_device == TYPE_2232H || ftdi_device == TYPE_4232H);
|
return (ftdi_device == TYPE_2232H || ftdi_device == TYPE_4232H);
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -529,10 +532,6 @@ static int ft2232_khz(int khz, int* jtag_speed)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG_DEBUG("RCLK not supported");
|
LOG_DEBUG("RCLK not supported");
|
||||||
#ifndef BUILD_FT2232_HIGHSPEED
|
|
||||||
LOG_DEBUG("If you have a high-speed FTDI device, then "
|
|
||||||
"OpenOCD may be built with --enable-ft2232-highspeed.");
|
|
||||||
#endif
|
|
||||||
return ERROR_FAIL;
|
return ERROR_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1941,7 +1940,7 @@ static int ft2232_init_ftd2xx(uint16_t vid, uint16_t pid, int more, int* try_mor
|
||||||
{"BM", "AM", "100AX", "UNKNOWN", "2232C", "232R", "2232H", "4232H"};
|
{"BM", "AM", "100AX", "UNKNOWN", "2232C", "232R", "2232H", "4232H"};
|
||||||
unsigned no_of_known_types = sizeof(type_str) / sizeof(type_str[0]) - 1;
|
unsigned no_of_known_types = sizeof(type_str) / sizeof(type_str[0]) - 1;
|
||||||
unsigned type_index = ((unsigned)ftdi_device <= no_of_known_types)
|
unsigned type_index = ((unsigned)ftdi_device <= no_of_known_types)
|
||||||
? ftdi_device : 3;
|
? ftdi_device : FT_DEVICE_UNKNOWN;
|
||||||
LOG_INFO("device: %lu \"%s\"", ftdi_device, type_str[type_index]);
|
LOG_INFO("device: %lu \"%s\"", ftdi_device, type_str[type_index]);
|
||||||
LOG_INFO("deviceID: %lu", deviceID);
|
LOG_INFO("deviceID: %lu", deviceID);
|
||||||
LOG_INFO("SerialNumber: %s", SerialNumber);
|
LOG_INFO("SerialNumber: %s", SerialNumber);
|
||||||
|
@ -2118,6 +2117,14 @@ static int ft2232_init(void)
|
||||||
|
|
||||||
if (ft2232_device_is_highspeed())
|
if (ft2232_device_is_highspeed())
|
||||||
{
|
{
|
||||||
|
#ifndef BUILD_FT2232_HIGHSPEED
|
||||||
|
#if BUILD_FT2232_FTD2XX == 1
|
||||||
|
LOG_WARNING("High Speed device found - You need a newer FTD2XX driver (version 2.04.16 or later)");
|
||||||
|
#elif BUILD_FT2232_LIBFTDI == 1
|
||||||
|
LOG_WARNING("High Speed device found - You need a newer libftdi version (0.16 or later)");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
/* make sure the legacy mode is disabled */
|
||||||
if (ft2232h_ft4232h_clk_divide_by_5(false) != ERROR_OK)
|
if (ft2232h_ft4232h_clk_divide_by_5(false) != ERROR_OK)
|
||||||
return ERROR_JTAG_INIT_FAILED;
|
return ERROR_JTAG_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue