jtag/drivers: Add new driver for ANGIE USB-JTAG Adapter
This is the driver code for NanoXplore's ANGIE USB-JTAG Adapter. The driver is based on the openULINK project. This driver communicate with ANGIE's firmware in order to establish JTAG protocol to debug the target chip. Since the ANGIE Adapter has a Spartan-6 FPGA in addition to the FX2 microcontroller, the driver adds two functions, one to download the firmware (embedded C) to the FX2, and the second to program the FPGA with its bitstream. Add ANGIE's configuration file to tcl/interface/ Add the device VID/PID to 60-openocd.rules file. Add ANGIE to OpenOCD's documentation Change-Id: Id17111c74073da01450d43d466e11b0cc086691f Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7702 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
This commit is contained in:
parent
9c91ce8d24
commit
94686eea6e
|
@ -118,6 +118,7 @@ m4_define([USB1_ADAPTERS],
|
||||||
[[stlink], [ST-Link Programmer], [HLADAPTER_STLINK]],
|
[[stlink], [ST-Link Programmer], [HLADAPTER_STLINK]],
|
||||||
[[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
|
[[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]],
|
||||||
[[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
|
[[ulink], [Keil ULINK JTAG Programmer], [ULINK]],
|
||||||
|
[[angie], [ANGIE Adapter], [ANGIE]],
|
||||||
[[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
|
[[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]],
|
||||||
[[ft232r], [Bitbang mode of FT232R based devices], [FT232R]],
|
[[ft232r], [Bitbang mode of FT232R based devices], [FT232R]],
|
||||||
[[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]],
|
[[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]],
|
||||||
|
|
|
@ -224,6 +224,10 @@ ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="660", GROUP="plugdev",
|
||||||
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||||
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1002", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||||
|
|
||||||
|
# ANGIE USB-JTAG Adapter
|
||||||
|
ATTRS{idVendor}=="584e", ATTRS{idProduct}=="424e", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||||
|
ATTRS{idVendor}=="584e", ATTRS{idProduct}=="4a55", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||||
|
|
||||||
# Marvell Sheevaplug
|
# Marvell Sheevaplug
|
||||||
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"
|
||||||
|
|
||||||
|
|
|
@ -508,6 +508,9 @@ debuggers to ARM Cortex based targets @url{http://www.keil.com/support/man/docs/
|
||||||
@item @b{ARM-JTAG-EW}
|
@item @b{ARM-JTAG-EW}
|
||||||
@* Link: @url{http://www.olimex.com/dev/arm-jtag-ew.html}
|
@* Link: @url{http://www.olimex.com/dev/arm-jtag-ew.html}
|
||||||
|
|
||||||
|
@item @b{angie}
|
||||||
|
@* Link: @url{https://nanoxplore.org/}
|
||||||
|
|
||||||
@item @b{Buspirate}
|
@item @b{Buspirate}
|
||||||
@* Link: @url{http://dangerousprototypes.com/bus-pirate-manual/}
|
@* Link: @url{http://dangerousprototypes.com/bus-pirate-manual/}
|
||||||
|
|
||||||
|
@ -2515,6 +2518,10 @@ Optionally sets that option first.
|
||||||
@end deffn
|
@end deffn
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
@deffn {Interface Driver} {angie}
|
||||||
|
This is the NanoXplore's ANGIE USB-JTAG Adapter.
|
||||||
|
@end deffn
|
||||||
|
|
||||||
@deffn {Interface Driver} {arm-jtag-ew}
|
@deffn {Interface Driver} {arm-jtag-ew}
|
||||||
Olimex ARM-JTAG-EW USB adapter
|
Olimex ARM-JTAG-EW USB adapter
|
||||||
This has one driver-specific command:
|
This has one driver-specific command:
|
||||||
|
|
|
@ -10,8 +10,10 @@ noinst_LTLIBRARIES += %D%/libocdjtagdrivers.la
|
||||||
%C%_libocdjtagdrivers_la_CPPFLAGS = $(AM_CPPFLAGS)
|
%C%_libocdjtagdrivers_la_CPPFLAGS = $(AM_CPPFLAGS)
|
||||||
|
|
||||||
ULINK_FIRMWARE = %D%/OpenULINK
|
ULINK_FIRMWARE = %D%/OpenULINK
|
||||||
|
ANGIE_FILES = %D%/angie
|
||||||
|
|
||||||
EXTRA_DIST += $(ULINK_FIRMWARE) \
|
EXTRA_DIST += $(ULINK_FIRMWARE) \
|
||||||
|
$(ANGIE_FILES) \
|
||||||
%D%/usb_blaster/README.CheapClone \
|
%D%/usb_blaster/README.CheapClone \
|
||||||
%D%/Makefile.rlink \
|
%D%/Makefile.rlink \
|
||||||
%D%/rlink_call.m4 \
|
%D%/rlink_call.m4 \
|
||||||
|
@ -123,6 +125,12 @@ ulinkdir = $(pkgdatadir)/OpenULINK
|
||||||
dist_ulink_DATA = $(ULINK_FIRMWARE)/ulink_firmware.hex
|
dist_ulink_DATA = $(ULINK_FIRMWARE)/ulink_firmware.hex
|
||||||
%C%_libocdjtagdrivers_la_LIBADD += -lm
|
%C%_libocdjtagdrivers_la_LIBADD += -lm
|
||||||
endif
|
endif
|
||||||
|
if ANGIE
|
||||||
|
DRIVERFILES += %D%/angie.c
|
||||||
|
angiedir = $(pkgdatadir)/angie
|
||||||
|
dist_angie_DATA = $(ANGIE_FILES)/angie_firmware.bin $(ANGIE_FILES)/angie_bitstream.bit
|
||||||
|
%C%_libocdjtagdrivers_la_LIBADD += -lm
|
||||||
|
endif
|
||||||
if VSLLINK
|
if VSLLINK
|
||||||
DRIVERFILES += %D%/versaloon/usbtoxxx/usbtogpio.c
|
DRIVERFILES += %D%/versaloon/usbtoxxx/usbtogpio.c
|
||||||
DRIVERFILES += %D%/versaloon/usbtoxxx/usbtojtagraw.c
|
DRIVERFILES += %D%/versaloon/usbtoxxx/usbtojtagraw.c
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,3 @@
|
||||||
|
This folder contain only the files needed by ANGIE's driver.
|
||||||
|
You will find the complete ANGIE's firmware and the bitstream's code source in
|
||||||
|
contrib/firmware.
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,172 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
****************************************************************************
|
||||||
|
File : msgtypes.h *
|
||||||
|
Contents : Definition of the commands supported by NanoXplore *
|
||||||
|
USB-JTAG ANGIE adapter hardware. *
|
||||||
|
Based on openULINK project code by: Martin Schmoelzer. *
|
||||||
|
Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
|
||||||
|
<aboudjelida@nanoxplore.com> *
|
||||||
|
<ahmederrachedbjld@gmail.com> *
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Definition of the commands supported by the ANGIE firmware.
|
||||||
|
*
|
||||||
|
* Basically, two types of commands can be distinguished:
|
||||||
|
* - Commands with fixed payload size
|
||||||
|
* - Commands with variable payload size
|
||||||
|
*
|
||||||
|
* SCAN commands (in all variations) carry payloads of variable size, all
|
||||||
|
* other commands carry payloads of fixed size.
|
||||||
|
*
|
||||||
|
* In the case of SCAN commands, the payload size (n) is calculated by
|
||||||
|
* dividing the scan_size_bits variable by 8, rounding up the result.
|
||||||
|
*
|
||||||
|
* Offset zero always contains the command ID.
|
||||||
|
*
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_SCAN_IN, CMD_SLOW_SCAN_IN: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: scan_size_bytes *
|
||||||
|
* offset 2: bits_last_byte *
|
||||||
|
* offset 3: tms_count_start + tms_count_end *
|
||||||
|
* offset 4: tms_sequence_start *
|
||||||
|
* offset 5: tms_sequence_end *
|
||||||
|
* *
|
||||||
|
* IN: *
|
||||||
|
* offset 0..n: TDO data *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_SCAN_OUT, CMD_SLOW_SCAN_OUT: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: scan_size_bytes *
|
||||||
|
* offset 2: bits_last_byte *
|
||||||
|
* offset 3: tms_count_start + tms_count_end *
|
||||||
|
* offset 4: tms_sequence_start *
|
||||||
|
* offset 5: tms_sequence_end *
|
||||||
|
* offset 6..x: TDI data *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_SCAN_IO, CMD_SLOW_SCAN_IO: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: scan_size_bytes *
|
||||||
|
* offset 2: bits_last_byte *
|
||||||
|
* offset 3: tms_count_start + tms_count_end *
|
||||||
|
* offset 4: tms_sequence_start *
|
||||||
|
* offset 5: tms_sequence_end *
|
||||||
|
* offset 6..x: TDI data *
|
||||||
|
* *
|
||||||
|
* IN: *
|
||||||
|
* offset 0..n: TDO data *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_CLOCK_TMS, CMD_SLOW_CLOCK_TMS: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: tms_count *
|
||||||
|
* offset 2: tms_sequence *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_CLOCK_TCK, CMD_SLOW_CLOCK_TCK: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: low byte of tck_count *
|
||||||
|
* offset 2: high byte of tck_count *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_CLOCK_SLEEP_US: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: low byte of sleep_us *
|
||||||
|
* offset 2: high byte of sleep_us *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_CLOCK_SLEEP_MS: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: low byte of sleep_ms *
|
||||||
|
* offset 2: high byte of sleep_ms *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_GET_SIGNALS: *
|
||||||
|
* *
|
||||||
|
* IN: *
|
||||||
|
* offset 0: current state of input signals *
|
||||||
|
* offset 1: current state of output signals *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_SET_SIGNALS: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: signals that should be de-asserted *
|
||||||
|
* offset 2: signals that should be asserted *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_CONFIGURE_TCK_FREQ: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: delay value for scan_in function *
|
||||||
|
* offset 2: delay value for scan_out function *
|
||||||
|
* offset 3: delay value for scan_io function *
|
||||||
|
* offset 4: delay value for clock_tck function *
|
||||||
|
* offset 5: delay value for clock_tms function *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_SET_LEDS: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: LED states: *
|
||||||
|
* Bit 0: turn COM LED on *
|
||||||
|
* Bit 1: turn RUN LED on *
|
||||||
|
* Bit 2: turn COM LED off *
|
||||||
|
* Bit 3: turn RUN LED off *
|
||||||
|
* Bits 7..4: Reserved *
|
||||||
|
****************************************************************************
|
||||||
|
* CMD_TEST: *
|
||||||
|
* *
|
||||||
|
* OUT: *
|
||||||
|
* offset 1: unused dummy value *
|
||||||
|
****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __MSGTYPES_H
|
||||||
|
#define __MSGTYPES_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Command IDs:
|
||||||
|
*
|
||||||
|
* Bits 7..6: Reserved, should always be zero
|
||||||
|
* Bits 5..0: Command ID. There are 62 usable IDs. Of this 63 available IDs,
|
||||||
|
* the IDs 0x00..0x1F are commands with variable payload size,
|
||||||
|
* the IDs 0x20..0x3F are commands with fixed payload size.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CMD_ID_MASK 0x3F
|
||||||
|
|
||||||
|
/* Commands with variable payload size */
|
||||||
|
#define CMD_SCAN_IN 0x00
|
||||||
|
#define CMD_SLOW_SCAN_IN 0x01
|
||||||
|
#define CMD_SCAN_OUT 0x02
|
||||||
|
#define CMD_SLOW_SCAN_OUT 0x03
|
||||||
|
#define CMD_SCAN_IO 0x04
|
||||||
|
#define CMD_SLOW_SCAN_IO 0x05
|
||||||
|
|
||||||
|
/* Commands with fixed payload size */
|
||||||
|
#define CMD_CLOCK_TMS 0x20
|
||||||
|
#define CMD_SLOW_CLOCK_TMS 0x21
|
||||||
|
#define CMD_CLOCK_TCK 0x22
|
||||||
|
#define CMD_SLOW_CLOCK_TCK 0x23
|
||||||
|
#define CMD_SLEEP_US 0x24
|
||||||
|
#define CMD_SLEEP_MS 0x25
|
||||||
|
#define CMD_GET_SIGNALS 0x26
|
||||||
|
#define CMD_SET_SIGNALS 0x27
|
||||||
|
#define CMD_CONFIGURE_TCK_FREQ 0x28
|
||||||
|
#define CMD_SET_LEDS 0x29
|
||||||
|
#define CMD_TEST 0x2A
|
||||||
|
|
||||||
|
/* JTAG signal definition for jtag_get_signals() -- Input signals! */
|
||||||
|
#define SIGNAL_TDO 1
|
||||||
|
|
||||||
|
/* JTAG signal definition for jtag_get_signals() -- Output signals! */
|
||||||
|
#define SIGNAL_TDI 8
|
||||||
|
#define SIGNAL_TMS 2
|
||||||
|
#define SIGNAL_TCK 4
|
||||||
|
#define SIGNAL_TRST 1
|
||||||
|
#define SIGNAL_SRST 32
|
||||||
|
|
||||||
|
#endif
|
|
@ -364,6 +364,7 @@ int adapter_poll_trace(uint8_t *buf, size_t *size);
|
||||||
|
|
||||||
extern struct adapter_driver am335xgpio_adapter_driver;
|
extern struct adapter_driver am335xgpio_adapter_driver;
|
||||||
extern struct adapter_driver amt_jtagaccel_adapter_driver;
|
extern struct adapter_driver amt_jtagaccel_adapter_driver;
|
||||||
|
extern struct adapter_driver angie_adapter_driver;
|
||||||
extern struct adapter_driver armjtagew_adapter_driver;
|
extern struct adapter_driver armjtagew_adapter_driver;
|
||||||
extern struct adapter_driver at91rm9200_adapter_driver;
|
extern struct adapter_driver at91rm9200_adapter_driver;
|
||||||
extern struct adapter_driver bcm2835gpio_adapter_driver;
|
extern struct adapter_driver bcm2835gpio_adapter_driver;
|
||||||
|
|
|
@ -96,6 +96,9 @@ struct adapter_driver *adapter_drivers[] = {
|
||||||
#if BUILD_ULINK == 1
|
#if BUILD_ULINK == 1
|
||||||
&ulink_adapter_driver,
|
&ulink_adapter_driver,
|
||||||
#endif
|
#endif
|
||||||
|
#if BUILD_ANGIE == 1
|
||||||
|
&angie_adapter_driver,
|
||||||
|
#endif
|
||||||
#if BUILD_ARMJTAGEW == 1
|
#if BUILD_ARMJTAGEW == 1
|
||||||
&armjtagew_adapter_driver,
|
&armjtagew_adapter_driver,
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# Copyright (C) 2023 by NanoXplore, France - all rights reserved
|
||||||
|
#
|
||||||
|
# configuration file for ANGIE Adapter from NanoXplore.
|
||||||
|
#
|
||||||
|
|
||||||
|
adapter driver angie
|
||||||
|
adapter speed 10000
|
||||||
|
reset_config trst_and_srst trst_push_pull srst_open_drain
|
Loading…
Reference in New Issue