OpenOCD
flash/nor/tcl.c File Reference

Implements Tcl commands used to access NOR flash facilities. More...

Include dependency graph for flash/nor/tcl.c:

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_list)
 
 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...
 
 COMMAND_HELPER (flash_command_get_bank_probe_optional, unsigned int name_index, struct flash_bank **bank, bool do_probe)
 Retrieves bank from a command argument, reporting errors parsing the bank identifier or retrieving the specified bank. More...
 
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...
 

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 []
 

Detailed Description

Implements Tcl commands used to access NOR flash facilities.

Definition in file flash/nor/tcl.c.

Function Documentation

◆ COMMAND_HANDLER() [1/18]

◆ COMMAND_HANDLER() [2/18]

COMMAND_HANDLER ( handle_flash_banks_command  )

◆ COMMAND_HANDLER() [3/18]

◆ COMMAND_HANDLER() [4/18]

◆ COMMAND_HANDLER() [5/18]

◆ COMMAND_HANDLER() [6/18]

◆ COMMAND_HANDLER() [7/18]

◆ COMMAND_HANDLER() [8/18]

COMMAND_HANDLER ( handle_flash_init_command  )

◆ COMMAND_HANDLER() [9/18]

COMMAND_HANDLER ( handle_flash_list  )

◆ COMMAND_HANDLER() [10/18]

◆ COMMAND_HANDLER() [11/18]

COMMAND_HANDLER ( handle_flash_padded_value_command  )

◆ COMMAND_HANDLER() [12/18]

◆ COMMAND_HANDLER() [13/18]

◆ COMMAND_HANDLER() [14/18]

◆ COMMAND_HANDLER() [15/18]

◆ COMMAND_HANDLER() [16/18]

◆ COMMAND_HANDLER() [17/18]

◆ COMMAND_HANDLER() [18/18]

◆ COMMAND_HELPER() [1/2]

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.

Parameters
name_indexThe index to the string in args containing the bank identifier.
bankOn output, contains a pointer to the bank or NULL.
Returns
ERROR_OK on success, or an error indicating the problem.

Definition at line 51 of file flash/nor/tcl.c.

References bank, and CALL_COMMAND_HANDLER.

◆ COMMAND_HELPER() [2/2]

COMMAND_HELPER ( flash_command_get_bank_probe_optional  ,
unsigned int  name_index,
struct flash_bank **  bank,
bool  do_probe 
)

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.

Parameters
name_indexThe index to the string in args containing the bank identifier.
bankOn output, contains a pointer to the bank or NULL.
do_probeDoes auto-probing when set, otherwise without probing.
Returns
ERROR_OK on success, or an error indicating the problem.

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.

◆ flash_init_drivers()

static int flash_init_drivers ( struct command_context cmd_ctx)
static

◆ flash_register_commands()

int flash_register_commands ( struct command_context cmd_ctx)

Registers the 'flash' subsystem commands.

Definition at line 1412 of file flash/nor/tcl.c.

References flash_command_handlers, NULL, and register_commands().

Referenced by setup_command_handler().

◆ flash_set_dirty()

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 1047 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().

Variable Documentation

◆ flash_command_handlers

const struct command_registration flash_command_handlers[]
static
Initial value:
= {
{
.name = "flash",
.mode = COMMAND_ANY,
.help = "NOR flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration flash_config_command_handlers[]
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:241

Definition at line 1351 of file flash/nor/tcl.c.

Referenced by flash_register_commands().

◆ flash_config_command_handlers

const struct command_registration flash_config_command_handlers[]
static

Definition at line 1351 of file flash/nor/tcl.c.

◆ flash_exec_command_handlers

const struct command_registration flash_exec_command_handlers[]
static

Definition at line 1058 of file flash/nor/tcl.c.

Referenced by flash_init_drivers().