aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMarc Schink <openocd-dev@marcschink.de>2014-10-20 13:18:38 -0400
committerFreddie Chopin <freddie.chopin@gmail.com>2015-11-26 12:19:22 +0000
commit442f1540d5066b9ef091cab677b505f2c8196313 (patch)
tree3524cbbeb1fa9cb3fa1041e36c37beb398e2f2f0 /configure.ac
parent9a6d6b51b7428ddac6ada28dd9db589deb616f4d (diff)
downloadriscv-openocd-442f1540d5066b9ef091cab677b505f2c8196313.zip
riscv-openocd-442f1540d5066b9ef091cab677b505f2c8196313.tar.gz
riscv-openocd-442f1540d5066b9ef091cab677b505f2c8196313.tar.bz2
Improve J-Link driver and introduce libjaylink.
This patch uses libjaylink which is a library to access J-Link devices. As other tools which are not in the scope of OpenOCD also need to access J-Link devices a library is used. A firmware upgrade tool and an advanced configuration tool for J-Link devices are under development. Further versions of libjaylink will support additional features OpenOCD could benefit from. This includes TCP/IP as additional possibility to connect to J-Link devices as well as power tracing and device internal communication. The latter is used to access peripherals on some development boards (e.g EFM32 STK and DVK). Integration of libjaylink is realized with a git submodule like jimtcl. As libjaylink depends on libusb-1.0 only, no additional dependency is introduced for OpenOCD. All low-level JTAG and SWD implementations of the current driver are left untouched and therefore no incompabilities are to be expected. Improvements of this patch: * Support for more USB Product IDs, including those with the new scheme (0x10xx). The corresponding udev rules are also updated. * Device selection with serial number and USB address. * Adaptive clocking is now correctly implemented and only usable for devices with the corresponding capability. * The target power supply can now be switched without the need for changing configuration and power cycling the device. * Device configuration is more restrictive and only allowed if the required capabilities are available. * Device configuration now shows the changes between the current configuration of the device and the values that will be applied. * Device configuration is verified after it is written to the device exactly as the vendor software does. * Connection registration is now handled properly and checks if the maximum number of connections on a device is reached. This is also necessary for devices which are attached via USB to OpenOCD as some device models also support connections on TCP/IP. * Serial Wire Output (SWO) can now be captured. This feature is not documented by SEGGER however it is completely supported by libjaylink. This patch and libjaylink were tested on Ubuntu 14.04 (i386), Debian 7 (amd64), FreeBSD 10.0 (amd64) and Windows XP SP3 (32-bit) with the following device and target configurations: * JTAG: J-Link v8.0, v9.0 and v9.3 with AT91SAM7S256 * SWD: SiLabs EFM32 STK 3700 (EFM32GG990F1024) * SWD: J-Link v8.0, v9.0 and v9.3 with EFM32GG990F1024 * SWD: XMC 2Go (XMC1100) * SWD: XMC1100 Boot Kit (XMC1100) * SWD: IAR Systems / Olimex Eval Board (LPC1343F) * SWD: Nordic Semiconductor nRF51 Dongle (nRF51422) * SWD: SiLabs EZR32 WSTK 6220A (EZR32WG330FG60G) Except for Windows XP all builds are tested with Clang in addition to GCC. This patch and libjaylink are not tested on OSX yet. Change-Id: I8476c57d37c6091c4b892b183da682c548ca1786 Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2598 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac31
1 files changed, 29 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 87d4d6a..fb01e1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,6 +201,7 @@ m4_define([ADAPTER_OPT], [m4_translit(ADAPTER_ARG($1), [_], [-])])
m4_define([USB1_ADAPTERS],
[[[ftdi], [MPSSE mode of FTDI based devices], [FTDI]],
+ [[jlink], [Segger J-Link JTAG Programmer], [JLINK]],
[[stlink], [ST-Link JTAG Programmer], [HLADAPTER_STLINK]],
[[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
[[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
@@ -208,8 +209,7 @@ m4_define([USB1_ADAPTERS],
[[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]]])
m4_define([USB_ADAPTERS],
- [[[jlink], [Segger J-Link JTAG Programmer], [JLINK]],
- [[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
+ [[[osbdm], [OSBDM (JTAG only) Programmer], [OSBDM]],
[[opendous], [eStick/opendous JTAG Programmer], [OPENDOUS]],
[[aice], [Andes JTAG Programmer], [AICE]]])
@@ -506,6 +506,11 @@ AC_ARG_ENABLE([internal-jimtcl],
AS_HELP_STRING([--disable-internal-jimtcl], [Disable building internal jimtcl]),
[use_internal_jimtcl=$enableval], [use_internal_jimtcl=yes])
+AC_ARG_ENABLE([internal-libjaylink],
+ AS_HELP_STRING([--disable-internal-libjaylink],
+ [Disable building internal libjaylink]),
+ [use_internal_libjaylink=$enableval], [use_internal_libjaylink=yes])
+
build_minidriver=no
AC_MSG_CHECKING([whether to enable ZY1000 minidriver])
if test $build_zy1000 = yes; then
@@ -787,6 +792,19 @@ if test $use_internal_jimtcl = yes; then
fi
fi
+if test $use_internal_libjaylink = yes; then
+ if test -f "$srcdir/src/jtag/drivers/libjaylink/configure.ac"; then
+ ( cd $srcdir/src/jtag/drivers/libjaylink/ && ./autogen.sh )
+ AX_CONFIG_SUBDIR_OPTION([src/jtag/drivers/libjaylink],
+ [--enable-subproject-build])
+ else
+ AC_MSG_ERROR([Internal libjaylink not found, run either 'git submodule init' and 'git submodule update' or disable internal libjaylink with --disable-internal-libjaylink.])
+ fi
+else
+ PKG_CHECK_MODULES([libjaylink], [libjaylink >= 0.1],
+ [CFLAGS="$CFLAGS $libjaylink_CFLAGS"; LIBS="$LIBS $libjaylink_LIBS"; HAVE_LIBJAYLINK=yes], [HAVE_LIBJAYLINK=no])
+fi
+
if test $build_remote_bitbang = yes; then
build_bitbang=yes
AC_DEFINE([BUILD_REMOTE_BITBANG], [1], [1 if you want the Remote Bitbang JTAG driver.])
@@ -1170,6 +1188,14 @@ else
fi
AM_CONDITIONAL([HLADAPTER], [test $enable_stlink != no -o $enable_ti_icdi != no])
+# Disable J-Link driver if internal libjaylink is disabled and libjaylink was
+# not found by pkg-config.
+if test $enable_jlink != no; then
+ if test $use_internal_libjaylink$HAVE_LIBJAYLINK = nono; then
+ enable_jlink=no
+ fi
+fi
+
AM_CONDITIONAL([RELEASE], [test $build_release = yes])
AM_CONDITIONAL([PARPORT], [test $build_parport = yes])
AM_CONDITIONAL([DUMMY], [test $build_dummy = yes])
@@ -1209,6 +1235,7 @@ AM_CONDITIONAL([MINIDRIVER], [test $build_minidriver = yes])
AM_CONDITIONAL([MINIDRIVER_DUMMY], [test $build_minidriver_dummy = yes])
AM_CONDITIONAL([INTERNAL_JIMTCL], [test $use_internal_jimtcl = yes])
+AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test $use_internal_libjaylink = yes])
# Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h?
AC_MSG_CHECKING([for environ in unistd.h and stdlib.h])