OpenOCD
amt_jtagaccel.c File Reference

Support the Amontec Chameleon POD with JTAG Accelerator support. More...

Include dependency graph for amt_jtagaccel.c:

Go to the source code of this file.

Macros

#define AMT_AR(val)   do { val = inb(amt_jtagaccel_port + 3); } while (0)
 
#define AMT_AW(val)   do { outb(val, amt_jtagaccel_port + 3); } while (0)
 
#define AMT_DR(val)   do { val = inb(amt_jtagaccel_port + 4); } while (0)
 
#define AMT_DW(val)   do { outb(val, amt_jtagaccel_port + 4); } while (0)
 

Functions

static void amt_jtagaccel_end_state (tap_state_t state)
 
static int amt_jtagaccel_execute_queue (struct jtag_command *cmd_queue)
 
static int amt_jtagaccel_init (void)
 
static int amt_jtagaccel_quit (void)
 
static void amt_jtagaccel_reset (int trst, int srst)
 
static void amt_jtagaccel_runtest (unsigned int num_cycles)
 
static void amt_jtagaccel_scan (bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
 
static int amt_jtagaccel_speed (int speed)
 
static void amt_jtagaccel_state_move (void)
 
static void amt_wait_scan_busy (void)
 
 COMMAND_HANDLER (amt_jtagaccel_handle_parport_port_command)
 
 COMMAND_HANDLER (amt_jtagaccel_handle_rtck_command)
 

Variables

struct adapter_driver amt_jtagaccel_adapter_driver
 
static struct jtag_interface amt_jtagaccel_interface
 
static uint16_t amt_jtagaccel_port
 
static const uint8_t amt_jtagaccel_tap_move [6][6][2]
 
static const struct command_registration amtjtagaccel_command_handlers []
 
static uint8_t aw_control_baudrate = 0x20
 
static uint8_t aw_control_fsm = 0x10
 
static uint8_t aw_control_rst
 
static int rtck_enabled
 

Detailed Description

Support the Amontec Chameleon POD with JTAG Accelerator support.

This is a parallel port JTAG adapter with a CPLD between the parallel port and the JTAG connection. VHDL code running in the CPLD significantly accelerates JTAG operations compared to the bitbanging "Wiggler" style of most parallel port adapters.

Definition in file amt_jtagaccel.c.

Macro Definition Documentation

◆ AMT_AR

#define AMT_AR (   val)    do { val = inb(amt_jtagaccel_port + 3); } while (0)

Definition at line 101 of file amt_jtagaccel.c.

◆ AMT_AW

#define AMT_AW (   val)    do { outb(val, amt_jtagaccel_port + 3); } while (0)

Definition at line 100 of file amt_jtagaccel.c.

◆ AMT_DR

#define AMT_DR (   val)    do { val = inb(amt_jtagaccel_port + 4); } while (0)

Definition at line 103 of file amt_jtagaccel.c.

◆ AMT_DW

#define AMT_DW (   val)    do { outb(val, amt_jtagaccel_port + 4); } while (0)

Definition at line 102 of file amt_jtagaccel.c.

Function Documentation

◆ amt_jtagaccel_end_state()

static void amt_jtagaccel_end_state ( tap_state_t  state)
static

◆ amt_jtagaccel_execute_queue()

◆ amt_jtagaccel_init()

◆ amt_jtagaccel_quit()

static int amt_jtagaccel_quit ( void  )
static

Definition at line 510 of file amt_jtagaccel.c.

References ERROR_OK.

◆ amt_jtagaccel_reset()

static void amt_jtagaccel_reset ( int  trst,
int  srst 
)
static

Definition at line 125 of file amt_jtagaccel.c.

References AMT_AW, and aw_control_rst.

Referenced by amt_jtagaccel_execute_queue(), and amt_jtagaccel_init().

◆ amt_jtagaccel_runtest()

static void amt_jtagaccel_runtest ( unsigned int  num_cycles)
static

◆ amt_jtagaccel_scan()

◆ amt_jtagaccel_speed()

static int amt_jtagaccel_speed ( int  speed)
static

Definition at line 140 of file amt_jtagaccel.c.

References AMT_AW, aw_control_baudrate, and ERROR_OK.

◆ amt_jtagaccel_state_move()

◆ amt_wait_scan_busy()

static void amt_wait_scan_busy ( void  )
static

Definition at line 159 of file amt_jtagaccel.c.

References AMT_AR, LOG_ERROR, and rtck_enabled.

Referenced by amt_jtagaccel_scan(), and amt_jtagaccel_state_move().

◆ COMMAND_HANDLER() [1/2]

COMMAND_HANDLER ( amt_jtagaccel_handle_parport_port_command  )

◆ COMMAND_HANDLER() [2/2]

COMMAND_HANDLER ( amt_jtagaccel_handle_rtck_command  )

Definition at line 535 of file amt_jtagaccel.c.

Variable Documentation

◆ amt_jtagaccel_adapter_driver

struct adapter_driver amt_jtagaccel_adapter_driver
Initial value:
= {
.name = "amt_jtagaccel",
.transports = jtag_only,
}
const char *const jtag_only[]
Definition: adapter.c:27
static const struct command_registration amtjtagaccel_command_handlers[]
static int amt_jtagaccel_init(void)
static int amt_jtagaccel_quit(void)
static int amt_jtagaccel_speed(int speed)
static struct jtag_interface amt_jtagaccel_interface

Definition at line 535 of file amt_jtagaccel.c.

◆ amt_jtagaccel_interface

struct jtag_interface amt_jtagaccel_interface
static
Initial value:
= {
.execute_queue = amt_jtagaccel_execute_queue,
}
static int amt_jtagaccel_execute_queue(struct jtag_command *cmd_queue)

Definition at line 535 of file amt_jtagaccel.c.

◆ amt_jtagaccel_port

uint16_t amt_jtagaccel_port
static

Definition at line 41 of file amt_jtagaccel.c.

Referenced by amt_jtagaccel_init(), and COMMAND_HANDLER().

◆ amt_jtagaccel_tap_move

const uint8_t amt_jtagaccel_tap_move[6][6][2]
static
Initial value:
= {
{ {0x1f, 0x00}, {0x0f, 0x00}, {0x05, 0x00}, {0x0a, 0x00}, {0x06, 0x00}, {0x96, 0x00} },
{ {0x1f, 0x00}, {0x00, 0x00}, {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x0b, 0x00} },
{ {0x1f, 0x00}, {0x0d, 0x00}, {0x00, 0x00}, {0x01, 0x00}, {0x8f, 0x09}, {0x8f, 0x01} },
{ {0x1f, 0x00}, {0x0c, 0x00}, {0x08, 0x00}, {0x00, 0x00}, {0x8f, 0x09}, {0x8f, 0x01} },
{ {0x1f, 0x00}, {0x0d, 0x00}, {0x07, 0x00}, {0x97, 0x00}, {0x00, 0x00}, {0x01, 0x00} },
{ {0x1f, 0x00}, {0x0c, 0x00}, {0x07, 0x00}, {0x97, 0x00}, {0x08, 0x00}, {0x00, 0x00} },
}

Definition at line 115 of file amt_jtagaccel.c.

Referenced by amt_jtagaccel_scan(), and amt_jtagaccel_state_move().

◆ amtjtagaccel_command_handlers

const struct command_registration amtjtagaccel_command_handlers[]
static
Initial value:
= {
{
.name = "parport_port",
.handler = &amt_jtagaccel_handle_parport_port_command,
.mode = COMMAND_CONFIG,
.help = "configure or display the parallel port to use",
.usage = "[port_num]",
},
{
.name = "rtck",
.handler = &amt_jtagaccel_handle_rtck_command,
.mode = COMMAND_CONFIG,
.help = "configure or display RTCK support",
.usage = "[enable|disable]",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_CONFIG
Definition: command.h:41

Definition at line 535 of file amt_jtagaccel.c.

◆ aw_control_baudrate

uint8_t aw_control_baudrate = 0x20
static

Definition at line 47 of file amt_jtagaccel.c.

Referenced by amt_jtagaccel_speed().

◆ aw_control_fsm

uint8_t aw_control_fsm = 0x10
static

Definition at line 46 of file amt_jtagaccel.c.

Referenced by amt_jtagaccel_init().

◆ aw_control_rst

uint8_t aw_control_rst
static

Definition at line 45 of file amt_jtagaccel.c.

Referenced by amt_jtagaccel_init(), and amt_jtagaccel_reset().

◆ rtck_enabled

int rtck_enabled
static