OpenOCD
pld.c File Reference
Include dependency graph for pld.c:

Go to the source code of this file.

Functions

 COMMAND_HANDLER (handle_pld_create_command)
 
 COMMAND_HANDLER (handle_pld_devices_command)
 
 COMMAND_HANDLER (handle_pld_init_command)
 
 COMMAND_HANDLER (handle_pld_load_command)
 
struct pld_deviceget_pld_device_by_name (const char *name)
 
struct pld_deviceget_pld_device_by_name_or_numstr (const char *str)
 
struct pld_deviceget_pld_device_by_num (int num)
 
int pld_connect_spi_to_jtag (struct pld_device *pld_device)
 
int pld_disconnect_spi_from_jtag (struct pld_device *pld_device)
 
int pld_get_jtagspi_stuff_bits (struct pld_device *pld_device, unsigned int *facing_read_bits, unsigned int *trailing_write_bits)
 
int pld_get_jtagspi_userircode (struct pld_device *pld_device, unsigned int *ir)
 
int pld_has_jtagspi_instruction (struct pld_device *pld_device, bool *has_instruction)
 
static int pld_init (struct command_context *cmd_ctx)
 
int pld_register_commands (struct command_context *cmd_ctx)
 

Variables

static const struct command_registration pld_command_handler []
 
static const struct command_registration pld_config_command_handlers []
 
static struct pld_devicepld_devices
 
static struct pld_driverpld_drivers []
 
static const struct command_registration pld_exec_command_handlers []
 

Function Documentation

◆ COMMAND_HANDLER() [1/4]

◆ COMMAND_HANDLER() [2/4]

COMMAND_HANDLER ( handle_pld_devices_command  )

◆ COMMAND_HANDLER() [3/4]

COMMAND_HANDLER ( handle_pld_init_command  )

Definition at line 325 of file pld.c.

References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_DEBUG, LOG_INFO, and pld_init().

◆ COMMAND_HANDLER() [4/4]

◆ get_pld_device_by_name()

struct pld_device* get_pld_device_by_name ( const char *  name)

Definition at line 46 of file pld.c.

References name, pld_device::next, NULL, and pld_devices.

Referenced by COMMAND_HANDLER(), and get_pld_device_by_name_or_numstr().

◆ get_pld_device_by_name_or_numstr()

struct pld_device* get_pld_device_by_name_or_numstr ( const char *  str)

Definition at line 56 of file pld.c.

References get_pld_device_by_name(), get_pld_device_by_num(), LOG_ERROR, and NULL.

Referenced by COMMAND_HANDLER(), and FLASH_BANK_COMMAND_HANDLER().

◆ get_pld_device_by_num()

struct pld_device* get_pld_device_by_num ( int  num)

Definition at line 31 of file pld.c.

References LOG_WARNING, pld_device::name, pld_device::next, NULL, and pld_devices.

Referenced by get_pld_device_by_name_or_numstr().

◆ pld_connect_spi_to_jtag()

int pld_connect_spi_to_jtag ( struct pld_device pld_device)

Definition at line 127 of file pld.c.

References pld_driver::connect_spi_to_jtag, pld_device::driver, ERROR_FAIL, and LOG_ERROR.

Referenced by jtagspi_cmd().

◆ pld_disconnect_spi_from_jtag()

int pld_disconnect_spi_from_jtag ( struct pld_device pld_device)

Definition at line 144 of file pld.c.

References pld_driver::disconnect_spi_from_jtag, pld_device::driver, ERROR_FAIL, and LOG_ERROR.

Referenced by jtagspi_cmd().

◆ pld_get_jtagspi_stuff_bits()

int pld_get_jtagspi_stuff_bits ( struct pld_device pld_device,
unsigned int *  facing_read_bits,
unsigned int *  trailing_write_bits 
)

Definition at line 109 of file pld.c.

References pld_device::driver, ERROR_FAIL, ERROR_OK, pld_driver::get_stuff_bits, and LOG_ERROR.

Referenced by jtagspi_cmd().

◆ pld_get_jtagspi_userircode()

int pld_get_jtagspi_userircode ( struct pld_device pld_device,
unsigned int *  ir 
)

◆ pld_has_jtagspi_instruction()

int pld_has_jtagspi_instruction ( struct pld_device pld_device,
bool *  has_instruction 
)

◆ pld_init()

static int pld_init ( struct command_context cmd_ctx)
static

Definition at line 317 of file pld.c.

References ERROR_OK, pld_devices, pld_exec_command_handlers, and register_commands().

Referenced by COMMAND_HANDLER().

◆ pld_register_commands()

int pld_register_commands ( struct command_context cmd_ctx)

Definition at line 368 of file pld.c.

References NULL, pld_command_handler, and register_commands().

Referenced by setup_command_handler().

Variable Documentation

◆ pld_command_handler

const struct command_registration pld_command_handler[]
static
Initial value:
= {
{
.name = "pld",
.mode = COMMAND_ANY,
.help = "programmable logic device commands",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration pld_config_command_handlers[]
Definition: pld.c:341

Definition at line 325 of file pld.c.

Referenced by pld_register_commands().

◆ pld_config_command_handlers

const struct command_registration pld_config_command_handlers[]
static
Initial value:
= {
{
.name = "create",
.mode = COMMAND_CONFIG,
.handler = handle_pld_create_command,
.help = "create a PLD device",
.usage = "name.pld driver_name [driver_args ... ]",
},
{
.name = "init",
.mode = COMMAND_CONFIG,
.handler = handle_pld_init_command,
.help = "initialize PLD devices",
.usage = ""
},
}
@ COMMAND_CONFIG
Definition: command.h:41

Definition at line 325 of file pld.c.

◆ pld_devices

struct pld_device* pld_devices
static

Definition at line 29 of file pld.c.

Referenced by COMMAND_HANDLER(), get_pld_device_by_name(), get_pld_device_by_num(), and pld_init().

◆ pld_drivers

struct pld_driver* pld_drivers[]
static
Initial value:
= {
}
struct pld_driver efinix_pld
Definition: efinix.c:300
struct pld_driver gatemate_pld
Definition: gatemate.c:300
struct pld_driver gowin_pld
Definition: gowin.c:592
struct pld_driver intel_pld
Definition: intel.c:367
struct pld_driver lattice_pld
Definition: lattice.c:653
struct pld_driver virtex2_pld
Definition: virtex2.c:472
#define NULL
Definition: usb.h:16

Definition at line 19 of file pld.c.

Referenced by COMMAND_HANDLER().

◆ pld_exec_command_handlers

const struct command_registration pld_exec_command_handlers[]
static
Initial value:
= {
{
.name = "devices",
.handler = handle_pld_devices_command,
.mode = COMMAND_EXEC,
.help = "list configured pld devices",
.usage = "",
},
{
.name = "load",
.handler = handle_pld_load_command,
.mode = COMMAND_EXEC,
.help = "load configuration file into PLD",
.usage = "pld_name filename",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 249 of file pld.c.

Referenced by pld_init().