OpenOCD
xlnx-pcie-xvc.c File Reference
Include dependency graph for xlnx-pcie-xvc.c:

Go to the source code of this file.

Data Structures

struct  xlnx_pcie_xvc
 

Macros

#define MASK_ACK(x)   (((x) >> 9) & 0x7)
 
#define MASK_PAR(x)   ((int)((x) & 0x1))
 
#define PCI_CFG_SPACE_EXP_SIZE   4096
 
#define PCIE_EXT_CAP_LST   0x100
 
#define XLNX_XVC_CAP_SIZE   0x20
 
#define XLNX_XVC_EXT_CAP   0x00
 
#define XLNX_XVC_LEN_REG   0x0C
 
#define XLNX_XVC_MAX_BITS   0x20
 
#define XLNX_XVC_TDX_REG   0x14
 
#define XLNX_XVC_TMS_REG   0x10
 
#define XLNX_XVC_VSEC_HDR   0x04
 
#define XLNX_XVC_VSEC_ID   0x8
 

Functions

 COMMAND_HANDLER (xlnx_pcie_xvc_handle_config_command)
 
static void swd_clear_sticky_errors (void)
 
static int xlnx_pcie_xvc_execute_command (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_pathmove (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_queue (void)
 
static void xlnx_pcie_xvc_execute_reset (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_runtest (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_scan (struct jtag_command *cmd)
 
static void xlnx_pcie_xvc_execute_sleep (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_stableclocks (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_execute_statemove (size_t skip)
 
static int xlnx_pcie_xvc_execute_tms (struct jtag_command *cmd)
 
static int xlnx_pcie_xvc_init (void)
 
static int xlnx_pcie_xvc_quit (void)
 
static int xlnx_pcie_xvc_read_reg (const int offset, uint32_t *val)
 
static int xlnx_pcie_xvc_swd_init (void)
 
static void xlnx_pcie_xvc_swd_read_reg (uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk)
 
static int xlnx_pcie_xvc_swd_run_queue (void)
 
static int xlnx_pcie_xvc_swd_sequence (const uint8_t *seq, size_t length)
 
static int xlnx_pcie_xvc_swd_switch_seq (enum swd_special_seq seq)
 
static void xlnx_pcie_xvc_swd_write_reg (uint8_t cmd, uint32_t value, uint32_t ap_delay_clk)
 
static int xlnx_pcie_xvc_transact (size_t num_bits, uint32_t tms, uint32_t tdi, uint32_t *tdo)
 
static int xlnx_pcie_xvc_write_reg (const int offset, const uint32_t val)
 

Variables

static int queued_retval
 
static struct xlnx_pcie_xvcxlnx_pcie_xvc = &xlnx_pcie_xvc_state
 
struct adapter_driver xlnx_pcie_xvc_adapter_driver
 
static const struct command_registration xlnx_pcie_xvc_command_handlers []
 
static struct jtag_interface xlnx_pcie_xvc_jtag_ops
 
static struct xlnx_pcie_xvc xlnx_pcie_xvc_state
 
static const struct command_registration xlnx_pcie_xvc_subcommand_handlers []
 
static const struct swd_driver xlnx_pcie_xvc_swd_ops
 
static const char *const xlnx_pcie_xvc_transports [] = { "jtag", "swd", NULL }
 

Macro Definition Documentation

◆ MASK_ACK

#define MASK_ACK (   x)    (((x) >> 9) & 0x7)

Definition at line 41 of file xlnx-pcie-xvc.c.

◆ MASK_PAR

#define MASK_PAR (   x)    ((int)((x) & 0x1))

Definition at line 42 of file xlnx-pcie-xvc.c.

◆ PCI_CFG_SPACE_EXP_SIZE

#define PCI_CFG_SPACE_EXP_SIZE   4096

Definition at line 26 of file xlnx-pcie-xvc.c.

◆ PCIE_EXT_CAP_LST

#define PCIE_EXT_CAP_LST   0x100

Definition at line 29 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_CAP_SIZE

#define XLNX_XVC_CAP_SIZE   0x20

Definition at line 37 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_EXT_CAP

#define XLNX_XVC_EXT_CAP   0x00

Definition at line 31 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_LEN_REG

#define XLNX_XVC_LEN_REG   0x0C

Definition at line 33 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_MAX_BITS

#define XLNX_XVC_MAX_BITS   0x20

Definition at line 39 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_TDX_REG

#define XLNX_XVC_TDX_REG   0x14

Definition at line 35 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_TMS_REG

#define XLNX_XVC_TMS_REG   0x10

Definition at line 34 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_VSEC_HDR

#define XLNX_XVC_VSEC_HDR   0x04

Definition at line 32 of file xlnx-pcie-xvc.c.

◆ XLNX_XVC_VSEC_ID

#define XLNX_XVC_VSEC_ID   0x8

Definition at line 38 of file xlnx-pcie-xvc.c.

Function Documentation

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( xlnx_pcie_xvc_handle_config_command  )

◆ swd_clear_sticky_errors()

static void swd_clear_sticky_errors ( void  )
static

◆ xlnx_pcie_xvc_execute_command()

◆ xlnx_pcie_xvc_execute_pathmove()

static int xlnx_pcie_xvc_execute_pathmove ( struct jtag_command cmd)
static

◆ xlnx_pcie_xvc_execute_queue()

static int xlnx_pcie_xvc_execute_queue ( void  )
static

Definition at line 365 of file xlnx-pcie-xvc.c.

References cmd, ERROR_OK, jtag_command_queue, and xlnx_pcie_xvc_execute_command().

◆ xlnx_pcie_xvc_execute_reset()

static void xlnx_pcie_xvc_execute_reset ( struct jtag_command cmd)
static

Definition at line 298 of file xlnx-pcie-xvc.c.

References cmd, and LOG_DEBUG.

Referenced by xlnx_pcie_xvc_execute_command().

◆ xlnx_pcie_xvc_execute_runtest()

static int xlnx_pcie_xvc_execute_runtest ( struct jtag_command cmd)
static

◆ xlnx_pcie_xvc_execute_scan()

◆ xlnx_pcie_xvc_execute_sleep()

static void xlnx_pcie_xvc_execute_sleep ( struct jtag_command cmd)
static

Definition at line 304 of file xlnx-pcie-xvc.c.

References cmd, and LOG_DEBUG.

Referenced by xlnx_pcie_xvc_execute_command().

◆ xlnx_pcie_xvc_execute_stableclocks()

static int xlnx_pcie_xvc_execute_stableclocks ( struct jtag_command cmd)
static

◆ xlnx_pcie_xvc_execute_statemove()

◆ xlnx_pcie_xvc_execute_tms()

static int xlnx_pcie_xvc_execute_tms ( struct jtag_command cmd)
static

◆ xlnx_pcie_xvc_init()

◆ xlnx_pcie_xvc_quit()

static int xlnx_pcie_xvc_quit ( void  )
static

Definition at line 438 of file xlnx-pcie-xvc.c.

References ERROR_OK, and xlnx_pcie_xvc::fd.

◆ xlnx_pcie_xvc_read_reg()

static int xlnx_pcie_xvc_read_reg ( const int  offset,
uint32_t *  val 
)
static

◆ xlnx_pcie_xvc_swd_init()

static int xlnx_pcie_xvc_swd_init ( void  )
static

Definition at line 681 of file xlnx-pcie-xvc.c.

References ERROR_OK.

◆ xlnx_pcie_xvc_swd_read_reg()

static void xlnx_pcie_xvc_swd_read_reg ( uint8_t  cmd,
uint32_t *  value,
uint32_t  ap_delay_clk 
)
static

◆ xlnx_pcie_xvc_swd_run_queue()

static int xlnx_pcie_xvc_swd_run_queue ( void  )
static

Definition at line 665 of file xlnx-pcie-xvc.c.

References ERROR_OK, LOG_DEBUG, NULL, queued_retval, and xlnx_pcie_xvc_transact().

◆ xlnx_pcie_xvc_swd_sequence()

static int xlnx_pcie_xvc_swd_sequence ( const uint8_t *  seq,
size_t  length 
)
static

◆ xlnx_pcie_xvc_swd_switch_seq()

◆ xlnx_pcie_xvc_swd_write_reg()

static void xlnx_pcie_xvc_swd_write_reg ( uint8_t  cmd,
uint32_t  value,
uint32_t  ap_delay_clk 
)
static

◆ xlnx_pcie_xvc_transact()

◆ xlnx_pcie_xvc_write_reg()

static int xlnx_pcie_xvc_write_reg ( const int  offset,
const uint32_t  val 
)
static

Variable Documentation

◆ queued_retval

int queued_retval
static

◆ xlnx_pcie_xvc

Definition at line 51 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_adapter_driver

struct adapter_driver xlnx_pcie_xvc_adapter_driver
Initial value:
= {
.name = "xlnx_pcie_xvc",
.transports = xlnx_pcie_xvc_transports,
.jtag_ops = &xlnx_pcie_xvc_jtag_ops,
.swd_ops = &xlnx_pcie_xvc_swd_ops,
}
static struct jtag_interface xlnx_pcie_xvc_jtag_ops
static const char *const xlnx_pcie_xvc_transports[]
static int xlnx_pcie_xvc_quit(void)
static const struct command_registration xlnx_pcie_xvc_command_handlers[]
static const struct swd_driver xlnx_pcie_xvc_swd_ops
static int xlnx_pcie_xvc_init(void)

Definition at line 694 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_command_handlers

const struct command_registration xlnx_pcie_xvc_command_handlers[]
static
Initial value:
= {
{
.name = "xlnx_pcie_xvc",
.mode = COMMAND_ANY,
.help = "perform xlnx_pcie_xvc management",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:235
static const struct command_registration xlnx_pcie_xvc_subcommand_handlers[]

Definition at line 449 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_jtag_ops

struct jtag_interface xlnx_pcie_xvc_jtag_ops
static
Initial value:
= {
.execute_queue = &xlnx_pcie_xvc_execute_queue,
}
static int xlnx_pcie_xvc_execute_queue(void)

Definition at line 449 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_state

struct xlnx_pcie_xvc xlnx_pcie_xvc_state
static

Definition at line 1 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_subcommand_handlers

const struct command_registration xlnx_pcie_xvc_subcommand_handlers[]
static
Initial value:
= {
{
.name = "config",
.handler = xlnx_pcie_xvc_handle_config_command,
.mode = COMMAND_CONFIG,
.help = "Configure XVC/PCIe JTAG adapter",
.usage = "device",
},
}
@ COMMAND_CONFIG
Definition: command.h:41

Definition at line 449 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_swd_ops

const struct swd_driver xlnx_pcie_xvc_swd_ops
static
Initial value:
= {
}
static void xlnx_pcie_xvc_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_clk)
static int xlnx_pcie_xvc_swd_init(void)
static int xlnx_pcie_xvc_swd_switch_seq(enum swd_special_seq seq)
static void xlnx_pcie_xvc_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk)
static int xlnx_pcie_xvc_swd_run_queue(void)

Definition at line 681 of file xlnx-pcie-xvc.c.

◆ xlnx_pcie_xvc_transports

const char* const xlnx_pcie_xvc_transports[] = { "jtag", "swd", NULL }
static

Definition at line 694 of file xlnx-pcie-xvc.c.