OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | jtagspi_flash_bank |
Macros | |
#define | JTAGSPI_MAX_TIMEOUT 3000 |
Functions | |
COMMAND_HANDLER (jtagspi_handle_always_4byte) | |
COMMAND_HANDLER (jtagspi_handle_cmd) | |
COMMAND_HANDLER (jtagspi_handle_set) | |
static uint8_t * | fill_addr (uint32_t addr, unsigned int addr_len, uint8_t *buffer) |
FLASH_BANK_COMMAND_HANDLER (jtagspi_flash_bank_command) | |
static void | flip_u8 (const uint8_t *in, uint8_t *out, unsigned int len) |
static int | jtagspi_auto_probe (struct flash_bank *bank) |
static int | jtagspi_bulk_erase (struct flash_bank *bank) |
static int | jtagspi_cmd (struct flash_bank *bank, uint8_t cmd, uint8_t *write_buffer, unsigned int write_len, uint8_t *data_buffer, int data_len) |
static int | jtagspi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | jtagspi_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | jtagspi_page_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | jtagspi_probe (struct flash_bank *bank) |
static int | jtagspi_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | jtagspi_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | jtagspi_read_status (struct flash_bank *bank, uint32_t *status) |
static int | jtagspi_sector_erase (struct flash_bank *bank, unsigned int sector) |
static void | jtagspi_set_user_ir (struct jtagspi_flash_bank *info) |
static int | jtagspi_wait (struct flash_bank *bank, int timeout_ms) |
static int | jtagspi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | jtagspi_write_enable (struct flash_bank *bank) |
Variables | |
static const struct command_registration | jtagspi_command_handlers [] |
static const struct command_registration | jtagspi_exec_command_handlers [] |
const struct flash_driver | jtagspi_flash |
COMMAND_HANDLER | ( | jtagspi_handle_always_4byte | ) |
Definition at line 411 of file jtagspi.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_BOOL, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtagspi_info(), and LOG_DEBUG.
COMMAND_HANDLER | ( | jtagspi_handle_cmd | ) |
Definition at line 360 of file jtagspi.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), command_print_sameline(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtagspi_cmd(), and LOG_DEBUG.
COMMAND_HANDLER | ( | jtagspi_handle_set | ) |
Definition at line 209 of file jtagspi.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, info, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, flash_sector::offset, flash_sector::size, and SPIFLASH_DEF_PAGESIZE.
|
static |
Definition at line 590 of file jtagspi.c.
References addr, jtagspi_flash_bank::addr_len, and buffer.
Referenced by jtagspi_page_write(), jtagspi_read(), and jtagspi_sector_erase().
FLASH_BANK_COMMAND_HANDLER | ( | jtagspi_flash_bank_command | ) |
Definition at line 32 of file jtagspi.c.
References bank, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, device, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_pld_device_by_name_or_numstr(), info, jtagspi_flash_bank::ir, LOG_ERROR, NULL, pld_get_jtagspi_userircode(), and pld_has_jtagspi_instruction().
|
static |
|
static |
|
static |
Definition at line 568 of file jtagspi.c.
References bank, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, info, jtagspi_cmd(), JTAGSPI_MAX_TIMEOUT, jtagspi_wait(), jtagspi_write_enable(), LOG_INFO, NULL, t0, and timeval_ms().
Referenced by jtagspi_erase().
|
static |
Definition at line 102 of file jtagspi.c.
References bank, cmd, ERROR_OK, flip_u8(), h_u32_to_be(), scan_field::in_value, info, jtag_add_dr_scan(), jtag_execute_queue(), jtag_tap_count_enabled(), jtagspi_set_user_ir(), LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, pld_connect_spi_to_jtag(), pld_disconnect_spi_from_jtag(), pld_get_jtagspi_stuff_bits(), and TAP_IDLE.
Referenced by COMMAND_HANDLER(), jtagspi_bulk_erase(), jtagspi_page_write(), jtagspi_probe(), jtagspi_read(), jtagspi_read_status(), jtagspi_sector_erase(), and jtagspi_write_enable().
|
static |
Definition at line 624 of file jtagspi.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, info, jtagspi_bulk_erase(), jtagspi_sector_erase(), LOG_DEBUG, LOG_ERROR, and LOG_WARNING.
|
static |
Definition at line 776 of file jtagspi.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 723 of file jtagspi.c.
References addr, jtagspi_flash_bank::addr_len, bank, buffer, count, ERROR_OK, fill_addr(), info, jtagspi_cmd(), JTAGSPI_MAX_TIMEOUT, jtagspi_wait(), jtagspi_write_enable(), and offset.
Referenced by jtagspi_write().
|
static |
Definition at line 436 of file jtagspi.c.
References bank, flash_device::device_id, ERROR_FAIL, ERROR_OK, flash_devices, id, info, flash_sector::is_erased, flash_sector::is_protected, jtagspi_cmd(), le_to_h_u24(), LOG_ERROR, LOG_INFO, LOG_WARNING, flash_device::name, NULL, flash_sector::offset, flash_device::sectorsize, flash_sector::size, and SPIFLASH_READ_ID.
Referenced by jtagspi_auto_probe().
|
static |
|
static |
Definition at line 682 of file jtagspi.c.
References addr, jtagspi_flash_bank::addr_len, bank, buffer, count, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, fill_addr(), info, jtagspi_cmd(), LOG_DEBUG, LOG_ERROR, offset, and SPIFLASH_DEF_PAGESIZE.
|
static |
Definition at line 517 of file jtagspi.c.
References bank, ERROR_OK, jtagspi_cmd(), LOG_DEBUG, NULL, SPIFLASH_READ_STATUS, and status.
Referenced by jtagspi_wait(), and jtagspi_write_enable().
|
static |
Definition at line 600 of file jtagspi.c.
References addr, jtagspi_flash_bank::addr_len, bank, ERROR_OK, fill_addr(), info, jtagspi_cmd(), JTAGSPI_MAX_TIMEOUT, jtagspi_wait(), jtagspi_write_enable(), LOG_INFO, NULL, t0, and timeval_ms().
Referenced by jtagspi_erase().
|
static |
Definition at line 83 of file jtagspi.c.
References buf_set_u32(), scan_field::in_value, info, jtag_add_ir_scan(), LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, and TAP_IDLE.
Referenced by jtagspi_cmd().
|
static |
Definition at line 528 of file jtagspi.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, jtagspi_read_status(), LOG_DEBUG, LOG_ERROR, SPIFLASH_BSY_BIT, status, t0, and timeval_ms().
Referenced by jtagspi_bulk_erase(), jtagspi_page_write(), and jtagspi_sector_erase().
|
static |
Definition at line 743 of file jtagspi.c.
References bank, buffer, count, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, info, jtagspi_page_write(), LOG_DEBUG, LOG_ERROR, offset, and SPIFLASH_DEF_PAGESIZE.
|
static |
Definition at line 552 of file jtagspi.c.
References bank, ERROR_FAIL, ERROR_OK, jtagspi_cmd(), jtagspi_read_status(), LOG_ERROR, NULL, SPIFLASH_WE_BIT, SPIFLASH_WRITE_ENABLE, and status.
Referenced by jtagspi_bulk_erase(), jtagspi_page_write(), and jtagspi_sector_erase().
|
static |
|
static |
const struct flash_driver jtagspi_flash |