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_ir (struct flash_bank *bank) |
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 345 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 292 of file jtagspi.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtagspi_cmd(), LOG_DEBUG, LOG_ERROR, and output.
COMMAND_HANDLER | ( | jtagspi_handle_set | ) |
Definition at line 146 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 530 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 29 of file jtagspi.c.
References bank, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, info, LOG_ERROR, and NULL.
|
static |
|
static |
|
static |
Definition at line 508 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, and timeval_ms().
Referenced by jtagspi_erase().
|
static |
Definition at line 71 of file jtagspi.c.
References bank, cmd, flip_u8(), h_u32_to_be(), scan_field::in_value, info, jtag_add_dr_scan(), jtag_execute_queue(), jtag_tap_count_enabled(), jtagspi_set_ir(), LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, 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 564 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 716 of file jtagspi.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 663 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 370 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 622 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 457 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 540 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, and timeval_ms().
Referenced by jtagspi_erase().
|
static |
Definition at line 51 of file jtagspi.c.
References bank, 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 468 of file jtagspi.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, jtagspi_read_status(), LOG_DEBUG, LOG_ERROR, SPIFLASH_BSY_BIT, status, and timeval_ms().
Referenced by jtagspi_bulk_erase(), jtagspi_page_write(), and jtagspi_sector_erase().
|
static |
Definition at line 683 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 492 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 |