Go to the source code of this file.
|
enum | fm3_flash_type { FM3_NO_FLASH_TYPE = 0
, FM3_FLASH_TYPE1 = 1
, FM3_FLASH_TYPE2 = 2
} |
|
enum | fm3_variant {
MB9BFXX1
, MB9BFXX2
, MB9BFXX3
, MB9BFXX4
,
MB9BFXX5
, MB9BFXX6
, MB9BFXX7
, MB9BFXX8
,
MB9AFXX1
, MB9AFXX2
, MB9AFXX3
, MB9AFXX4
,
MB9AFXX5
, MB9AFXX6
, MB9AFXX7
, MB9AFXX8
} |
|
◆ FLASH_DQ5
#define FLASH_DQ5 0x20 /* Time limit exceeding flag bit (TLOV) position */ |
Definition at line 22 of file fm3.c.
◆ FLASH_DQ6
#define FLASH_DQ6 0x40 /* Data toggle flag bit (TOGG) position */ |
Definition at line 21 of file fm3.c.
◆ fm3_flash_type
Enumerator |
---|
FM3_NO_FLASH_TYPE | |
FM3_FLASH_TYPE1 | |
FM3_FLASH_TYPE2 | |
Definition at line 44 of file fm3.c.
◆ fm3_variant
Enumerator |
---|
MB9BFXX1 | |
MB9BFXX2 | |
MB9BFXX3 | |
MB9BFXX4 | |
MB9BFXX5 | |
MB9BFXX6 | |
MB9BFXX7 | |
MB9BFXX8 | |
MB9AFXX1 | |
MB9AFXX2 | |
MB9AFXX3 | |
MB9AFXX4 | |
MB9AFXX5 | |
MB9AFXX6 | |
MB9AFXX7 | |
MB9AFXX8 | |
Definition at line 24 of file fm3.c.
◆ COMMAND_HANDLER()
COMMAND_HANDLER |
( |
fm3_handle_chip_erase_command |
| ) |
|
◆ FLASH_BANK_COMMAND_HANDLER()
FLASH_BANK_COMMAND_HANDLER |
( |
fm3_flash_bank_command |
| ) |
|
Definition at line 56 of file fm3.c.
References bank, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_BANK_INVALID, ERROR_OK, fm3_flash_bank::flashtype, FM3_FLASH_TYPE1, FM3_FLASH_TYPE2, LOG_ERROR, MB9AFXX1, MB9AFXX2, MB9AFXX3, MB9AFXX4, MB9AFXX5, MB9AFXX6, MB9AFXX7, MB9AFXX8, MB9BFXX1, MB9BFXX2, MB9BFXX3, MB9BFXX4, MB9BFXX5, MB9BFXX6, MB9BFXX7, MB9BFXX8, fm3_flash_bank::probed, and fm3_flash_bank::variant.
◆ fm3_auto_probe()
static int fm3_auto_probe |
( |
struct flash_bank * |
bank | ) |
|
|
static |
◆ fm3_busy_wait()
static int fm3_busy_wait |
( |
struct target * |
target, |
|
|
uint32_t |
offset, |
|
|
int |
timeout_ms |
|
) |
| |
|
static |
◆ fm3_chip_erase()
static int fm3_chip_erase |
( |
struct flash_bank * |
bank | ) |
|
|
static |
Definition at line 802 of file fm3.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, fm3_flash_bank::flashtype, fm3_busy_wait(), FM3_FLASH_TYPE1, FM3_FLASH_TYPE2, init_reg_param(), LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, PARAM_OUT, target::state, target_alloc_working_area(), target_free_working_area(), TARGET_HALTED, target_read_u32(), target_run_algorithm(), target_write_buffer(), and target_write_u32().
◆ fm3_erase()
static int fm3_erase |
( |
struct flash_bank * |
bank, |
|
|
unsigned int |
first, |
|
|
unsigned int |
last |
|
) |
| |
|
static |
Definition at line 193 of file fm3.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, fm3_flash_bank::flashtype, fm3_busy_wait(), FM3_FLASH_TYPE1, FM3_FLASH_TYPE2, init_reg_param(), LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, offset, PARAM_OUT, target::state, target_alloc_working_area(), target_free_working_area(), TARGET_HALTED, target_read_u32(), target_run_algorithm(), target_write_buffer(), and target_write_u32().
◆ fm3_probe()
Definition at line 622 of file fm3.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, MB9AFXX1, MB9AFXX2, MB9AFXX4, MB9AFXX5, MB9AFXX6, MB9AFXX7, MB9AFXX8, MB9BFXX1, MB9BFXX2, MB9BFXX4, MB9BFXX5, MB9BFXX6, MB9BFXX7, MB9BFXX8, fm3_flash_bank::probed, TARGET_HALTED, and fm3_flash_bank::variant.
Referenced by fm3_auto_probe().
◆ fm3_write_block()
static int fm3_write_block |
( |
struct flash_bank * |
bank, |
|
|
const uint8_t * |
buffer, |
|
|
uint32_t |
offset, |
|
|
uint32_t |
count |
|
) |
| |
|
static |
Definition at line 337 of file fm3.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_get_u32(), buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, count, destroy_reg_param(), ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, fm3_flash_bank::flashtype, FM3_FLASH_TYPE1, FM3_FLASH_TYPE2, init_reg_param(), LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, offset, PARAM_IN, PARAM_OUT, source, target_alloc_working_area(), target_free_working_area(), target_run_algorithm(), target_write_buffer(), target_write_u32(), and target::working_area_size.
◆ fm3_command_handlers
Initial value:= {
{
.name = "fm3",
.help = "fm3 Flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static const struct command_registration fm3_exec_command_handlers[]
Definition at line 933 of file fm3.c.
◆ fm3_exec_command_handlers
Initial value:= {
{
.name = "chip_erase",
.usage = "<bank>",
.handler = fm3_handle_chip_erase_command,
.help = "Erase entire Flash device.",
},
}
Definition at line 933 of file fm3.c.
◆ fm3_flash
Initial value:= {
.name = "fm3",
.flash_bank_command = fm3_flash_bank_command,
}
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
static int fm3_probe(struct flash_bank *bank)
static int fm3_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
static const struct command_registration fm3_command_handlers[]
static int fm3_auto_probe(struct flash_bank *bank)
static int fm3_write_block(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition at line 933 of file fm3.c.