OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | angie |
Describes one driver instance. More... | |
struct | angie_cmd |
ANGIE command (ANGIE command queue element). More... | |
Macros | |
#define | ANGIE_BITSTREAM_FILE PKGDATADIR "/angie/angie_bitstream.bit" |
Default location of ANGIE firmware image. More... | |
#define | ANGIE_FIRMWARE_FILE PKGDATADIR "/angie/angie_firmware.bin" |
Default location of ANGIE firmware image. More... | |
#define | ANGIE_PID 0x414F |
USB Product ID of ANGIE device in unconfigured state (no firmware loaded yet) or with its firmware. More... | |
#define | ANGIE_PID_2 0x424e |
#define | ANGIE_PID_3 0x4255 |
#define | ANGIE_PID_4 0x4355 |
#define | ANGIE_PID_5 0x4a55 |
#define | ANGIE_RENUMERATION_DELAY_US 1500000 |
Delay (in microseconds) to wait while EZ-USB performs ReNumeration. More... | |
#define | ANGIE_VID 0x584e |
USB Vendor ID of ANGIE device in unconfigured state (no firmware loaded yet) or with its firmware. More... | |
#define | CPU_RESET 0x01 |
Value to write into CPUCS to put EZ-USB ANGIE into reset. More... | |
#define | CPU_START 0x00 |
Value to write into CPUCS to put EZ-USB ANGIE out of reset. More... | |
#define | CPUCS_REG 0xE600 |
Address of EZ-USB ANGIE CPU Control & Status register. More... | |
#define | FIRMWARE_ADDR 0x0000 |
Base address of firmware in EZ-USB ANGIE code space. More... | |
#define | REQUEST_FIRMWARE_LOAD 0xA0 |
USB Control EP0 bRequest: "Firmware Load". More... | |
#define | SECTION_BUFFERSIZE 16384 |
Maximum size of a single firmware section. More... | |
#define | SPLIT_SCAN_THRESHOLD 10 |
Tuning of OpenOCD SCAN commands split into multiple ANGIE commands. More... | |
#define | USB_INTERFACE 0 |
USB interface number. More... | |
Enumerations | |
enum | angie_delay_type { DELAY_CLOCK_TCK , DELAY_CLOCK_TMS , DELAY_SCAN_IN , DELAY_SCAN_OUT , DELAY_SCAN_IO } |
enum | angie_payload_direction { PAYLOAD_DIRECTION_OUT , PAYLOAD_DIRECTION_IN } |
enum | angie_type { ANGIE } |
ANGIE hardware type. More... | |
Functions | |
static int | angie_allocate_payload (struct angie_cmd *angie_cmd, int size, enum angie_payload_direction direction) |
Allocate and initialize space in memory for ANGIE command payload. More... | |
static int | angie_append_clock_tck_cmd (struct angie *device, uint16_t count) |
Generate a defined amount of TCK clock cycles. More... | |
static int | angie_append_clock_tms_cmd (struct angie *device, uint8_t count, uint8_t sequence) |
Perform TAP state transitions. More... | |
static int | angie_append_configure_tck_cmd (struct angie *device, int delay_scan_in, int delay_scan_out, int delay_scan_io, int delay_tck, int delay_tms) |
Set TCK delay counters. More... | |
static int | angie_append_get_signals_cmd (struct angie *device) |
Read JTAG signals. More... | |
static int | angie_append_queue (struct angie *device, struct angie_cmd *angie_cmd) |
Add a command to the ANGIE command queue. More... | |
static int | angie_append_scan_cmd (struct angie *device, enum scan_type scan_type, int scan_size_bits, uint8_t *tdi, uint8_t *tdo_start, uint8_t *tdo, uint8_t tms_count_start, uint8_t tms_sequence_start, uint8_t tms_count_end, uint8_t tms_sequence_end, struct jtag_command *origin, bool postprocess) |
static int | angie_append_scan_cmd (struct angie *device, enum scan_type scan_type, int scan_size_bits, uint8_t *tdi, uint8_t *tdo_start, uint8_t *tdo, uint8_t tms_count_start, uint8_t tms_sequence_start, uint8_t tms_count_end, uint8_t tms_sequence_end, struct jtag_command *origin, bool postprocess) |
Perform JTAG scan. More... | |
static int | angie_append_set_signals_cmd (struct angie *device, uint8_t low, uint8_t high) |
Arbitrarily set JTAG output signals. More... | |
static int | angie_append_sleep_cmd (struct angie *device, uint32_t us) |
Sleep for a pre-defined number of microseconds. More... | |
static int | angie_append_test_cmd (struct angie *device) |
Test command. More... | |
static int | angie_calculate_delay (enum angie_delay_type type, long f, int *delay) |
Calculate delay values for a given TCK frequency. More... | |
static long | angie_calculate_frequency (enum angie_delay_type type, int delay) |
Calculate frequency for a given delay value. More... | |
static void | angie_clear_queue (struct angie *device) |
Clear the ANGIE command queue. More... | |
static const char * | angie_cmd_id_string (uint8_t id) |
Convert an ANGIE command ID (id) to a human-readable string. More... | |
static int | angie_cpu_reset (struct angie *device, char reset_bit) |
Writes '0' or '1' to the CPUCS register, putting the EZ-USB CPU into reset or out of reset. More... | |
static void | angie_dump_command (struct angie_cmd *angie_cmd) |
Print one ANGIE command to stdout. More... | |
static void | angie_dump_queue (struct angie *device) |
Print the ANGIE command queue to stdout. More... | |
static void | angie_dump_signal_states (uint8_t input_signals, uint8_t output_signals) |
Print state of interesting signals via LOG_INFO(). More... | |
static int | angie_execute_queue (struct jtag_command *cmd_queue) |
Executes the JTAG Command Queue. More... | |
static int | angie_execute_queued_commands (struct angie *device, int timeout_ms) |
Sends all queued ANGIE commands to the ANGIE for execution. More... | |
static int | angie_get_queue_size (struct angie *device, enum angie_payload_direction direction) |
Get the current number of bytes in the queue, including command IDs. More... | |
static int | angie_i2c_write (struct angie *device, uint8_t *i2c_data, uint8_t i2c_data_size) |
Send an i2c write operation to dev-board components. More... | |
static int | angie_init (void) |
Initiates the firmware download to the ANGIE adapter and prepares the USB handle. More... | |
static int | angie_io_extender_config (struct angie *device, uint8_t i2c_adr, uint8_t cfg_value) |
Configure dev-board gpio extender modules by configuring their register 3 and register 1 responsible for IO directions and values. More... | |
static int | angie_khz (int khz, int *jtag_speed) |
Set the TCK frequency of the ANGIE adapter. More... | |
static int | angie_load_bitstream (struct angie *device, const char *filename) |
Downloads a bitstream file to the ANGIE's FPGA through the EZ-USB microcontroller over the USB bus. More... | |
static int | angie_load_firmware (struct angie *device, const char *filename) |
Downloads a firmware image to the ANGIE's EZ-USB microcontroller over the USB bus. More... | |
static int | angie_load_firmware_and_renumerate (struct angie *device, const char *filename, uint32_t delay_us) |
Puts the ANGIE's EZ-USB microcontroller into reset state, downloads the firmware image, resumes the microcontroller and re-enumerates USB devices. More... | |
static int | angie_post_process_queue (struct angie *device) |
Perform post-processing of commands after ANGIE queue has been executed. More... | |
static int | angie_post_process_scan (struct angie_cmd *angie_cmd) |
Post-process JTAG_SCAN command. More... | |
static int | angie_queue_pathmove (struct angie *device, struct jtag_command *cmd) |
Move to one TAP state or several states in succession. More... | |
static int | angie_queue_runtest (struct angie *device, struct jtag_command *cmd) |
Run Test. More... | |
static int | angie_queue_scan (struct angie *device, struct jtag_command *cmd) |
Perform a scan operation on a JTAG register. More... | |
static int | angie_queue_sleep (struct angie *device, struct jtag_command *cmd) |
Sleep for a specific amount of time. More... | |
static int | angie_queue_stableclocks (struct angie *device, struct jtag_command *cmd) |
Generate TCK cycles while remaining in a stable state. More... | |
static int | angie_queue_statemove (struct angie *device) |
Move from the current TAP state to the current TAP end state. More... | |
static int | angie_queue_tlr_reset (struct angie *device, struct jtag_command *cmd) |
Move the TAP into the Test Logic Reset state. More... | |
static int | angie_quit (void) |
Closes the USB handle for the ANGIE device. More... | |
static int | angie_reset (int trst, int srst) |
Execute a JTAG_RESET command. More... | |
static void | angie_set_end_state (tap_state_t endstate) |
Sets the end state follower (see interface.h) if endstate is a stable state. More... | |
static int | angie_speed (int speed) |
Set the TCK frequency of the ANGIE adapter. More... | |
static int | angie_speed_div (int speed, int *khz) |
Convert adapter-specific speed value to corresponding TCK frequency in kHz. More... | |
static int | angie_usb_close (struct angie *device) |
Releases the ANGIE interface and closes the USB device handle. More... | |
static int | angie_usb_open (struct angie *device) |
Opens the ANGIE device. More... | |
static int | angie_write_firmware_section (struct angie *device, struct image *firmware_image, int section_index) |
Send one contiguous firmware section to the ANGIE's EZ-USB microcontroller over the USB bus. More... | |
Variables | |
struct adapter_driver | angie_adapter_driver |
static struct angie * | angie_handle |
static struct jtag_interface | angie_interface |
#define ANGIE_BITSTREAM_FILE PKGDATADIR "/angie/angie_bitstream.bit" |
#define ANGIE_FIRMWARE_FILE PKGDATADIR "/angie/angie_firmware.bin" |
#define ANGIE_PID 0x414F |
#define ANGIE_RENUMERATION_DELAY_US 1500000 |
#define ANGIE_VID 0x584e |
#define CPU_RESET 0x01 |
#define CPU_START 0x00 |
#define CPUCS_REG 0xE600 |
#define FIRMWARE_ADDR 0x0000 |
#define REQUEST_FIRMWARE_LOAD 0xA0 |
#define SECTION_BUFFERSIZE 16384 |
#define SPLIT_SCAN_THRESHOLD 10 |
enum angie_delay_type |
enum angie_type |
|
static |
Allocate and initialize space in memory for ANGIE command payload.
angie_cmd | pointer to command whose payload should be allocated. |
size | the amount of memory to allocate (bytes). |
direction | which payload to allocate. |
Definition at line 655 of file angie.c.
References direction, ERROR_FAIL, ERROR_OK, angie_cmd::free_payload_in_start, LOG_ERROR, PAYLOAD_DIRECTION_IN, PAYLOAD_DIRECTION_OUT, angie_cmd::payload_in, angie_cmd::payload_in_size, angie_cmd::payload_in_start, angie_cmd::payload_out, angie_cmd::payload_out_size, and size.
Referenced by angie_append_clock_tck_cmd(), angie_append_clock_tms_cmd(), angie_append_configure_tck_cmd(), angie_append_get_signals_cmd(), angie_append_scan_cmd(), angie_append_set_signals_cmd(), angie_append_sleep_cmd(), and angie_append_test_cmd().
|
static |
Generate a defined amount of TCK clock cycles.
All other JTAG signals are left unchanged.
device | pointer to struct angie identifying ANGIE driver instance. |
count | the number of TCK clock cycles to generate. |
Definition at line 1144 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_CLOCK_TCK, CMD_SLOW_CLOCK_TCK, count, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_queue_runtest(), and angie_queue_stableclocks().
|
static |
Perform TAP state transitions.
device | pointer to struct angie identifying ANGIE driver instance. |
count | defines the number of TCK clock cycles generated (up to 8). |
sequence | defines the TMS pin levels for each state transition. The Least-Significant Bit is read first. |
Definition at line 1105 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_CLOCK_TMS, CMD_SLOW_CLOCK_TMS, count, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_queue_pathmove(), angie_queue_statemove(), and angie_queue_tlr_reset().
|
static |
Set TCK delay counters.
device | pointer to struct angie identifying ANGIE driver instance. |
delay_scan_in | delay count top value in jtag_slow_scan_in() function. |
delay_scan_out | delay count top value in jtag_slow_scan_out() function. |
delay_scan_io | delay count top value in jtag_slow_scan_io() function. |
delay_tck | delay count top value in jtag_clock_tck() function. |
delay_tms | delay count top value in jtag_slow_clock_tms() function. |
Definition at line 1293 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_CONFIGURE_TCK_FREQ, delay_scan_in, delay_scan_io, delay_scan_out, delay_tck, delay_tms, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_khz().
|
static |
Read JTAG signals.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 1179 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_GET_SIGNALS, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_IN.
Referenced by angie_init().
Add a command to the ANGIE command queue.
device | pointer to struct angie identifying ANGIE driver instance. |
angie_cmd | pointer to command that shall be appended to the ANGIE command queue. |
Definition at line 778 of file angie.c.
References angie_clear_queue(), angie_execute_queued_commands(), angie_get_queue_size(), angie_post_process_queue(), device, ERROR_OK, LIBUSB_TIMEOUT_MS, PAYLOAD_DIRECTION_IN, PAYLOAD_DIRECTION_OUT, angie_cmd::payload_in_size, and angie_cmd::payload_out_size.
Referenced by angie_append_clock_tck_cmd(), angie_append_clock_tms_cmd(), angie_append_configure_tck_cmd(), angie_append_get_signals_cmd(), angie_append_scan_cmd(), angie_append_set_signals_cmd(), angie_append_sleep_cmd(), and angie_append_test_cmd().
|
static |
Referenced by angie_queue_scan().
|
static |
Perform JTAG scan.
Creates and appends a JTAG scan command to the ANGIE command queue. A JTAG scan consists of three steps:
device | pointer to struct angie identifying ANGIE driver instance. |
scan_type | the type of the scan (IN, OUT, IO (bidirectional)). |
scan_size_bits | number of bits to shift into the JTAG chain. |
tdi | pointer to array containing TDI data. |
tdo_start | pointer to first element of array where TDO data shall be stored. See angie_cmd for details. |
tdo | pointer to array where TDO data shall be stored |
tms_count_start | number of TMS state transitions to perform BEFORE shifting data into the JTAG chain. |
tms_sequence_start | sequence of TMS state transitions that will be performed BEFORE shifting data into the JTAG chain. |
tms_count_end | number of TMS state transitions to perform AFTER shifting data into the JTAG chain. |
tms_sequence_end | sequence of TMS state transitions that will be performed AFTER shifting data into the JTAG chain. |
origin | pointer to OpenOCD command that generated this scan command. |
postprocess | whether this command needs to be post-processed after execution. |
Definition at line 1004 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_SCAN_IN, CMD_SCAN_IO, CMD_SCAN_OUT, CMD_SLOW_SCAN_IN, CMD_SLOW_SCAN_IO, CMD_SLOW_SCAN_OUT, device, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, LOG_ERROR, PAYLOAD_DIRECTION_IN, PAYLOAD_DIRECTION_OUT, SCAN_IN, SCAN_IO, and SCAN_OUT.
|
static |
Arbitrarily set JTAG output signals.
device | pointer to struct angie identifying ANGIE driver instance. |
low | defines which signals will be de-asserted. Each bit corresponds to a JTAG signal:
|
high | defines which signals will be asserted. |
Definition at line 1220 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_SET_SIGNALS, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, low, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_queue_stableclocks(), and angie_reset().
|
static |
Sleep for a pre-defined number of microseconds.
device | pointer to struct angie identifying ANGIE driver instance. |
us | the number microseconds to sleep. |
Definition at line 1255 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_SLEEP_US, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_queue_sleep().
|
static |
Test command.
Used to check if the ANGIE device is ready to accept new commands.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 1350 of file angie.c.
References angie_allocate_payload(), angie_append_queue(), cmd, CMD_TEST, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, and PAYLOAD_DIRECTION_OUT.
Referenced by angie_init().
|
static |
Calculate delay values for a given TCK frequency.
The ANGIE firmware uses five different speed values for different commands. These speed values are calculated in these functions.
The five different commands which support variable TCK frequency are implemented twice in the firmware:
To set the ANGIE to maximum frequency, it is only necessary to use the corresponding command IDs. To set the ANGIE to a lower frequency, the delay loop top values have to be calculated first. Then, a CMD_CONFIGURE_TCK_FREQ command needs to be sent to the ANGIE device.
The delay values are described by linear equations: t = k * x + d (t = period, k = constant, x = delay value, d = constant)
Thus, the delay can be calculated as in the following equation: x = (t - d) / k
The constants in these equations have been determined and validated by measuring the frequency resulting from different delay values.
type | for which command to calculate the delay value. |
f | TCK frequency for which to calculate the delay value in Hz. |
delay | where to store resulting delay value. |
Definition at line 1408 of file angie.c.
References DELAY_CLOCK_TCK, DELAY_CLOCK_TMS, DELAY_SCAN_IN, DELAY_SCAN_IO, DELAY_SCAN_OUT, ERROR_FAIL, ERROR_OK, and type.
Referenced by angie_khz().
|
static |
Calculate frequency for a given delay value.
Similar to the angie_calculate_delay function, this function calculates the TCK frequency for a given delay value by using linear equations of the form: t = k * x + d (t = period, k = constant, x = delay value, d = constant)
type | for which command to calculate the delay value. |
delay | value for which to calculate the resulting TCK frequency. |
Definition at line 1468 of file angie.c.
References DELAY_CLOCK_TCK, DELAY_CLOCK_TMS, DELAY_SCAN_IN, DELAY_SCAN_IO, DELAY_SCAN_OUT, and type.
Referenced by angie_khz().
|
static |
Clear the ANGIE command queue.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 736 of file angie.c.
References device, angie_cmd::free_payload_in_start, angie_cmd::next, NULL, angie_cmd::payload_in, angie_cmd::payload_in_start, and angie_cmd::payload_out.
Referenced by angie_append_queue(), angie_execute_queue(), angie_init(), and angie_reset().
|
static |
Convert an ANGIE command ID (id) to a human-readable string.
id | the ANGIE command ID. |
Definition at line 899 of file angie.c.
References CMD_CLOCK_TCK, CMD_CLOCK_TMS, CMD_CONFIGURE_TCK_FREQ, CMD_GET_SIGNALS, CMD_SCAN_IN, CMD_SCAN_IO, CMD_SCAN_OUT, CMD_SET_LEDS, CMD_SET_SIGNALS, CMD_SLEEP_MS, CMD_SLEEP_US, CMD_SLOW_CLOCK_TCK, CMD_SLOW_CLOCK_TMS, CMD_SLOW_SCAN_IN, CMD_SLOW_SCAN_IO, CMD_SLOW_SCAN_OUT, and CMD_TEST.
Referenced by angie_dump_command().
|
static |
Writes '0' or '1' to the CPUCS register, putting the EZ-USB CPU into reset or out of reset.
device | pointer to struct angie identifying ANGIE driver instance. |
reset_bit | 0 to put CPU into reset, 1 to put CPU out of reset. |
Definition at line 308 of file angie.c.
References CPUCS_REG, device, jtag_libusb_control_transfer(), LIBUSB_TIMEOUT_MS, NULL, and REQUEST_FIRMWARE_LOAD.
Referenced by angie_load_firmware().
|
static |
Print one ANGIE command to stdout.
angie_cmd | pointer to ANGIE command. |
Definition at line 946 of file angie.c.
References angie_cmd_id_string(), angie_cmd::id, LOG_DEBUG_IO, angie_cmd::payload_in_size, angie_cmd::payload_out, and angie_cmd::payload_out_size.
Referenced by angie_dump_queue().
|
static |
Print the ANGIE command queue to stdout.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 964 of file angie.c.
References angie_dump_command(), device, LOG_DEBUG_IO, and angie_cmd::next.
Referenced by angie_execute_queued_commands().
|
static |
Print state of interesting signals via LOG_INFO().
input_signals | input signal states as returned by CMD_GET_SIGNALS |
output_signals | output signal states as returned by CMD_GET_SIGNALS |
Definition at line 632 of file angie.c.
References LOG_INFO, SIGNAL_SRST, SIGNAL_TCK, SIGNAL_TDI, SIGNAL_TDO, SIGNAL_TMS, and SIGNAL_TRST.
Referenced by angie_init().
|
static |
Executes the JTAG Command Queue.
This is done in three stages: First, all OpenOCD commands are processed into queued ANGIE commands. Next, the ANGIE command queue is sent to the ANGIE device and data received from the ANGIE device is cached. Finally, the post-processing function writes back data to the corresponding OpenOCD commands.
Definition at line 2041 of file angie.c.
References angie_clear_queue(), angie_execute_queued_commands(), angie_handle, angie_post_process_queue(), angie_queue_pathmove(), angie_queue_runtest(), angie_queue_scan(), angie_queue_sleep(), angie_queue_stableclocks(), angie_queue_tlr_reset(), cmd, angie::commands_in_queue, ERROR_FAIL, ERROR_OK, JTAG_PATHMOVE, JTAG_RUNTEST, JTAG_SCAN, JTAG_SLEEP, JTAG_STABLECLOCKS, JTAG_TLR_RESET, LIBUSB_TIMEOUT_MS, and LOG_ERROR.
|
static |
Sends all queued ANGIE commands to the ANGIE for execution.
device | pointer to struct angie identifying ANGIE driver instance. |
timeout_ms |
Definition at line 830 of file angie.c.
References angie_dump_queue(), buffer, device, ERROR_FAIL, ERROR_OK, angie_cmd::id, jtag_libusb_bulk_write(), LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, angie_cmd::next, angie_cmd::payload_in, angie_cmd::payload_in_size, angie_cmd::payload_out, and angie_cmd::payload_out_size.
Referenced by angie_append_queue(), angie_execute_queue(), angie_init(), and angie_reset().
|
static |
Get the current number of bytes in the queue, including command IDs.
device | pointer to struct angie identifying ANGIE driver instance. |
direction | the transfer direction for which to get byte count. |
Definition at line 709 of file angie.c.
References device, direction, angie_cmd::next, PAYLOAD_DIRECTION_IN, PAYLOAD_DIRECTION_OUT, angie_cmd::payload_in_size, and angie_cmd::payload_out_size.
Referenced by angie_append_queue().
|
static |
Send an i2c write operation to dev-board components.
device | pointer to struct angie identifying ANGIE driver instance. |
i2c_data | table of i2c data that we want to write to slave device. |
i2c_data_size | the size of i2c data table. |
Definition at line 502 of file angie.c.
References device, ERROR_FAIL, ERROR_OK, jtag_libusb_bulk_write(), and LOG_ERROR.
Referenced by angie_io_extender_config().
|
static |
Initiates the firmware download to the ANGIE adapter and prepares the USB handle.
Definition at line 2230 of file angie.c.
References angie_append_get_signals_cmd(), angie_append_test_cmd(), ANGIE_BITSTREAM_FILE, angie_clear_queue(), angie_dump_signal_states(), angie_execute_queued_commands(), ANGIE_FIRMWARE_FILE, angie_handle, angie_io_extender_config(), angie_load_bitstream(), angie_load_firmware_and_renumerate(), angie_quit(), ANGIE_RENUMERATION_DELAY_US, angie_usb_open(), dummy, angie::ep_in, angie::ep_out, ERROR_FAIL, ERROR_OK, jtag_libusb_bulk_write(), jtag_libusb_choose_interface(), LOG_ERROR, LOG_INFO, NULL, angie_cmd::payload_in, angie::queue_start, and angie::usb_device_handle.
|
static |
Configure dev-board gpio extender modules by configuring their register 3 and register 1 responsible for IO directions and values.
device | pointer to struct angie identifying ANGIE driver instance. |
i2c_adr | i2c address of the gpio extender. |
cfg_value | IOs configuration to be written in register Number 3. |
value | the IOs value to be written in register Number 1. |
Definition at line 547 of file angie.c.
References angie_i2c_write(), device, and ERROR_OK.
Referenced by angie_init().
|
static |
Set the TCK frequency of the ANGIE adapter.
khz | desired JTAG TCK frequency. |
jtag_speed | where to store corresponding adapter-specific speed value. |
Definition at line 2101 of file angie.c.
References angie_append_configure_tck_cmd(), angie_calculate_delay(), angie_calculate_frequency(), angie_handle, DELAY_CLOCK_TCK, angie::delay_clock_tck, DELAY_CLOCK_TMS, angie::delay_clock_tms, DELAY_SCAN_IN, angie::delay_scan_in, DELAY_SCAN_IO, angie::delay_scan_io, DELAY_SCAN_OUT, angie::delay_scan_out, ERROR_FAIL, ERROR_OK, LOG_DEBUG_IO, and LOG_ERROR.
Referenced by angie_speed().
|
static |
Downloads a bitstream file to the ANGIE's FPGA through the EZ-USB microcontroller over the USB bus.
device | pointer to struct angie identifying ANGIE driver instance. |
filename | an absolute or relative path to the Xilinx .bit file containing the bitstream data. |
Definition at line 417 of file angie.c.
References device, ERROR_FAIL, ERROR_OK, h_u32_to_be(), jtag_libusb_bulk_write(), jtag_libusb_control_transfer(), LIBUSB_TIMEOUT_MS, LOG_ERROR, LOG_INFO, and NULL.
Referenced by angie_init().
|
static |
Downloads a firmware image to the ANGIE's EZ-USB microcontroller over the USB bus.
device | pointer to struct angie identifying ANGIE driver instance. |
filename | an absolute or relative path to the Intel HEX file containing the firmware image. |
Definition at line 367 of file angie.c.
References angie_cpu_reset(), angie_write_firmware_section(), image::base_address, image::base_address_set, CPU_RESET, CPU_START, device, ERROR_OK, image_close(), image_open(), LOG_ERROR, and image::num_sections.
Referenced by angie_load_firmware_and_renumerate().
|
static |
Puts the ANGIE's EZ-USB microcontroller into reset state, downloads the firmware image, resumes the microcontroller and re-enumerates USB devices.
device | pointer to struct angie identifying ANGIE driver instance. The usb_handle member will be modified during re-enumeration. |
filename | path to the Intel HEX file containing the firmware image. |
delay_us | the delay to wait for the device to re-enumerate. |
Definition at line 327 of file angie.c.
References angie_handle, angie_load_firmware(), angie_usb_close(), angie_usb_open(), delay_us(), device, ERROR_FAIL, ERROR_OK, and angie::usb_device_handle.
Referenced by angie_init().
|
static |
Perform post-processing of commands after ANGIE queue has been executed.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 1984 of file angie.c.
References angie_post_process_scan(), angie_cmd::cmd_origin, device, ERROR_FAIL, ERROR_OK, JTAG_PATHMOVE, JTAG_RUNTEST, JTAG_SCAN, JTAG_SLEEP, JTAG_STABLECLOCKS, JTAG_TLR_RESET, LOG_ERROR, angie_cmd::needs_postprocessing, angie_cmd::next, and jtag_command::type.
Referenced by angie_append_queue(), and angie_execute_queue().
|
static |
Post-process JTAG_SCAN command.
angie_cmd | pointer to ANGIE command that shall be processed. |
Definition at line 1954 of file angie.c.
References cmd, angie_cmd::cmd_origin, ERROR_FAIL, ERROR_OK, jtag_read_buffer(), jtag_scan_type(), LOG_ERROR, angie_cmd::payload_in_start, SCAN_IN, SCAN_IO, and SCAN_OUT.
Referenced by angie_post_process_queue().
|
static |
Move to one TAP state or several states in succession.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1837 of file angie.c.
References angie_append_clock_tms_cmd(), angie_handle, buf_set_u32(), cmd, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_INFO, tap_get_state(), tap_set_state, tap_state_name(), and tap_state_transition().
Referenced by angie_execute_queue().
|
static |
Run Test.
Generate TCK clock cycles while remaining in the Run-Test/Idle state.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1766 of file angie.c.
References angie_append_clock_tck_cmd(), angie_queue_statemove(), angie_set_end_state(), cmd, device, ERROR_OK, tap_get_state(), TAP_IDLE, and tap_set_end_state().
Referenced by angie_execute_queue().
|
static |
Perform a scan operation on a JTAG register.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1566 of file angie.c.
References angie_append_scan_cmd(), angie_set_end_state(), cmd, device, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, jtag_build_buffer(), jtag_scan_size(), jtag_scan_type(), NULL, SCAN_IN, SCAN_IO, SCAN_OUT, TAP_DRPAUSE, TAP_DRSHIFT, tap_get_end_state(), tap_get_state(), tap_get_tms_path(), tap_get_tms_path_len(), TAP_IRPAUSE, TAP_IRSHIFT, tap_set_end_state(), tap_set_state, tdi_buffer, tdo_buffer, and type.
Referenced by angie_execute_queue().
|
static |
Sleep for a specific amount of time.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1897 of file angie.c.
References angie_append_sleep_cmd(), cmd, and device.
Referenced by angie_execute_queue().
|
static |
Generate TCK cycles while remaining in a stable state.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1910 of file angie.c.
References angie_append_clock_tck_cmd(), angie_append_set_signals_cmd(), cmd, device, ERROR_FAIL, ERROR_OK, LOG_ERROR, SIGNAL_TMS, tap_get_state(), tap_is_state_stable(), and TAP_RESET.
Referenced by angie_execute_queue().
|
static |
Move from the current TAP state to the current TAP end state.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 1537 of file angie.c.
References angie_append_clock_tms_cmd(), device, ERROR_OK, tap_get_end_state(), tap_get_state(), tap_get_tms_path(), tap_get_tms_path_len(), and tap_set_state.
Referenced by angie_queue_runtest().
|
static |
Move the TAP into the Test Logic Reset state.
device | pointer to struct angie identifying ANGIE driver instance. |
cmd | pointer to the command that shall be executed. |
Definition at line 1745 of file angie.c.
References angie_append_clock_tms_cmd(), device, ERROR_OK, TAP_RESET, and tap_set_state.
Referenced by angie_execute_queue().
|
static |
Closes the USB handle for the ANGIE device.
Definition at line 2376 of file angie.c.
Referenced by angie_init().
|
static |
Execute a JTAG_RESET command.
device | |
trst | indicate if trst signal is activated. |
srst | indicate if srst signal is activated. |
Definition at line 1799 of file angie.c.
References angie_append_set_signals_cmd(), angie_clear_queue(), angie_execute_queued_commands(), angie_handle, device, ERROR_OK, LIBUSB_TIMEOUT_MS, low, SIGNAL_SRST, SIGNAL_TRST, TAP_RESET, and tap_set_state.
|
static |
Sets the end state follower (see interface.h) if endstate is a stable state.
endstate | the state the end state follower should be set to. |
Definition at line 1522 of file angie.c.
References LOG_ERROR, tap_is_state_stable(), tap_set_end_state(), and tap_state_name().
Referenced by angie_queue_runtest(), and angie_queue_scan().
|
static |
Set the TCK frequency of the ANGIE adapter.
Because of the way the TCK frequency is set up in the ANGIE firmware, there are five different speed settings. To simplify things, the adapter-specific speed setting value is identical to the TCK frequency in khz.
speed | desired adapter-specific speed value. |
Definition at line 2196 of file angie.c.
References angie_khz(), and dummy.
|
static |
Convert adapter-specific speed value to corresponding TCK frequency in kHz.
Because of the way the TCK frequency is set up in the ANGIE firmware, there are five different speed settings. To simplify things, the adapter-specific speed setting value is identical to the TCK frequency in khz.
speed | adapter-specific speed value. |
khz | where to store corresponding TCK frequency in kHz. |
Definition at line 2216 of file angie.c.
References ERROR_OK.
|
static |
Releases the ANGIE interface and closes the USB device handle.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 283 of file angie.c.
References device, ERROR_FAIL, ERROR_OK, jtag_libusb_close(), LOG_ERROR, and NULL.
Referenced by angie_load_firmware_and_renumerate().
|
static |
Opens the ANGIE device.
device | pointer to struct angie identifying ANGIE driver instance. |
Definition at line 257 of file angie.c.
References ANGIE, ANGIE_PID, ANGIE_PID_2, ANGIE_PID_3, ANGIE_PID_4, ANGIE_PID_5, ANGIE_VID, device, ERROR_OK, jtag_libusb_open(), LOG_ERROR, and NULL.
Referenced by angie_init(), and angie_load_firmware_and_renumerate().
|
static |
Send one contiguous firmware section to the ANGIE's EZ-USB microcontroller over the USB bus.
device | pointer to struct angie identifying ANGIE driver instance. |
firmware_image | pointer to the firmware image that contains the section which should be sent to the ANGIE's EZ-USB microcontroller. |
section_index | index of the section within the firmware image. |
Definition at line 569 of file angie.c.
References addr, imagesection::base_address, device, ERROR_FAIL, ERROR_OK, FIRMWARE_ADDR, image_read_section(), jtag_libusb_control_transfer(), LIBUSB_TIMEOUT_MS, LOG_DEBUG, REQUEST_FIRMWARE_LOAD, SECTION_BUFFERSIZE, image::sections, size, and imagesection::size.
Referenced by angie_load_firmware().
struct adapter_driver angie_adapter_driver |
|
static |
Definition at line 246 of file angie.c.
Referenced by angie_execute_queue(), angie_init(), angie_khz(), angie_load_firmware_and_renumerate(), angie_queue_pathmove(), and angie_reset().
|
static |