OpenOCD
|
Implements Tcl commands used to access NOR flash facilities. More...
Go to the source code of this file.
Functions | |
COMMAND_HANDLER (handle_flash_bank_command) | |
COMMAND_HANDLER (handle_flash_banks_command) | |
COMMAND_HANDLER (handle_flash_erase_address_command) | |
COMMAND_HANDLER (handle_flash_erase_check_command) | |
COMMAND_HANDLER (handle_flash_erase_command) | |
COMMAND_HANDLER (handle_flash_fill_command) | |
COMMAND_HANDLER (handle_flash_info_command) | |
COMMAND_HANDLER (handle_flash_init_command) | |
COMMAND_HANDLER (handle_flash_md_command) | |
COMMAND_HANDLER (handle_flash_padded_value_command) | |
COMMAND_HANDLER (handle_flash_probe_command) | |
COMMAND_HANDLER (handle_flash_protect_command) | |
COMMAND_HANDLER (handle_flash_read_bank_command) | |
COMMAND_HANDLER (handle_flash_verify_bank_command) | |
COMMAND_HANDLER (handle_flash_verify_image_command) | |
COMMAND_HANDLER (handle_flash_write_bank_command) | |
COMMAND_HANDLER (handle_flash_write_image_command) | |
COMMAND_HELPER (flash_command_get_bank, unsigned name_index, struct flash_bank **bank) | |
Retrieves bank from a command argument, reporting errors parsing the bank identifier or retrieving the specified bank. More... | |
static | COMMAND_HELPER (flash_command_get_bank_maybe_probe, unsigned name_index, struct flash_bank **bank, bool do_probe) |
static int | flash_init_drivers (struct command_context *cmd_ctx) |
int | flash_register_commands (struct command_context *cmd_ctx) |
Registers the 'flash' subsystem commands. More... | |
void | flash_set_dirty (void) |
Forces targets to re-examine their erase/protection state. More... | |
static int | jim_flash_list (Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
Variables | |
static const struct command_registration | flash_command_handlers [] |
static const struct command_registration | flash_config_command_handlers [] |
static const struct command_registration | flash_exec_command_handlers [] |
Implements Tcl commands used to access NOR flash facilities.
Definition in file flash/nor/tcl.c.
COMMAND_HANDLER | ( | handle_flash_bank_command | ) |
Definition at line 1242 of file flash/nor/tcl.c.
References flash_bank::base, flash_bank::bus_width, CALL_COMMAND_HANDLER, flash_bank::chip_width, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, flash_driver::commands, flash_bank::default_padded_value, flash_bank::driver, flash_bank::erased_value, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_bank_add(), flash_driver_find_by_name(), FLASH_WRITE_GAP_SECTOR, get_flash_bank_by_name_noprobe(), get_target(), LOG_DEBUG, LOG_ERROR, flash_bank::minimal_write_gap, flash_bank::name, NULL, register_commands(), flash_bank::size, flash_bank::target, target, TARGET_ADDR_FMT, and flash_driver::usage.
COMMAND_HANDLER | ( | handle_flash_banks_command | ) |
Definition at line 1312 of file flash/nor/tcl.c.
References CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, flash_bank_list(), flash_bank::next, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_erase_address_command | ) |
Definition at line 226 of file flash/nor/tcl.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, flash_erase_address_range(), flash_set_dirty(), flash_unlock_address_range(), get_current_target(), get_flash_bank_by_addr(), length, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_erase_check_command | ) |
Definition at line 179 of file flash/nor/tcl.c.
References flash_bank::base, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), flash_bank::driver, flash_driver::erase_check, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, flash_sector::is_erased, flash_bank::num_sectors, flash_sector::offset, flash_bank::sectors, flash_sector::size, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_erase_command | ) |
Definition at line 287 of file flash/nor/tcl.c.
References flash_bank::bank_number, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_measure(), duration_start(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_driver_erase(), and flash_bank::num_sectors.
COMMAND_HANDLER | ( | handle_flash_fill_command | ) |
Definition at line 515 of file flash/nor/tcl.c.
References bank, buffer, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, command_print(), count, duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_driver_read(), flash_driver_write(), flash_write_align_end(), flash_write_align_start(), get_current_target(), get_flash_bank_by_addr(), LOG_ERROR, LOG_INFO, LOG_WARNING, TARGET_ADDR_FMT, target_buffer_get_u16(), target_buffer_get_u32(), target_buffer_get_u64(), target_buffer_set_u16(), target_buffer_set_u32(), and target_buffer_set_u64().
COMMAND_HANDLER | ( | handle_flash_info_command | ) |
Definition at line 58 of file flash/nor/tcl.c.
References flash_driver::auto_probe, flash_bank::bank_number, flash_bank::base, flash_bank::bus_width, CALL_COMMAND_HANDLER, flash_bank::chip_width, CMD, CMD_ARGC, CMD_ARGV, command_print(), command_print_sameline(), flash_bank::driver, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, flash_driver::info, flash_sector::is_protected, LOG_ERROR, LOG_INFO, flash_driver::name, flash_bank::num_prot_blocks, flash_bank::num_sectors, offset, flash_bank::prot_blocks, flash_driver::protect_check, flash_bank::sectors, flash_bank::size, size, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_init_command | ) |
Definition at line 1363 of file flash/nor/tcl.c.
References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, flash_init_drivers(), LOG_DEBUG, and LOG_INFO.
COMMAND_HANDLER | ( | handle_flash_md_command | ) |
Definition at line 670 of file flash/nor/tcl.c.
References bank, buffer, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, command_print(), count, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_driver_read(), get_current_target(), get_flash_bank_by_addr(), offset, and target_handle_md_output().
COMMAND_HANDLER | ( | handle_flash_padded_value_command | ) |
Definition at line 1057 of file flash/nor/tcl.c.
References flash_bank::bank_number, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), flash_bank::default_padded_value, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | handle_flash_probe_command | ) |
Definition at line 152 of file flash/nor/tcl.c.
References flash_bank::base, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), flash_bank::driver, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_driver::name, flash_driver::probe, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_protect_command | ) |
Definition at line 335 of file flash/nor/tcl.c.
References flash_bank::bank_number, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, COMMAND_PARSE_ON_OFF, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_driver_protect(), flash_bank::num_prot_blocks, and flash_bank::num_sectors.
COMMAND_HANDLER | ( | handle_flash_read_bank_command | ) |
Definition at line 845 of file flash/nor/tcl.c.
References flash_bank::bank_number, buffer, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, FILEIO_BINARY, fileio_close(), fileio_open(), fileio_write(), FILEIO_WRITE, flash_driver_read(), length, LOG_ERROR, offset, and flash_bank::size.
COMMAND_HANDLER | ( | handle_flash_verify_bank_command | ) |
Definition at line 925 of file flash/nor/tcl.c.
References flash_bank::bank_number, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, FILEIO_BINARY, fileio_close(), fileio_open(), fileio_read(), FILEIO_READ, fileio_size(), flash_driver_read(), keep_alive(), length, LOG_ERROR, LOG_INFO, MIN, offset, and flash_bank::size.
COMMAND_HANDLER | ( | handle_flash_verify_image_command | ) |
Definition at line 463 of file flash/nor/tcl.c.
References image::base_address, image::base_address_set, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_write_unlock_verify(), get_current_target(), image_close(), image_open(), LOG_ERROR, NULL, and image::start_address_set.
COMMAND_HANDLER | ( | handle_flash_write_bank_command | ) |
Definition at line 731 of file flash/nor/tcl.c.
References bank, buffer, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, FILEIO_BINARY, fileio_close(), fileio_open(), fileio_read(), FILEIO_READ, fileio_size(), flash_driver_write(), flash_write_align_end(), flash_write_align_start(), length, LOG_ERROR, LOG_INFO, LOG_WARNING, MIN, offset, and TARGET_ADDR_FMT.
COMMAND_HANDLER | ( | handle_flash_write_image_command | ) |
Definition at line 392 of file flash/nor/tcl.c.
References image::base_address, image::base_address_set, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), duration_elapsed(), duration_kbps(), duration_measure(), duration_start(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_write_unlock_verify(), get_current_target(), image_close(), image_open(), LOG_ERROR, NULL, and image::start_address_set.
COMMAND_HELPER | ( | flash_command_get_bank | , |
unsigned | name_index, | ||
struct flash_bank ** | bank | ||
) |
Retrieves bank from a command argument, reporting errors parsing the bank identifier or retrieving the specified bank.
The bank may be identified by its bank number or by name.instance
, where instance is driver-specific.
name_index | The index to the string in args containing the bank identifier. |
bank | On output, contains a pointer to the bank or NULL. |
Definition at line 51 of file flash/nor/tcl.c.
References bank, and CALL_COMMAND_HANDLER.
|
static |
Definition at line 22 of file flash/nor/tcl.c.
References bank, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_FAIL, ERROR_OK, get_flash_bank_by_name(), get_flash_bank_by_name_noprobe(), get_flash_bank_by_num(), get_flash_bank_by_num_noprobe(), and name.
|
static |
Definition at line 1234 of file flash/nor/tcl.c.
References ERROR_OK, flash_bank_list(), flash_exec_command_handlers, and register_commands().
Referenced by COMMAND_HANDLER().
int flash_register_commands | ( | struct command_context * | cmd_ctx | ) |
Registers the 'flash' subsystem commands.
Definition at line 1423 of file flash/nor/tcl.c.
References flash_command_handlers, NULL, and register_commands().
Referenced by setup_command_handler().
void flash_set_dirty | ( | void | ) |
Forces targets to re-examine their erase/protection state.
This routine must be called when the system may modify the status.
Definition at line 1046 of file flash/nor/tcl.c.
References flash_bank_list(), flash_sector::is_erased, flash_bank::next, flash_bank::num_sectors, and flash_bank::sectors.
Referenced by COMMAND_HANDLER(), flash_write_unlock_verify(), and gdb_v_packet().
|
static |
Definition at line 1327 of file flash/nor/tcl.c.
References flash_bank_list(), flash_bank::next, NULL, and target_name().
|
static |
Definition at line 1363 of file flash/nor/tcl.c.
Referenced by flash_register_commands().
|
static |
Definition at line 1363 of file flash/nor/tcl.c.
|
static |
Definition at line 1057 of file flash/nor/tcl.c.
Referenced by flash_init_drivers().