OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | gowin_bit_file |
struct | gowin_pld_device |
Macros | |
#define | ADDRESS_INITIALIZATION 0x12 |
#define | CONFIG_DISABLE 0x3A |
#define | CONFIG_ENABLE 0x15 |
#define | ENABLE_2ND_FLASH 0x78 |
#define | ERASE_FLASH 0x75 |
#define | ERASE_SRAM 0x05 |
#define | IDCODE 0x11 |
#define | NO_OP 0x02 |
#define | READ_USERCODE 0x13 |
#define | RELOAD 0x3C |
#define | SRAM_ERASE_DONE 0x09 |
#define | STATUS_REGISTER 0x41 |
#define | STAUS_MASK_MEMORY_ERASE BIT(5) |
#define | STAUS_MASK_SYSTEM_EDIT_MODE BIT(7) |
#define | TRANSFER_CONFIGURATION_DATA 0x17 |
#define | USER1 0x42 |
#define | USER2 0x43 |
Functions | |
COMMAND_HANDLER (gowin_read_status_command_handler) | |
COMMAND_HANDLER (gowin_read_user_register_command_handler) | |
COMMAND_HANDLER (gowin_reload_command_handler) | |
static int | gowin_add_byte_to_bit_file (struct gowin_bit_file *bit_file, uint8_t byte) |
static int | gowin_check_status_flag (struct jtag_tap *tap, uint32_t mask, uint32_t flag) |
static int | gowin_disable_config (struct jtag_tap *tap) |
static int | gowin_enable_config (struct jtag_tap *tap) |
static int | gowin_erase_sram (struct jtag_tap *tap, bool tx_erase_done) |
static int | gowin_get_ipdbg_hub (int user_num, struct pld_device *pld_device, struct pld_ipdbg_hub *hub) |
static int | gowin_load_to_sram (struct pld_device *pld_device, const char *filename) |
static int | gowin_read_file (struct gowin_bit_file *bit_file, const char *filename, bool *is_fs) |
static int | gowin_read_fs_file (struct gowin_bit_file *bit_file, const char *filename) |
static uint64_t | gowin_read_fs_file_bitsequence (const char *bits, int length) |
static int | gowin_read_fs_file_header (struct gowin_bit_file *bit_file, FILE *stream) |
static int | gowin_read_register (struct jtag_tap *tap, uint32_t reg, uint32_t *result) |
static int | gowin_read_register_command (struct pld_device *pld_device, uint32_t cmd, uint32_t *value) |
static int | gowin_reload (struct jtag_tap *tap) |
static int | gowin_reload_command (struct pld_device *pld_device) |
static int | gowin_runtest_idle (struct jtag_tap *tap, unsigned int frac_sec) |
static int | gowin_set_instr (struct jtag_tap *tap, uint8_t new_instr) |
PLD_CREATE_COMMAND_HANDLER (gowin_pld_create_command) | |
Variables | |
static const struct command_registration | gowin_command_handler [] |
static const struct command_registration | gowin_exec_command_handlers [] |
struct pld_driver | gowin_pld |
COMMAND_HANDLER | ( | gowin_read_status_command_handler | ) |
Definition at line 478 of file gowin.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(), gowin_read_register_command(), status, and STATUS_REGISTER.
COMMAND_HANDLER | ( | gowin_read_user_register_command_handler | ) |
Definition at line 498 of file gowin.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(), gowin_read_register_command(), and READ_USERCODE.
COMMAND_HANDLER | ( | gowin_reload_command_handler | ) |
Definition at line 518 of file gowin.c.
References CMD, CMD_ARGC, CMD_ARGV, command_print(), device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, get_pld_device_by_name_or_numstr(), and gowin_reload_command().
|
static |
Definition at line 63 of file gowin.c.
References buffer, gowin_bit_file::capacity, raw_bit_file::data, ERROR_FAIL, ERROR_OK, raw_bit_file::length, LOG_ERROR, and gowin_bit_file::raw_file.
Referenced by gowin_read_fs_file(), and gowin_read_fs_file_header().
|
static |
Definition at line 241 of file gowin.c.
References ERROR_FAIL, ERROR_OK, flag, gowin_read_register(), mask, status, and STATUS_REGISTER.
Referenced by gowin_disable_config(), gowin_enable_config(), and gowin_erase_sram().
|
static |
Definition at line 269 of file gowin.c.
References CONFIG_DISABLE, ERROR_OK, gowin_check_status_flag(), gowin_set_instr(), jtag_execute_queue(), and STAUS_MASK_SYSTEM_EDIT_MODE.
Referenced by gowin_load_to_sram().
|
static |
Definition at line 257 of file gowin.c.
References CONFIG_ENABLE, ERROR_OK, gowin_check_status_flag(), gowin_set_instr(), jtag_execute_queue(), and STAUS_MASK_SYSTEM_EDIT_MODE.
Referenced by gowin_load_to_sram().
|
static |
Definition at line 300 of file gowin.c.
References ERASE_SRAM, ERROR_OK, gowin_check_status_flag(), gowin_runtest_idle(), gowin_set_instr(), jtag_add_sleep(), jtag_execute_queue(), NO_OP, SRAM_ERASE_DONE, and STAUS_MASK_MEMORY_ERASE.
Referenced by gowin_load_to_sram().
|
static |
Definition at line 455 of file gowin.c.
References pld_device::driver_priv, ERROR_FAIL, ERROR_OK, LOG_ERROR, gowin_pld_device::tap, pld_ipdbg_hub::tap, USER1, USER2, and pld_ipdbg_hub::user_ir_code.
|
static |
Definition at line 344 of file gowin.c.
References ADDRESS_INITIALIZATION, raw_bit_file::data, pld_device::driver_priv, ERROR_FAIL, ERROR_OK, flip_u32(), gowin_disable_config(), gowin_enable_config(), gowin_erase_sram(), gowin_read_file(), gowin_read_register(), gowin_set_instr(), gowin_bit_file::id, id, IDCODE, scan_field::in_value, jtag_add_dr_scan(), jtag_add_runtest(), jtag_execute_queue(), raw_bit_file::length, LOG_ERROR, NO_OP, scan_field::num_bits, scan_field::out_value, gowin_bit_file::raw_file, gowin_pld_device::tap, TAP_IDLE, and TRANSFER_CONFIGURATION_DATA.
|
static |
Definition at line 173 of file gowin.c.
References cpld_read_raw_bit_file(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_PLD_FILE_LOAD_FAILED, gowin_read_fs_file(), LOG_ERROR, and gowin_bit_file::raw_file.
Referenced by gowin_load_to_sram().
|
static |
Definition at line 126 of file gowin.c.
References raw_bit_file::data, ERROR_FAIL, ERROR_OK, ERROR_PLD_FILE_LOAD_FAILED, gowin_add_byte_to_bit_file(), gowin_read_fs_file_bitsequence(), gowin_read_fs_file_header(), LOG_ERROR, and gowin_bit_file::raw_file.
Referenced by gowin_read_file().
|
static |
Definition at line 55 of file gowin.c.
Referenced by gowin_read_fs_file(), and gowin_read_fs_file_header().
|
static |
Definition at line 84 of file gowin.c.
References BIT, buffer, gowin_bit_file::crc_en, ERROR_FAIL, ERROR_OK, gowin_add_byte_to_bit_file(), gowin_read_fs_file_bitsequence(), and gowin_bit_file::id.
Referenced by gowin_read_fs_file().
|
static |
Definition at line 217 of file gowin.c.
References scan_field::check_mask, scan_field::check_value, ERROR_OK, gowin_set_instr(), scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), le_to_h_u32(), NULL, scan_field::num_bits, scan_field::out_value, and TAP_IDLE.
Referenced by gowin_check_status_flag(), gowin_load_to_sram(), and gowin_read_register_command().
|
static |
Definition at line 429 of file gowin.c.
References cmd, pld_device::driver_priv, ERROR_FAIL, gowin_read_register(), and gowin_pld_device::tap.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 281 of file gowin.c.
References ERROR_OK, gowin_set_instr(), jtag_execute_queue(), NO_OP, and RELOAD.
Referenced by gowin_reload_command().
|
static |
Definition at line 442 of file gowin.c.
References pld_device::driver_priv, ERROR_FAIL, gowin_reload(), and gowin_pld_device::tap.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 292 of file gowin.c.
References adapter_get_speed_khz(), DIV_ROUND_UP, jtag_add_runtest(), jtag_execute_queue(), and TAP_IDLE.
Referenced by gowin_erase_sram().
|
static |
Definition at line 199 of file gowin.c.
References buf_set_u32(), DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_tap::ir_length, jtag_add_ir_scan(), jtag_add_runtest(), LOG_ERROR, NULL, scan_field::num_bits, scan_field::out_value, and TAP_IDLE.
Referenced by gowin_disable_config(), gowin_enable_config(), gowin_erase_sram(), gowin_load_to_sram(), gowin_read_register(), and gowin_reload().
|
static |
|
static |
struct pld_driver gowin_pld |