Commit aa441aa8 authored by claurita's avatar claurita Committed by Thomas Petazzoni
Browse files

openocd: bump to version 0.8.0



This patch adds the management of (almost) all the config options of
openocd 0.8.0. A BR config variable is added for (almost) every
adapter known to openocd and all the dependencies are automatically
calculated from the chosen adapters, so only the necessary libraries
are built.

Note that CMSIS_DAP adapter requires hidapi (not libhid) and hidapi is
not actually included in buildroot, so it has been removed.  Also
zy1000 adapters are actually broken in openocd and have been removed.

The host version of the package enables all the possible adapters and
the related libraries.

[Thomas:
 - Slightly fixup the commit log.
 - Rename the patches to the new patch naming convention.
 - Update hash file using a contribution from Vincent Stehlé.
 - Move the thread dependency from the OpenOCD option down to each
   sub-option that actually needs it (when it needs libusb,
   libusb-compat or libftdi). We keep only one comment, as we would
   otherwise have to add too many repeatitive comments.
 - Remove commented options.
 - Add missing dependency on BR2_ARCH_HAS_ATOMICS when selecting
   BR2_PACKAGE_LIBFTDI.
 - Remove trailing white spaces.
 - Pass -std=gnu99, needed to build with a basic toolchain.
 - Write the OPENOCD_DEPENDENCIES and OPENOCD_CONF_OPTS conditions in
   a more compact way.
 - Adjust indentation for HOST_OPENOCD_CONF_OPTS.
 - Reword the comment above HOST_OPENOCD_CONF_OPTS.]

Signed-off-by: default avatarClaudio Laurita <claudio.laurita@integrazionetotale.it>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent be529e22
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
From 893330638a26ea2868c6e7606047acf9b6fe31ea Mon Sep 17 00:00:00 2001
From: Claudio Laurita <claudio.laurita@integrazionetotale.it>
Date: Sun, 30 Nov 2014 17:30:36 +0100
Subject: [PATCH 1/1] Fix compilation error in src/flash/nor/mini51.c

0001-Fix-compilation-error-in-src-flash-nor-mini51.c.patch
gcc complains about missing initialization of 
local variable flash_size and compilation aborts

Signed-off-by: Claudio Laurita <claudio.laurita@integrazionetotale.it>
---
 src/flash/nor/mini51.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/flash/nor/mini51.c b/src/flash/nor/mini51.c
index 61aee5d..c7ba13a 100644
--- a/src/flash/nor/mini51.c
+++ b/src/flash/nor/mini51.c
@@ -397,7 +397,7 @@ static int mini51_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t
 
 static int mini51_probe(struct flash_bank *bank)
 {
-	uint32_t flash_size;
+	uint32_t flash_size = 0;
 	int retval;
 	int num_pages;
 	uint32_t offset = 0;
-- 
2.1.3
+35 −0
Original line number Diff line number Diff line
From 3bef159779c8fd39a070ec5c8191e18ba2efa79d Mon Sep 17 00:00:00 2001
From: Claudio Laurita <claudio.laurita@integrazionetotale.it>
Date: Sun, 30 Nov 2014 18:21:58 +0100
Subject: [PATCH 2/2] Fix jimtcl auto configuration to force static library
 only. jimtcl ignores a --disable-shared option if a previous --enable-shared
 option was given. This breaks openocd compilation if shared was the preferred
 option in buildroot project.

Signed-off-by: Claudio Laurita <claudio.laurita@integrazionetotale.it>
---
 jimtcl/auto.def | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/jimtcl/auto.def b/jimtcl/auto.def
index ddb0c1e..929ade0 100644
--- a/jimtcl/auto.def
+++ b/jimtcl/auto.def
@@ -181,12 +181,8 @@ if {[opt-bool references]} {
     msg-result "Enabling references"
     define JIM_REFERENCES
 }
-if {[opt-bool shared with-jim-shared]} {
-    msg-result "Building shared library"
-} else {
-    msg-result "Building static library"
-    define JIM_STATICLIB
-}
+msg-result "Building static library"
+define JIM_STATICLIB
 define JIM_INSTALL [opt-bool install-jim]
 
 # Attributes of the extensions
-- 
2.1.3
+190 −13
Original line number Diff line number Diff line
config BR2_PACKAGE_OPENOCD
	bool "openocd"
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	select BR2_PACKAGE_LIBUSB
	select BR2_PACKAGE_LIBUSB_COMPAT
	help
	  OpenOCD - Open On-Chip Debugger

@@ -12,23 +9,203 @@ if BR2_PACKAGE_OPENOCD

comment "Adapters"

config BR2_PACKAGE_OPENOCD_FT2XXX
	bool "FT2xxx/FT4xxx Based JTAG Programmer"
	depends on BR2_ARCH_HAS_ATOMICS # libftdi
	select BR2_PACKAGE_LIBFTDI
config BR2_PACKAGE_OPENOCD_FTDI
	bool "MPSSE mode of FTDI based devices"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the MPSSE mode of FTDI
	  (FT2xxx/FT4xxx) based devices (default is auto)

config BR2_PACKAGE_OPENOCD_STLINK
	bool "ST-Link JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the ST-Link JTAG
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_TI_ICDI
	bool "TI ICDI JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the TI ICDI JTAG
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_ULINK
	bool "Keil ULINK JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the Keil ULINK JTAG
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_UBLASTER2
	bool "Altera USB-Blaster II Compatible"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for FT2232 based devices
	  using the libftdi driver, opensource alternate of FTD2XX
	  Enable building support for the Altera USB-Blaster
	  II Compatible (default is auto)

config BR2_PACKAGE_OPENOCD_JLINK
	bool "Segger J-Link JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Segger J-Link JTAG Programmer and clone such as Atmel SAM-ICE
	  Segger J-Link JTAG Programmer and clone such as Atmel
	  SAM-ICE

config BR2_PACKAGE_OPENOCD_OSDBM
	bool "OSDBM JTAG (only) Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the OSBDM (JTAG only)
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_OPENDOUS
	bool "eStick/opendous JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the eStick/opendous JTAG
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_AICE
	bool "Andes JTAG Programmer"
	select BR2_PACKAGE_LIBUSB
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
	help
	  Enable building support for the Andes JTAG
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_VSLLINK
	bool "Versaloon-Link JTAG Programmr"
	bool "Versaloon-Link JTAG Programmer"
	select BR2_PACKAGE_LIBUSB_COMPAT
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb-compat -> libusb
	help
	  Enable building support for the Versaloon-Link JTAG
	  Programmer (default is auto)

endif # BR2_PACKAGE_OPENOCD
config BR2_PACKAGE_OPENOCD_USBPROG
	bool "USBProg JTAG Programmer"
	select BR2_PACKAGE_LIBUSB_COMPAT
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb-compat -> libusb
	help
	  Enable building support for the USBProg JTAG
	  Programmer (default is auto)

comment "openocd needs a toolchain w/ threads"
config BR2_PACKAGE_OPENOCD_RLINK
	bool "Raisonance RLink JTAG Programmer"
	select BR2_PACKAGE_LIBUSB_COMPAT
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb-compat -> libusb
	help
	  Enable building support for the Raisonance RLink
	  JTAG Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_ARMEW
	bool "Olimex ARM-JTAG-EW Programmer"
	select BR2_PACKAGE_LIBUSB_COMPAT
	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb-compat -> libusb
	help
	  Enable building support for the Olimex ARM-JTAG-EW
	  Programmer (default is auto)

config BR2_PACKAGE_OPENOCD_PARPORT
	bool "pc parallel port driver"
	help
	  Enable building the pc parallel port driver

config BR2_PACKAGE_OPENOCD_FT2XXX
	bool "FT2232 based devices (DEPRECATED)"
	select BR2_PACKAGE_LIBFTDI
	depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb
	depends on BR2_ARCH_HAS_ATOMICS
	help
	  (DEPRECATED) Enable building support for FT2232
	  based devices using the libftdi library

config BR2_PACKAGE_OPENOCD_VPI
	bool "JTAG VPI"
	help
	  Enable building support for JTAG VPI

config BR2_PACKAGE_OPENOCD_UBLASTER
	bool "Altera USB-Blaster"
	select BR2_PACKAGE_LIBFTDI
	depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb
	depends on BR2_ARCH_HAS_ATOMICS
	help
	  Enable building support for the Altera USB-Blaster
	  using the libftdi driver, opensource alternate of
	  FTD2XX

config BR2_PACKAGE_OPENOCD_AMTJT
	bool "Amontec JTAG-Accelerator"
	help
	  Enable building the Amontec JTAG-Accelerator driver

if BR2_arm

config BR2_PACKAGE_OPENOCD_EP93XX
	bool "EP93xx based SBCs"
	help
	  Enable building support for EP93xx based SBCs

config BR2_PACKAGE_OPENOCD_AT91RM
	bool "AT91RM9200 based SBCs"
	help
	  Enable building support for AT91RM9200 based SBCs

config BR2_PACKAGE_OPENOCD_BCM2835
	bool "bitbanging on BCM2835"
	help
	  Enable building support for bitbanging on BCM2835
	  (as found in Raspberry Pi)

endif # BR2_arm

config BR2_PACKAGE_OPENOCD_GW16012
	bool "Gateworks GW16012 JTAG Programmer"
	help
	  Enable building support for the Gateworks GW16012
	  JTAG Programmer

config BR2_PACKAGE_OPENOCD_PRESTO
	bool "ASIX Presto Programmer"
	select BR2_PACKAGE_LIBFTDI
	depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb
	depends on BR2_ARCH_HAS_ATOMICS
	help
	  Enable building support for ASIX Presto Programmer
	  using the libftdi driver

config BR2_PACKAGE_OPENOCD_OPENJTAG
	bool "OpenJTAG Programmer"
	select BR2_PACKAGE_LIBFTDI
	depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb
	depends on BR2_ARCH_HAS_ATOMICS
	help
	  Enable building support for the OpenJTAG Programmer
	  with ftdi driver

config BR2_PACKAGE_OPENOCD_BUSPIRATE
	bool "Buspirate"
	help
	  Enable building support for the Buspirate

config BR2_PACKAGE_OPENOCD_SYSFS
	bool "programming via sysfs gpios"
	help
	  Enable building support for programming driven via
	  sysfs gpios.

# Many adapters need libusb or libusb-compat, which require threads,
# but we don't want to duplicate this comment for all adapters that
# select libusb or libusb-compat.
comment "many openocd adapters needs a toolchain w/ threads"
	depends on !BR2_TOOLCHAIN_HAS_THREADS

endif # BR2_PACKAGE_OPENOCD
+0 −33
Original line number Diff line number Diff line
From 3728c4af7f6303ccedab56ec220797f8f290580e Mon Sep 17 00:00:00 2001
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Date: Wed, 10 Aug 2011 00:17:29 +0800
Subject: [PATCH] fix cross compilation: host libsub was used before

tested in buildroot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 configure.in |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index dfa1e8f..cfe2218 100644
--- a/configure.in
+++ b/configure.in
@@ -1046,8 +1046,11 @@ build_usb=no
 if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \
   $build_rlink = yes -o $build_ulink = yes -o $build_armjtagew = yes
 then
-  AC_CHECK_HEADERS([usb.h],[],
-  [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])])
+  dnl check for libusb
+  PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.11)
+  CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
+  LDFLAGS="$LDFLAGS $LIBUSB_LDFLAGS"
+  LIBS="$LIBS $LIBUSB_LIBS"
   build_usb=yes
 fi
 
-- 
1.7.5.4
+0 −20
Original line number Diff line number Diff line
xscale: fix uninitialise breakpoint_pc

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 src/target/xscale.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/src/target/xscale.c
===================================================================
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2811,7 +2811,7 @@ static int xscale_analyze_trace(struct t
    struct xscale_common *xscale = target_to_xscale(target);
    struct xscale_trace_data *trace_data = xscale->trace.data;
    int i, retval;
-   uint32_t breakpoint_pc;
+   uint32_t breakpoint_pc = 0;
    struct arm_instruction instruction;
    uint32_t current_pc = 0;  /* initialized when address determined */
 	
Loading