OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | lattice_devices_elem |
Macros | |
#define | PRELOAD 0x1C |
#define | USER1 0x32 |
#define | USER2 0x38 |
Functions | |
COMMAND_HANDLER (lattice_read_status_command_handler) | |
COMMAND_HANDLER (lattice_read_usercode_register_command_handler) | |
COMMAND_HANDLER (lattice_refresh_command_handler) | |
COMMAND_HANDLER (lattice_set_preload_command_handler) | |
COMMAND_HANDLER (lattice_write_usercode_register_command_handler) | |
static int | lattice_check_device_family (struct lattice_pld_device *lattice_device) |
static int | lattice_connect_spi_to_jtag (struct pld_device *pld_device) |
static int | lattice_disconnect_spi_from_jtag (struct pld_device *pld_device) |
static int | lattice_get_ipdbg_hub (int user_num, struct pld_device *pld_device, struct pld_ipdbg_hub *hub) |
static int | lattice_get_stuff_bits (struct pld_device *pld_device, unsigned int *facing_read_bits, unsigned int *trailing_write_bits) |
static int | lattice_has_jtagspi_instruction (struct pld_device *device, bool *has_instruction) |
static int | lattice_load_command (struct pld_device *pld_device, const char *filename) |
int | lattice_preload (struct lattice_pld_device *lattice_device) |
static int | lattice_read_status_u32 (struct lattice_pld_device *lattice_device, uint32_t *status, uint32_t out, bool do_idle) |
static int | lattice_read_status_u64 (struct lattice_pld_device *lattice_device, uint64_t *status, uint64_t out) |
int | lattice_read_u32_register (struct jtag_tap *tap, uint8_t cmd, uint32_t *in_val, uint32_t out_val, bool do_idle) |
int | lattice_read_u64_register (struct jtag_tap *tap, uint8_t cmd, uint64_t *in_val, uint64_t out_val) |
static int | lattice_read_usercode (struct lattice_pld_device *lattice_device, uint32_t *usercode, uint32_t out) |
int | lattice_set_instr (struct jtag_tap *tap, uint8_t new_instr, tap_state_t endstate) |
int | lattice_verify_status_register_u32 (struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask, bool do_idle) |
int | lattice_verify_status_register_u64 (struct lattice_pld_device *lattice_device, uint64_t out, uint64_t expected, uint64_t mask) |
int | lattice_verify_usercode (struct lattice_pld_device *lattice_device, uint32_t out, uint32_t expected, uint32_t mask) |
static int | lattice_write_usercode (struct lattice_pld_device *lattice_device, uint32_t usercode) |
PLD_CREATE_COMMAND_HANDLER (lattice_pld_create_command) | |
Variables | |
static const struct command_registration | lattice_command_handler [] |
static const struct lattice_devices_elem | lattice_devices [] |
static const struct command_registration | lattice_exec_command_handlers [] |
struct pld_driver | lattice_pld |
COMMAND_HANDLER | ( | lattice_read_status_command_handler | ) |
Definition at line 543 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, get_pld_device_by_name_or_numstr(), LATTICE_CERTUS, lattice_check_device_family(), LATTICE_ECP5, lattice_read_status_u32(), lattice_read_status_u64(), and status.
COMMAND_HANDLER | ( | lattice_read_usercode_register_command_handler | ) |
Definition at line 464 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_pld_device_by_name_or_numstr(), lattice_check_device_family(), and lattice_read_usercode().
COMMAND_HANDLER | ( | lattice_refresh_command_handler | ) |
Definition at line 578 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, get_pld_device_by_name_or_numstr(), LATTICE_CERTUS, lattice_certus_refresh(), lattice_check_device_family(), LATTICE_ECP2, lattice_ecp2_3_refresh(), LATTICE_ECP3, LATTICE_ECP5, and lattice_ecp5_refresh().
COMMAND_HANDLER | ( | lattice_set_preload_command_handler | ) |
Definition at line 492 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_pld_device_by_name_or_numstr(), and lattice_pld_device::preload_length.
COMMAND_HANDLER | ( | lattice_write_usercode_register_command_handler | ) |
Definition at line 517 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_pld_device_by_name_or_numstr(), lattice_check_device_family(), and lattice_write_usercode().
|
static |
Definition at line 79 of file lattice.c.
References ARRAY_SIZE, ERROR_FAIL, ERROR_OK, lattice_devices_elem::family, lattice_pld_device::family, jtag_tap::has_idcode, jtag_tap::idcode, lattice_devices, LATTICE_UNKNOWN, LOG_ERROR, lattice_devices_elem::preload_length, lattice_pld_device::preload_length, and lattice_pld_device::tap.
Referenced by COMMAND_HANDLER(), lattice_connect_spi_to_jtag(), lattice_disconnect_spi_from_jtag(), lattice_get_stuff_bits(), and lattice_load_command().
|
static |
Definition at line 345 of file lattice.c.
References pld_device::driver_priv, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_connect_spi_to_jtag(), lattice_check_device_family(), LATTICE_ECP2, lattice_ecp2_3_connect_spi_to_jtag(), LATTICE_ECP3, LATTICE_ECP5, and lattice_ecp5_connect_spi_to_jtag().
|
static |
Definition at line 366 of file lattice.c.
References pld_device::driver_priv, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_disconnect_spi_from_jtag(), lattice_check_device_family(), LATTICE_ECP2, lattice_ecp2_3_disconnect_spi_from_jtag(), LATTICE_ECP3, LATTICE_ECP5, and lattice_ecp5_disconnect_spi_from_jtag().
|
static |
Definition at line 322 of file lattice.c.
References pld_device::driver_priv, ERROR_FAIL, ERROR_OK, LOG_ERROR, lattice_pld_device::tap, pld_ipdbg_hub::tap, USER1, USER2, and pld_ipdbg_hub::user_ir_code.
|
static |
Definition at line 387 of file lattice.c.
References pld_device::driver_priv, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_get_facing_read_bits(), lattice_check_device_family(), LATTICE_ECP2, lattice_ecp2_3_get_facing_read_bits(), LATTICE_ECP3, LATTICE_ECP5, and lattice_ecp5_get_facing_read_bits().
|
static |
|
static |
Definition at line 273 of file lattice.c.
References raw_bit_file::data, pld_device::driver_priv, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, lattice_bit_file::has_id, jtag_tap::has_idcode, jtag_tap::idcode, lattice_bit_file::idcode, LATTICE_CERTUS, lattice_certus_load(), lattice_check_device_family(), LATTICE_ECP2, lattice_ecp2_load(), LATTICE_ECP3, lattice_ecp3_load(), LATTICE_ECP5, lattice_ecp5_load(), lattice_read_file(), LOG_ERROR, LOG_WARNING, lattice_bit_file::raw_bit, and lattice_pld_device::tap.
int lattice_preload | ( | struct lattice_pld_device * | lattice_device | ) |
Definition at line 147 of file lattice.c.
References buffer, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), lattice_set_instr(), LOG_ERROR, NULL, scan_field::num_bits, scan_field::out_value, PRELOAD, lattice_pld_device::preload_length, lattice_pld_device::tap, and TAP_IDLE.
Referenced by lattice_certus_connect_spi_to_jtag(), lattice_certus_load(), lattice_certus_refresh(), lattice_ecp2_load(), lattice_ecp3_load(), lattice_ecp5_connect_spi_to_jtag(), lattice_ecp5_load(), and lattice_ecp5_refresh().
|
static |
Definition at line 216 of file lattice.c.
References ERROR_FAIL, lattice_pld_device::family, LATTICE_ECP2, lattice_ecp2_3_read_status(), LATTICE_ECP3, LATTICE_ECP5, lattice_ecp5_read_status(), status, and lattice_pld_device::tap.
Referenced by COMMAND_HANDLER(), and lattice_verify_status_register_u32().
|
static |
Definition at line 229 of file lattice.c.
References ERROR_FAIL, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_read_status(), status, and lattice_pld_device::tap.
Referenced by COMMAND_HANDLER(), and lattice_verify_status_register_u64().
int lattice_read_u32_register | ( | struct jtag_tap * | tap, |
uint8_t | cmd, | ||
uint32_t * | in_val, | ||
uint32_t | out_val, | ||
bool | do_idle | ||
) |
Definition at line 100 of file lattice.c.
References buffer, cmd, ERROR_OK, h_u32_to_le(), scan_field::in_value, jtag_add_dr_scan(), jtag_add_runtest(), jtag_add_sleep(), jtag_execute_queue(), lattice_set_instr(), le_to_h_u32(), scan_field::num_bits, scan_field::out_value, and TAP_IDLE.
Referenced by lattice_certus_read_usercode(), lattice_ecp2_3_read_status(), lattice_ecp2_3_read_usercode(), lattice_ecp5_read_status(), and lattice_ecp5_read_usercode().
int lattice_read_u64_register | ( | struct jtag_tap * | tap, |
uint8_t | cmd, | ||
uint64_t * | in_val, | ||
uint64_t | out_val | ||
) |
Definition at line 126 of file lattice.c.
References buffer, cmd, ERROR_OK, h_u64_to_le(), scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), lattice_set_instr(), le_to_h_u64(), scan_field::num_bits, scan_field::out_value, and TAP_IDLE.
Referenced by lattice_certus_read_status().
|
static |
Definition at line 171 of file lattice.c.
References ERROR_FAIL, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_read_usercode(), LATTICE_ECP2, lattice_ecp2_3_read_usercode(), LATTICE_ECP3, LATTICE_ECP5, lattice_ecp5_read_usercode(), and lattice_pld_device::tap.
Referenced by COMMAND_HANDLER(), and lattice_verify_usercode().
int lattice_set_instr | ( | struct jtag_tap * | tap, |
uint8_t | new_instr, | ||
tap_state_t | endstate | ||
) |
Definition at line 62 of file lattice.c.
References buf_set_u32(), DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_tap::ir_length, jtag_add_ir_scan(), LOG_ERROR, NULL, scan_field::num_bits, and scan_field::out_value.
Referenced by lattice_certus_connect_spi_to_jtag(), lattice_certus_enable_programming(), lattice_certus_enable_transparent_mode(), lattice_certus_erase_device(), lattice_certus_exit_programming_mode(), lattice_certus_init_address(), lattice_certus_program_config_map(), lattice_certus_refresh(), lattice_ecp2_3_connect_spi_to_jtag(), lattice_ecp2_3_disconnect_spi_from_jtag(), lattice_ecp2_3_erase_device(), lattice_ecp2_3_exit_programming_mode(), lattice_ecp2_3_program_config_map(), lattice_ecp2_3_refresh(), lattice_ecp2_3_write_usercode(), lattice_ecp2_load(), lattice_ecp3_load(), lattice_ecp5_connect_spi_to_jtag(), lattice_ecp5_enable_sram_programming(), lattice_ecp5_erase_sram(), lattice_ecp5_exit_programming_mode(), lattice_ecp5_init_address(), lattice_ecp5_program_config_map(), lattice_ecp5_refresh(), lattice_ecp5_write_usercode(), lattice_preload(), lattice_read_u32_register(), and lattice_read_u64_register().
int lattice_verify_status_register_u32 | ( | struct lattice_pld_device * | lattice_device, |
uint32_t | out, | ||
uint32_t | expected, | ||
uint32_t | mask, | ||
bool | do_idle | ||
) |
Definition at line 241 of file lattice.c.
References ERROR_FAIL, ERROR_OK, jtag_tap::expected, lattice_read_status_u32(), LOG_ERROR, mask, and status.
Referenced by lattice_ecp2_load(), lattice_ecp3_load(), and lattice_ecp5_load().
int lattice_verify_status_register_u64 | ( | struct lattice_pld_device * | lattice_device, |
uint64_t | out, | ||
uint64_t | expected, | ||
uint64_t | mask | ||
) |
Definition at line 257 of file lattice.c.
References ERROR_FAIL, ERROR_OK, jtag_tap::expected, lattice_read_status_u64(), LOG_ERROR, mask, and status.
Referenced by lattice_certus_erase_device(), and lattice_certus_load().
int lattice_verify_usercode | ( | struct lattice_pld_device * | lattice_device, |
uint32_t | out, | ||
uint32_t | expected, | ||
uint32_t | mask | ||
) |
Definition at line 187 of file lattice.c.
References ERROR_FAIL, ERROR_OK, jtag_tap::expected, lattice_read_usercode(), LOG_ERROR, and mask.
Referenced by lattice_ecp2_3_erase_device(), lattice_ecp2_3_write_usercode(), and lattice_ecp5_write_usercode().
|
static |
Definition at line 204 of file lattice.c.
References ERROR_FAIL, lattice_pld_device::family, LATTICE_CERTUS, lattice_certus_write_usercode(), LATTICE_ECP2, lattice_ecp2_3_write_usercode(), LATTICE_ECP3, LATTICE_ECP5, and lattice_ecp5_write_usercode().
Referenced by COMMAND_HANDLER().
PLD_CREATE_COMMAND_HANDLER | ( | lattice_pld_create_command | ) |
Definition at line 415 of file lattice.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, lattice_pld_device::family, jtag_tap_by_string(), LATTICE_CERTUS, LATTICE_ECP2, LATTICE_ECP3, LATTICE_ECP5, LATTICE_UNKNOWN, LOG_ERROR, lattice_pld_device::preload_length, and lattice_pld_device::tap.
|
static |
|
static |
Definition at line 1 of file lattice.c.
Referenced by lattice_check_device_family().
|
static |
struct pld_driver lattice_pld |