Parcourir la source

[add] 添加raspberry-pico openocd

Yaochenger il y a 1 an
Parent
commit
60c3f1a242
100 fichiers modifiés avec 5974 ajouts et 0 suppressions
  1. 2 0
      bin/dap.bat
  2. BIN
      bin/ftd2xx.dll
  3. 3 0
      bin/interface/picoprobe.cfg
  4. BIN
      bin/libusb-1.0.dll
  5. BIN
      bin/openocd.exe
  6. 54 0
      bin/target/rp2040.cfg
  7. BIN
      drivers/FTDI CDM v2.08.28 Certified/Static/amd64/ftd2xx.lib
  8. BIN
      drivers/FTDI CDM v2.08.28 Certified/Static/i386/ftd2xx.lib
  9. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftbusui.dll
  10. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftcserco.dll
  11. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx.lib
  12. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx64.dll
  13. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftdibus.sys
  14. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftlang.dll
  15. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftser2k.sys
  16. BIN
      drivers/FTDI CDM v2.08.28 Certified/amd64/ftserui2.dll
  17. 8 0
      drivers/FTDI CDM v2.08.28 Certified/driver.xml
  18. 1341 0
      drivers/FTDI CDM v2.08.28 Certified/ftd2xx.h
  19. BIN
      drivers/FTDI CDM v2.08.28 Certified/ftdibus.cat
  20. 131 0
      drivers/FTDI CDM v2.08.28 Certified/ftdibus.inf
  21. BIN
      drivers/FTDI CDM v2.08.28 Certified/ftdiport.cat
  22. 167 0
      drivers/FTDI CDM v2.08.28 Certified/ftdiport.inf
  23. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftbusui.dll
  24. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftcserco.dll
  25. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.dll
  26. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.lib
  27. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftdibus.sys
  28. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftlang.dll
  29. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftser2k.sys
  30. BIN
      drivers/FTDI CDM v2.08.28 Certified/i386/ftserui2.dll
  31. BIN
      drivers/Interop.CERTENROLLLib.dll
  32. BIN
      drivers/ST-Link/amd64/WdfCoInstaller01009.dll
  33. BIN
      drivers/ST-Link/amd64/winusbcoinstaller2.dll
  34. BIN
      drivers/ST-Link/dpinst_amd64.exe
  35. BIN
      drivers/ST-Link/dpinst_x86.exe
  36. 12 0
      drivers/ST-Link/driver.xml
  37. 74 0
      drivers/ST-Link/stlink_VCP.inf
  38. 135 0
      drivers/ST-Link/stlink_dbg_winusb.inf
  39. 7 0
      drivers/ST-Link/stlink_winusb_install.bat
  40. BIN
      drivers/ST-Link/stlinkdbgwinusb_x64.cat
  41. BIN
      drivers/ST-Link/stlinkdbgwinusb_x86.cat
  42. BIN
      drivers/ST-Link/stlinkvcp_x64.cat
  43. BIN
      drivers/ST-Link/stlinkvcp_x86.cat
  44. BIN
      drivers/ST-Link/x86/WdfCoInstaller01009.dll
  45. BIN
      drivers/ST-Link/x86/winusbcoinstaller2.dll
  46. BIN
      drivers/UsbDriverTool.exe
  47. 7 0
      drivers/UsbDriverTool.exe.config
  48. BIN
      drivers/WinUSB/amd64/WdfCoInstaller01009.dll
  49. BIN
      drivers/WinUSB/amd64/winusbcoinstaller2.dll
  50. 8 0
      drivers/WinUSB/driver.xml
  51. 129 0
      drivers/WinUSB/libusb_device.inf
  52. 180 0
      drivers/WinUSB/libusb_device_multiple_interfaces_0.inf
  53. 180 0
      drivers/WinUSB/libusb_device_multiple_interfaces_1.inf
  54. BIN
      drivers/WinUSB/x86/WdfCoInstaller01009.dll
  55. BIN
      drivers/WinUSB/x86/winusbcoinstaller2.dll
  56. 8 0
      drivers/WinUSB_Mini/driver.xml
  57. 57 0
      drivers/WinUSB_Mini/winusb_device.inf
  58. 12 0
      drivers/xds110/driver.xml
  59. BIN
      drivers/xds110/i386/WdfCoInstaller01009.dll
  60. BIN
      drivers/xds110/i386/winusbcoinstaller2.dll
  61. BIN
      drivers/xds110/x64/WdfCoInstaller01009.dll
  62. BIN
      drivers/xds110/x64/winusbcoinstaller2.dll
  63. BIN
      drivers/xds110/xds110_debug.cat
  64. 113 0
      drivers/xds110/xds110_debug.inf
  65. BIN
      drivers/xds110/xds110_ports.cat
  66. 67 0
      drivers/xds110/xds110_ports.inf
  67. 347 0
      share/openocd/OpenULINK/ulink_firmware.hex
  68. 145 0
      share/openocd/contrib/60-openocd.rules
  69. 134 0
      share/openocd/contrib/99-openocd.rules
  70. 68 0
      share/openocd/contrib/coresight-trace.txt
  71. 119 0
      share/openocd/contrib/cross-build.sh
  72. 124 0
      share/openocd/contrib/gen-stellaris-part-header.pl
  73. 459 0
      share/openocd/contrib/itmdump.c
  74. 19 0
      share/openocd/contrib/libdcc/README
  75. 157 0
      share/openocd/contrib/libdcc/dcc_stdio.c
  76. 35 0
      share/openocd/contrib/libdcc/dcc_stdio.h
  77. 58 0
      share/openocd/contrib/libdcc/example.c
  78. 34 0
      share/openocd/contrib/loaders/Makefile
  79. 33 0
      share/openocd/contrib/loaders/README
  80. 30 0
      share/openocd/contrib/loaders/checksum/Makefile
  81. 7 0
      share/openocd/contrib/loaders/checksum/armv4_5_crc.inc
  82. 58 0
      share/openocd/contrib/loaders/checksum/armv4_5_crc.s
  83. 5 0
      share/openocd/contrib/loaders/checksum/armv7m_crc.inc
  84. 71 0
      share/openocd/contrib/loaders/checksum/armv7m_crc.s
  85. 72 0
      share/openocd/contrib/loaders/checksum/mips32.s
  86. 33 0
      share/openocd/contrib/loaders/debug/xscale/Makefile
  87. 716 0
      share/openocd/contrib/loaders/debug/xscale/debug_handler.S
  88. 101 0
      share/openocd/contrib/loaders/debug/xscale/debug_handler.inc
  89. 49 0
      share/openocd/contrib/loaders/debug/xscale/debug_handler.ld
  90. 68 0
      share/openocd/contrib/loaders/debug/xscale/protocol.h
  91. 30 0
      share/openocd/contrib/loaders/erase_check/Makefile
  92. 3 0
      share/openocd/contrib/loaders/erase_check/armv4_5_erase_check.inc
  93. 39 0
      share/openocd/contrib/loaders/erase_check/armv4_5_erase_check.s
  94. 2 0
      share/openocd/contrib/loaders/erase_check/armv7m_0_erase_check.inc
  95. 45 0
      share/openocd/contrib/loaders/erase_check/armv7m_0_erase_check.s
  96. 2 0
      share/openocd/contrib/loaders/erase_check/armv7m_erase_check.inc
  97. 45 0
      share/openocd/contrib/loaders/erase_check/armv7m_erase_check.s
  98. 57 0
      share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_16.s
  99. 57 0
      share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_32.s
  100. 57 0
      share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_8.s

+ 2 - 0
bin/dap.bat

@@ -0,0 +1,2 @@
+cd /d E:\OpenOCD-0.12.0\bin
+pyocd.exe flash --target=unknow --erase=auto --frequency=5000 D:\RT-ThreadStudio\workspace\pico-template\Debug\rtthread.bin

BIN
bin/ftd2xx.dll


+ 3 - 0
bin/interface/picoprobe.cfg

@@ -0,0 +1,3 @@
+# Adapter section
+adapter driver picoprobe
+adapter speed 5000

BIN
bin/libusb-1.0.dll


BIN
bin/openocd.exe


+ 54 - 0
bin/target/rp2040.cfg

@@ -0,0 +1,54 @@
+source [find target/swj-dp.tcl]
+source [find mem_helper.tcl]
+
+set _CHIPNAME rp2040
+set _CPUTAPID 0x01002927
+set _ENDIAN little
+
+swj_newdap $_CHIPNAME.core0 cpu -dp-id $_CPUTAPID -instance-id 0
+swj_newdap $_CHIPNAME.core1 cpu -dp-id $_CPUTAPID -instance-id 1
+
+# NOTE target smp makes both targets act a single virtual target on one port for gdb
+#      (without it you should be able to debug separately on two ports)
+# NOTE: "-rtos hwthread" creates a thread per core in smp mode (otherwise it is a single thread for the virtual target)
+
+# Give OpenOCD SRAM1 (64k) to use for e.g. flash programming bounce buffers (should avoid algo stack etc)
+# Don't require save/restore, because this isn't something we'd do whilst a user app is running
+set _WORKSIZE 0x10000
+set _WORKBASE 0x20010000
+
+#core 0
+set _TARGETNAME_0 $_CHIPNAME.core0
+dap create $_TARGETNAME_0.dap -chain-position $_CHIPNAME.core0.cpu
+target create $_TARGETNAME_0 cortex_m -endian $_ENDIAN -coreid 0 -dap $_TARGETNAME_0.dap -rtos hwthread
+$_TARGETNAME_0 configure -work-area-phys $_WORKBASE -work-area-size $_WORKSIZE -work-area-backup 0
+cortex_m reset_config sysresetreq
+
+#core 1
+set _TARGETNAME_1 $_CHIPNAME.core1
+dap create $_TARGETNAME_1.dap -chain-position $_CHIPNAME.core1.cpu
+target create $_TARGETNAME_1 cortex_m -endian $_ENDIAN -coreid 1 -dap $_TARGETNAME_1.dap -rtos hwthread
+$_TARGETNAME_1 configure -work-area-phys $_WORKBASE -work-area-size $_WORKSIZE -work-area-backup 0
+cortex_m reset_config sysresetreq
+
+target smp $_TARGETNAME_0 $_TARGETNAME_1
+
+set _FLASHNAME $_CHIPNAME.flash
+set _FLASHSIZE 0x200000
+set _FLASHBASE 0x10000000
+#          name        driver        base, size in bytes, chip_width, bus_width, target used to access
+flash bank $_FLASHNAME rp2040_flash $_FLASHBASE $_FLASHSIZE    1 32 $_TARGETNAME_0
+
+# Openocd associates a flash bank with a target (in our case a core) and
+# running `openocd -c "program foo.elf"` just grabs the last selected core
+# from the TCL context. Select `core0` by default so that flash probe
+# succeeds. Note gdb understands there are 2 cores -- this is only for TCL.
+targets rp2040.core0
+targets rp2040.core1
+
+# srst is not fitted so use SYSRESETREQ to perform a soft reset
+reset_config srst_nogate
+
+gdb_flash_program enable
+gdb_memory_map enable
+

BIN
drivers/FTDI CDM v2.08.28 Certified/Static/amd64/ftd2xx.lib


BIN
drivers/FTDI CDM v2.08.28 Certified/Static/i386/ftd2xx.lib


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftbusui.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftcserco.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx.lib


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx64.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftdibus.sys


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftlang.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftser2k.sys


BIN
drivers/FTDI CDM v2.08.28 Certified/amd64/ftserui2.dll


+ 8 - 0
drivers/FTDI CDM v2.08.28 Certified/driver.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <UniversalUsbDriver>
+    <UniversalDriverName>FTDI CDM</UniversalDriverName>
+	<PrimaryInfFile>ftdibus.inf</PrimaryInfFile>
+	<UniqueDriverId>com.sysprogs.ftdi</UniqueDriverId>
+  </UniversalUsbDriver>
+</ArrayOfUniversalUsbDriver>

+ 1341 - 0
drivers/FTDI CDM v2.08.28 Certified/ftd2xx.h

@@ -0,0 +1,1341 @@
+/*++
+
+Copyright © 2001-2011 Future Technology Devices International Limited
+
+THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+
+FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE
+RESPONSIBILITY OF THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL
+RE-CERTIFICATION AS A RESULT OF MAKING THESE CHANGES.
+
+
+Module Name:
+
+ftd2xx.h
+
+Abstract:
+
+Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices
+FTD2XX library definitions
+
+Environment:
+
+kernel & user mode
+
+
+--*/
+
+
+#ifndef FTD2XX_H
+#define FTD2XX_H
+
+// The following ifdef block is the standard way of creating macros
+// which make exporting from a DLL simpler.  All files within this DLL
+// are compiled with the FTD2XX_EXPORTS symbol defined on the command line.
+// This symbol should not be defined on any project that uses this DLL.
+// This way any other project whose source files include this file see
+// FTD2XX_API functions as being imported from a DLL, whereas this DLL
+// sees symbols defined with this macro as being exported.
+
+#ifdef FTD2XX_EXPORTS
+#define FTD2XX_API __declspec(dllexport)
+#else
+#define FTD2XX_API __declspec(dllimport)
+#endif
+
+
+typedef PVOID	FT_HANDLE;
+typedef ULONG	FT_STATUS;
+
+//
+// Device status
+//
+enum {
+	FT_OK,
+	FT_INVALID_HANDLE,
+	FT_DEVICE_NOT_FOUND,
+	FT_DEVICE_NOT_OPENED,
+	FT_IO_ERROR,
+	FT_INSUFFICIENT_RESOURCES,
+	FT_INVALID_PARAMETER,
+	FT_INVALID_BAUD_RATE,
+
+	FT_DEVICE_NOT_OPENED_FOR_ERASE,
+	FT_DEVICE_NOT_OPENED_FOR_WRITE,
+	FT_FAILED_TO_WRITE_DEVICE,
+	FT_EEPROM_READ_FAILED,
+	FT_EEPROM_WRITE_FAILED,
+	FT_EEPROM_ERASE_FAILED,
+	FT_EEPROM_NOT_PRESENT,
+	FT_EEPROM_NOT_PROGRAMMED,
+	FT_INVALID_ARGS,
+	FT_NOT_SUPPORTED,
+	FT_OTHER_ERROR,
+	FT_DEVICE_LIST_NOT_READY,
+};
+
+
+#define FT_SUCCESS(status) ((status) == FT_OK)
+
+//
+// FT_OpenEx Flags
+//
+
+#define FT_OPEN_BY_SERIAL_NUMBER	1
+#define FT_OPEN_BY_DESCRIPTION		2
+#define FT_OPEN_BY_LOCATION			4
+
+//
+// FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags
+//
+
+#define FT_LIST_NUMBER_ONLY			0x80000000
+#define FT_LIST_BY_INDEX			0x40000000
+#define FT_LIST_ALL					0x20000000
+
+#define FT_LIST_MASK (FT_LIST_NUMBER_ONLY|FT_LIST_BY_INDEX|FT_LIST_ALL)
+
+//
+// Baud Rates
+//
+
+#define FT_BAUD_300			300
+#define FT_BAUD_600			600
+#define FT_BAUD_1200		1200
+#define FT_BAUD_2400		2400
+#define FT_BAUD_4800		4800
+#define FT_BAUD_9600		9600
+#define FT_BAUD_14400		14400
+#define FT_BAUD_19200		19200
+#define FT_BAUD_38400		38400
+#define FT_BAUD_57600		57600
+#define FT_BAUD_115200		115200
+#define FT_BAUD_230400		230400
+#define FT_BAUD_460800		460800
+#define FT_BAUD_921600		921600
+
+//
+// Word Lengths
+//
+
+#define FT_BITS_8			(UCHAR) 8
+#define FT_BITS_7			(UCHAR) 7
+
+//
+// Stop Bits
+//
+
+#define FT_STOP_BITS_1		(UCHAR) 0
+#define FT_STOP_BITS_2		(UCHAR) 2
+
+//
+// Parity
+//
+
+#define FT_PARITY_NONE		(UCHAR) 0
+#define FT_PARITY_ODD		(UCHAR) 1
+#define FT_PARITY_EVEN		(UCHAR) 2
+#define FT_PARITY_MARK		(UCHAR) 3
+#define FT_PARITY_SPACE		(UCHAR) 4
+
+//
+// Flow Control
+//
+
+#define FT_FLOW_NONE		0x0000
+#define FT_FLOW_RTS_CTS		0x0100
+#define FT_FLOW_DTR_DSR		0x0200
+#define FT_FLOW_XON_XOFF	0x0400
+
+//
+// Purge rx and tx buffers
+//
+#define FT_PURGE_RX			1
+#define FT_PURGE_TX			2
+
+//
+// Events
+//
+
+typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);
+
+#define FT_EVENT_RXCHAR			1
+#define FT_EVENT_MODEM_STATUS	2
+#define FT_EVENT_LINE_STATUS	4
+
+//
+// Timeouts
+//
+
+#define FT_DEFAULT_RX_TIMEOUT	300
+#define FT_DEFAULT_TX_TIMEOUT	300
+
+//
+// Device types
+//
+
+typedef ULONG	FT_DEVICE;
+
+enum {
+	FT_DEVICE_BM,
+	FT_DEVICE_AM,
+	FT_DEVICE_100AX,
+	FT_DEVICE_UNKNOWN,
+	FT_DEVICE_2232C,
+	FT_DEVICE_232R,
+	FT_DEVICE_2232H,
+	FT_DEVICE_4232H,
+	FT_DEVICE_232H,
+	FT_DEVICE_X_SERIES
+};
+
+//
+// Bit Modes
+//
+
+#define FT_BITMODE_RESET					0x00
+#define FT_BITMODE_ASYNC_BITBANG			0x01
+#define FT_BITMODE_MPSSE					0x02
+#define FT_BITMODE_SYNC_BITBANG				0x04
+#define FT_BITMODE_MCU_HOST					0x08
+#define FT_BITMODE_FAST_SERIAL				0x10
+#define FT_BITMODE_CBUS_BITBANG				0x20
+#define FT_BITMODE_SYNC_FIFO				0x40
+
+//
+// FT232R CBUS Options EEPROM values
+//
+
+#define FT_232R_CBUS_TXDEN					0x00	//	Tx Data Enable
+#define FT_232R_CBUS_PWRON					0x01	//	Power On
+#define FT_232R_CBUS_RXLED					0x02	//	Rx LED
+#define FT_232R_CBUS_TXLED					0x03	//	Tx LED
+#define FT_232R_CBUS_TXRXLED				0x04	//	Tx and Rx LED
+#define FT_232R_CBUS_SLEEP					0x05	//	Sleep
+#define FT_232R_CBUS_CLK48					0x06	//	48MHz clock
+#define FT_232R_CBUS_CLK24					0x07	//	24MHz clock
+#define FT_232R_CBUS_CLK12					0x08	//	12MHz clock
+#define FT_232R_CBUS_CLK6					0x09	//	6MHz clock
+#define FT_232R_CBUS_IOMODE					0x0A	//	IO Mode for CBUS bit-bang
+#define FT_232R_CBUS_BITBANG_WR				0x0B	//	Bit-bang write strobe
+#define FT_232R_CBUS_BITBANG_RD				0x0C	//	Bit-bang read strobe
+
+//
+// FT232H CBUS Options EEPROM values
+//
+
+#define FT_232H_CBUS_TRISTATE				0x00	//	Tristate
+#define FT_232H_CBUS_TXLED					0x01	//	Tx LED
+#define FT_232H_CBUS_RXLED					0x02	//	Rx LED
+#define FT_232H_CBUS_TXRXLED				0x03	//	Tx and Rx LED
+#define FT_232H_CBUS_PWREN					0x04	//	Power Enable
+#define FT_232H_CBUS_SLEEP					0x05	//	Sleep
+#define FT_232H_CBUS_DRIVE_0				0x06	//	Drive pin to logic 0
+#define FT_232H_CBUS_DRIVE_1				0x07	//	Drive pin to logic 1
+#define FT_232H_CBUS_IOMODE					0x08	//	IO Mode for CBUS bit-bang
+#define FT_232H_CBUS_TXDEN					0x09	//	Tx Data Enable
+#define FT_232H_CBUS_CLK30					0x0A	//	30MHz clock
+#define FT_232H_CBUS_CLK15					0x0B	//	15MHz clock
+#define FT_232H_CBUS_CLK7_5					0x0C	//	7.5MHz clock
+
+//
+// FT X Series CBUS Options EEPROM values
+//
+
+#define FT_X_SERIES_CBUS_TRISTATE			0x00	//	Tristate
+#define FT_X_SERIES_CBUS_RXLED				0x01	//	Tx LED
+#define FT_X_SERIES_CBUS_TXLED				0x02	//	Rx LED
+#define FT_X_SERIES_CBUS_TXRXLED			0x03	//	Tx and Rx LED
+#define FT_X_SERIES_CBUS_PWREN				0x04	//	Power Enable
+#define FT_X_SERIES_CBUS_SLEEP				0x05	//	Sleep
+#define FT_X_SERIES_CBUS_DRIVE_0			0x06	//	Drive pin to logic 0
+#define FT_X_SERIES_CBUS_DRIVE_1			0x07	//	Drive pin to logic 1
+#define FT_X_SERIES_CBUS_IOMODE				0x08	//	IO Mode for CBUS bit-bang
+#define FT_X_SERIES_CBUS_TXDEN				0x09	//	Tx Data Enable
+#define FT_X_SERIES_CBUS_CLK24				0x0A	//	24MHz clock
+#define FT_X_SERIES_CBUS_CLK12				0x0B	//	12MHz clock
+#define FT_X_SERIES_CBUS_CLK6				0x0C	//	6MHz clock
+#define FT_X_SERIES_CBUS_BCD_CHARGER		0x0D	//	Battery charger detected
+#define FT_X_SERIES_CBUS_BCD_CHARGER_N		0x0E	//	Battery charger detected inverted
+#define FT_X_SERIES_CBUS_I2C_TXE			0x0F	//	I2C Tx empty
+#define FT_X_SERIES_CBUS_I2C_RXF			0x10	//	I2C Rx full
+#define FT_X_SERIES_CBUS_VBUS_SENSE			0x11	//	Detect VBUS
+#define FT_X_SERIES_CBUS_BITBANG_WR			0x12	//	Bit-bang write strobe
+#define FT_X_SERIES_CBUS_BITBANG_RD			0x13	//	Bit-bang read strobe
+#define FT_X_SERIES_CBUS_TIMESTAMP			0x14	//	Toggle output when a USB SOF token is received
+#define FT_X_SERIES_CBUS_KEEP_AWAKE			0x15	//	
+
+
+// Driver types
+#define FT_DRIVER_TYPE_D2XX		0
+#define FT_DRIVER_TYPE_VCP		1
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Open(
+		int deviceNumber,
+		FT_HANDLE *pHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_OpenEx(
+		PVOID pArg1,
+		DWORD Flags,
+		FT_HANDLE *pHandle
+		);
+
+	FTD2XX_API 
+		FT_STATUS WINAPI FT_ListDevices(
+		PVOID pArg1,
+		PVOID pArg2,
+		DWORD Flags
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Close(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Read(
+		FT_HANDLE ftHandle,
+		LPVOID lpBuffer,
+		DWORD dwBytesToRead,
+		LPDWORD lpBytesReturned
+		);
+
+	FTD2XX_API 
+		FT_STATUS WINAPI FT_Write(
+		FT_HANDLE ftHandle,
+		LPVOID lpBuffer,
+		DWORD dwBytesToWrite,
+		LPDWORD lpBytesWritten
+		);
+
+	FTD2XX_API 
+		FT_STATUS WINAPI FT_IoCtl(
+		FT_HANDLE ftHandle,
+		DWORD dwIoControlCode,
+		LPVOID lpInBuf,
+		DWORD nInBufSize,
+		LPVOID lpOutBuf,
+		DWORD nOutBufSize,
+		LPDWORD lpBytesReturned,
+		LPOVERLAPPED lpOverlapped
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetBaudRate(
+		FT_HANDLE ftHandle,
+		ULONG BaudRate
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetDivisor(
+		FT_HANDLE ftHandle,
+		USHORT Divisor
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetDataCharacteristics(
+		FT_HANDLE ftHandle,
+		UCHAR WordLength,
+		UCHAR StopBits,
+		UCHAR Parity
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetFlowControl(
+		FT_HANDLE ftHandle,
+		USHORT FlowControl,
+		UCHAR XonChar,
+		UCHAR XoffChar
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_ResetDevice(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetDtr(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_ClrDtr(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetRts(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_ClrRts(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetModemStatus(
+		FT_HANDLE ftHandle,
+		ULONG *pModemStatus
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetChars(
+		FT_HANDLE ftHandle,
+		UCHAR EventChar,
+		UCHAR EventCharEnabled,
+		UCHAR ErrorChar,
+		UCHAR ErrorCharEnabled
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Purge(
+		FT_HANDLE ftHandle,
+		ULONG Mask
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetTimeouts(
+		FT_HANDLE ftHandle,
+		ULONG ReadTimeout,
+		ULONG WriteTimeout
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetQueueStatus(
+		FT_HANDLE ftHandle,
+		DWORD *dwRxBytes
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetEventNotification(
+		FT_HANDLE ftHandle,
+		DWORD Mask,
+		PVOID Param
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetStatus(
+		FT_HANDLE ftHandle,
+		DWORD *dwRxBytes,
+		DWORD *dwTxBytes,
+		DWORD *dwEventDWord
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetBreakOn(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetBreakOff(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetWaitMask(
+		FT_HANDLE ftHandle,
+		DWORD Mask
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_WaitOnMask(
+		FT_HANDLE ftHandle,
+		DWORD *Mask
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetEventStatus(
+		FT_HANDLE ftHandle,
+		DWORD *dwEventDWord
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_ReadEE(
+		FT_HANDLE ftHandle,
+		DWORD dwWordOffset,
+		LPWORD lpwValue
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_WriteEE(
+		FT_HANDLE ftHandle,
+		DWORD dwWordOffset,
+		WORD wValue
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EraseEE(
+		FT_HANDLE ftHandle
+		);
+
+	//
+	// structure to hold program data for FT_EE_Program, FT_EE_ProgramEx, FT_EE_Read 
+	// and FT_EE_ReadEx functions
+	//
+	typedef struct ft_program_data {
+
+		DWORD Signature1;			// Header - must be 0x00000000 
+		DWORD Signature2;			// Header - must be 0xffffffff
+		DWORD Version;				// Header - FT_PROGRAM_DATA version
+		//			0 = original
+		//			1 = FT2232 extensions
+		//			2 = FT232R extensions
+		//			3 = FT2232H extensions
+		//			4 = FT4232H extensions
+		//			5 = FT232H extensions
+
+		WORD VendorId;				// 0x0403
+		WORD ProductId;				// 0x6001
+		char *Manufacturer;			// "FTDI"
+		char *ManufacturerId;		// "FT"
+		char *Description;			// "USB HS Serial Converter"
+		char *SerialNumber;			// "FT000001" if fixed, or NULL
+		WORD MaxPower;				// 0 < MaxPower <= 500
+		WORD PnP;					// 0 = disabled, 1 = enabled
+		WORD SelfPowered;			// 0 = bus powered, 1 = self powered
+		WORD RemoteWakeup;			// 0 = not capable, 1 = capable
+		//
+		// Rev4 (FT232B) extensions
+		//
+		UCHAR Rev4;					// non-zero if Rev4 chip, zero otherwise
+		UCHAR IsoIn;				// non-zero if in endpoint is isochronous
+		UCHAR IsoOut;				// non-zero if out endpoint is isochronous
+		UCHAR PullDownEnable;		// non-zero if pull down enabled
+		UCHAR SerNumEnable;			// non-zero if serial number to be used
+		UCHAR USBVersionEnable;		// non-zero if chip uses USBVersion
+		WORD USBVersion;			// BCD (0x0200 => USB2)
+		//
+		// Rev 5 (FT2232) extensions
+		//
+		UCHAR Rev5;					// non-zero if Rev5 chip, zero otherwise
+		UCHAR IsoInA;				// non-zero if in endpoint is isochronous
+		UCHAR IsoInB;				// non-zero if in endpoint is isochronous
+		UCHAR IsoOutA;				// non-zero if out endpoint is isochronous
+		UCHAR IsoOutB;				// non-zero if out endpoint is isochronous
+		UCHAR PullDownEnable5;		// non-zero if pull down enabled
+		UCHAR SerNumEnable5;		// non-zero if serial number to be used
+		UCHAR USBVersionEnable5;	// non-zero if chip uses USBVersion
+		WORD USBVersion5;			// BCD (0x0200 => USB2)
+		UCHAR AIsHighCurrent;		// non-zero if interface is high current
+		UCHAR BIsHighCurrent;		// non-zero if interface is high current
+		UCHAR IFAIsFifo;			// non-zero if interface is 245 FIFO
+		UCHAR IFAIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR IFAIsFastSer;			// non-zero if interface is Fast serial
+		UCHAR AIsVCP;				// non-zero if interface is to use VCP drivers
+		UCHAR IFBIsFifo;			// non-zero if interface is 245 FIFO
+		UCHAR IFBIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR IFBIsFastSer;			// non-zero if interface is Fast serial
+		UCHAR BIsVCP;				// non-zero if interface is to use VCP drivers
+		//
+		// Rev 6 (FT232R) extensions
+		//
+		UCHAR UseExtOsc;			// Use External Oscillator
+		UCHAR HighDriveIOs;			// High Drive I/Os
+		UCHAR EndpointSize;			// Endpoint size
+		UCHAR PullDownEnableR;		// non-zero if pull down enabled
+		UCHAR SerNumEnableR;		// non-zero if serial number to be used
+		UCHAR InvertTXD;			// non-zero if invert TXD
+		UCHAR InvertRXD;			// non-zero if invert RXD
+		UCHAR InvertRTS;			// non-zero if invert RTS
+		UCHAR InvertCTS;			// non-zero if invert CTS
+		UCHAR InvertDTR;			// non-zero if invert DTR
+		UCHAR InvertDSR;			// non-zero if invert DSR
+		UCHAR InvertDCD;			// non-zero if invert DCD
+		UCHAR InvertRI;				// non-zero if invert RI
+		UCHAR Cbus0;				// Cbus Mux control
+		UCHAR Cbus1;				// Cbus Mux control
+		UCHAR Cbus2;				// Cbus Mux control
+		UCHAR Cbus3;				// Cbus Mux control
+		UCHAR Cbus4;				// Cbus Mux control
+		UCHAR RIsD2XX;				// non-zero if using D2XX driver
+		//
+		// Rev 7 (FT2232H) Extensions
+		//
+		UCHAR PullDownEnable7;		// non-zero if pull down enabled
+		UCHAR SerNumEnable7;		// non-zero if serial number to be used
+		UCHAR ALSlowSlew;			// non-zero if AL pins have slow slew
+		UCHAR ALSchmittInput;		// non-zero if AL pins are Schmitt input
+		UCHAR ALDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR AHSlowSlew;			// non-zero if AH pins have slow slew
+		UCHAR AHSchmittInput;		// non-zero if AH pins are Schmitt input
+		UCHAR AHDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BLSlowSlew;			// non-zero if BL pins have slow slew
+		UCHAR BLSchmittInput;		// non-zero if BL pins are Schmitt input
+		UCHAR BLDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BHSlowSlew;			// non-zero if BH pins have slow slew
+		UCHAR BHSchmittInput;		// non-zero if BH pins are Schmitt input
+		UCHAR BHDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR IFAIsFifo7;			// non-zero if interface is 245 FIFO
+		UCHAR IFAIsFifoTar7;		// non-zero if interface is 245 FIFO CPU target
+		UCHAR IFAIsFastSer7;		// non-zero if interface is Fast serial
+		UCHAR AIsVCP7;				// non-zero if interface is to use VCP drivers
+		UCHAR IFBIsFifo7;			// non-zero if interface is 245 FIFO
+		UCHAR IFBIsFifoTar7;		// non-zero if interface is 245 FIFO CPU target
+		UCHAR IFBIsFastSer7;		// non-zero if interface is Fast serial
+		UCHAR BIsVCP7;				// non-zero if interface is to use VCP drivers
+		UCHAR PowerSaveEnable;		// non-zero if using BCBUS7 to save power for self-powered designs
+		//
+		// Rev 8 (FT4232H) Extensions
+		//
+		UCHAR PullDownEnable8;		// non-zero if pull down enabled
+		UCHAR SerNumEnable8;		// non-zero if serial number to be used
+		UCHAR ASlowSlew;			// non-zero if A pins have slow slew
+		UCHAR ASchmittInput;		// non-zero if A pins are Schmitt input
+		UCHAR ADriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BSlowSlew;			// non-zero if B pins have slow slew
+		UCHAR BSchmittInput;		// non-zero if B pins are Schmitt input
+		UCHAR BDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR CSlowSlew;			// non-zero if C pins have slow slew
+		UCHAR CSchmittInput;		// non-zero if C pins are Schmitt input
+		UCHAR CDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR DSlowSlew;			// non-zero if D pins have slow slew
+		UCHAR DSchmittInput;		// non-zero if D pins are Schmitt input
+		UCHAR DDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR ARIIsTXDEN;			// non-zero if port A uses RI as RS485 TXDEN
+		UCHAR BRIIsTXDEN;			// non-zero if port B uses RI as RS485 TXDEN
+		UCHAR CRIIsTXDEN;			// non-zero if port C uses RI as RS485 TXDEN
+		UCHAR DRIIsTXDEN;			// non-zero if port D uses RI as RS485 TXDEN
+		UCHAR AIsVCP8;				// non-zero if interface is to use VCP drivers
+		UCHAR BIsVCP8;				// non-zero if interface is to use VCP drivers
+		UCHAR CIsVCP8;				// non-zero if interface is to use VCP drivers
+		UCHAR DIsVCP8;				// non-zero if interface is to use VCP drivers
+		//
+		// Rev 9 (FT232H) Extensions
+		//
+		UCHAR PullDownEnableH;		// non-zero if pull down enabled
+		UCHAR SerNumEnableH;		// non-zero if serial number to be used
+		UCHAR ACSlowSlewH;			// non-zero if AC pins have slow slew
+		UCHAR ACSchmittInputH;		// non-zero if AC pins are Schmitt input
+		UCHAR ACDriveCurrentH;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR ADSlowSlewH;			// non-zero if AD pins have slow slew
+		UCHAR ADSchmittInputH;		// non-zero if AD pins are Schmitt input
+		UCHAR ADDriveCurrentH;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR Cbus0H;				// Cbus Mux control
+		UCHAR Cbus1H;				// Cbus Mux control
+		UCHAR Cbus2H;				// Cbus Mux control
+		UCHAR Cbus3H;				// Cbus Mux control
+		UCHAR Cbus4H;				// Cbus Mux control
+		UCHAR Cbus5H;				// Cbus Mux control
+		UCHAR Cbus6H;				// Cbus Mux control
+		UCHAR Cbus7H;				// Cbus Mux control
+		UCHAR Cbus8H;				// Cbus Mux control
+		UCHAR Cbus9H;				// Cbus Mux control
+		UCHAR IsFifoH;				// non-zero if interface is 245 FIFO
+		UCHAR IsFifoTarH;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR IsFastSerH;			// non-zero if interface is Fast serial
+		UCHAR IsFT1248H;			// non-zero if interface is FT1248
+		UCHAR FT1248CpolH;			// FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+		UCHAR FT1248LsbH;			// FT1248 data is LSB (1) or MSB (0)
+		UCHAR FT1248FlowControlH;	// FT1248 flow control enable
+		UCHAR IsVCPH;				// non-zero if interface is to use VCP drivers
+		UCHAR PowerSaveEnableH;		// non-zero if using ACBUS7 to save power for self-powered designs
+		
+	} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_Program(
+		FT_HANDLE ftHandle,
+		PFT_PROGRAM_DATA pData
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_ProgramEx(
+		FT_HANDLE ftHandle,
+		PFT_PROGRAM_DATA pData,
+		char *Manufacturer,
+		char *ManufacturerId,
+		char *Description,
+		char *SerialNumber
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_Read(
+		FT_HANDLE ftHandle,
+		PFT_PROGRAM_DATA pData
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_ReadEx(
+		FT_HANDLE ftHandle,
+		PFT_PROGRAM_DATA pData,
+		char *Manufacturer,
+		char *ManufacturerId,
+		char *Description,
+		char *SerialNumber
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_UASize(
+		FT_HANDLE ftHandle,
+		LPDWORD lpdwSize
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_UAWrite(
+		FT_HANDLE ftHandle,
+		PUCHAR pucData,
+		DWORD dwDataLen
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_UARead(
+		FT_HANDLE ftHandle,
+		PUCHAR pucData,
+		DWORD dwDataLen,
+		LPDWORD lpdwBytesRead
+		);
+
+
+	typedef struct ft_eeprom_header {
+		FT_DEVICE deviceType;		// FTxxxx device type to be programmed
+		// Device descriptor options
+		WORD VendorId;				// 0x0403
+		WORD ProductId;				// 0x6001
+		UCHAR SerNumEnable;			// non-zero if serial number to be used
+		// Config descriptor options
+		WORD MaxPower;				// 0 < MaxPower <= 500
+		UCHAR SelfPowered;			// 0 = bus powered, 1 = self powered
+		UCHAR RemoteWakeup;			// 0 = not capable, 1 = capable
+		// Hardware options
+		UCHAR PullDownEnable;		// non-zero if pull down in suspend enabled
+	} FT_EEPROM_HEADER, *PFT_EEPROM_HEADER;
+
+
+	// FT232B EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_232b {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+	} FT_EEPROM_232B, *PFT_EEPROM_232B;
+
+
+	// FT2232 EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_2232 {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR AIsHighCurrent;		// non-zero if interface is high current
+		UCHAR BIsHighCurrent;		// non-zero if interface is high current
+		// Hardware options
+		UCHAR AIsFifo;				// non-zero if interface is 245 FIFO
+		UCHAR AIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR AIsFastSer;			// non-zero if interface is Fast serial
+		UCHAR BIsFifo;				// non-zero if interface is 245 FIFO
+		UCHAR BIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR BIsFastSer;			// non-zero if interface is Fast serial
+		// Driver option
+		UCHAR ADriverType;			// 
+		UCHAR BDriverType;			// 
+	} FT_EEPROM_2232, *PFT_EEPROM_2232;
+
+
+	// FT232R EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_232r {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR IsHighCurrent;		// non-zero if interface is high current
+		// Hardware options
+		UCHAR UseExtOsc;			// Use External Oscillator
+		UCHAR InvertTXD;			// non-zero if invert TXD
+		UCHAR InvertRXD;			// non-zero if invert RXD
+		UCHAR InvertRTS;			// non-zero if invert RTS
+		UCHAR InvertCTS;			// non-zero if invert CTS
+		UCHAR InvertDTR;			// non-zero if invert DTR
+		UCHAR InvertDSR;			// non-zero if invert DSR
+		UCHAR InvertDCD;			// non-zero if invert DCD
+		UCHAR InvertRI;				// non-zero if invert RI
+		UCHAR Cbus0;				// Cbus Mux control
+		UCHAR Cbus1;				// Cbus Mux control
+		UCHAR Cbus2;				// Cbus Mux control
+		UCHAR Cbus3;				// Cbus Mux control
+		UCHAR Cbus4;				// Cbus Mux control
+		// Driver option
+		UCHAR DriverType;			// 
+	} FT_EEPROM_232R, *PFT_EEPROM_232R;
+
+
+	// FT2232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_2232h {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR ALSlowSlew;			// non-zero if AL pins have slow slew
+		UCHAR ALSchmittInput;		// non-zero if AL pins are Schmitt input
+		UCHAR ALDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR AHSlowSlew;			// non-zero if AH pins have slow slew
+		UCHAR AHSchmittInput;		// non-zero if AH pins are Schmitt input
+		UCHAR AHDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BLSlowSlew;			// non-zero if BL pins have slow slew
+		UCHAR BLSchmittInput;		// non-zero if BL pins are Schmitt input
+		UCHAR BLDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BHSlowSlew;			// non-zero if BH pins have slow slew
+		UCHAR BHSchmittInput;		// non-zero if BH pins are Schmitt input
+		UCHAR BHDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		// Hardware options
+		UCHAR AIsFifo;				// non-zero if interface is 245 FIFO
+		UCHAR AIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR AIsFastSer;			// non-zero if interface is Fast serial
+		UCHAR BIsFifo;				// non-zero if interface is 245 FIFO
+		UCHAR BIsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR BIsFastSer;			// non-zero if interface is Fast serial
+		UCHAR PowerSaveEnable;		// non-zero if using BCBUS7 to save power for self-powered designs
+		// Driver option
+		UCHAR ADriverType;			// 
+		UCHAR BDriverType;			// 
+	} FT_EEPROM_2232H, *PFT_EEPROM_2232H;
+
+
+	// FT4232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_4232h {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR ASlowSlew;			// non-zero if A pins have slow slew
+		UCHAR ASchmittInput;		// non-zero if A pins are Schmitt input
+		UCHAR ADriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR BSlowSlew;			// non-zero if B pins have slow slew
+		UCHAR BSchmittInput;		// non-zero if B pins are Schmitt input
+		UCHAR BDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR CSlowSlew;			// non-zero if C pins have slow slew
+		UCHAR CSchmittInput;		// non-zero if C pins are Schmitt input
+		UCHAR CDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR DSlowSlew;			// non-zero if D pins have slow slew
+		UCHAR DSchmittInput;		// non-zero if D pins are Schmitt input
+		UCHAR DDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		// Hardware options
+		UCHAR ARIIsTXDEN;			// non-zero if port A uses RI as RS485 TXDEN
+		UCHAR BRIIsTXDEN;			// non-zero if port B uses RI as RS485 TXDEN
+		UCHAR CRIIsTXDEN;			// non-zero if port C uses RI as RS485 TXDEN
+		UCHAR DRIIsTXDEN;			// non-zero if port D uses RI as RS485 TXDEN
+		// Driver option
+		UCHAR ADriverType;			// 
+		UCHAR BDriverType;			// 
+		UCHAR CDriverType;			// 
+		UCHAR DDriverType;			// 
+	} FT_EEPROM_4232H, *PFT_EEPROM_4232H;
+
+
+	// FT232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_232h {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR ACSlowSlew;			// non-zero if AC bus pins have slow slew
+		UCHAR ACSchmittInput;		// non-zero if AC bus pins are Schmitt input
+		UCHAR ACDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR ADSlowSlew;			// non-zero if AD bus pins have slow slew
+		UCHAR ADSchmittInput;		// non-zero if AD bus pins are Schmitt input
+		UCHAR ADDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		// CBUS options
+		UCHAR Cbus0;				// Cbus Mux control
+		UCHAR Cbus1;				// Cbus Mux control
+		UCHAR Cbus2;				// Cbus Mux control
+		UCHAR Cbus3;				// Cbus Mux control
+		UCHAR Cbus4;				// Cbus Mux control
+		UCHAR Cbus5;				// Cbus Mux control
+		UCHAR Cbus6;				// Cbus Mux control
+		UCHAR Cbus7;				// Cbus Mux control
+		UCHAR Cbus8;				// Cbus Mux control
+		UCHAR Cbus9;				// Cbus Mux control
+		// FT1248 options
+		UCHAR FT1248Cpol;			// FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+		UCHAR FT1248Lsb;			// FT1248 data is LSB (1) or MSB (0)
+		UCHAR FT1248FlowControl;	// FT1248 flow control enable
+		// Hardware options
+		UCHAR IsFifo;				// non-zero if interface is 245 FIFO
+		UCHAR IsFifoTar;			// non-zero if interface is 245 FIFO CPU target
+		UCHAR IsFastSer;			// non-zero if interface is Fast serial
+		UCHAR IsFT1248	;			// non-zero if interface is FT1248
+		UCHAR PowerSaveEnable;		// 
+		// Driver option
+		UCHAR DriverType;			// 
+	} FT_EEPROM_232H, *PFT_EEPROM_232H;
+
+
+	// FT X Series EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+	typedef struct ft_eeprom_x_series {
+		// Common header
+		FT_EEPROM_HEADER common;	// common elements for all device EEPROMs
+		// Drive options
+		UCHAR ACSlowSlew;			// non-zero if AC bus pins have slow slew
+		UCHAR ACSchmittInput;		// non-zero if AC bus pins are Schmitt input
+		UCHAR ACDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		UCHAR ADSlowSlew;			// non-zero if AD bus pins have slow slew
+		UCHAR ADSchmittInput;		// non-zero if AD bus pins are Schmitt input
+		UCHAR ADDriveCurrent;		// valid values are 4mA, 8mA, 12mA, 16mA
+		// CBUS options
+		UCHAR Cbus0;				// Cbus Mux control
+		UCHAR Cbus1;				// Cbus Mux control
+		UCHAR Cbus2;				// Cbus Mux control
+		UCHAR Cbus3;				// Cbus Mux control
+		UCHAR Cbus4;				// Cbus Mux control
+		UCHAR Cbus5;				// Cbus Mux control
+		UCHAR Cbus6;				// Cbus Mux control
+		// UART signal options
+		UCHAR InvertTXD;			// non-zero if invert TXD
+		UCHAR InvertRXD;			// non-zero if invert RXD
+		UCHAR InvertRTS;			// non-zero if invert RTS
+		UCHAR InvertCTS;			// non-zero if invert CTS
+		UCHAR InvertDTR;			// non-zero if invert DTR
+		UCHAR InvertDSR;			// non-zero if invert DSR
+		UCHAR InvertDCD;			// non-zero if invert DCD
+		UCHAR InvertRI;				// non-zero if invert RI
+		// Battery Charge Detect options
+		UCHAR BCDEnable;			// Enable Battery Charger Detection
+		UCHAR BCDForceCbusPWREN;	// asserts the power enable signal on CBUS when charging port detected
+		UCHAR BCDDisableSleep;		// forces the device never to go into sleep mode
+		// I2C options
+		WORD I2CSlaveAddress;		// I2C slave device address
+		DWORD I2CDeviceId;			// I2C device ID
+		UCHAR I2CDisableSchmitt;	// Disable I2C Schmitt trigger
+		// FT1248 options
+		UCHAR FT1248Cpol;			// FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+		UCHAR FT1248Lsb;			// FT1248 data is LSB (1) or MSB (0)
+		UCHAR FT1248FlowControl;	// FT1248 flow control enable
+		// Hardware options
+		UCHAR RS485EchoSuppress;	// 
+		UCHAR PowerSaveEnable;		// 
+		// Driver option
+		UCHAR DriverType;			// 
+	} FT_EEPROM_X_SERIES, *PFT_EEPROM_X_SERIES;
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EEPROM_Read(
+		FT_HANDLE ftHandle,
+		void *eepromData,
+		DWORD eepromDataSize,
+		char *Manufacturer,
+		char *ManufacturerId,
+		char *Description,
+		char *SerialNumber
+		);
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EEPROM_Program(
+		FT_HANDLE ftHandle,
+		void *eepromData,
+		DWORD eepromDataSize,
+		char *Manufacturer,
+		char *ManufacturerId,
+		char *Description,
+		char *SerialNumber
+		);
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetLatencyTimer(
+		FT_HANDLE ftHandle,
+		UCHAR ucLatency
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetLatencyTimer(
+		FT_HANDLE ftHandle,
+		PUCHAR pucLatency
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetBitMode(
+		FT_HANDLE ftHandle,
+		UCHAR ucMask,
+		UCHAR ucEnable
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetBitMode(
+		FT_HANDLE ftHandle,
+		PUCHAR pucMode
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetUSBParameters(
+		FT_HANDLE ftHandle,
+		ULONG ulInTransferSize,
+		ULONG ulOutTransferSize
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetDeadmanTimeout(
+		FT_HANDLE ftHandle,
+		ULONG ulDeadmanTimeout
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetDeviceInfo(
+		FT_HANDLE ftHandle,
+		FT_DEVICE *lpftDevice,
+		LPDWORD lpdwID,
+		PCHAR SerialNumber,
+		PCHAR Description,
+		LPVOID Dummy
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_StopInTask(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_RestartInTask(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_SetResetPipeRetryCount(
+		FT_HANDLE ftHandle,
+		DWORD dwCount
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_ResetPort(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_CyclePort(
+		FT_HANDLE ftHandle
+		);
+
+
+	//
+	// Win32-type functions
+	//
+
+	FTD2XX_API
+		FT_HANDLE WINAPI FT_W32_CreateFile(
+		LPCTSTR					lpszName,
+		DWORD					dwAccess,
+		DWORD					dwShareMode,
+		LPSECURITY_ATTRIBUTES	lpSecurityAttributes,
+		DWORD					dwCreate,
+		DWORD					dwAttrsAndFlags,
+		HANDLE					hTemplate
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_CloseHandle(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_ReadFile(
+		FT_HANDLE ftHandle,
+		LPVOID lpBuffer,
+		DWORD nBufferSize,
+		LPDWORD lpBytesReturned,
+		LPOVERLAPPED lpOverlapped
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_WriteFile(
+		FT_HANDLE ftHandle,
+		LPVOID lpBuffer,
+		DWORD nBufferSize,
+		LPDWORD lpBytesWritten,
+		LPOVERLAPPED lpOverlapped
+		);
+
+	FTD2XX_API
+		DWORD WINAPI FT_W32_GetLastError(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_GetOverlappedResult(
+		FT_HANDLE ftHandle,
+		LPOVERLAPPED lpOverlapped,
+		LPDWORD lpdwBytesTransferred,
+		BOOL bWait
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_CancelIo(
+		FT_HANDLE ftHandle
+		);
+
+
+	//
+	// Win32 COMM API type functions
+	//
+	typedef struct _FTCOMSTAT {
+		DWORD fCtsHold : 1;
+		DWORD fDsrHold : 1;
+		DWORD fRlsdHold : 1;
+		DWORD fXoffHold : 1;
+		DWORD fXoffSent : 1;
+		DWORD fEof : 1;
+		DWORD fTxim : 1;
+		DWORD fReserved : 25;
+		DWORD cbInQue;
+		DWORD cbOutQue;
+	} FTCOMSTAT, *LPFTCOMSTAT;
+
+	typedef struct _FTDCB {
+		DWORD DCBlength;			/* sizeof(FTDCB)						*/
+		DWORD BaudRate;				/* Baudrate at which running			*/
+		DWORD fBinary: 1;			/* Binary Mode (skip EOF check)			*/
+		DWORD fParity: 1;			/* Enable parity checking				*/
+		DWORD fOutxCtsFlow:1;		/* CTS handshaking on output			*/
+		DWORD fOutxDsrFlow:1;		/* DSR handshaking on output			*/
+		DWORD fDtrControl:2;		/* DTR Flow control						*/
+		DWORD fDsrSensitivity:1;	/* DSR Sensitivity						*/
+		DWORD fTXContinueOnXoff: 1;	/* Continue TX when Xoff sent			*/
+		DWORD fOutX: 1;				/* Enable output X-ON/X-OFF				*/
+		DWORD fInX: 1;				/* Enable input X-ON/X-OFF				*/
+		DWORD fErrorChar: 1;		/* Enable Err Replacement				*/
+		DWORD fNull: 1;				/* Enable Null stripping				*/
+		DWORD fRtsControl:2;		/* Rts Flow control						*/
+		DWORD fAbortOnError:1;		/* Abort all reads and writes on Error	*/
+		DWORD fDummy2:17;			/* Reserved								*/
+		WORD wReserved;				/* Not currently used					*/
+		WORD XonLim;				/* Transmit X-ON threshold				*/
+		WORD XoffLim;				/* Transmit X-OFF threshold				*/
+		BYTE ByteSize;				/* Number of bits/byte, 4-8				*/
+		BYTE Parity;				/* 0-4=None,Odd,Even,Mark,Space			*/
+		BYTE StopBits;				/* 0,1,2 = 1, 1.5, 2					*/
+		char XonChar;				/* Tx and Rx X-ON character				*/
+		char XoffChar;				/* Tx and Rx X-OFF character			*/
+		char ErrorChar;				/* Error replacement char				*/
+		char EofChar;				/* End of Input character				*/
+		char EvtChar;				/* Received Event character				*/
+		WORD wReserved1;			/* Fill for now.						*/
+	} FTDCB, *LPFTDCB;
+
+	typedef struct _FTTIMEOUTS {
+		DWORD ReadIntervalTimeout;			/* Maximum time between read chars.	*/
+		DWORD ReadTotalTimeoutMultiplier;	/* Multiplier of characters.		*/
+		DWORD ReadTotalTimeoutConstant;		/* Constant in milliseconds.		*/
+		DWORD WriteTotalTimeoutMultiplier;	/* Multiplier of characters.		*/
+		DWORD WriteTotalTimeoutConstant;	/* Constant in milliseconds.		*/
+	} FTTIMEOUTS,*LPFTTIMEOUTS;
+
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_ClearCommBreak(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_ClearCommError(
+		FT_HANDLE ftHandle,
+		LPDWORD lpdwErrors,
+		LPFTCOMSTAT lpftComstat
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_EscapeCommFunction(
+		FT_HANDLE ftHandle,
+		DWORD dwFunc
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_GetCommModemStatus(
+		FT_HANDLE ftHandle,
+		LPDWORD lpdwModemStatus
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_GetCommState(
+		FT_HANDLE ftHandle,
+		LPFTDCB lpftDcb
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_GetCommTimeouts(
+		FT_HANDLE ftHandle,
+		FTTIMEOUTS *pTimeouts
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_PurgeComm(
+		FT_HANDLE ftHandle,
+		DWORD dwMask
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_SetCommBreak(
+		FT_HANDLE ftHandle
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_SetCommMask(
+		FT_HANDLE ftHandle,
+		ULONG ulEventMask
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_GetCommMask(
+		FT_HANDLE ftHandle,
+		LPDWORD lpdwEventMask
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_SetCommState(
+		FT_HANDLE ftHandle,
+		LPFTDCB lpftDcb
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_SetCommTimeouts(
+		FT_HANDLE ftHandle,
+		FTTIMEOUTS *pTimeouts
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_SetupComm(
+		FT_HANDLE ftHandle,
+		DWORD dwReadBufferSize,
+		DWORD dwWriteBufferSize
+		);
+
+	FTD2XX_API
+		BOOL WINAPI FT_W32_WaitCommEvent(
+		FT_HANDLE ftHandle,
+		PULONG pulEvent,
+		LPOVERLAPPED lpOverlapped
+		);
+
+
+	//
+	// Device information
+	//
+
+	typedef struct _ft_device_list_info_node {
+		ULONG Flags;
+		ULONG Type;
+		ULONG ID;
+		DWORD LocId;
+		char SerialNumber[16];
+		char Description[64];
+		FT_HANDLE ftHandle;
+	} FT_DEVICE_LIST_INFO_NODE;
+
+	// Device information flags
+	enum {
+		FT_FLAGS_OPENED = 1,
+		FT_FLAGS_HISPEED = 2
+	};
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_CreateDeviceInfoList(
+		LPDWORD lpdwNumDevs
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetDeviceInfoList(
+		FT_DEVICE_LIST_INFO_NODE *pDest,
+		LPDWORD lpdwNumDevs
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetDeviceInfoDetail(
+		DWORD dwIndex,
+		LPDWORD lpdwFlags,
+		LPDWORD lpdwType,
+		LPDWORD lpdwID,
+		LPDWORD lpdwLocId,
+		LPVOID lpSerialNumber,
+		LPVOID lpDescription,
+		FT_HANDLE *pftHandle
+		);
+
+
+	//
+	// Version information
+	//
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetDriverVersion(
+		FT_HANDLE ftHandle,
+		LPDWORD lpdwVersion
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetLibraryVersion(
+		LPDWORD lpdwVersion
+		);
+
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Rescan(
+		void
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_Reload(
+		WORD wVid,
+		WORD wPid
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetComPortNumber(
+		FT_HANDLE ftHandle,
+		LPLONG	lpdwComPortNumber
+		);
+
+
+	//
+	// FT232H additional EEPROM functions
+	//
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_ReadConfig(
+		FT_HANDLE ftHandle,
+		UCHAR ucAddress,
+		PUCHAR pucValue
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_WriteConfig(
+		FT_HANDLE ftHandle,
+		UCHAR ucAddress,
+		UCHAR ucValue
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_EE_ReadECC(
+		FT_HANDLE ftHandle,
+		UCHAR ucOption,
+		LPWORD lpwValue
+		);
+
+	FTD2XX_API
+		FT_STATUS WINAPI FT_GetQueueStatusEx(
+		FT_HANDLE ftHandle,
+		DWORD *dwRxBytes
+		);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif	/* FTD2XX_H */
+

BIN
drivers/FTDI CDM v2.08.28 Certified/ftdibus.cat


+ 131 - 0
drivers/FTDI CDM v2.08.28 Certified/ftdibus.inf

@@ -0,0 +1,131 @@
+; FTDIBUS.INF
+; 
+; Copyright © 2000-2013 Future Technology Devices International Limited
+; 
+; USB serial converter driver installation file for Windows 2000, XP, Server 2003, Vista, Server 2008,
+; Windows 7, Server 2008 R2 and Windows 8 (x86 and x64).
+; 
+; 
+; THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED ``AS IS'' AND ANY EXPRESS 
+; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED
+; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+; THE POSSIBILITY OF SUCH DAMAGE. 
+ 
+; FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+ 
+; FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+; IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE RESPONSIBILITY OF
+; THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL RE-CERTIFICATION AS A RESULT OF
+; MAKING THESE CHANGES.
+;
+
+
+[Version]
+Signature="$Windows NT$"
+DriverPackageType=PlugAndPlay
+DriverPackageDisplayName=%DESC%
+Class=USB
+ClassGUID={36fc9e60-c465-11cf-8056-444553540000}
+Provider=%FTDI%
+CatalogFile=ftdibus.cat
+DriverVer=01/18/2013,2.08.28
+
+[SourceDisksNames]
+1=%DriversDisk%,,,
+
+[SourceDisksFiles]
+ftdibus.sys = 1,i386
+ftbusui.dll = 1,i386
+ftd2xx.dll = 1,i386
+FTLang.Dll = 1,i386
+
+[SourceDisksFiles.amd64]
+ftdibus.sys = 1,amd64
+ftbusui.dll = 1,amd64
+ftd2xx64.dll = 1,amd64
+ftd2xx.dll = 1,i386
+FTLang.Dll = 1,amd64
+
+[DestinationDirs]
+FtdiBus.NT.Copy = 10,system32\drivers
+FtdiBus.NT.Copy2 = 10,system32
+FtdiBus.NTamd64.Copy = 10,system32\drivers
+FtdiBus.NTamd64.Copy2 = 10,system32
+FtdiBus.NTamd64.Copy3 = 10,syswow64
+
+
+[Manufacturer]
+%Ftdi%=FtdiHw,NTamd64
+
+[FtdiHw]
+$$DEVICE_NAME$$=FtdiBus.NT,$$HARDWARE_ID$$
+
+[FtdiHw.NTamd64]
+$$DEVICE_NAME$$=FtdiBus.NTamd64,$$HARDWARE_ID$$
+
+[ControlFlags]
+ExcludeFromSelect=*
+
+[FtdiBus.NT]
+CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
+AddReg=FtdiBus.NT.AddReg
+
+[FtdiBus.NTamd64]
+CopyFiles=FtdiBus.NTamd64.Copy,FtdiBus.NTamd64.Copy2,FtdiBus.NTamd64.Copy3
+AddReg=FtdiBus.NT.AddReg
+
+[FtdiBus.NT.Services]
+AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
+
+[FtdiBus.NTamd64.Services]
+AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
+
+[FtdiBus.NT.AddService]
+DisplayName = %SvcDesc%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %10%\system32\drivers\ftdibus.sys
+LoadOrderGroup = Base
+AddReg = FtdiBus.NT.AddService.AddReg
+
+[FtdiBus.NT.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,ftdibus.sys
+HKR,,EnumPropPages32,,"ftbusui.dll,FTBUSUIPropPageProvider"
+
+[FtdiBus.NT.AddService.AddReg]
+;HKR,Parameters,"LocIds",1,31,00,00,00,32,00,00,00,00
+;HKR,Parameters,"RetryResetCount",0x10001,50
+
+
+[FtdiBus.NT.Copy]
+ftdibus.sys
+
+[FtdiBus.NT.Copy2]
+ftbusui.dll
+ftd2xx.dll
+FTLang.dll
+
+[FtdiBus.NTamd64.Copy]
+ftdibus.sys
+
+[FtdiBus.NTamd64.Copy2]
+ftbusui.dll
+ftd2xx.dll,ftd2xx64.dll
+FTLang.dll
+
+[FtdiBus.NTamd64.Copy3]
+ftd2xx.dll
+
+[Strings]
+Ftdi="$$PROVIDER_NAME$$"
+DESC="CDM Driver Package - Bus/D2XX Driver"
+DriversDisk="FTDI USB Drivers Disk"
+SvcDesc="USB Serial Converter Driver"
+ClassName="USB"

BIN
drivers/FTDI CDM v2.08.28 Certified/ftdiport.cat


+ 167 - 0
drivers/FTDI CDM v2.08.28 Certified/ftdiport.inf

@@ -0,0 +1,167 @@
+; FTDIPORT.INF
+; 
+; Copyright © 2000-2013 Future Technology Devices International Limited
+;
+; USB serial port driver installation file for Windows 2000, XP, Server 2003, Vista, Server 2008,
+; Windows 7, Server 2008 R2 and Windows 8 (x86 and x64).
+; 
+; 
+; THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED ``AS IS'' AND ANY EXPRESS 
+; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED
+; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+; THE POSSIBILITY OF SUCH DAMAGE. 
+ 
+; FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+ 
+; FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+; IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE RESPONSIBILITY OF
+; THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL RE-CERTIFICATION AS A RESULT OF
+; MAKING THESE CHANGES.
+;
+
+
+[Version]
+Signature="$Windows NT$"
+DriverPackageType=PlugAndPlay
+DriverPackageDisplayName=%DESC%
+Class=Ports
+ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}
+Provider=%FTDI%
+CatalogFile=ftdiport.cat
+DriverVer=01/18/2013,2.08.28
+
+[SourceDisksNames]
+1=%DriversDisk%,,,
+
+[SourceDisksFiles]
+ftser2k.sys=1,i386
+ftserui2.dll=1,i386
+ftcserco.dll = 1,i386
+
+[SourceDisksFiles.amd64]
+ftser2k.sys=1,amd64
+ftserui2.dll=1,amd64
+ftcserco.dll = 1,amd64
+
+[DestinationDirs]
+FtdiPort.NT.Copy=10,system32\drivers
+FtdiPort.NT.CopyUI=10,system32
+FtdiPort.NT.CopyCoInst=10,system32
+
+[ControlFlags]
+ExcludeFromSelect=*
+
+[Manufacturer]
+%FTDI%=FtdiHw,NTamd64
+
+[FtdiHw]
+%VID_0403&PID_6001.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6001
+%VID_0403&PID_6010.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6010
+%VID_0403&PID_6011.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6011
+%VID_0403&PID_6014.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6014
+%VID_0403&PID_6015.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6015
+
+[FtdiHw.NTamd64]
+%VID_0403&PID_6001.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6001
+%VID_0403&PID_6010.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6010
+%VID_0403&PID_6011.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6011
+%VID_0403&PID_6014.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6014
+%VID_0403&PID_6015.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6015
+
+[FtdiPort.NT.AddService]
+DisplayName    = %SvcDesc%
+ServiceType    = 1 ; SERVICE_KERNEL_DRIVER
+StartType      = 3 ; SERVICE_DEMAND_START
+ErrorControl   = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary  = %10%\system32\drivers\ftser2k.sys
+LoadOrderGroup = Base
+
+
+; -------------- Serenum Driver install section
+[SerEnum_AddService]
+DisplayName    = %SerEnum.SvcDesc%
+ServiceType    = 1 ; SERVICE_KERNEL_DRIVER
+StartType      = 3 ; SERVICE_DEMAND_START
+ErrorControl   = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary  = %12%\serenum.sys
+LoadOrderGroup = PNP Filter
+
+[FtdiPort.NT.AddReg]
+HKR,,EnumPropPages32,,"ftserui2.dll,SerialPortPropPageProvider"
+
+[FtdiPort.NT.Copy]
+ftser2k.sys
+
+[FtdiPort.NT.CopyUI]
+ftserui2.dll
+
+[FtdiPort.NT.CopyCoInst]
+ftcserco.dll
+
+[FtdiPort.NT]
+CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
+AddReg=FtdiPort.NT.AddReg
+
+[FtdiPort.NTamd64]
+CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
+AddReg=FtdiPort.NT.AddReg
+
+[FtdiPort.NT.HW]
+AddReg=FtdiPort.NT.HW.AddReg
+
+[FtdiPort.NTamd64.HW]
+AddReg=FtdiPort.NT.HW.AddReg
+
+
+[FtdiPort.NT.Services]
+AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
+AddService = Serenum,,SerEnum_AddService
+DelService = FTSERIAL
+
+[FtdiPort.NTamd64.Services]
+AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
+AddService = Serenum,,SerEnum_AddService
+DelService = FTSERIAL
+
+
+[FtdiPort.NT.HW.AddReg]
+HKR,,"UpperFilters",0x00010000,"serenum"
+HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,4E,C0,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00
+HKR,,"MinReadTimeout",0x00010001,0
+HKR,,"MinWriteTimeout",0x00010001,0
+HKR,,"LatencyTimer",0x00010001,16
+
+
+[FtdiPort.NT.CoInstallers]
+AddReg=FtdiPort.NT.CoInstallers.AddReg
+CopyFiles=FtdiPort.NT.CopyCoInst
+
+[FtdiPort.NTamd64.CoInstallers]
+AddReg=FtdiPort.NT.CoInstallers.AddReg
+CopyFiles=FtdiPort.NT.CopyCoInst
+
+[FtdiPort.NT.CoInstallers.AddReg]
+HKR,,CoInstallers32,0x00010000,"ftcserco.Dll,FTCSERCoInstaller"
+
+
+;---------------------------------------------------------------;
+
+[Strings]
+FTDI="FTDI"
+DESC="CDM Driver Package - VCP Driver"
+DriversDisk="FTDI USB Drivers Disk"
+PortsClassName = "Ports (COM & LPT)"
+VID_0403&PID_6001.DeviceDesc="USB Serial Port"
+VID_0403&PID_6010.DeviceDesc="USB Serial Port"
+VID_0403&PID_6011.DeviceDesc="USB Serial Port"
+VID_0403&PID_6014.DeviceDesc="USB Serial Port"
+VID_0403&PID_6015.DeviceDesc="USB Serial Port"
+SvcDesc="USB Serial Port Driver"
+SerEnum.SvcDesc="Serenum Filter Driver"
+
+

BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftbusui.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftcserco.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.lib


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftdibus.sys


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftlang.dll


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftser2k.sys


BIN
drivers/FTDI CDM v2.08.28 Certified/i386/ftserui2.dll


BIN
drivers/Interop.CERTENROLLLib.dll


BIN
drivers/ST-Link/amd64/WdfCoInstaller01009.dll


BIN
drivers/ST-Link/amd64/winusbcoinstaller2.dll


BIN
drivers/ST-Link/dpinst_amd64.exe


BIN
drivers/ST-Link/dpinst_x86.exe


+ 12 - 0
drivers/ST-Link/driver.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <UniversalUsbDriver>
+    <UniversalDriverName>ST-Link Driver</UniversalDriverName>
+	<PrimaryInfFile>stlink_dbg_winusb.inf </PrimaryInfFile>
+	<UniqueDriverId>com.sysprogs.libusb.stlink</UniqueDriverId>
+	<FixedDriver>
+		<ManufacturerName>STMicroelectronics</ManufacturerName>
+		<DeviceNameRegex>STMicroelectronics STLink dongle</DeviceNameRegex>
+	</FixedDriver>
+  </UniversalUsbDriver>
+</ArrayOfUniversalUsbDriver>

+ 74 - 0
drivers/ST-Link/stlink_VCP.inf

@@ -0,0 +1,74 @@
+
+;
+; Installs the Virtual COM port interface of ST-Link based composite devices.
+;
+
+[Version]
+Signature = "$Windows NT$"
+Class     = Ports
+ClassGUID = {4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider  = %ManufacturerName%
+CatalogFile.NTx86  = STLinkVCP_x86.cat
+CatalogFile.NTAMD64 = STLinkVCP_x64.cat
+DriverVer=12/10/2013,1.0
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+; List of devices supporting the Virtual COM port (with the corresponding interface ID)
+[Standard.NTx86]
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374A&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374B&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374C&MI_01
+
+[Standard.NTamd64]
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374A&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374B&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374C&MI_01
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_InstallVCP]
+Include   = mdmcpq.inf
+CopyFiles = FakeModemCopyFileSection
+AddReg    = USB_InstallVCP.AddReg
+
+[USB_InstallVCP.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[USB_InstallVCP.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%DeviceNameVCP%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+; [DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.  
+; You must explicitly reference all file-list-section names in this section.
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="STMicroelectronics"
+ClassName="Universal Serial Bus devices"
+DeviceNameVCP="STMicroelectronics STLink Virtual COM Port"
+REG_MULTI_SZ = 0x00010000

+ 135 - 0
drivers/ST-Link/stlink_dbg_winusb.inf

@@ -0,0 +1,135 @@
+;
+; Installation INF for the STMicroelectronics STLINK for Windows XP SP2 or later.
+;
+
+[Version]
+Signature = "$Windows NT$"
+Class     = STLinkWinUSB
+ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
+Provider  = %ManufacturerName%
+CatalogFile.NTx86  = STLinkDbgWinUSB_x86.cat
+CatalogFile.NTAMD64 = STLinkDbgWinUSB_x64.cat
+DriverVer=01/21/2013,1.01
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+[Standard.NTx86]
+%DeviceName% =USB_Install, USB\VID_0483&PID_3748
+%DeviceName% =USB_Install, USB\VID_0483&PID_374A&MI_00
+%DeviceName% =USB_Install, USB\VID_0483&PID_374B&MI_00
+%DeviceNameRW% =USB_InstallRW, USB\VID_0483&PID_374A&MI_01
+
+[Standard.NTamd64]
+%DeviceName% =USB_Install, USB\VID_0483&PID_3748
+%DeviceName% =USB_Install, USB\VID_0483&PID_374A&MI_00
+%DeviceName% =USB_Install, USB\VID_0483&PID_374B&MI_00
+%DeviceNameRW% =USB_InstallRW, USB\VID_0483&PID_374A&MI_01
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs   = WINUSB.NT
+
+[USB_InstallRW]
+Include = winusb.inf
+Needs   = WINUSB.NT
+
+[USB_Install.Services]
+Include =winusb.inf
+Addservice = WinUSB, 0x00000002, WinUSB_ServiceInstall
+
+[USB_InstallRW.Services]
+Include =winusb.inf
+Addservice = WinUSB, 0x00000002, WinUSB_ServiceInstall
+
+[WinUSB_ServiceInstall]
+DisplayName    = %WinUSB_SvcDesc%
+ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
+StartType      = 3                  ; SERVICE_DEMAND_START
+ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
+ServiceBinary  = %12%\WinUSB.sys
+
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[USB_InstallRW.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUsb_Install]
+KmdfLibraryVersion=1.9
+
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[USB_InstallRW.HW]
+AddReg=Dev_AddRegRW
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%STLink_GUID%
+
+[Dev_AddRegRW]
+HKR,,DeviceInterfaceGUIDs,0x10000,%STLink_GUID_RW%
+
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[USB_InstallRW.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.  
+; You must explicitly reference all file-list-section names in this section.
+CoInstallers_CopyFiles=11
+
+; ================= Source Media Section =====================
+
+[SourceDisksNames]
+1 = %DISK_NAME%,,,\x86
+2 = %DISK_NAME%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="STMicroelectronics"
+ClassName="Universal Serial Bus devices"
+DeviceName="STMicroelectronics STLink dongle"
+DeviceNameRW="STMicroelectronics STLink dongle RW"
+WinUSB_SvcDesc="WinUSB Driver for STLink"
+REG_MULTI_SZ = 0x00010000
+DISK_NAME="WinUSB coinstallers sources on disk"
+
+;------------Replace GUID below with custom GUID-------------;
+STLink_GUID="{DBCE1CD9-A320-4b51-A365-A0C3F3C5FB29}"
+STLink_GUID_RW="{8326506F-7260-4854-9C03-26E416F04494}"

+ 7 - 0
drivers/ST-Link/stlink_winusb_install.bat

@@ -0,0 +1,7 @@
+@echo off
+if "%PROCESSOR_ARCHITECTURE%"=="x86" goto X86
+dpinst_amd64.exe
+goto END
+:X86
+dpinst_x86.exe
+:END

BIN
drivers/ST-Link/stlinkdbgwinusb_x64.cat


BIN
drivers/ST-Link/stlinkdbgwinusb_x86.cat


BIN
drivers/ST-Link/stlinkvcp_x64.cat


BIN
drivers/ST-Link/stlinkvcp_x86.cat


BIN
drivers/ST-Link/x86/WdfCoInstaller01009.dll


BIN
drivers/ST-Link/x86/winusbcoinstaller2.dll


BIN
drivers/UsbDriverTool.exe


+ 7 - 0
drivers/UsbDriverTool.exe.config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+  <startup>
+    <supportedRuntime version="v2.0.50727"/>
+    <supportedRuntime version="v4.0.30319"/>
+  </startup>
+</configuration>

BIN
drivers/WinUSB/amd64/WdfCoInstaller01009.dll


BIN
drivers/WinUSB/amd64/winusbcoinstaller2.dll


+ 8 - 0
drivers/WinUSB/driver.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <UniversalUsbDriver>
+    <UniversalDriverName>Libusb - WinUSB</UniversalDriverName>
+	<PrimaryInfFile>libusb_device.inf</PrimaryInfFile>
+	<UniqueDriverId>com.sysprogs.libusb.original</UniqueDriverId>
+  </UniversalUsbDriver>
+</ArrayOfUniversalUsbDriver>

+ 129 - 0
drivers/WinUSB/libusb_device.inf

@@ -0,0 +1,129 @@
+[Strings]
+
+DeviceName = "$$DEVICE_NAME$$"
+DeviceGUID = "$$DEVICE_GUID$$"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+Date = "$$TODAY_DATE$$"
+
+ProviderName = "$$PROVIDER_NAME$$"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, $$HARDWARE_ID$$
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, $$HARDWARE_ID$$
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for 
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these 
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if 
+; it is not already on the target system. The AddService directive specifies 
+; WinUsb.sys as the device’s function driver. These directives should not be 
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys 
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName     = %WinUSB_SvcDesc%
+ServiceType     = 1
+StartType       = 3
+ErrorControl    = 1
+ServiceBinary   = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The 
+; referenced WinUSB_Install section specifies the KMDF library version. 
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with 
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device 
+; interface globally unique identifier (GUID) for your device. The AddReg 
+; directive puts the interface GUID in a standard registry value. When 
+; WinUsb.sys is loaded as the device’s function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You 
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and 
+; CopyFiles sections, contains data and instructions to install the WinUSB and 
+; KMDF co installers and associate them with the device. Most USB devices can 
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+ 
+; The x86 and x64 versions of Windows have separate co installers. This example 
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+

+ 180 - 0
drivers/WinUSB/libusb_device_multiple_interfaces_0.inf

@@ -0,0 +1,180 @@
+; ======== libusb 1.0 (WinUSB) device driver ==========
+;
+; To customize this inf file for your own device
+;
+; 1. Change "DeviceName" with the name you want your device to appear with 
+;    on your system.
+;
+; 2. Change "VendorID" and "ProductID" according to those of your device. 
+;    If your device is plugged in, you can retrieve these values through the 
+;    Device Manager (regardless of whether the driver is installed or not).
+;
+; 3. Change "DeviceGUID" to a value that is unique on your system. For more 
+;    information and tools to help you generate your own GUIDs, see 
+;    http://en.wikipedia.org/wiki/Universally_Unique_Identifier.
+;
+; 4. Change "DeviceClassGUID" to reflect your USB Device Class. 
+;    The following Device Classes are listed for reference:
+;    {745a17a0-74d3-11d0-b6fe-00a0c90f57da} : HID device
+;    {78a1c341-4539-11d3-b88d-00c04fad5171} : Generic WinUSB device
+;
+; 5. (Optional) For a composite device (hardware ID with an MI_## part),
+;    change the empty "InterfaceID" string with the "MI_##" string of
+;    your device
+;
+; 6. (Optional) Change the "Date" string.
+;
+; Note 1: if you need to create a matching cat file for this inf, you can use
+; the inf2cat utility from the WinDDK, with the the following command:
+; inf2cat /driver:"path_to_your inf" /os:7_X86,7_X64,Vista_X86,Vista_X64
+;
+; Note 2: The co-installers provided in these files are version 1.9.
+; Please refer to:
+; http://blogs.msdn.com/iliast/archive/2008/03/10/why-do-we-need-wdf-coinstallers.aspx and
+; http://blogs.msdn.com/iliast/archive/2009/08/13/wdf-logo-requirements-regarding-coinstallers.aspx
+; for more information about co-installers and their versioning
+
+; ===================== Strings =======================
+
+[Strings]
+
+; =====================================================
+; ========= START USER CONFIGURABLE SECTION ===========
+; =====================================================
+
+DeviceName = "Olimex ARM-USB-TINY (Channel A)"
+; Make sure "VID_" and "PID_" are always part of the strings below
+VendorID = "VID_15ba"
+ProductID = "PID_0004"
+InterfaceID = "MI_00"
+DeviceGUID = "{d35924d6-3e16-4a9e-9782-5524a4b79ba0}"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+; Date MUST be in MM/DD/YYYY format
+Date = "01/08/2010"
+
+; =====================================================
+; ========== END USER CONFIGURABLE SECTION ============
+; =====================================================
+
+ProviderName = "libusb 1.0"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for 
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these 
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if 
+; it is not already on the target system. The AddService directive specifies 
+; WinUsb.sys as the device’s function driver. These directives should not be 
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys 
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName     = %WinUSB_SvcDesc%
+ServiceType     = 1
+StartType       = 3
+ErrorControl    = 1
+ServiceBinary   = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The 
+; referenced WinUSB_Install section specifies the KMDF library version. 
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with 
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device 
+; interface globally unique identifier (GUID) for your device. The AddReg 
+; directive puts the interface GUID in a standard registry value. When 
+; WinUsb.sys is loaded as the device’s function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You 
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and 
+; CopyFiles sections, contains data and instructions to install the WinUSB and 
+; KMDF co installers and associate them with the device. Most USB devices can 
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+ 
+; The x86 and x64 versions of Windows have separate co installers. This example 
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+

+ 180 - 0
drivers/WinUSB/libusb_device_multiple_interfaces_1.inf

@@ -0,0 +1,180 @@
+; ======== libusb 1.0 (WinUSB) device driver ==========
+;
+; To customize this inf file for your own device
+;
+; 1. Change "DeviceName" with the name you want your device to appear with 
+;    on your system.
+;
+; 2. Change "VendorID" and "ProductID" according to those of your device. 
+;    If your device is plugged in, you can retrieve these values through the 
+;    Device Manager (regardless of whether the driver is installed or not).
+;
+; 3. Change "DeviceGUID" to a value that is unique on your system. For more 
+;    information and tools to help you generate your own GUIDs, see 
+;    http://en.wikipedia.org/wiki/Universally_Unique_Identifier.
+;
+; 4. Change "DeviceClassGUID" to reflect your USB Device Class. 
+;    The following Device Classes are listed for reference:
+;    {745a17a0-74d3-11d0-b6fe-00a0c90f57da} : HID device
+;    {78a1c341-4539-11d3-b88d-00c04fad5171} : Generic WinUSB device
+;
+; 5. (Optional) For a composite device (hardware ID with an MI_## part),
+;    change the empty "InterfaceID" string with the "MI_##" string of
+;    your device
+;
+; 6. (Optional) Change the "Date" string.
+;
+; Note 1: if you need to create a matching cat file for this inf, you can use
+; the inf2cat utility from the WinDDK, with the the following command:
+; inf2cat /driver:"path_to_your inf" /os:7_X86,7_X64,Vista_X86,Vista_X64
+;
+; Note 2: The co-installers provided in these files are version 1.9.
+; Please refer to:
+; http://blogs.msdn.com/iliast/archive/2008/03/10/why-do-we-need-wdf-coinstallers.aspx and
+; http://blogs.msdn.com/iliast/archive/2009/08/13/wdf-logo-requirements-regarding-coinstallers.aspx
+; for more information about co-installers and their versioning
+
+; ===================== Strings =======================
+
+[Strings]
+
+; =====================================================
+; ========= START USER CONFIGURABLE SECTION ===========
+; =====================================================
+
+DeviceName = "Olimex ARM-USB-TINY (Channel B)"
+; Make sure "VID_" and "PID_" are always part of the strings below
+VendorID = "VID_15ba"
+ProductID = "PID_0004"
+InterfaceID = "MI_01"
+DeviceGUID = "{d35924d6-3e16-4a9e-9782-5524a4b79ba1}"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+; Date MUST be in MM/DD/YYYY format
+Date = "01/08/2010"
+
+; =====================================================
+; ========== END USER CONFIGURABLE SECTION ============
+; =====================================================
+
+ProviderName = "libusb 1.0"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for 
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these 
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if 
+; it is not already on the target system. The AddService directive specifies 
+; WinUsb.sys as the device’s function driver. These directives should not be 
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys 
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName     = %WinUSB_SvcDesc%
+ServiceType     = 1
+StartType       = 3
+ErrorControl    = 1
+ServiceBinary   = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The 
+; referenced WinUSB_Install section specifies the KMDF library version. 
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with 
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device 
+; interface globally unique identifier (GUID) for your device. The AddReg 
+; directive puts the interface GUID in a standard registry value. When 
+; WinUsb.sys is loaded as the device’s function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You 
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and 
+; CopyFiles sections, contains data and instructions to install the WinUSB and 
+; KMDF co installers and associate them with the device. Most USB devices can 
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+ 
+; The x86 and x64 versions of Windows have separate co installers. This example 
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+

BIN
drivers/WinUSB/x86/WdfCoInstaller01009.dll


BIN
drivers/WinUSB/x86/winusbcoinstaller2.dll


+ 8 - 0
drivers/WinUSB_Mini/driver.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <UniversalUsbDriver>
+    <UniversalDriverName>WinUSB</UniversalDriverName>
+	<PrimaryInfFile>winusb_device.inf</PrimaryInfFile>
+	<UniqueDriverId>com.sysprogs.libusb.mini</UniqueDriverId>
+  </UniversalUsbDriver>
+</ArrayOfUniversalUsbDriver>

+ 57 - 0
drivers/WinUSB_Mini/winusb_device.inf

@@ -0,0 +1,57 @@
+[Version]
+Signature = "$Windows NT$"
+Class     = USBDevice
+ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
+Provider  = %ManufacturerName%
+DriverVer = "$$TODAY_DATE$$"
+CatalogFile = winusb.cat
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+[Standard.NTx86]
+%DeviceName% =USB_Install, $$HARDWARE_ID$$
+
+[Standard.NTamd64]
+%DeviceName% =USB_Install, $$HARDWARE_ID$$
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs   = WINUSB.NT
+
+[USB_Install.Services]
+Include =winusb.inf
+Needs   = WINUSB.NT.Services
+
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,"$$DEVICE_GUID$$"
+
+; [DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.  
+; You must explicitly reference all file-list-section names in this section.
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="$$PROVIDER_NAME$$"
+ClassName="Universal Serial Bus devices"
+DeviceName="$$DEVICE_NAME$$"
+REG_MULTI_SZ = 0x00010000

+ 12 - 0
drivers/xds110/driver.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <UniversalUsbDriver>
+    <UniversalDriverName>TI XDS110 Driver</UniversalDriverName>
+	<PrimaryInfFile>xds110_debug.inf</PrimaryInfFile>
+	<UniqueDriverId>com.sysprogs.ti.xds110</UniqueDriverId>
+	<FixedDriver>
+		<ManufacturerName>Texas Instruments Incorporated</ManufacturerName>
+		<DeviceNameRegex>XDS110 Class Debug Probe</DeviceNameRegex>
+	</FixedDriver>
+  </UniversalUsbDriver>
+</ArrayOfUniversalUsbDriver>

BIN
drivers/xds110/i386/WdfCoInstaller01009.dll


BIN
drivers/xds110/i386/winusbcoinstaller2.dll


BIN
drivers/xds110/x64/WdfCoInstaller01009.dll


BIN
drivers/xds110/x64/winusbcoinstaller2.dll


BIN
drivers/xds110/xds110_debug.cat


+ 113 - 0
drivers/xds110/xds110_debug.inf

@@ -0,0 +1,113 @@
+;-------------------------------------------------------------------------
+;
+; XDS110 USB driver installation file. 
+;
+; Copyright (c) 2014-2016 Texas Instruments Incorporated. 
+; All rights reserved.
+; 
+;-------------------------------------------------------------------------
+
+[Version]
+Signature   = "$Windows NT$"
+Class       = TI_Debug_Probe
+ClassGuid   = {8E84F6AE-7786-4c95-A48A-14CF3B92C002}
+Provider    = %MFGNAME%
+CatalogFile = xds110_debug.cat
+DriverVer   = 04/05/2016,1.7.0.0
+
+; ================== Class section ===================
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,"%TI_Debug_Probe_Name%"
+HKR,,Icon,,-1
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%MFGNAME% = XDS110Device,NTx86,NTamd64
+
+[XDS110Device.NTx86]
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF1&MI_00
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF2&MI_02
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF2&MI_03
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF3&MI_02
+%DESCRIPTION_2% = USB_Install,USB\VID_0451&PID_BEF3&MI_06
+
+[XDS110Device.NTamd64]
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF1&MI_00
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF2&MI_02
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF2&MI_03
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF3&MI_02
+%DESCRIPTION_2% = USB_Install,USB\VID_0451&PID_BEF3&MI_06
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs   = WINUSB.NT
+
+[USB_Install.Services]
+Include    = winusb.inf
+AddService = WinUSB,0x00000002,WinUSB_ServiceInstall
+
+[WinUSB_ServiceInstall]
+DisplayName   = %WinUSB_SvcDesc%
+ServiceType   = 1
+StartType     = 3
+ErrorControl  = 1
+ServiceBinary = %12%\WinUSB.sys
+
+[USB_Install.Wdf]
+KmdfService = WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion = 1.9
+
+[USB_Install.HW]
+AddReg = XDS110_AddReg
+
+[XDS110_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,"{70cd8e5b-1a46-4418-a1a5-4489f4b4aa79}"
+
+[USB_Install.CoInstallers]
+AddReg    = CoInstallers_AddReg
+CopyFiles = CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+DefaultDestDir         = 12
+CoInstallers_CopyFiles = 11
+
+; ================= Source Media Section =====================
+
+[SourceDisksNames]
+1 = %DISKNAME%,,,\i386
+2 = %DISKNAME%,,,\x64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll  = 1
+WdfCoInstaller01009.dll = 1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll  = 2
+WdfCoInstaller01009.dll = 2
+
+; =================== Strings ===================
+
+[Strings]
+MFGNAME             = "Texas Instruments Incorporated"
+DISKNAME            = "XDS110 Debug Probe"
+DESCRIPTION_0       = "XDS110 Class Debug Probe"
+DESCRIPTION_1       = "XDS110 Class DFU Interface"
+DESCRIPTION_2       = "XDS110 Class Data Port"
+WinUSB_SvcDesc      = "WinUSB Driver Service"
+TI_Debug_Probe_Name = "Texas Instruments Debug Probes"

BIN
drivers/xds110/xds110_ports.cat


+ 67 - 0
drivers/xds110/xds110_ports.inf

@@ -0,0 +1,67 @@
+;-------------------------------------------------------------------------
+;
+; XDS110 USB CDC driver installation file.
+;
+; Copyright (c) 2014-2016 Texas Instruments Incorporated. 
+; All rights reserved.
+;
+;-------------------------------------------------------------------------
+
+[Version]
+Signature   = "$Windows NT$"
+Class       = Ports
+ClassGuid   = {4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider    = %MFGNAME%
+LayoutFile  = layout.inf
+CatalogFile = xds110_ports.cat
+DriverVer   = 04/05/2016,1.7.0.0
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%MFGNAME% = XDS110Device,NTx86,NTamd64
+
+[XDS110Device.NTx86]
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF2&MI_00
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF3&MI_00
+%DESCRIPTION_1% = DriverInstall,USB\VID_0451&PID_BEF3&MI_03
+
+[XDS110Device.NTamd64]
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF2&MI_00
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF3&MI_00
+%DESCRIPTION_1% = DriverInstall,USB\VID_0451&PID_BEF3&MI_03
+
+; =================== Installation ===================
+
+[DriverInstall]
+CopyFiles = DriverCopyFiles
+AddReg    = DriverInstall.AddReg
+
+[DriverCopyFiles]
+usbser.sys,,,0x20
+
+[DriverInstall.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[DriverInstall.Services]
+AddService = usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName   = %SERVICE%
+ServiceType   = 1
+StartType     = 3
+ErrorControl  = 1
+ServiceBinary = %12%\usbser.sys
+
+[DestinationDirs]
+DefaultDestDir = 12
+
+; =================== Strings ===================
+
+[Strings]
+MFGNAME       = "Texas Instruments Incorporated"
+DESCRIPTION_0 = "XDS110 Class Application/User UART"
+DESCRIPTION_1 = "XDS110 Class Auxiliary Data Port"
+SERVICE       = "XDS110 Device Serial Ports"

+ 347 - 0
share/openocd/OpenULINK/ulink_firmware.hex

@@ -0,0 +1,347 @@
+:040000000200713257
+:01000B0032C2
+:0100130032BA
+:01001B0032B2
+:0100230032AA
+:01002B0032A2
+:01003300329A
+:01003B003292
+:01004300328A
+:01004B003282
+:01005300327A
+:01005B003272
+:01006300326A
+:03006B000201107F
+:0300CA0002006EC3
+:03006E000201018B
+:1000CD00907F937404F0907F9C7495F0907F96745C
+:1000DD0090F0907F94E4F0907F9D747FF0907F97E7
+:1000ED00E4F0907F957440F0907F9E7442F0907F85
+:1000FD0098E4F0221200CD1204ADD2AF1208E090B8
+:10010D00000022C021C0E0C0F0C082C083C007C083
+:10011D0006C005C004C003C002C001C000C0D07538
+:10012D00D000AF9174EF5FF59112040C907FAB741A
+:10013D0001F0907FB4E04402F0D0D0D000D001D0D7
+:10014D0002D003D004D005D006D007D083D082D002
+:10015D00F0D0E0D02132323232323232323232C04D
+:10016D00E0C082C083C007C0D075D000D201AF916E
+:10017D0074EF5FF591907FA97404F0D0D0D007D0C3
+:10018D0083D082D0E032C0E0C082C083C007C0D02F
+:10019D0075D000D200AF9174EF5FF591907FAA7486
+:1001AD0004F0D0D0D007D083D082D0E032323232BA
+:1001BD0032323232323232AF82747F5FFE24F850E7
+:1001CD0003020278EE240A83F582EE240C83F58374
+:1001DD00E473EFF306192C3F52650101020202028E
+:1001ED000202907FB422EF30E7067DB67E7F800459
+:1001FD007DC67E7F8D828E8322EF30E7067DB87EB1
+:10020D007F80047DC87E7F8D828E8322EF30E7064E
+:10021D007DBA7E7F80047DCA7E7F8D828E8322EFA4
+:10022D0030E7067DBC7E7F80047DCC7E7F8D828E07
+:10023D008322EF30E7067DBE7E7F80047DCE7E7FFC
+:10024D008D828E8322EF30E7067DC07E7F80047D18
+:10025D00D07E7F8D828E8322EF30E7067EC27F7F38
+:10026D0080047ED27F7F8E828F832290000022AF0A
+:10027D008274105FFE74075F4206907FD7EEF074B4
+:10028D00204EF022907FE8E0C322907FE8E0FF60EF
+:10029D0005BF0246800A907FB4E0FF4401F0803A2A
+:1002AD00907FEAE0FEA3E0FF4E7027907FECE0FE2A
+:1002BD00A3E08E821201C4AE82AF83EE4F7002C3F3
+:1002CD00228E828F83E0FD5305FE8E828F83EDF0AB
+:1002DD008008907FB4E0FF4401F0D322907FE8E0E6
+:1002ED00FF6005BF02468010907FEAE0FEA3E0FFAD
+:1002FD00BE0239BF0036D322907FEAE0FEA3E0FFB5
+:10030D004E7027907FECE0FEA3E08E821201C4AE0A
+:10031D0082AF83EE4F7002C3228E828F83E0FD4346
+:10032D0005018E828F83EDF08002C322D322907F50
+:10033D00EAE0A3E0FF907FEAE0FDA3E07E00BF01CD
+:10034D0002800DBF02028021BF030280340203EC44
+:10035D007ED37F138F06907FD4EEF07ED37F137FF5
+:10036D0000907FD5EEF00203EE7EE57F138F0690B1
+:10037D007FD4EEF07EE57F137F00907FD5EEF08089
+:10038D0060907FECE0FEA3E0FF4E70187E057F14B9
+:10039D008F06907FD4EEF07E057F147F00907FD581
+:1003AD00EEF0803D907FECE0FEA3E0FFBE092EBF96
+:1003BD00042BED1475F002A42459F582741435F054
+:1003CD00F583E493FEA3E493FF8E048F058D0490D3
+:1003DD007FD4ECF07F00907FD5EEF08004C322C374
+:1003ED0022D32275828212027C75820212027C90C7
+:1003FD007FB87402F0907FC8E4F0907FC9F022902E
+:10040D007FE9E0FF24F3500122EFF5F0240B83F593
+:10041D0082E5F0241183F583E473414F5D655D72D0
+:10042D007B73889899A9AC0404040404040404049F
+:10043D0004040404120291500122907FB4E044019F
+:10044D00F022120297500122907FB4E04401F02275
+:10045D00907FB4E04401F0221202E94042907FB453
+:10046D00E04401F02222907FB4E04401F022120317
+:10047D003B402C907FB4E04401F0229013EAE493CA
+:10048D00907F00F0907FB57401F022229013F0E47C
+:10049D0093907F00F0907FB57401F0221203F0224B
+:1004AD00907FDE7404F0907FDF7404F0907FE0E4C1
+:1004BD00F0907FE1F0907FA17401F0907FAFE04468
+:1004CD0001F0907FAEE04401F0907FAD7404F090A8
+:1004DD007FAC7404F0D2E8907FD6740AF09000C817
+:0A04ED0012137C907FD67406F022F3
+:1013D30012011001FFFFFF4051C21027000101025B
+:1013E3000301090220000101048032090400000204
+:1013F300FFFFFF00070582024000000705020240CD
+:1014030000000403090414034F00700065006E001C
+:1014130055004C0049004E004B0014034F00700070
+:1014230065006E0055004C0049004E004B000E0352
+:101433003000300030003000300031001A034A0021
+:101443005400410047002000410064006100700027
+:0E14530074006500720009141D1431143F145A
+:1004F700E5080424C0F582E4347DF583E0FF30E1AC
+:1005070008907F96E0FE54EFF08F06EE30E00890FB
+:100517007F96E0FE547FF0EF30E308907F96E0FE91
+:100527004410F0EF30E208907F96E0FF4480F0221D
+:100537007F00E50824C0F582E4347DF583E0FE24DE
+:10054700D550030208A6EE240A83F582EE242F83F2
+:10055700F583E473B18AD7B0FAD3A6A6A6A6A6A652
+:10056700A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A624
+:10057700A6A6A6A621FA512A639CD5053493A205FF
+:1005870006050605060808080808080808080808F0
+:1005970008080808080808080808080808080806D6
+:1005A700060607070707080808087E05E508042464
+:1005B700C0F582E4347DF583E0FFE50804F5828524
+:1005C7000927C007C00612091DD006D0070208A8D0
+:1005D700E5080424C0F582E4347DF583E02405FEB4
+:1005E700E50804F582C007C006120BDED006D00767
+:1005F7000208A8E5080424C0F582E4347DF583E009
+:10060700FF2405FEE50804F58285093CC007C006FE
+:10061700120E79D006D0070208A87E02E508042446
+:10062700C0F582E4347DF583E0FD7402250824C01B
+:10063700F582E4347DF583E0F50A8D82C007C006B4
+:1006470012124AD006D0070208A87E02E508042441
+:10065700C0F582E4347DF583E0FC7D007402250853
+:1006670024C0F582E4347DF583E0FAE44204EA42EB
+:10067700058C828D83C007C0061211DDD006D00716
+:100687000208A87E05E5080424C0F582E4347DF558
+:1006970083E0FFE50804F58285092DC007C006122F
+:1006A7000A67D006D0070208A8E5080424C0F58227
+:1006B700E4347DF583E02405FEE50804F582C007F0
+:1006C700C006120D14D006D0070208A8E5080424B6
+:1006D700C0F582E4347DF583E0FF2405FEE50804D8
+:1006E700F582850943C007C006121013D006D0074C
+:1006F7000208A87E02E5080424C0F582E4347DF5EB
+:1007070083E0FB7402250824C0F582E4347DF58379
+:10071700E0F50A8B82C007C006121281D006D00707
+:100727000208A87E02E5080424C0F582E4347DF5BA
+:1007370083E0FC7D007402250824C0F582E4347D43
+:10074700F583E0FAE44204EA42058C828D83C00710
+:10075700C006121207D006D0070208A87E02E508D5
+:100767000424C0F582E4347DF583E0FC7D00740247
+:10077700250824C0F582E4347DF583E0FAE44204D9
+:10078700EA42058C828D83C007C006121349D00642
+:10079700D0070208A87E02E5080424C0F582E434E5
+:1007A7007DF583E0FC7D007402250824C0F582E412
+:1007B700347DF583E0FAE44204EA42058C828D83B6
+:1007C700C007C00612137CD006D0070208A87E0017
+:1007D7007F02C007C0061212CEAC82AD83D006D00E
+:1007E7000785098275837E8D03EBF0E509042400F4
+:1007F700F582E4347EF5837D00ECF00208A87E02E2
+:10080700E5080424C0F582E4347DF583E0FD740235
+:10081700250824C0F582E4347DF583E0F50A8D824E
+:10082700C007C006121311D006D00780747E05E5F5
+:10083700080424C0F582E4347DF583E0FD740225C5
+:100847000824C0F582E4347DF583E0F50A740325B6
+:100857000824C0F582E4347DF583E0F50B740425A4
+:100867000824C0F582E4347DF583E0F50C74052592
+:100877000824C0F582E4347DF583E0F50D8D82C050
+:1008870007C006121329D006D00780157E01C007BE
+:10089700C0061204F7D006D00780067E0180027ECC
+:1008A70000EF2509F509AD087F008E037C00EB2DCD
+:1008B700FDEC3FFF0DBD00010F907FC9E0FC7B0001
+:1008C700C3ED9CEF64808BF063F08095F04002D31A
+:1008D70022EE042508F508C32275080075090010E3
+:1008E700000280FB907F96E0FF547FF0C202200257
+:1008F70007120537920280F6907F96E0FF4480F05A
+:10090700E509600B907FB9E509F010010280FB90C3
+:100917007FC9E4F080C3E582FF24C0F582E4347D1B
+:10092700F583E0F528EF0424C0F582E4347DF583F0
+:10093700E0F52974022FFC24C0F582E4347DF583A9
+:10094700E0C4540FFB53030FEC24C0F582E4347D5D
+:10095700F583E0FC740F5CF52A74032F24C0F5823D
+:10096700E4347DF583E0FA74042F24C0F582E4347F
+:100977007DF583E0F52BEB60078A0A8B8212124A1A
+:10098700907F97E0FB5303F874044BFA7900A8288B
+:100997007C0018B8FF011C89067F00C3EE98EF643E
+:1009A700808CF063F08095F050347F007E00907F5C
+:1009B70097EBF0EFC313FF907F97EAF0907F99E0F2
+:1009C700FC30E5034307800EBE080040E1E5272918
+:1009D7002400F582E4347EF583EFF00980B0892C9A
+:1009E7007F00AC2A7A00C3EA95295040A8297900EC
+:1009F70018B8FF01198A057E00EDB50011EEB501A3
+:100A07000DEC600A4303021CE52BC313F52B907F03
+:100A170097EBF0EFC313FF907F9774044BF0907F31
+:100A270099E0FE30E5034307800A80BAAD297E00CE
+:100A37007408C39DFDE49EFE8DF005F0EF8002C3B0
+:100A470013D5F0FBFFE527252C2400F582E4347E3F
+:100A5700F583EFF0EC6008852B0A8C8202124A229C
+:100A6700E582FF24C0F582E4347DF583E0F52EEFBF
+:100A77000424C0F582E4347DF583E0F52F74022F5A
+:100A8700FC24C0F582E4347DF583E0C4540FFB53A6
+:100A9700030FEC24C0F582E4347DF583E0FC740F8A
+:100AA7005CF53074032F24C0F582E4347DF583E0D0
+:100AB700FA74042F24C0F582E4347DF583E0F53120
+:100AC700EB60078A0A8B82121281907F97E0FB53B3
+:100AD70003F874044BFA753200A82E7C0018B8FF8F
+:100AE700011CA9327E00C3E998EE64808CF063F0A4
+:100AF7008095F0504C7E007C00907F97EBF079005A
+:100B0700C3E9952250030980F7EEC313FE907F9740
+:100B1700EAF07900C3E9952250030980F7907F999D
+:100B2700E0F930E5034306800CBC080040CBE52D17
+:100B370025322400F582E4347EF583EEF005328019
+:100B4700987E00AA307900C3E9952F5056A82F7CCC
+:100B57000018B8FF011C89057F00EDB50011EFB53E
+:100B6700040DEA600A4303021AE531C313F5319015
+:100B77007F97EBF07F00C3EF952250030F80F7EECE
+:100B8700C313FE907F9774044BF07F00C3EF952249
+:100B970050030F80F7907F99E0FF30E5034306800D
+:100BA7000980A4AD2F7F007408C39DFDE49FFF8DCE
+:100BB700F005F0EE8002C313D5F0FBFEE52D2532DC
+:100BC7002400F582E4347EF583EEF0EA600885318F
+:100BD7000A8A8202128122E582FF24C0F582E43468
+:100BE7007DF583E0F533EF0424C0F582E4347DF529
+:100BF70083E0F53474022FFC24C0F582E4347DF5DC
+:100C070083E0C4540FFB53030FEC24C0F582E43494
+:100C17007DF583E0FC740F5CF53574032F24C0F574
+:100C270082E4347DF583E0FA74042F24C0F582E46E
+:100C3700347DF583E0F536EB600B8A0A8B82C007BB
+:100C470012124AD007907F97E0FB5303F97A00A866
+:100C5700337C0018B8FF011C8A017E00C3E998EEB7
+:100C670064808CF063F08095F05039EF2A240524D6
+:100C7700C0F582E4347DF583E0FE7C00EE30E005CC
+:100C870043030180068B0174FE59FB907F97EBF0BD
+:100C9700EEC313FE907F9774044BF00CBC08004022
+:100CA700DB0A80ABEF2A240524C0F582E4347DF506
+:100CB70083E0FEAF357C00C3EC95345044EE30E062
+:100CC7000543030180068B0274FE5AFBA9347A00A0
+:100CD70019B9FF011A8C007D00E8B50111EDB502C5
+:100CE7000DEF600A4303021FE536C313F536907F05
+:100CF70097EBF0EEC313FE907F9774044BF00C80D4
+:100D0700B6EF600885360A8F8202124A22E582F51D
+:100D17003724C0F582E4347DF583E0F538E5370400
+:100D270024C0F582E4347DF583E0F5397402253774
+:100D3700FC24C0F582E4347DF583E0C4540FFB53F3
+:100D4700030FEC24C0F582E4347DF583E0FC740FD7
+:100D57005CF53A7403253724C0F582E4347DF583C6
+:100D6700E0FA7404253724C0F582E4347DF583E086
+:100D7700F53BEB60078A0A8B82121281907F97E01E
+:100D8700FB5303F97A00A8387C0018B8FF011C8AC6
+:100D9700067F00C3EE98EF64808CF063F08095F0D7
+:100DA7005050E5372A240524C0F582E4347DF583C5
+:100DB700E0FF7E00EF30E00543030180068B0474FB
+:100DC700FE5CFB907F97EBF07C00C3EC9523500310
+:100DD7000C80F7EFC313FF907F9774044BF07C00F0
+:100DE700C3EC952350030C80F70EBE080040C50ADC
+:100DF7008094E5372A240524C0F582E4347DF58301
+:100E0700E0FFAE3A7C00C3EC9539505AEF30E0056D
+:100E170043030180068B0274FE5AFBA8397A001837
+:100E2700B8FF011A8C017D00E9B50011EDB5020D7F
+:100E3700EE600A4303021EE53BC313F53B907F9721
+:100E4700EBF07D00C3ED952350030D80F7EFC3133F
+:100E5700FF907F9774044BF07D00C3ED95235003FB
+:100E67000D80F70C80A0EE6008853B0A8E82021287
+:100E77008122E582FF24C0F582E4347DF583E0F525
+:100E87003DEF0424C0F582E4347DF583E0F53E743C
+:100E9700022FFC24C0F582E4347DF583E0C4540FAF
+:100EA700FB53030FEC24C0F582E4347DF583E0FCAB
+:100EB700740F5CF53F74032F24C0F582E4347DF58D
+:100EC70083E0FA74042F24C0F582E4347DF583E0CF
+:100ED700F540EB600B8A0A8B82C00712124AD007D3
+:100EE700907F97E0FB5303F97A00A83D7C0018B880
+:100EF700FF011C8A017E00C3E998EE64808CF063D1
+:100F0700F08095F0505CEF2A240524C0F582E43484
+:100F17007DF583E0F5417C007900E54130E005434C
+:100F2700030180068B0074FE58FB907F97EBF0E57A
+:100F370041C313F541907F9774044BF0ECC313FC46
+:100F4700907F99E0F830E50343048009B908004031
+:100F5700C9E53C2A2400F582E4347EF583ECF00AE7
+:100F670080888A01EF2A240524C0F582E4347DF5C0
+:100F770083E0F5417C00AF3F754200C3E542953EF3
+:100F87005057E54130E00543030180068B0074FEAE
+:100F970058FBA83E7D0018B8FF011DAA427E00EA53
+:100FA700B50011EEB5050DEF600A4303021FE540DA
+:100FB700C313F540907F97EBF0E541C313F54190DC
+:100FC7007F9774044BF0ECC313FC907F99E0FE30DD
+:100FD700E503430480054280A2AD3E7E007408C34A
+:100FE7009DFDE49EFE8DF005F0EC8002C313D5F065
+:100FF700FBFCE53C292400F582E4347EF583ECF024
+:10100700EF600885400A8F8202124A22E582F54482
+:1010170024C0F582E4347DF583E0F545E5440424F6
+:10102700C0F582E4347DF583E0F54674022544FC7F
+:1010370024C0F582E4347DF583E0C4540FFB5303E9
+:101047000FEC24C0F582E4347DF583E0FC740F5C7B
+:10105700F5477403254424C0F582E4347DF583E025
+:10106700FA7404254424C0F582E4347DF583E0F561
+:1010770048EB60078A0A8B82121281907F97E0FB08
+:101087005303F97A00A8457C0018B8FF011C8A06AB
+:101097007F00C3EE98EF64808CF063F08095F0508A
+:1010A70074E5442A240524C0F582E4347DF583E001
+:1010B700F5497E007C00E54930E0054303018006E1
+:1010C7008B0074FE58FB907F97EBF07800C3E89590
+:1010D7002450030880F7E549C313F549907F9774B7
+:1010E700044BF07800C3E8952450030880F7EEC35B
+:1010F70013FE907F99E0F830E5034306800CBC08A7
+:101107000040B3E5432A2400F582E4347EF583EEFC
+:10111700F00A02108C8A04E5442A240524C0F582CB
+:10112700E4347DF583E0F5497E00AA47754A00C39C
+:10113700E54A9546506DE54930E0054303018006D1
+:101147008B0174FE59FBA9467D0019B9FF011DA843
+:101157004A7F00E8B50111EFB5050DEA600A4303C0
+:10116700021AE548C313F548907F97EBF07F00C359
+:10117700EF952450030F80F7E549C313F549907F96
+:101187009774044BF07F00C3EF952450030F80F74B
+:10119700EEC313FE907F99E0FF30E5034306800519
+:1011A7004A808CAD467F007408C39DFDE49FFF8D88
+:1011B700F005F0EE8002C313D5F0FBFEE5432C24C7
+:1011C70000F582E4347EF583EEF0EA600885480A8C
+:1011D7008A8202128122AE82AF83907F97E0FD530D
+:1011E70005FB74044DFC7A007B00C3EA9EEB9F501D
+:1011F7000E907F97EDF0ECF00ABA00EE0B80EB2231
+:10120700AE82AF83907F97E0FD5305FB74044DFCDE
+:101217007A007B00C3EA9EEB9F5027907F97EDF003
+:101227007900C3E9952550030980F7907F97ECF083
+:101237007900C3E9952550030980F70ABA00D50B51
+:1012470080D222AF82907F97E0FE5306FB7D00C3DA
+:10125700ED9F5025E50A30E00543060280068E041F
+:1012670074FD5CFE907F97EEF0E50AC313F50A90D4
+:101277007F9774044EF00D80D622AF82907F97E05F
+:10128700FE5306FB7D00C3ED9F503BE50A30E005AA
+:1012970043060280068E0474FD5CFE907F97EEF095
+:1012A7007C00C3EC952650030C80F7E50AC313F5C1
+:1012B7000A907F9774044EF07C00C3EC9526500388
+:1012C7000C80F70D80C0227F00907F99E0FE30E50B
+:1012D700027F01907F99E0FE30E603430702907F8B
+:1012E7009AE0FE30E703430704907F9BE0FE30E57A
+:1012F70003430708907F9AE0FE53067F8F05E4FFBC
+:10130700FCEE4FF582EC4DF58322E582547FF4FF26
+:10131700907F97E05FF0747F550AFF907F97E04FCB
+:10132700F022858222850A23850B24850C25850DCD
+:10133700262200227E567F021EBEFF011FEE4F703F
+:10134700F722750A05750B001213A6AE82AF837CD0
+:10135700007D00C3EC9EED9F501AC007C006C00574
+:10136700C004121339D004D005D006D0070CBC0036
+:10137700E20D80DF22AE82AF837C007D00C3EC9E4E
+:10138700ED9F501AC007C006C005C00412133BD01A
+:0F13970004D005D006D0070CBC00E20D80DF2289
+:03004300021B009D
+:101B0000020110000201630002016400020165008D
+:101B1000020166000201670002016800020169001B
+:101B200002016A0002016B0002016C0002019300D5
+:101B30000201BA000201BB000201BC000201BD00AB
+:101B40000201BE000201BF000201C0000201C1008B
+:081B50000201C2000201C30002
+:1013A6007A10E4FBFCE58225E0F582E58333F583DC
+:1013B600EB33FBEC33FCEB950AF5F0EC950B4006B2
+:0913C600FCABF0438201DADD22E8
+:0600A000E478FFF6D8FD34
+:10007E007900E94400601B7A009014617800759253
+:10008E0020E493F2A308B800020592D9F4DAF275CF
+:02009E0092FFCF
+:1000A6007800E84400600A7900759220E4F309D8E4
+:1000B600FC7800E84400600C7900902000E4F0A38E
+:0400C600D8FCD9FA8F
+:0D00710075814A1213CFE582600302006E14
+:0413CF007582002201
+:00000001FF

+ 145 - 0
share/openocd/contrib/60-openocd.rules

@@ -0,0 +1,145 @@
+# Copy this file to /etc/udev/rules.d/
+
+ACTION!="add|change", GOTO="openocd_rules_end"
+SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
+
+# Please keep this list sorted by VID:PID
+
+# opendous and estick
+ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT232/FT245 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT2232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT4232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT232H VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# DISTORTEC JTAG-lock-pick Tiny 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TUMPA, TUMPA Lite
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# XDS100v2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris Evaluation Board FTDI (several)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# egnite Turtelizer 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Section5 ICEbear
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Amontec JTAGkey and JTAGkey-tiny
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI ICDI
+ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v2
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v2-1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Cypress KitProg in KitProg mode
+ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f139", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Cypress KitProg in CMSIS-DAP mode
+ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f138", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hilscher NXHX Boards
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hitex STR9-comStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hitex STM32-PerformanceStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Altera USB Blaster
+ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Amontec JTAGkey-HiSpeed
+ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# SEGGER J-Link
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Raisonance RLink
+ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Debug Board for Neo1973
+ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-TINY
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-JTAG-EW
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-TINY-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# USBprog with OpenOCD firmware
+ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
+ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Ambiq Micro EVK and Debug boards.
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="664", GROUP="plugdev", TAG+="uaccess"
+
+# Marvell Sheevaplug
+ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Keil Software, Inc. ULink
+ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# CMSIS-DAP compatible adapters
+ATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+LABEL="openocd_rules_end"

+ 134 - 0
share/openocd/contrib/99-openocd.rules

@@ -0,0 +1,134 @@
+# Copy this file to /etc/udev/rules.d/
+
+ACTION!="add|change", GOTO="openocd_rules_end"
+SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
+
+# Please keep this list sorted by VID:PID
+
+# opendous and estick
+ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="664", GROUP="plugdev"
+
+# Original FT232/FT245 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev"
+
+# Original FT2232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev"
+
+# Original FT4232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev"
+
+# Original FT232H VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="664", GROUP="plugdev"
+
+# DISTORTEC JTAG-lock-pick Tiny 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="664", GROUP="plugdev"
+
+# TUMPA, TUMPA Lite
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="664", GROUP="plugdev"
+
+# XDS100v2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="664", GROUP="plugdev"
+
+# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris Evaluation Board FTDI (several)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="664", GROUP="plugdev"
+
+# egnite Turtelizer 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="664", GROUP="plugdev"
+
+# Section5 ICEbear
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="664", GROUP="plugdev"
+
+# Amontec JTAGkey and JTAGkey-tiny
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="664", GROUP="plugdev"
+
+# TI ICDI
+ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="664", GROUP="plugdev"
+
+# STLink v1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="664", GROUP="plugdev"
+
+# STLink v2
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="664", GROUP="plugdev"
+
+# STLink v2-1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="664", GROUP="plugdev"
+
+# Hilscher NXHX Boards
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="664", GROUP="plugdev"
+
+# Hitex STR9-comStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="664", GROUP="plugdev"
+
+# Hitex STM32-PerformanceStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="664", GROUP="plugdev"
+
+# Altera USB Blaster
+ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev"
+
+# Amontec JTAGkey-HiSpeed
+ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="664", GROUP="plugdev"
+
+# SEGGER J-Link
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="664", GROUP="plugdev"
+
+# Raisonance RLink
+ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="664", GROUP="plugdev"
+
+# Debug Board for Neo1973
+ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-TINY
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-JTAG-EW
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-TINY-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="664", GROUP="plugdev"
+
+# USBprog with OpenOCD firmware
+ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
+ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="664", GROUP="plugdev"
+
+# Marvell Sheevaplug
+ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="664", GROUP="plugdev"
+
+# Keil Software, Inc. ULink
+ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="664", GROUP="plugdev"
+
+# CMSIS-DAP compatible adapters
+ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
+
+LABEL="openocd_rules_end"

+ 68 - 0
share/openocd/contrib/coresight-trace.txt

@@ -0,0 +1,68 @@
++OpenOCD and CoreSight Tracing
++
+Many recent ARM chips  (Using e..g. Cortex-M3 and
+Cortex-M4 cores) support CoreSight debug/trace.
+This note sketches an approach currently planned for those cores
+with OpenOCD.
+
+ This tracing data can help debug and tune ARM software, but not
+all cores support tracing.  Some support more extensive tracing
+other cores with trace support +should be able to use the same
+approach and maybe some of the same analysis code.
+
++the Cortex-M3 is assumed here to be the
++core in use, for simplicity and to reflect current OpenOCD users.
+
+
+This note summarizes a software model to generate, collect, and
+analyze such trace data .  That is not fully implemented as of early
+January 2011, +and thus is not *yet* usable.
++
++
++Some microcontroller cores support a low pin-count Single-wire trace,
+with a mode where +trace data is emitted (usually to a UART.  To use
+this mode, +SWD must be in use.
++At this writing, OpenOCD SWD support is not yet complete either.
+
+(There are also multi-wire trace ports requiring more complex debug
+adapters than OpenOCD currently supports, and offering richer data.
++
++
++* ENABLING involves activating  SWD and (single wire) trace.
++
++current expectations are that OpenOCD itself will handle enabling;
+activating single wire trace involves a debug adapter interaction, and
+collecting that trace data requires particular (re)wiring.
++
++* CONFIGURATION involves setting up ITM  and/or ETM modules to emit the
++desired data from the Cortex core.  (This might include dumping
++event counters printf-style messages; code profiling; and more.  Not all
++cores offer the same trace capabilities.
++
++current expectations are that Tcl scripts will be used to configure these
++modules for the desired tracing, by direct writes to registers.  In some
++cases (as with RTOS event tracking and similar messaging, this might
++be  augmented or replaced by user code running on the ARM core.
++
++COLLECTION involves reading that trace data, probably through UART, and
++saving it in a useful format to analyse  For now, deferred analysis modes
+are assumed, not than real-time or interactive ones.
++
++
++current expectations are to to dump data in text using contrib/itmdump.c
++or derived tools, and to post-process it into reports.  Such reports might
++include program messaging (such as application data streams via ITM, maybe
++using printf type messaging; code coverage analysis or so forth.  Recent
++versions of CMSIS software reserve some ITM codespace for RTOS  event
+tracing and include ITM messaging support.
+Clearly some of that data would be valuable for interactive debugging.
++
++Should someone get ambitious, GUI reports should be possible.  GNU tools
++for simpler reports like gprof may be simpler to support at first.
++In any case, OpenOCD is not currently GUI-oriented.  Accordingly, we now
++expect any such graphics to come from postprocessing.
+
+ measurments for RTOS event timings should also be easy to collect.
++Examples include context and message switch times, as well as times
+for application interactions.
++

+ 119 - 0
share/openocd/contrib/cross-build.sh

@@ -0,0 +1,119 @@
+#!/bin/sh
+
+# This is an example of how to do a cross-build of OpenOCD using pkg-config.
+# Cross-building with pkg-config is deceptively hard and most guides and
+# tutorials are incomplete or give bad advice. Some of the traps that are easy
+# to fall in but handled by this script are:
+#
+#  * Polluting search paths and flags with values from the build system.
+#  * Faulty pkg-config wrappers shipped with distribution packaged cross-
+#    toolchains.
+#  * Build failing because pkg-config discards some paths even though they are
+#    correctly listed in the .pc file.
+#  * Getting successfully built binaries that cannot find runtime data because
+#    paths refer to the build file system.
+#
+# This script is probably more useful as a reference than as a complete build
+# tool but for some configurations it may be usable as-is. It only cross-
+# builds libusb-1.0 from source, but the script can be extended to build other
+# prerequisities in a similar manner.
+#
+# Usage:
+# export LIBUSB1_SRC=/path/to/libusb-1.0
+# export HIDAPI_SRC=/path/to/hidapi
+# export OPENOCD_CONFIG="--enable-..."
+# cd /work/dir
+# /path/to/openocd/contrib/cross-build.sh <host-triplet>
+#
+# For static linking, a workaround is to
+# export LIBUSB1_CONFIG="--enable-static --disable-shared"
+#
+# All the paths must not contain any spaces.
+
+set -e -x
+
+WORK_DIR=$PWD
+
+## Source code paths, customize as necessary
+: ${OPENOCD_SRC:="`dirname "$0"`/.."}
+: ${LIBUSB1_SRC:=/path/to/libusb}
+: ${HIDAPI_SRC:=/path/to/hidapi}
+
+OPENOCD_SRC=`readlink -m $OPENOCD_SRC`
+LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC`
+HIDAPI_SRC=`readlink -m $HIDAPI_SRC`
+
+HOST_TRIPLET=$1
+BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build
+LIBUSB1_BUILD_DIR=$BUILD_DIR/libusb1
+HIDAPI_BUILD_DIR=$BUILD_DIR/hidapi
+OPENOCD_BUILD_DIR=$BUILD_DIR/openocd
+
+## Root of host file tree
+SYSROOT=$WORK_DIR/$HOST_TRIPLET-root
+
+## Install location within host file tree
+: ${PREFIX=/usr}
+
+## OpenOCD-only install dir for packaging
+PACKAGE_DIR=$WORK_DIR/openocd_`git --git-dir=$OPENOCD_SRC/.git describe`_$HOST_TRIPLET
+
+#######
+
+# Create pkg-config wrapper and make sure it's used
+export PKG_CONFIG=$WORK_DIR/$HOST_TRIPLET-pkg-config
+
+cat > $PKG_CONFIG <<EOF
+#!/bin/sh
+
+SYSROOT=$SYSROOT
+
+export PKG_CONFIG_DIR=
+export PKG_CONFIG_LIBDIR=\${SYSROOT}$PREFIX/lib/pkgconfig:\${SYSROOT}$PREFIX/share/pkgconfig
+export PKG_CONFIG_SYSROOT_DIR=\${SYSROOT}
+
+# The following have to be set to avoid pkg-config to strip /usr/include and /usr/lib from paths
+# before they are prepended with the sysroot path. Feels like a pkg-config bug.
+export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=
+export PKG_CONFIG_ALLOW_SYSTEM_LIBS=
+
+exec pkg-config "\$@"
+EOF
+chmod +x $PKG_CONFIG
+
+# Clear out work dir
+rm -rf $SYSROOT $BUILD_DIR
+mkdir -p $SYSROOT
+
+# libusb-1.0 build & install into sysroot
+mkdir -p $LIBUSB1_BUILD_DIR
+cd $LIBUSB1_BUILD_DIR
+$LIBUSB1_SRC/configure --build=`$LIBUSB1_SRC/config.guess` --host=$HOST_TRIPLET \
+--with-sysroot=$SYSROOT --prefix=$PREFIX \
+$LIBUSB1_CONFIG
+make
+make install DESTDIR=$SYSROOT
+
+# hidapi build & install into sysroot
+if [ -d $HIDAPI_SRC ] ; then
+  mkdir -p $HIDAPI_BUILD_DIR
+  cd $HIDAPI_BUILD_DIR
+  $HIDAPI_SRC/configure --build=`$HIDAPI_SRC/config.guess` --host=$HOST_TRIPLET \
+    --with-sysroot=$SYSROOT --prefix=$PREFIX \
+    $HIDAPI_CONFIG
+  make
+  make install DESTDIR=$SYSROOT
+fi
+
+# OpenOCD build & install into sysroot
+mkdir -p $OPENOCD_BUILD_DIR
+cd $OPENOCD_BUILD_DIR
+$OPENOCD_SRC/configure --build=`$OPENOCD_SRC/config.guess` --host=$HOST_TRIPLET \
+--with-sysroot=$SYSROOT --prefix=$PREFIX \
+$OPENOCD_CONFIG
+make
+make install DESTDIR=$SYSROOT
+
+# Separate OpenOCD install w/o dependencies. OpenOCD will have to be linked
+# statically or have dependencies packaged/installed separately.
+make install DESTDIR=$PACKAGE_DIR

+ 124 - 0
share/openocd/contrib/gen-stellaris-part-header.pl

@@ -0,0 +1,124 @@
+#!/usr/bin/perl
+# Automatically generates the StellarisParts struct in src/flash/nor/stellaris.c
+# Uses the header files from TI/Luminary's StellarisWare complete Firmware Development Package
+# available from: http://www.luminarymicro.com/products/software_updates.html
+
+$comment = "// Autogenerated by contrib/gen-stellaris-part-header.pl
+// From Stellaris Firmware Development Package revision";
+
+$struct_header = "static const struct {
+	uint8_t class;
+	uint8_t partno;
+	const char *partname;
+} StellarisParts[] = {
+";
+
+$struct_footer = "\t{0xFF, 0x00, \"Unknown Part\"}\n};\n";
+
+$#ARGV == 1 || die "Usage: $0 <inc directory> <output file>\n";
+-d $ARGV[0] || die $ARGV[0]." is not a directory\n";
+$dir = $ARGV[0];
+-f $ARGV[1] || die $ARGV[1]." is not a file\n";
+$file = $ARGV[1];
+print STDERR "Scanning $dir, Updating $file\n";
+
+opendir(DIR, $dir) || die "can't open $dir: $!";
+@files = readdir(DIR);
+closedir(DIR);
+
+@header_files = sort(grep(/lm.+\.h/, @files));
+
+$ver = 0;
+$new_struct = $struct_header;
+process_file(@header_files);
+$new_struct .= $struct_footer;
+
+$dump = "$comment $ver\n$new_struct";
+{
+	local($/, *INPUT);
+	open(INPUT, $file) || die "can't open $file: $!";
+	$contents = <INPUT>;
+	close(INPUT);
+}
+
+$old_struct = qr/((^\/\/.*?\n)*)\Q$struct_header\E.*?$struct_footer/sm;
+$contents =~ s/$old_struct/$dump/;
+open(OUTPUT, ">$file") || die "can't open file $file for writing: $!";
+print OUTPUT $contents;
+close(OUTPUT);
+
+sub process_file {
+	foreach $h_file (@_) {
+		($base) = ($h_file =~ m/lm..(.{3,7})\.h/ig);
+		$base = uc($base);
+		local($/, *FILE);
+		open(FILE, "$dir/$h_file");
+		$content = <FILE>;
+		close(FILE);
+		$invalid = 0;
+		if ($content =~ /This is part of revision (\d+) of/) {
+			if ($ver != 0 and $ver != $1) {
+				print STDERR "File version mismatch: $ver != $1\n";
+				$ver = max($ver, $1);
+			} else {
+				$ver = $1;
+			}
+		}
+
+		if ($content =~ /SYSCTL_DID0_CLASS_[^M].+?0x(\S+)/s) {
+			$class = hex($1) >> 16;
+		} else {
+			# attempt another way to get class
+			if ($content =~ /\s(\S+)-class/) {
+				$class = getclass($1);
+				if ($class eq 0xFF) {
+					print STDERR "$h_file unknown class\n";
+					$invalid = 1;
+				}
+			} else {
+				print STDERR "$h_file is missing SYSCTL_DID0_CLASS_\n";
+				$class = 0;
+				$invalid = 1;
+			}
+		}
+
+		if ($content =~ /SYSCTL_DID1_PRTNO_$base.+0x(\S+)/) {
+			$prtno = hex($1);
+			$base = "LM3S" . $base;
+		} else {
+			# LM4F have a changed header
+			if ($content =~ /SYSCTL_DID1_PRTNO_LM4F$base.+?0x(\S+)/s) {
+				$prtno = hex($1);
+				$base = "LM4F" . $base;
+			} else {
+				print STDERR "$h_file is missing SYSCTL_DID1_PRTNO\n";
+				$prtno = 0;
+				$invalid = 1;
+			}
+		}
+		$new_member = sprintf "{0x%02X, 0x%02X, \"%s\"},", $class, $prtno >> 16, $base;
+		if ($invalid == 1) {
+			#$new_struct .= "\t//$new_member\t// Invalid\n";
+		} else {
+			$new_struct .= "\t$new_member\n";
+		}
+	}
+}
+
+sub getclass {
+	$class = $_[0];
+	if ($class =~ /Sandstorm/i) {
+		return 0;
+	} elsif ($class =~ /Fury/i) {
+		return 1;
+	} elsif ($class =~ /DustDevil/i) {
+		return 3;
+	} elsif ($class =~ /Tempest/i) {
+		return 4;
+	} elsif ($class =~ /Blizzard/i) {
+		return 5;
+	} elsif ($class =~ /Firestorm/i) {
+		return 6;
+	}
+	return 0xFF;
+}

+ 459 - 0
share/openocd/contrib/itmdump.c

@@ -0,0 +1,459 @@
+/*
+ * Copyright (C) 2010 by David Brownell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Simple utility to parse and dump ARM Cortex-M3 SWO trace output.  Once the
+ * mechanisms work right, this information can be used for various purposes
+ * including profiling (particularly easy for flat PC-sample profiles) and
+ * for debugging.
+ *
+ * SWO is the Single Wire Output found on some ARM cores, most notably on the
+ * Cortex-M3.  It combines data from several sources:
+ *
+ *  - Software trace (ITM):  so-called "printf-style" application messaging
+ *    using "ITM stimulus ports"; and differential timestamps.
+ *  - Hardware trace (DWT):  for profiling counters and comparator matches.
+ *  - TPIU may issue sync packets.
+ *
+ * The trace data format is defined in Appendix E, "Debug ITM and DWT packet
+ * protocol", of the ARMv7-M Architecture Reference Manual (DDI 0403C).  It
+ * is a superset of the ITM data format from the Coresight TRM.
+ *
+ * The trace data has two encodings.  The working assumption is that data
+ * gets into this program using the UART encoding.
+ */
+
+#include <errno.h>
+#include <libgen.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+
+unsigned int dump_swit;
+
+/* Example ITM trace word (0xWWXXYYZZ) parsing for task events, sent
+ * on port 31 (Reserved for "the" RTOS in CMSIS v1.30)
+ *   WWXX: event code (0..3 pre-assigned, 4..15 reserved)
+ *   YY:   task priority
+ *   ZZ:   task number
+ *
+ * NOTE that this specific encoding could be space-optimized; and that
+ * trace data streams could also be history-sensitive.
+ */
+static void show_task(int port, unsigned data)
+{
+	unsigned code = data >> 16;
+	char buf[16];
+
+	if (dump_swit)
+		return;
+
+	switch (code) {
+	case 0:
+		strcpy(buf, "run");
+		break;
+	case 1:
+		strcpy(buf, "block");
+		break;
+	case 2:
+		strcpy(buf, "create");
+		break;
+	case 3:
+		strcpy(buf, "destroy");
+		break;
+	/* 4..15 reserved for other infrastructure ops */
+	default:
+		sprintf(buf, "code %d", code);
+		break;
+	}
+	printf("TASK %d, pri %d: %s",
+		(data >> 0) & 0xff,
+		(data >> 8) & 0xff,
+		buf);
+}
+
+static void show_reserved(FILE *f, char *label, int c)
+{
+	unsigned i;
+
+	if (dump_swit)
+		return;
+
+	printf("%s - %#02x", label, c);
+
+	for (i = 0; (c & 0x80) && i < 4; i++) {
+		c = fgetc(f);
+		if (c == EOF) {
+			printf("(ERROR %d - %s) ", errno, strerror(errno));
+			break;
+		}
+		printf(" %#02x", c);
+	}
+
+	printf("\n");
+}
+
+static bool read_varlen(FILE *f, int c, unsigned *value)
+{
+	unsigned size;
+	unsigned char buf[4];
+
+	*value = 0;
+
+	switch (c & 3) {
+	case 3:
+		size = 4;
+		break;
+	case 2:
+		size = 2;
+		break;
+	case 1:
+		size = 1;
+		break;
+	default:
+		printf("INVALID SIZE\n");
+		return false;
+	}
+
+	memset(buf, 0, sizeof buf);
+	if (fread(buf, 1, size, f) != size)
+		goto err;
+
+	*value =  (buf[3] << 24)
+		+ (buf[2] << 16)
+		+ (buf[1] << 8)
+		+ (buf[0] << 0);
+	return true;
+
+err:
+	printf("(ERROR %d - %s)\n", errno, strerror(errno));
+	return false;
+}
+
+static void show_hard(FILE *f, int c)
+{
+	unsigned type = c >> 3;
+	unsigned value;
+	char *label;
+
+	if (dump_swit)
+		return;
+
+	printf("DWT - ");
+
+	if (!read_varlen(f, c, &value))
+		return;
+	printf("%#x", value);
+
+	switch (type) {
+	case 0:				/* event counter wrapping */
+		printf("overflow %s%s%s%s%s%s",
+			(value & (1 << 5)) ? "cyc " : "",
+			(value & (1 << 4)) ? "fold " : "",
+			(value & (1 << 3)) ? "lsu " : "",
+			(value & (1 << 2)) ? "slp " : "",
+			(value & (1 << 1)) ? "exc " : "",
+			(value & (1 << 0)) ? "cpi " : "");
+		break;
+	case 1:				/* exception tracing */
+		switch (value >> 12) {
+		case 1:
+			label = "entry to";
+			break;
+		case 2:
+			label = "exit from";
+			break;
+		case 3:
+			label = "return to";
+			break;
+		default:
+			label = "?";
+			break;
+		}
+		printf("%s exception %d", label, value & 0x1ff);
+		break;
+	case 2:				/* PC sampling */
+		if (c == 0x15)
+			printf("PC - sleep");
+		else
+			printf("PC - %#08x", value);
+		break;
+	case 8:				/* data tracing, pc value */
+	case 10:
+	case 12:
+	case 14:
+		printf("Data trace %d, PC %#08x", (c >> 4) & 3, value);
+		/* optionally followed by data value */
+		break;
+	case 9:				/* data tracing, address offset */
+	case 11:
+	case 13:
+	case 15:
+		printf("Data trace %d, address offset %#04x",
+				(c >> 4) & 3, value);
+		/* always followed by data value */
+		break;
+	case 16 ... 23:			/* data tracing, data value */
+		printf("Data trace %d, ", (c >> 4) & 3);
+		label = (c & 0x8) ? "write" : "read";
+		switch (c & 3) {
+		case 3:
+			printf("word %s, value %#08x", label, value);
+			break;
+		case 2:
+			printf("halfword %s, value %#04x", label, value);
+			break;
+		case 1:
+			printf("byte %s, value %#02x", label, value);
+			break;
+		}
+		break;
+	default:
+		printf("UNDEFINED, rawtype: %x", type);
+		break;
+	}
+
+	printf("\n");
+	return;
+}
+
+/*
+ * Table of SWIT (SoftWare InstrumentTation) message dump formats, for
+ * ITM port 0..31 application data.
+ *
+ * Eventually this should be customizable; all usage is application defined.
+ *
+ * REVISIT there can be up to 256 trace ports, via "ITM Extension" packets
+ */
+struct {
+	int port;
+	void (*show)(int port, unsigned data);
+} format[] = {
+	{ .port = 31,  .show = show_task, },
+};
+
+static void show_swit(FILE *f, int c)
+{
+	unsigned port = c >> 3;
+	unsigned value = 0;
+	unsigned i;
+
+	if (port + 1 == dump_swit) {
+		if (!read_varlen(f, c, &value))
+			return;
+		printf("%c", value);
+		return;
+	}
+
+	if (!read_varlen(f, c, &value))
+		return;
+
+	if (dump_swit)
+		return;
+
+	printf("SWIT %u - ", port);
+
+	printf("%#08x", value);
+
+	for (i = 0; i < sizeof(format) / sizeof(format[0]); i++) {
+		if (format[i].port == port) {
+			printf(", ");
+			format[i].show(port, value);
+			break;
+		}
+	}
+
+	printf("\n");
+	return;
+}
+
+static void show_timestamp(FILE *f, int c)
+{
+	unsigned counter = 0;
+	char *label = "";
+	bool delayed = false;
+
+	if (dump_swit)
+		return;
+
+	printf("TIMESTAMP - ");
+
+	/* Format 2: header only */
+	if (!(c & 0x80)) {
+		switch (c) {
+		case 0:		/* sync packet -- coding error! */
+		case 0x70:	/* overflow -- ditto! */
+			printf("ERROR - %#02x\n", c);
+			break;
+		default:
+			/* synchronous to ITM */
+			counter = c >> 4;
+			goto done;
+		}
+		return;
+	}
+
+	/* Format 1:  one to four bytes of data too */
+	switch (c >> 4) {
+	default:
+		label = ", reserved control\n";
+		break;
+	case 0xc:
+		/* synchronous to ITM */
+		break;
+	case 0xd:
+		label = ", timestamp delayed";
+		delayed = true;
+		break;
+	case 0xe:
+		label = ", packet delayed";
+		delayed = true;
+		break;
+	case 0xf:
+		label = ", packet and timetamp delayed";
+		delayed = true;
+		break;
+	}
+
+	c = fgetc(f);
+	if (c == EOF)
+		goto err;
+	counter = c & 0x7f;
+	if (!(c & 0x80))
+		goto done;
+
+	c = fgetc(f);
+	if (c == EOF)
+		goto err;
+	counter |= (c & 0x7f) << 7;
+	if (!(c & 0x80))
+		goto done;
+
+	c = fgetc(f);
+	if (c == EOF)
+		goto err;
+	counter |= (c & 0x7f) << 14;
+	if (!(c & 0x80))
+		goto done;
+
+	c = fgetc(f);
+	if (c == EOF)
+		goto err;
+	counter |= (c & 0x7f) << 21;
+
+done:
+	/* REVISIT should we try to convert from delta values?  */
+	printf("+%u%s\n", counter, label);
+	return;
+
+err:
+	printf("(ERROR %d - %s) ", errno, strerror(errno));
+	goto done;
+}
+
+int main(int argc, char **argv)
+{
+	FILE *f = stdin;
+	int c;
+
+	/* parse arguments */
+	while ((c = getopt(argc, argv, "f:d:")) != EOF) {
+		switch (c) {
+		case 'f':
+			/* e.g. from UART connected to /dev/ttyUSB0 */
+			f = fopen(optarg, "r");
+			if (!f) {
+				perror(optarg);
+				return 1;
+			}
+			break;
+		case 'd':
+			dump_swit = atoi(optarg);
+			break;
+		default:
+			fprintf(stderr, "usage: %s [-f input]",
+				basename(argv[0]));
+			return 1;
+		}
+	}
+
+	/* Parse data ... records have a header then data bytes.
+	 * NOTE: we assume getc() deals in 8-bit bytes.
+	 */
+	bool overflow = false;
+
+	while ((c = getc(f)) != EOF) {
+
+		/* Sync packet ... 7 zeroes, 0x80 */
+		if (c == 0) {
+			int i;
+
+			for (i = 0; i < 6; i++) {
+				c = fgetc(f);
+				if (c == EOF)
+					break;
+				if (c != 0)
+					goto bad_sync;
+			}
+			c = fgetc(f);
+			if (c == 0x80) {
+				printf("SYNC\n");
+				continue;
+			}
+bad_sync:
+			printf("BAD SYNC\n");
+			continue;
+		}
+
+		/* Overflow packet */
+		if (c == 0x70) {
+			/* REVISIT later, report just what overflowed!
+			 * Timestamp and SWIT can happen.  Non-ITM too?
+			 */
+			overflow = true;
+			printf("OVERFLOW ...\n");
+			continue;
+		}
+		overflow = false;
+
+		switch (c & 0x0f) {
+		case 0x00:		/* Timestamp */
+			show_timestamp(f, c);
+			break;
+		case 0x04:		/* "Reserved" */
+			show_reserved(f, "RESERVED", c);
+			break;
+		case 0x08:		/* ITM Extension */
+			/* FIXME someday, handle these ...  */
+			show_reserved(f, "ITM EXT", c);
+			break;
+		case 0x0c:		/* DWT Extension */
+			show_reserved(f, "DWT EXT", c);
+			break;
+		default:
+			if (c & 4)
+				show_hard(f, c);
+			else
+				show_swit(f, c);
+			break;
+		}
+
+	}
+
+	return 0;
+}

+ 19 - 0
share/openocd/contrib/libdcc/README

@@ -0,0 +1,19 @@
+This code is an example of using the openocd debug message system.
+
+Before the message output is seen in the debug window, the functionality
+will need enabling:
+
+From the gdb prompt:
+monitor target_request debugmsgs enable
+monitor trace point 1
+
+From the Telnet prompt:
+target_request debugmsgs enable
+trace point 1
+
+To see how many times the trace point was hit:
+(monitor) trace point 1
+
+Spen
+spen@spen-soft.co.uk
+

+ 157 - 0
share/openocd/contrib/libdcc/dcc_stdio.c

@@ -0,0 +1,157 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Dominic Rath                                    *
+ *   Dominic.Rath@gmx.de                                                   *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *   Copyright (C) 2008 by Frederik Kriewtz                                *
+ *   frederik@kriewitz.eu                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+#include "dcc_stdio.h"
+
+#define TARGET_REQ_TRACEMSG					0x00
+#define TARGET_REQ_DEBUGMSG_ASCII			0x01
+#define TARGET_REQ_DEBUGMSG_HEXMSG(size)	(0x01 | ((size & 0xff) << 8))
+#define TARGET_REQ_DEBUGCHAR				0x02
+
+#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_6SM__)
+
+/* we use the System Control Block DCRDR reg to simulate a arm7_9 dcc channel
+ * DCRDR[7:0] is used by target for status
+ * DCRDR[15:8] is used by target for write buffer
+ * DCRDR[23:16] is used for by host for status
+ * DCRDR[31:24] is used for by host for write buffer */
+
+#define NVIC_DBG_DATA_R		(*((volatile unsigned short *)0xE000EDF8))
+
+#define	BUSY	1
+
+void dbg_write(unsigned long dcc_data)
+{
+	int len = 4;
+
+	while (len--)
+	{
+		/* wait for data ready */
+		while (NVIC_DBG_DATA_R & BUSY);
+
+		/* write our data and set write flag - tell host there is data*/
+		NVIC_DBG_DATA_R = (unsigned short)(((dcc_data & 0xff) << 8) | BUSY);
+		dcc_data >>= 8;
+	}
+}
+
+#elif defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5T__)
+
+void dbg_write(unsigned long dcc_data)
+{
+	unsigned long dcc_status;
+
+	do {
+		asm volatile("mrc p14, 0, %0, c0, c0" : "=r" (dcc_status));
+	} while (dcc_status & 0x2);
+
+	asm volatile("mcr p14, 0, %0, c1, c0" : : "r" (dcc_data));
+}
+
+#else
+ #error unsupported target
+#endif
+
+void dbg_trace_point(unsigned long number)
+{
+	dbg_write(TARGET_REQ_TRACEMSG | (number << 8));
+}
+
+void dbg_write_u32(const unsigned long *val, long len)
+{
+	dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(4) | ((len & 0xffff) << 16));
+
+	while (len > 0)
+	{
+		dbg_write(*val);
+
+		val++;
+		len--;
+	}
+}
+
+void dbg_write_u16(const unsigned short *val, long len)
+{
+	unsigned long dcc_data;
+
+	dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(2) | ((len & 0xffff) << 16));
+
+	while (len > 0)
+	{
+		dcc_data = val[0]
+			| ((len > 1) ? val[1] << 16: 0x0000);
+
+		dbg_write(dcc_data);
+
+		val += 2;
+		len -= 2;
+	}
+}
+
+void dbg_write_u8(const unsigned char *val, long len)
+{
+	unsigned long dcc_data;
+
+	dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(1) | ((len & 0xffff) << 16));
+
+	while (len > 0)
+	{
+		dcc_data = val[0]
+			| ((len > 1) ? val[1] << 8 : 0x00)
+			| ((len > 2) ? val[2] << 16 : 0x00)
+			| ((len > 3) ? val[3] << 24 : 0x00);
+
+		dbg_write(dcc_data);
+
+		val += 4;
+		len -= 4;
+	}
+}
+
+void dbg_write_str(const char *msg)
+{
+	long len;
+	unsigned long dcc_data;
+
+	for (len = 0; msg[len] && (len < 65536); len++);
+
+	dbg_write(TARGET_REQ_DEBUGMSG_ASCII | ((len & 0xffff) << 16));
+
+	while (len > 0)
+	{
+		dcc_data = msg[0]
+			| ((len > 1) ? msg[1] << 8 : 0x00)
+			| ((len > 2) ? msg[2] << 16 : 0x00)
+			| ((len > 3) ? msg[3] << 24 : 0x00);
+		dbg_write(dcc_data);
+
+		msg += 4;
+		len -= 4;
+	}
+}
+
+void dbg_write_char(char msg)
+{
+	dbg_write(TARGET_REQ_DEBUGCHAR | ((msg & 0xff) << 16));
+}

+ 35 - 0
share/openocd/contrib/libdcc/dcc_stdio.h

@@ -0,0 +1,35 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Dominic Rath                                    *
+ *   Dominic.Rath@gmx.de                                                   *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+#ifndef DCC_STDIO_H
+#define DCC_STDIO_H
+
+void dbg_trace_point(unsigned long number);
+
+void dbg_write_u32(const unsigned long *val, long len);
+void dbg_write_u16(const unsigned short *val, long len);
+void dbg_write_u8(const unsigned char *val, long len);
+
+void dbg_write_str(const char *msg);
+void dbg_write_char(char msg);
+
+#endif	/* DCC_STDIO_H */

+ 58 - 0
share/openocd/contrib/libdcc/example.c

@@ -0,0 +1,58 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *   Copyright (C) 2008 by Frederik Kriewtz                                *
+ *   frederik@kriewitz.eu                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+#include "dcc_stdio.h"
+
+/* enable openocd debugmsg at the gdb prompt:
+ * monitor target_request debugmsgs enable
+ *
+ * create a trace point:
+ * monitor trace point 1
+ *
+ * to show how often the trace point was hit:
+ * monitor trace point
+*/
+
+int main(void)
+{
+	dbg_write_str("hello world");
+
+	dbg_write_char('t');
+	dbg_write_char('e');
+	dbg_write_char('s');
+	dbg_write_char('t');
+	dbg_write_char('\n');
+
+	unsigned long test_u32 = 0x01234567;
+	dbg_write_u32(&test_u32, 1);
+
+	static const unsigned short test_u16[] = {0x0123, 0x4567, 0x89AB, 0xCDEF, 0x0123, 0x4567, 0x89AB, 0xCDEF};
+	dbg_write_u16(test_u16, 8);
+
+	static const unsigned char test_u8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0XDD, 0xEE, 0xFF};
+	dbg_write_u8(test_u8, 16);
+
+	while(1)
+	{
+		dbg_trace_point(0);
+	}
+}

+ 34 - 0
share/openocd/contrib/loaders/Makefile

@@ -0,0 +1,34 @@
+.PHONY: arm clean-arm
+
+all: arm
+
+common_dirs = \
+	checksum \
+	erase_check \
+	watchdog
+
+ARM_CROSS_COMPILE ?= arm-none-eabi-
+
+arm_dirs = \
+	flash/fm4 \
+	flash/kinetis_ke \
+	flash/xmc1xxx \
+	debug/xscale
+
+arm:
+	for d in $(common_dirs); do \
+		$(MAKE) -C $$d arm; \
+	done
+	for d in $(arm_dirs); do \
+		$(MAKE) -C $$d all CROSS_COMPILE=$(ARM_CROSS_COMPILE); \
+	done
+
+clean-arm:
+	for d in $(arm_dirs); do \
+		$(MAKE) -C $$d clean; \
+	done
+
+clean: clean-arm
+	for d in $(common_dirs); do \
+		$(MAKE) -C $$d clean; \
+	done

+ 33 - 0
share/openocd/contrib/loaders/README

@@ -0,0 +1,33 @@
+Included in these directories are the src to the various ram loaders used
+within openocd.
+
+** target checksum loaders **
+
+checksum/armv4_5_crc.s :
+ - ARMv4 and ARMv5 checksum loader : see target/arm_crc_code.c:arm_crc_code
+
+checksum/armv7m_crc.s :
+ - ARMv7m checksum loader : see target/armv7m.c:cortex_m_crc_code
+
+checksum/mips32.s :
+ - MIPS32 checksum loader : see target/mips32.c:mips_crc_code
+
+** target flash loaders **
+
+flash/pic32mx.s :
+ - Microchip PIC32 flash loader : see flash/nor/pic32mx.c:pic32mx_flash_write_code
+
+flash/stellaris.s :
+ - TI Stellaris flash loader : see flash/nor/stellaris.c:stellaris_write_code
+
+flash/stm32x.s :
+ - ST STM32 flash loader : see flash/nor/stm32x.c:stm32x_flash_write_code
+
+flash/str7x.s :
+ - ST STR7 flash loader : see flash/nor/str7x.c:str7x_flash_write_code
+
+flash/str9x.s :
+ - ST STR9 flash loader : see flash/nor/str9x.c:str9x_flash_write_code
+
+Spencer Oliver
+spen@spen-soft.co.uk

+ 30 - 0
share/openocd/contrib/loaders/checksum/Makefile

@@ -0,0 +1,30 @@
+BIN2C = ../../../src/helper/bin2char.sh
+
+ARM_CROSS_COMPILE ?= arm-none-eabi-
+ARM_AS      ?= $(ARM_CROSS_COMPILE)as
+ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
+
+ARM_AFLAGS = -EL
+
+arm: armv4_5_crc.inc armv7m_crc.inc
+
+armv4_5_%.elf: armv4_5_%.s
+	$(ARM_AS) $(ARM_AFLAGS) $< -o $@
+
+armv4_5_%.bin: armv4_5_%.elf
+	$(ARM_OBJCOPY) -Obinary $< $@
+
+armv4_5_%.inc: armv4_5_%.bin
+	$(BIN2C) < $< > $@
+
+armv7m_%.elf: armv7m_%.s
+	$(ARM_AS) $(ARM_AFLAGS) $< -o $@
+
+armv7m_%.bin: armv7m_%.elf
+	$(ARM_OBJCOPY) -Obinary $< $@
+
+armv7m_%.inc: armv7m_%.bin
+	$(BIN2C) < $< > $@
+
+clean:
+	-rm -f *.elf *.bin *.inc

+ 7 - 0
share/openocd/contrib/loaders/checksum/armv4_5_crc.inc

@@ -0,0 +1,7 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x00,0x20,0xa0,0xe1,0x00,0x00,0xe0,0xe3,0x01,0x30,0xa0,0xe1,0x00,0x40,0xa0,0xe3,
+0x0b,0x00,0x00,0xea,0x04,0x10,0xd2,0xe7,0x30,0x70,0x9f,0xe5,0x01,0x0c,0x20,0xe0,
+0x00,0x50,0xa0,0xe3,0x00,0x00,0x50,0xe3,0x80,0x60,0xa0,0xe1,0x01,0x50,0x85,0xe2,
+0x06,0x00,0xa0,0xe1,0x07,0x00,0x26,0xb0,0x08,0x00,0x55,0xe3,0xf8,0xff,0xff,0x1a,
+0x01,0x40,0x84,0xe2,0x03,0x00,0x54,0xe1,0xf1,0xff,0xff,0x1a,0x70,0x00,0x20,0xe1,
+0xb7,0x1d,0xc1,0x04,

+ 58 - 0
share/openocd/contrib/loaders/checksum/armv4_5_crc.s

@@ -0,0 +1,58 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+/*
+	r0 - address in - crc out
+	r1 - char count
+*/
+
+	.text
+	.arm
+
+_start:
+main:
+	mov		r2, r0
+	mov		r0, #0xffffffff	/* crc */
+	mov		r3, r1
+	mov		r4, #0
+	b		ncomp
+nbyte:
+	ldrb	r1, [r2, r4]
+	ldr		r7, CRC32XOR
+	eor		r0, r0, r1, asl #24
+	mov		r5, #0
+loop:
+	cmp		r0, #0
+	mov		r6, r0, asl #1
+	add		r5, r5, #1
+	mov		r0, r6
+	eorlt	r0, r6, r7
+	cmp		r5, #8
+	bne		loop
+	add		r4, r4, #1
+ncomp:
+	cmp		r4, r3
+	bne		nbyte
+end:
+	bkpt	#0
+
+CRC32XOR:	.word	0x04c11db7
+
+	.end

+ 5 - 0
share/openocd/contrib/loaders/checksum/armv7m_crc.inc

@@ -0,0 +1,5 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x02,0x46,0x00,0x20,0xc0,0x43,0x0a,0x4e,0x0b,0x46,0x00,0x24,0x0d,0xe0,0x11,0x5d,
+0x09,0x06,0x48,0x40,0x00,0x25,0x00,0x28,0x02,0xda,0x40,0x00,0x70,0x40,0x00,0xe0,
+0x40,0x00,0x01,0x35,0x08,0x2d,0xf6,0xd1,0x01,0x34,0x9c,0x42,0xef,0xd1,0x00,0xbe,
+0xb7,0x1d,0xc1,0x04,

+ 71 - 0
share/openocd/contrib/loaders/checksum/armv7m_crc.s

@@ -0,0 +1,71 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+/*
+	parameters:
+	r0 - address in - crc out
+	r1 - char count
+*/
+
+	.text
+	.syntax unified
+	.cpu cortex-m0
+	.thumb
+	.thumb_func
+
+	.align	2
+
+_start:
+main:
+	mov		r2, r0
+	movs	r0, #0
+	mvns	r0, r0
+	ldr		r6, CRC32XOR
+	mov		r3, r1
+	movs	r4, #0
+	b		ncomp
+nbyte:
+	ldrb	r1, [r2, r4]
+	lsls	r1, r1, #24
+	eors	r0, r0, r1
+	movs	r5, #0
+loop:
+	cmp		r0, #0
+	bge		notset
+	lsls	r0, r0, #1
+	eors	r0, r0, r6
+	b		cont
+notset:
+	lsls	r0, r0, #1
+cont:
+	adds	r5, r5, #1
+	cmp		r5, #8
+	bne		loop
+	adds	r4, r4, #1
+ncomp:
+	cmp		r4, r3
+	bne		nbyte
+	bkpt	#0
+
+	.align	2
+
+CRC32XOR:	.word	0x04c11db7
+
+	.end

+ 72 - 0
share/openocd/contrib/loaders/checksum/mips32.s

@@ -0,0 +1,72 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+	.global main
+	.text
+	.set noreorder
+
+/* params:
+ * $a0 address in
+ * $a1 byte count
+ * vars
+ * $a0 crc
+ * $a1 crc data byte
+ * temps:
+ * t3 v0 a3 a2 t0 v1
+ */
+
+.ent main
+main:
+	addiu	$t4, $a0, 0		/* address in */
+	addiu	$t2, $a1, 0		/* count */
+
+	addiu	$a0, $zero, 0xffffffff /* a0 crc - result */
+
+	beq		$zero, $zero, ncomp
+	addiu	$t3, $zero, 0	/* clear bytes read */
+
+nbyte:
+	lb		$a1, ($t4)		/* load byte from source address */
+	addi	$t4, $t4, 1		/* inc byte count */
+
+crc:
+	sll		$a1, $a1, 24
+	lui		$v0, 0x04c1
+	xor		$a0, $a0, $a1
+	ori		$a3, $v0, 0x1db7
+	addu	$a2, $zero, $zero /* clear bit count */
+loop:
+	sll		$t0, $a0, 1
+	addiu	$a2, $a2, 1		/* inc bit count */
+	slti	$a0, $a0, 0
+	xor		$t1, $t0, $a3
+	movn	$t0, $t1, $a0
+	slti	$v1, $a2, 8		/* 8bits processed */
+	bne		$v1, $zero, loop
+	addu	$a0, $t0, $zero
+
+ncomp:
+	bne		$t2, $t3, nbyte	/* all bytes processed */
+	addiu	$t3, $t3, 1
+
+wait:
+	sdbbp
+
+.end main

+ 33 - 0
share/openocd/contrib/loaders/debug/xscale/Makefile

@@ -0,0 +1,33 @@
+BIN2C = ../../../../src/helper/bin2char.sh
+
+CROSS_COMPILE ?= arm-none-eabi-
+
+CC=$(CROSS_COMPILE)gcc
+OBJCOPY=$(CROSS_COMPILE)objcopy
+OBJDUMP=$(CROSS_COMPILE)objdump
+
+CFLAGS = -static -nostartfiles -mlittle-endian -Wa,-EL
+LDFLAGS = -Tdebug_handler.ld
+
+all: debug_handler.inc
+
+.PHONY: clean
+
+.INTERMEDIATE: debug_handler.elf
+
+debug_handler.elf: protocol.h
+
+%.elf: %.S
+	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+
+%.lst: %.elf
+	$(OBJDUMP) -S $< > $@
+
+%.bin: %.elf
+	$(OBJCOPY) -Obinary $< $@
+
+%.inc: %.bin
+	$(BIN2C) < $< > $@
+
+clean:
+	-rm -f *.elf *.lst *.bin *.inc

+ 716 - 0
share/openocd/contrib/loaders/debug/xscale/debug_handler.S

@@ -0,0 +1,716 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Dominic Rath                                    *
+ *   Dominic.Rath@gmx.de                                                   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
+ ***************************************************************************/
+#include "protocol.h"
+
+    .text
+    .align  4
+
+@ Disable thumb mode
+    .code 32
+
+@ send word to debugger
+.macro m_send_to_debugger reg
+1:
+	mrc p14, 0, r15, c14, c0, 0
+	bvs 1b
+	mcr p14, 0, \reg, c8, c0, 0
+.endm
+
+@ receive word from debugger
+.macro m_receive_from_debugger reg
+1:
+	mrc p14, 0, r15, c14, c0, 0
+	bpl 1b
+	mrc p14, 0, \reg, c9, c0, 0
+.endm
+
+@ save register on debugger, small
+.macro m_small_save_reg reg
+	mov r0, \reg
+	bl send_to_debugger
+.endm
+
+@ save status register on debugger, small
+.macro m_small_save_psr
+	mrs r0, spsr
+	bl send_to_debugger
+.endm
+
+@ wait for all outstanding coprocessor accesses to complete
+.macro m_cpwait
+	mrc p15, 0, r0, c2, c0, 0
+	mov r0, r0
+	sub pc, pc, #4
+.endm
+
+.global reset_handler
+.global undef_handler
+.global swi_handler
+.global prefetch_abort_handler
+.global data_abort_handler
+.global irq_handler
+.global fiq_handler
+
+.section .part1 , "ax"
+
+reset_handler:
+	@ read DCSR
+	mrc p14, 0, r13, c10, c0
+	@ check if global enable bit (GE) is set
+	ands r13, r13, #0x80000000
+
+	bne debug_handler
+
+	@ set global enable bit (GE)
+	mov r13, #0xc0000000
+	mcr p14, 0, r13, c10, c0
+
+debug_handler:
+
+	@ save r0 without modifying other registers
+	m_send_to_debugger r0
+
+	@ save lr (program PC) without branching (use macro)
+	m_send_to_debugger r14
+
+	@ save non-banked registers and spsr (program CPSR)
+	m_small_save_reg r1
+	m_small_save_reg r2
+	m_small_save_reg r3
+	m_small_save_reg r4
+	m_small_save_reg r5
+	m_small_save_reg r6
+	m_small_save_reg r7
+	m_small_save_psr
+
+	mrs r0, spsr
+
+	@ prepare program PSR for debug use (clear Thumb, set I/F to disable interrupts)
+	bic r0, r0, #PSR_T
+	orr r0, r0, #(PSR_I | PSR_F)
+
+	@ examine mode bits
+	and r1, r0, #MODE_MASK
+	cmp r1, #MODE_USR
+
+	bne not_user_mode
+
+	@ replace USR mode with SYS
+	bic r0, r0, #MODE_MASK
+	orr r0, r0, #MODE_SYS
+
+not_user_mode:
+
+	b save_banked_registers
+
+@ command loop
+@ wait for command from debugger, than execute desired function
+get_command:
+	bl receive_from_debugger
+
+	@ 0x0n - register access
+	cmp r0, #0x0
+	beq get_banked_registers
+
+	cmp r0, #0x1
+	beq set_banked_registers
+
+	@ 0x1n - read memory
+	cmp r0, #0x11
+	beq read_byte
+
+	cmp r0, #0x12
+	beq read_half_word
+
+	cmp r0, #0x14
+	beq read_word
+
+	@ 0x2n - write memory
+	cmp r0, #0x21
+	beq write_byte
+
+	cmp r0, #0x22
+	beq write_half_word
+
+	cmp r0, #0x24
+	beq write_word
+
+	@ 0x3n - program execution
+	cmp r0, #0x30
+	beq resume
+
+	cmp r0, #0x31
+	beq resume_w_trace
+
+	@ 0x4n - coprocessor access
+	cmp r0, #0x40
+	beq read_cp_reg
+
+	cmp r0, #0x41
+	beq write_cp_reg
+
+	@ 0x5n - cache and mmu functions
+	cmp r0, #0x50
+	beq clean_d_cache
+
+	cmp r0, #0x51
+	beq invalidate_d_cache
+
+	cmp r0, #0x52
+	beq invalidate_i_cache
+
+	cmp r0, #0x53
+	beq cpwait
+
+	@ 0x6n - misc functions
+	cmp r0, #0x60
+	beq clear_sa
+
+	cmp r0, #0x61
+	beq read_trace_buffer
+
+	cmp r0, #0x62
+	beq clean_trace_buffer
+
+	@ return (back to get_command)
+	b get_command
+
+@ ----
+
+@ resume program execution
+resume:
+	@ restore CPSR (SPSR_dbg)
+	bl receive_from_debugger
+	msr spsr, r0
+
+	@ restore registers (r7 - r0)
+	bl receive_from_debugger @ r7
+	mov r7, r0
+	bl receive_from_debugger @ r6
+	mov r6, r0
+	bl receive_from_debugger @ r5
+	mov r5, r0
+	bl receive_from_debugger @ r4
+	mov r4, r0
+	bl receive_from_debugger @ r3
+	mov r3, r0
+	bl receive_from_debugger @ r2
+	mov r2, r0
+	bl receive_from_debugger @ r1
+	mov r1, r0
+	bl receive_from_debugger @ r0
+
+	@ resume addresss
+	m_receive_from_debugger lr
+
+	@ branch back to application code, restoring CPSR
+	subs pc, lr, #0
+
+@ get banked registers
+@ receive mode bits from host, then run into save_banked_registers to
+
+get_banked_registers:
+	bl receive_from_debugger
+
+@ save banked registers
+@ r0[4:0]: desired mode bits
+save_banked_registers:
+	@ backup CPSR
+	mrs r7, cpsr
+	msr cpsr_c, r0
+	nop
+
+	@ keep current mode bits in r1 for later use
+	and r1, r0, #MODE_MASK
+
+	@ backup banked registers
+	m_send_to_debugger r8
+	m_send_to_debugger r9
+	m_send_to_debugger r10
+	m_send_to_debugger r11
+	m_send_to_debugger r12
+	m_send_to_debugger r13
+	m_send_to_debugger r14
+
+	@ if not in SYS mode (or USR, which we replaced with SYS before)
+	cmp r1, #MODE_SYS
+
+	beq no_spsr_to_save
+
+	@ backup SPSR
+	mrs r0, spsr
+	m_send_to_debugger r0
+
+no_spsr_to_save:
+
+	@ restore CPSR for SDS
+	msr cpsr_c, r7
+	nop
+
+   	@ return
+	b get_command
+
+@ ----
+
+
+@ set banked registers
+@ receive mode bits from host, then run into save_banked_registers to
+
+set_banked_registers:
+	bl receive_from_debugger
+
+@ restore banked registers
+@ r0[4:0]: desired mode bits
+restore_banked_registers:
+	@ backup CPSR
+	mrs r7, cpsr
+	msr cpsr_c, r0
+	nop
+
+	@ keep current mode bits in r1 for later use
+	and r1, r0, #MODE_MASK
+
+	@ set banked registers
+	m_receive_from_debugger r8
+	m_receive_from_debugger r9
+	m_receive_from_debugger r10
+	m_receive_from_debugger r11
+	m_receive_from_debugger r12
+	m_receive_from_debugger r13
+	m_receive_from_debugger r14
+
+	@ if not in SYS mode (or USR, which we replaced with SYS before)
+	cmp r1, #MODE_SYS
+
+	beq no_spsr_to_restore
+
+	@ set SPSR
+	m_receive_from_debugger r0
+	msr spsr, r0
+
+no_spsr_to_restore:
+
+	@ restore CPSR for SDS
+	msr cpsr_c, r7
+	nop
+
+   	@ return
+	b get_command
+
+@ ----
+
+read_byte:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+rb_loop:
+	ldrb r0, [r2], #1
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	bl send_to_debugger
+
+	subs r1, r1, #1
+	bne rb_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+read_half_word:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+rh_loop:
+	ldrh r0, [r2], #2
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	bl send_to_debugger
+
+	subs r1, r1, #1
+	bne rh_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+read_word:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+rw_loop:
+	ldr r0, [r2], #4
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	bl send_to_debugger
+
+	subs r1, r1, #1
+	bne rw_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+write_byte:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+wb_loop:
+	bl receive_from_debugger
+	strb r0, [r2], #1
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	subs r1, r1, #1
+	bne wb_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+write_half_word:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+wh_loop:
+	bl receive_from_debugger
+	strh r0, [r2], #2
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	subs r1, r1, #1
+	bne wh_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+write_word:
+	@ r2: address
+	bl receive_from_debugger
+	mov r2, r0
+
+	@ r1: count
+	bl receive_from_debugger
+	mov r1, r0
+
+ww_loop:
+	bl receive_from_debugger
+	str r0, [r2], #4
+
+	@ drain write- (and fill-) buffer to work around XScale errata
+	mcr p15, 0, r8, c7, c10, 4
+
+	subs r1, r1, #1
+	bne ww_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+clear_sa:
+	@ read DCSR
+	mrc p14, 0, r0, c10, c0
+
+	@ clear SA bit
+	bic r0, r0, #0x20
+
+	@ write DCSR
+	mcr p14, 0, r0, c10, c0
+
+	@ return
+	b get_command
+
+@ ----
+
+clean_d_cache:
+	@ r0: cache clean area
+	bl receive_from_debugger
+
+	mov r1, #1024
+clean_loop:
+	mcr p15, 0, r0, c7, c2, 5
+	add r0, r0, #32
+	subs r1, r1, #1
+	bne clean_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+invalidate_d_cache:
+	mcr p15, 0, r0, c7, c6, 0
+
+	@ return
+	b get_command
+
+@ ----
+
+invalidate_i_cache:
+	mcr p15, 0, r0, c7, c5, 0
+
+	@ return
+	b get_command
+
+@ ----
+
+cpwait:
+	m_cpwait
+
+	@return
+	b get_command
+
+@ ----
+
+.section .part2 , "ax"
+
+read_cp_reg:
+	@ requested cp register
+	bl receive_from_debugger
+
+	adr r1, read_cp_table
+	add pc, r1, r0, lsl #3
+
+read_cp_table:
+	mrc p15, 0, r0, c0, c0, 0  @ XSCALE_MAINID
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c0, c0, 1  @ XSCALE_CACHETYPE
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c1, c0, 0  @ XSCALE_CTRL
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c1, c0, 1  @ XSCALE_AUXCTRL
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c2, c0, 0  @ XSCALE_TTB
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c3, c0, 0  @ XSCALE_DAC
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c5, c0, 0  @ XSCALE_FSR
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c6, c0, 0  @ XSCALE_FAR
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c13, c0, 0  @ XSCALE_PID
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c15, c0, 0  @ XSCALE_CP_ACCESS
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c14, c8, 0  @ XSCALE_IBCR0
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c14, c9, 0  @ XSCALE_IBCR1
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c14, c0, 0  @ XSCALE_DBR0
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c14, c3, 0  @ XSCALE_DBR1
+	b read_cp_reg_reply
+	mrc p15, 0, r0, c14, c4, 0  @ XSCALE_DBCON
+	b read_cp_reg_reply
+	mrc p14, 0, r0, c11, c0, 0 @ XSCALE_TBREG
+	b read_cp_reg_reply
+	mrc p14, 0, r0, c12, c0, 0 @ XSCALE_CHKPT0
+	b read_cp_reg_reply
+	mrc p14, 0, r0, c13, c0, 0 @ XSCALE_CHKPT1
+	b read_cp_reg_reply
+	mrc p14, 0, r0, c10, c0, 0 @ XSCALE_DCSR
+	b read_cp_reg_reply
+
+read_cp_reg_reply:
+	bl send_to_debugger
+
+	@ return
+	b get_command
+
+@ ----
+
+write_cp_reg:
+	@ requested cp register
+	bl receive_from_debugger
+	mov r1, r0
+
+	@ value to be written
+	bl receive_from_debugger
+
+	adr r2, write_cp_table
+	add pc, r2, r1, lsl #3
+
+write_cp_table:
+	mcr p15, 0, r0, c0, c0, 0  @ XSCALE_MAINID (0x0)
+	b get_command
+	mcr p15, 0, r0, c0, c0, 1  @ XSCALE_CACHETYPE (0x1)
+	b get_command
+	mcr p15, 0, r0, c1, c0, 0  @ XSCALE_CTRL (0x2)
+	b get_command
+	mcr p15, 0, r0, c1, c0, 1  @ XSCALE_AUXCTRL (0x3)
+	b get_command
+	mcr p15, 0, r0, c2, c0, 0  @ XSCALE_TTB (0x4)
+	b get_command
+	mcr p15, 0, r0, c3, c0, 0  @ XSCALE_DAC (0x5)
+	b get_command
+	mcr p15, 0, r0, c5, c0, 0  @ XSCALE_FSR (0x6)
+	b get_command
+	mcr p15, 0, r0, c6, c0, 0  @ XSCALE_FAR (0x7)
+	b get_command
+	mcr p15, 0, r0, c13, c0, 0  @ XSCALE_PID (0x8)
+	b get_command
+	mcr p15, 0, r0, c15, c0, 0  @ XSCALE_CP_ACCESS (0x9)
+	b get_command
+	mcr p15, 0, r0, c14, c8, 0  @ XSCALE_IBCR0 (0xa)
+	b get_command
+	mcr p15, 0, r0, c14, c9, 0  @ XSCALE_IBCR1 (0xb)
+	b get_command
+	mcr p15, 0, r0, c14, c0, 0  @ XSCALE_DBR0 (0xc)
+	b get_command
+	mcr p15, 0, r0, c14, c3, 0  @ XSCALE_DBR1 (0xd)
+	b get_command
+	mcr p15, 0, r0, c14, c4, 0  @ XSCALE_DBCON (0xe)
+	b get_command
+	mcr p14, 0, r0, c11, c0, 0 @ XSCALE_TBREG (0xf)
+	b get_command
+	mcr p14, 0, r0, c12, c0, 0 @ XSCALE_CHKPT0 (0x10)
+	b get_command
+	mcr p14, 0, r0, c13, c0, 0 @ XSCALE_CHKPT1 (0x11)
+	b get_command
+	mcr p14, 0, r0, c10, c0, 0 @ XSCALE_DCSR (0x12)
+	b get_command
+
+@ ----
+
+read_trace_buffer:
+
+	@ dump 256 entries from trace buffer
+	mov	r1, #256
+read_tb_loop:
+	mrc p14, 0, r0, c11, c0, 0 @ XSCALE_TBREG
+	bl send_to_debugger
+	subs r1, r1, #1
+	bne read_tb_loop
+
+	@ dump checkpoint register 0
+	mrc p14, 0, r0, c12, c0, 0 @ XSCALE_CHKPT0 (0x10)
+	bl send_to_debugger
+
+	@ dump checkpoint register 1
+	mrc p14, 0, r0, c13, c0, 0 @ XSCALE_CHKPT1 (0x11)
+	bl send_to_debugger
+
+	@ return
+	b get_command
+
+@ ----
+
+clean_trace_buffer:
+
+	@ clean 256 entries from trace buffer
+	mov	r1, #256
+clean_tb_loop:
+	mrc p14, 0, r0, c11, c0, 0 @ XSCALE_TBREG
+	subs r1, r1, #1
+	bne clean_tb_loop
+
+	@ return
+	b get_command
+
+@ ----
+
+
+@ resume program execution with trace buffer enabled
+resume_w_trace:
+	@ restore CPSR (SPSR_dbg)
+	bl receive_from_debugger
+	msr spsr, r0
+
+	@ restore registers (r7 - r0)
+	bl receive_from_debugger @ r7
+	mov r7, r0
+	bl receive_from_debugger @ r6
+	mov r6, r0
+	bl receive_from_debugger @ r5
+	mov r5, r0
+	bl receive_from_debugger @ r4
+	mov r4, r0
+	bl receive_from_debugger @ r3
+	mov r3, r0
+	bl receive_from_debugger @ r2
+	mov r2, r0
+	bl receive_from_debugger @ r1
+	mov r1, r0
+	bl receive_from_debugger @ r0
+
+	@ resume addresss
+	m_receive_from_debugger lr
+
+	mrc p14, 0, r13, c10, c0, 0 @ XSCALE_DCSR
+	orr r13, r13, #1
+	mcr p14, 0, r13, c10, c0, 0 @ XSCALE_DCSR
+
+	@ branch back to application code, restoring CPSR
+	subs pc, lr, #0
+
+undef_handler:
+swi_handler:
+prefetch_abort_handler:
+data_abort_handler:
+irq_handler:
+fiq_handler:
+1:
+	b 1b
+
+send_to_debugger:
+	m_send_to_debugger r0
+	mov pc, lr
+
+receive_from_debugger:
+	m_receive_from_debugger r0
+	mov pc, lr
+

+ 101 - 0
share/openocd/contrib/loaders/debug/xscale/debug_handler.inc

@@ -0,0 +1,101 @@
+/* Autogenerated with ../../../../src/helper/bin2char.sh */
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x10,0xde,0x1a,0xee,0x02,0xd1,0x1d,0xe2,0x01,0x00,0x00,0x1a,0x03,0xd1,0xa0,0xe3,
+0x10,0xde,0x0a,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0x0e,0x08,0xee,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xee,0x08,0xee,0x01,0x00,0xa0,0xe1,
+0x70,0x01,0x00,0xeb,0x02,0x00,0xa0,0xe1,0x6e,0x01,0x00,0xeb,0x03,0x00,0xa0,0xe1,
+0x6c,0x01,0x00,0xeb,0x04,0x00,0xa0,0xe1,0x6a,0x01,0x00,0xeb,0x05,0x00,0xa0,0xe1,
+0x68,0x01,0x00,0xeb,0x06,0x00,0xa0,0xe1,0x66,0x01,0x00,0xeb,0x07,0x00,0xa0,0xe1,
+0x64,0x01,0x00,0xeb,0x00,0x00,0x4f,0xe1,0x62,0x01,0x00,0xeb,0x00,0x00,0x4f,0xe1,
+0x20,0x00,0xc0,0xe3,0xc0,0x00,0x80,0xe3,0x1f,0x10,0x00,0xe2,0x10,0x00,0x51,0xe3,
+0x01,0x00,0x00,0x1a,0x1f,0x00,0xc0,0xe3,0x1f,0x00,0x80,0xe3,0x3d,0x00,0x00,0xea,
+0x5c,0x01,0x00,0xeb,0x00,0x00,0x50,0xe3,0x39,0x00,0x00,0x0a,0x01,0x00,0x50,0xe3,
+0x5a,0x00,0x00,0x0a,0x11,0x00,0x50,0xe3,0x7b,0x00,0x00,0x0a,0x12,0x00,0x50,0xe3,
+0x83,0x00,0x00,0x0a,0x14,0x00,0x50,0xe3,0x8b,0x00,0x00,0x0a,0x21,0x00,0x50,0xe3,
+0x93,0x00,0x00,0x0a,0x22,0x00,0x50,0xe3,0x9b,0x00,0x00,0x0a,0x24,0x00,0x50,0xe3,
+0xa3,0x00,0x00,0x0a,0x30,0x00,0x50,0xe3,0x14,0x00,0x00,0x0a,0x31,0x00,0x50,0xe3,
+0x2b,0x01,0x00,0x0a,0x40,0x00,0x50,0xe3,0xc4,0x00,0x00,0x0a,0x41,0x00,0x50,0xe3,
+0xed,0x00,0x00,0x0a,0x50,0x00,0x50,0xe3,0xa7,0x00,0x00,0x0a,0x51,0x00,0x50,0xe3,
+0xac,0x00,0x00,0x0a,0x52,0x00,0x50,0xe3,0xac,0x00,0x00,0x0a,0x53,0x00,0x50,0xe3,
+0xac,0x00,0x00,0x0a,0x60,0x00,0x50,0xe3,0x9b,0x00,0x00,0x0a,0x61,0x00,0x50,0xe3,
+0x0c,0x01,0x00,0x0a,0x62,0x00,0x50,0xe3,0x14,0x01,0x00,0x0a,0xd7,0xff,0xff,0xea,
+0x34,0x01,0x00,0xeb,0x00,0xf0,0x69,0xe1,0x32,0x01,0x00,0xeb,0x00,0x70,0xa0,0xe1,
+0x30,0x01,0x00,0xeb,0x00,0x60,0xa0,0xe1,0x2e,0x01,0x00,0xeb,0x00,0x50,0xa0,0xe1,
+0x2c,0x01,0x00,0xeb,0x00,0x40,0xa0,0xe1,0x2a,0x01,0x00,0xeb,0x00,0x30,0xa0,0xe1,
+0x28,0x01,0x00,0xeb,0x00,0x20,0xa0,0xe1,0x26,0x01,0x00,0xeb,0x00,0x10,0xa0,0xe1,
+0x24,0x01,0x00,0xeb,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xee,0x19,0xee,
+0x00,0xf0,0x5e,0xe2,0x1f,0x01,0x00,0xeb,0x00,0x70,0x0f,0xe1,0x00,0xf0,0x21,0xe1,
+0x00,0x00,0xa0,0xe1,0x1f,0x10,0x00,0xe2,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
+0x10,0x8e,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0x9e,0x08,0xee,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xae,0x08,0xee,0x10,0xfe,0x1e,0xee,
+0xfd,0xff,0xff,0x6a,0x10,0xbe,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
+0x10,0xce,0x08,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xde,0x08,0xee,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,0x10,0xee,0x08,0xee,0x1f,0x00,0x51,0xe3,
+0x03,0x00,0x00,0x0a,0x00,0x00,0x4f,0xe1,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
+0x10,0x0e,0x08,0xee,0x07,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,0x9f,0xff,0xff,0xea,
+0xfc,0x00,0x00,0xeb,0x00,0x70,0x0f,0xe1,0x00,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,
+0x1f,0x10,0x00,0xe2,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x8e,0x19,0xee,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x9e,0x19,0xee,0x10,0xfe,0x1e,0xee,
+0xfd,0xff,0xff,0x5a,0x10,0xae,0x19,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
+0x10,0xbe,0x19,0xee,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xce,0x19,0xee,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0xde,0x19,0xee,0x10,0xfe,0x1e,0xee,
+0xfd,0xff,0xff,0x5a,0x10,0xee,0x19,0xee,0x1f,0x00,0x51,0xe3,0x03,0x00,0x00,0x0a,
+0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,0x10,0x0e,0x19,0xee,0x00,0xf0,0x69,0xe1,
+0x07,0xf0,0x21,0xe1,0x00,0x00,0xa0,0xe1,0x7c,0xff,0xff,0xea,0xd9,0x00,0x00,0xeb,
+0x00,0x20,0xa0,0xe1,0xd7,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0x01,0x00,0xd2,0xe4,
+0x9a,0x8f,0x07,0xee,0xcf,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
+0x72,0xff,0xff,0xea,0xcf,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xcd,0x00,0x00,0xeb,
+0x00,0x10,0xa0,0xe1,0xb2,0x00,0xd2,0xe0,0x9a,0x8f,0x07,0xee,0xc5,0x00,0x00,0xeb,
+0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x68,0xff,0xff,0xea,0xc5,0x00,0x00,0xeb,
+0x00,0x20,0xa0,0xe1,0xc3,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0x04,0x00,0x92,0xe4,
+0x9a,0x8f,0x07,0xee,0xbb,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
+0x5e,0xff,0xff,0xea,0xbb,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xb9,0x00,0x00,0xeb,
+0x00,0x10,0xa0,0xe1,0xb7,0x00,0x00,0xeb,0x01,0x00,0xc2,0xe4,0x9a,0x8f,0x07,0xee,
+0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x54,0xff,0xff,0xea,0xb1,0x00,0x00,0xeb,
+0x00,0x20,0xa0,0xe1,0xaf,0x00,0x00,0xeb,0x00,0x10,0xa0,0xe1,0xad,0x00,0x00,0xeb,
+0xb2,0x00,0xc2,0xe0,0x9a,0x8f,0x07,0xee,0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,
+0x4a,0xff,0xff,0xea,0xa7,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0xa5,0x00,0x00,0xeb,
+0x00,0x10,0xa0,0xe1,0xa3,0x00,0x00,0xeb,0x04,0x00,0x82,0xe4,0x9a,0x8f,0x07,0xee,
+0x01,0x10,0x51,0xe2,0xfa,0xff,0xff,0x1a,0x40,0xff,0xff,0xea,0x10,0x0e,0x1a,0xee,
+0x20,0x00,0xc0,0xe3,0x10,0x0e,0x0a,0xee,0x3c,0xff,0xff,0xea,0x99,0x00,0x00,0xeb,
+0x01,0x1b,0xa0,0xe3,0xb2,0x0f,0x07,0xee,0x20,0x00,0x80,0xe2,0x01,0x10,0x51,0xe2,
+0xfb,0xff,0xff,0x1a,0x35,0xff,0xff,0xea,0x16,0x0f,0x07,0xee,0x33,0xff,0xff,0xea,
+0x15,0x0f,0x07,0xee,0x31,0xff,0xff,0xea,0x10,0x0f,0x12,0xee,0x00,0x00,0xa0,0xe1,
+0x04,0xf0,0x4f,0xe2,0x2d,0xff,0xff,0xea,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x80,0x00,0x00,0xeb,0x00,0x10,0x8f,0xe2,0x80,0xf1,0x81,0xe0,0x10,0x0f,0x10,0xee,
+0x23,0x00,0x00,0xea,0x30,0x0f,0x10,0xee,0x21,0x00,0x00,0xea,0x10,0x0f,0x11,0xee,
+0x1f,0x00,0x00,0xea,0x30,0x0f,0x11,0xee,0x1d,0x00,0x00,0xea,0x10,0x0f,0x12,0xee,
+0x1b,0x00,0x00,0xea,0x10,0x0f,0x13,0xee,0x19,0x00,0x00,0xea,0x10,0x0f,0x15,0xee,
+0x17,0x00,0x00,0xea,0x10,0x0f,0x16,0xee,0x15,0x00,0x00,0xea,0x10,0x0f,0x1d,0xee,
+0x13,0x00,0x00,0xea,0x10,0x0f,0x1f,0xee,0x11,0x00,0x00,0xea,0x18,0x0f,0x1e,0xee,
+0x0f,0x00,0x00,0xea,0x19,0x0f,0x1e,0xee,0x0d,0x00,0x00,0xea,0x10,0x0f,0x1e,0xee,
+0x0b,0x00,0x00,0xea,0x13,0x0f,0x1e,0xee,0x09,0x00,0x00,0xea,0x14,0x0f,0x1e,0xee,
+0x07,0x00,0x00,0xea,0x10,0x0e,0x1b,0xee,0x05,0x00,0x00,0xea,0x10,0x0e,0x1c,0xee,
+0x03,0x00,0x00,0xea,0x10,0x0e,0x1d,0xee,0x01,0x00,0x00,0xea,0x10,0x0e,0x1a,0xee,
+0xff,0xff,0xff,0xea,0x53,0x00,0x00,0xeb,0xf8,0xfe,0xff,0xea,0x55,0x00,0x00,0xeb,
+0x00,0x10,0xa0,0xe1,0x53,0x00,0x00,0xeb,0x00,0x20,0x8f,0xe2,0x81,0xf1,0x82,0xe0,
+0x10,0x0f,0x00,0xee,0xf1,0xfe,0xff,0xea,0x30,0x0f,0x00,0xee,0xef,0xfe,0xff,0xea,
+0x10,0x0f,0x01,0xee,0xed,0xfe,0xff,0xea,0x30,0x0f,0x01,0xee,0xeb,0xfe,0xff,0xea,
+0x10,0x0f,0x02,0xee,0xe9,0xfe,0xff,0xea,0x10,0x0f,0x03,0xee,0xe7,0xfe,0xff,0xea,
+0x10,0x0f,0x05,0xee,0xe5,0xfe,0xff,0xea,0x10,0x0f,0x06,0xee,0xe3,0xfe,0xff,0xea,
+0x10,0x0f,0x0d,0xee,0xe1,0xfe,0xff,0xea,0x10,0x0f,0x0f,0xee,0xdf,0xfe,0xff,0xea,
+0x18,0x0f,0x0e,0xee,0xdd,0xfe,0xff,0xea,0x19,0x0f,0x0e,0xee,0xdb,0xfe,0xff,0xea,
+0x10,0x0f,0x0e,0xee,0xd9,0xfe,0xff,0xea,0x13,0x0f,0x0e,0xee,0xd7,0xfe,0xff,0xea,
+0x14,0x0f,0x0e,0xee,0xd5,0xfe,0xff,0xea,0x10,0x0e,0x0b,0xee,0xd3,0xfe,0xff,0xea,
+0x10,0x0e,0x0c,0xee,0xd1,0xfe,0xff,0xea,0x10,0x0e,0x0d,0xee,0xcf,0xfe,0xff,0xea,
+0x10,0x0e,0x0a,0xee,0xcd,0xfe,0xff,0xea,0x01,0x1c,0xa0,0xe3,0x10,0x0e,0x1b,0xee,
+0x24,0x00,0x00,0xeb,0x01,0x10,0x51,0xe2,0xfb,0xff,0xff,0x1a,0x10,0x0e,0x1c,0xee,
+0x20,0x00,0x00,0xeb,0x10,0x0e,0x1d,0xee,0x1e,0x00,0x00,0xeb,0xc3,0xfe,0xff,0xea,
+0x01,0x1c,0xa0,0xe3,0x10,0x0e,0x1b,0xee,0x01,0x10,0x51,0xe2,0xfc,0xff,0xff,0x1a,
+0xbe,0xfe,0xff,0xea,0x1b,0x00,0x00,0xeb,0x00,0xf0,0x69,0xe1,0x19,0x00,0x00,0xeb,
+0x00,0x70,0xa0,0xe1,0x17,0x00,0x00,0xeb,0x00,0x60,0xa0,0xe1,0x15,0x00,0x00,0xeb,
+0x00,0x50,0xa0,0xe1,0x13,0x00,0x00,0xeb,0x00,0x40,0xa0,0xe1,0x11,0x00,0x00,0xeb,
+0x00,0x30,0xa0,0xe1,0x0f,0x00,0x00,0xeb,0x00,0x20,0xa0,0xe1,0x0d,0x00,0x00,0xeb,
+0x00,0x10,0xa0,0xe1,0x0b,0x00,0x00,0xeb,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
+0x10,0xee,0x19,0xee,0x10,0xde,0x1a,0xee,0x01,0xd0,0x8d,0xe3,0x10,0xde,0x0a,0xee,
+0x00,0xf0,0x5e,0xe2,0xfe,0xff,0xff,0xea,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x6a,
+0x10,0x0e,0x08,0xee,0x0e,0xf0,0xa0,0xe1,0x10,0xfe,0x1e,0xee,0xfd,0xff,0xff,0x5a,
+0x10,0x0e,0x19,0xee,0x0e,0xf0,0xa0,0xe1,

+ 49 - 0
share/openocd/contrib/loaders/debug/xscale/debug_handler.ld

@@ -0,0 +1,49 @@
+/* identify the Entry Point  */
+ENTRY(reset_handler)
+
+/* specify the mini-ICache memory areas  */
+MEMORY
+{
+	mini_icache_0 (x)  				: ORIGIN = 0x0, LENGTH = 1024	/* first part of mini icache (sets 0-31) */
+	mini_icache_1 (x)  				: ORIGIN = 0x400, LENGTH = 1024	/* second part of mini icache (sets 0-31) */
+}
+
+/* now define the output sections  */
+SECTIONS
+{
+	.part1 :
+	{
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		*(.part1)
+	} >mini_icache_0
+
+	.part2 :
+	{
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		LONG(0)
+		*(.part2)
+		FILL(0x0)
+	} >mini_icache_1
+
+	/DISCARD/ :
+	{
+		*(.text)
+		*(.glue_7)
+		*(.glue_7t)
+		*(.data)
+		*(.bss)
+	}
+}

+ 68 - 0
share/openocd/contrib/loaders/debug/xscale/protocol.h

@@ -0,0 +1,68 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Dominic Rath                                    *
+ *   Dominic.Rath@gmx.de                                                   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
+ ***************************************************************************/
+
+#define REG_R0 0
+#define REG_R1 1
+#define REG_R2 2
+#define REG_R3 3
+#define REG_R4 4
+#define REG_R5 5
+#define REG_R6 6
+#define REG_R7 7
+#define REG_R8 8
+#define REG_R9 9
+#define REG_R10 10
+#define REG_R11 11
+#define REG_R12 12
+#define REG_R13 13
+#define REG_R14 14
+#define REG_R15 15
+#define REG_CPSR 16
+#define REG_SPSR 17
+
+#define MODE_USR 0x10
+#define MODE_FIQ 0x11
+#define MODE_IRQ 0x12
+#define MODE_SVC 0x13
+#define MODE_ABT 0x17
+#define MODE_UND 0x1b
+#define MODE_SYS 0x1f
+
+#define MODE_ANY 0x40
+#define MODE_CURRENT 0x80
+
+#define MODE_MASK 0x1f
+#define PSR_I 0x80
+#define PSR_F 0x40
+#define PSR_T 0x20
+
+#define XSCALE_DBG_MAINID 0x0
+#define XSCALE_DBG_CACHETYPE 0x1
+#define XSCALE_DBG_CTRL 0x2
+#define XSCALE_DBG_AUXCTRL 0x3
+#define XSCALE_DBG_TTB 0x4
+#define XSCALE_DBG_DAC 0x5
+#define XSCALE_DBG_FSR 0x6
+#define XSCALE_DBG_FAR 0x7
+#define XSCALE_DBG_PID 0x8
+#define XSCALE_DBG_CPACCESS 0x9
+#define XSCALE_DBG_IBCR0 0xa
+#define XSCALE_DBG_IBCR1 0xb
+#define XSCALE_DBG_DBR0 0xc
+#define XSCALE_DBG_DBR1 0xd
+#define XSCALE_DBG_DBCON 0xe

+ 30 - 0
share/openocd/contrib/loaders/erase_check/Makefile

@@ -0,0 +1,30 @@
+BIN2C = ../../../src/helper/bin2char.sh
+
+ARM_CROSS_COMPILE ?= arm-none-eabi-
+ARM_AS      ?= $(ARM_CROSS_COMPILE)as
+ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
+
+ARM_AFLAGS = -EL
+
+arm: armv4_5_erase_check.inc armv7m_erase_check.inc armv7m_0_erase_check.inc
+
+armv4_5_%.elf: armv4_5_%.s
+	$(ARM_AS) $(ARM_AFLAGS) $< -o $@
+
+armv4_5_%.bin: armv4_5_%.elf
+	$(ARM_OBJCOPY) -Obinary $< $@
+
+armv4_5_%.inc: armv4_5_%.bin
+	$(BIN2C) < $< > $@
+
+armv7m_%.elf: armv7m_%.s
+	$(ARM_AS) $(ARM_AFLAGS) $< -o $@
+
+armv7m_%.bin: armv7m_%.elf
+	$(ARM_OBJCOPY) -Obinary $< $@
+
+armv7m_%.inc: armv7m_%.bin
+	$(BIN2C) < $< > $@
+
+clean:
+	-rm -f *.elf *.bin *.inc

+ 3 - 0
share/openocd/contrib/loaders/erase_check/armv4_5_erase_check.inc

@@ -0,0 +1,3 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x01,0x30,0xd0,0xe4,0x03,0x20,0x02,0xe0,0x01,0x10,0x51,0xe2,0xfb,0xff,0xff,0x1a,
+0x70,0x00,0x20,0xe1,

+ 39 - 0
share/openocd/contrib/loaders/erase_check/armv4_5_erase_check.s

@@ -0,0 +1,39 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+/*
+	parameters:
+	r0 - address in
+	r1 - byte count
+	r2 - mask - result out
+*/
+
+	.text
+	.arm
+
+loop:
+	ldrb r3, [r0], #1
+	and r2, r2, r3
+	subs r1, r1, #1
+	bne loop
+end:
+	bkpt	#0
+
+	.end

+ 2 - 0
share/openocd/contrib/loaders/erase_check/armv7m_0_erase_check.inc

@@ -0,0 +1,2 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x03,0x78,0x01,0x30,0x1a,0x43,0x01,0x39,0xfa,0xd1,0x00,0xbe,

+ 45 - 0
share/openocd/contrib/loaders/erase_check/armv7m_0_erase_check.s

@@ -0,0 +1,45 @@
+/***************************************************************************
+ *   Copyright (C) 2014 by Jeff Ciesielski                                 *
+ *   jeffciesielski@gmail.com                                              *
+ *                                                                         *
+ *   Based on the armv7m erase checker by:                                 *
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ ***************************************************************************/
+
+/*
+	parameters:
+	r0 - address in
+	r1 - byte count
+	r2 - mask - result out
+*/
+
+	.text
+	.syntax unified
+	.cpu cortex-m0
+	.thumb
+	.thumb_func
+
+	.align	2
+
+loop:
+	ldrb	r3, [r0]
+	adds	r0, #1
+	orrs	r2, r2, r3
+	subs	r1, r1, #1
+	bne		loop
+end:
+	bkpt	#0
+
+	.end

+ 2 - 0
share/openocd/contrib/loaders/erase_check/armv7m_erase_check.inc

@@ -0,0 +1,2 @@
+/* Autogenerated with ../../../src/helper/bin2char.sh */
+0x03,0x78,0x01,0x30,0x1a,0x40,0x01,0x39,0xfa,0xd1,0x00,0xbe,

+ 45 - 0
share/openocd/contrib/loaders/erase_check/armv7m_erase_check.s

@@ -0,0 +1,45 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+/*
+	parameters:
+	r0 - address in
+	r1 - byte count
+	r2 - mask - result out
+*/
+
+	.text
+	.syntax unified
+	.cpu cortex-m0
+	.thumb
+	.thumb_func
+
+	.align	2
+
+loop:
+	ldrb	r3, [r0]
+	adds	r0, #1
+	ands	r2, r2, r3
+	subs	r1, r1, #1
+	bne		loop
+end:
+	bkpt	#0
+
+	.end

+ 57 - 0
share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_16.s

@@ -0,0 +1,57 @@
+/***************************************************************************
+ *   Copyright (C) 2005, 2007 by Dominic Rath                              *
+ *   Dominic.Rath@gmx.de                                                   *
+ *   Copyright (C) 2010 Spencer Oliver                                     *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+	.text
+	.arm
+	.arch armv4
+
+	.section .init
+
+/* algorithm register usage:
+ * r0: source address (in RAM)
+ * r1: target address (in Flash)
+ * r2: count
+ * r3: flash write command
+ * r4: status byte (returned to host)
+ * r5: busy test pattern
+ * r6: error test pattern
+ */
+
+loop:
+	ldrh	r4, [r0], #2
+	strh	r3, [r1]
+	strh	r4, [r1]
+busy:
+	ldrh	r4, [r1]
+	and		r7, r4, r5
+	cmp		r7, r5
+	bne		busy
+	tst		r4, r6
+	bne		done
+	subs	r2, r2, #1
+	beq		done
+	add		r1, r1, #2
+	b		loop
+done:
+	b		done
+
+	.end

+ 57 - 0
share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_32.s

@@ -0,0 +1,57 @@
+/***************************************************************************
+ *   Copyright (C) 2005, 2007 by Dominic Rath                              *
+ *   Dominic.Rath@gmx.de                                                   *
+ *   Copyright (C) 2010 Spencer Oliver                                     *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+	.text
+	.arm
+	.arch armv4
+
+	.section .init
+
+/* algorithm register usage:
+ * r0: source address (in RAM)
+ * r1: target address (in Flash)
+ * r2: count
+ * r3: flash write command
+ * r4: status byte (returned to host)
+ * r5: busy test pattern
+ * r6: error test pattern
+ */
+
+loop:
+	ldr		r4, [r0], #4
+	str		r3, [r1]
+	str		r4, [r1]
+busy:
+	ldr		r4, [r1]
+	and		r7, r4, r5
+	cmp		r7, r5
+	bne		busy
+	tst		r4, r6
+	bne		done
+	subs	r2, r2, #1
+	beq		done
+	add		r1, r1, #4
+	b		loop
+done:
+	b		done
+
+	.end

+ 57 - 0
share/openocd/contrib/loaders/flash/armv4_5_cfi_intel_8.s

@@ -0,0 +1,57 @@
+/***************************************************************************
+ *   Copyright (C) 2005, 2007 by Dominic Rath                              *
+ *   Dominic.Rath@gmx.de                                                   *
+ *   Copyright (C) 2010 Spencer Oliver                                     *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ ***************************************************************************/
+
+	.text
+	.arm
+	.arch armv4
+
+	.section .init
+
+/* algorithm register usage:
+ * r0: source address (in RAM)
+ * r1: target address (in Flash)
+ * r2: count
+ * r3: flash write command
+ * r4: status byte (returned to host)
+ * r5: busy test pattern
+ * r6: error test pattern
+ */
+
+loop:
+	ldrb	r4, [r0], #1
+	strb	r3, [r1]
+	strb	r4, [r1]
+busy:
+	ldrb	r4, [r1]
+	and		r7, r4, r5
+	cmp		r7, r5
+	bne		busy
+	tst		r4, r6
+	bne		done
+	subs	r2, r2, #1
+	beq		done
+	add		r1, r1, #1
+	b		loop
+done:
+	b		done
+
+	.end

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff