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

Detailed Description

Implements Tcl commands used to access NOR flash facilities.

Definition in file flash/nor/tcl.c.

Function Documentation

◆ COMMAND_HANDLER() [1/17]

◆ COMMAND_HANDLER() [2/17]

COMMAND_HANDLER ( handle_flash_banks_command  )

◆ COMMAND_HANDLER() [3/17]

◆ COMMAND_HANDLER() [4/17]

◆ COMMAND_HANDLER() [5/17]

◆ COMMAND_HANDLER() [6/17]

◆ COMMAND_HANDLER() [7/17]

◆ COMMAND_HANDLER() [8/17]

COMMAND_HANDLER ( handle_flash_init_command  )

◆ COMMAND_HANDLER() [9/17]

◆ COMMAND_HANDLER() [10/17]

COMMAND_HANDLER ( handle_flash_padded_value_command  )

◆ COMMAND_HANDLER() [11/17]

◆ COMMAND_HANDLER() [12/17]

◆ COMMAND_HANDLER() [13/17]

◆ COMMAND_HANDLER() [14/17]

◆ COMMAND_HANDLER() [15/17]

◆ COMMAND_HANDLER() [16/17]

◆ COMMAND_HANDLER() [17/17]

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

static COMMAND_HELPER ( flash_command_get_bank_maybe_probe  ,
unsigned  name_index,
struct flash_bank **  bank,
bool  do_probe 
)
static

◆ 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 1423 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 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().

◆ jim_flash_list()

static int jim_flash_list ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

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

References flash_bank_list(), flash_bank::next, NULL, and target_name().

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:247
@ 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:235

Definition at line 1363 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 1363 of file flash/nor/tcl.c.

◆ flash_exec_command_handlers

const struct command_registration flash_exec_command_handlers[]
static

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

Referenced by flash_init_drivers().