OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | em357_flash_bank |
struct | em357_options |
Macros | |
#define | EM357_FLASH_ACR 0x40008000 |
#define | EM357_FLASH_AR 0x40008014 |
#define | EM357_FLASH_CR 0x40008010 |
#define | EM357_FLASH_KEYR 0x40008004 |
#define | EM357_FLASH_OBR 0x4000801C |
#define | EM357_FLASH_OPTKEYR 0x40008008 |
#define | EM357_FLASH_SR 0x4000800C |
#define | EM357_FLASH_WRPR 0x40008020 |
#define | EM357_FPEC_CLK 0x4000402c |
#define | EM357_OB_RDP 0x08040800 |
#define | EM357_OB_WRP0 0x08040808 |
#define | EM357_OB_WRP1 0x0804080A |
#define | EM357_OB_WRP2 0x0804080C |
#define | FLASH_BSY (1 << 0) |
#define | FLASH_EOP (1 << 5) |
#define | FLASH_LOCK (1 << 7) |
#define | FLASH_MER (1 << 2) |
#define | FLASH_OPTER (1 << 5) |
#define | FLASH_OPTPG (1 << 4) |
#define | FLASH_OPTWRE (1 << 9) |
#define | FLASH_PER (1 << 1) |
#define | FLASH_PG (1 << 0) |
#define | FLASH_PGERR (1 << 2) |
#define | FLASH_STRT (1 << 6) |
#define | FLASH_WRPRTERR (1 << 4) |
#define | KEY1 0x45670123 |
#define | KEY2 0xCDEF89AB |
#define | OPT_ERROR 0 |
#define | OPT_READOUT 1 |
Functions | |
COMMAND_HANDLER (em357_handle_lock_command) | |
COMMAND_HANDLER (em357_handle_mass_erase_command) | |
COMMAND_HANDLER (em357_handle_unlock_command) | |
static int | em357_auto_probe (struct flash_bank *bank) |
static int | em357_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | em357_erase_options (struct flash_bank *bank) |
static int | em357_get_flash_status (struct flash_bank *bank, uint32_t *status) |
static int | em357_mass_erase (struct flash_bank *bank) |
static int | em357_probe (struct flash_bank *bank) |
static int | em357_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | em357_protect_check (struct flash_bank *bank) |
static int | em357_read_options (struct flash_bank *bank) |
static int | em357_wait_status_busy (struct flash_bank *bank, int timeout) |
static int | em357_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | em357_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | em357_write_options (struct flash_bank *bank) |
FLASH_BANK_COMMAND_HANDLER (em357_flash_bank_command) | |
Variables | |
static const struct command_registration | em357_command_handlers [] |
static const struct command_registration | em357_exec_command_handlers [] |
const struct flash_driver | em357_flash |
COMMAND_HANDLER | ( | em357_handle_lock_command | ) |
Definition at line 741 of file em357.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), em357_erase_options(), em357_write_options(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, NULL, em357_flash_bank::option_bytes, em357_options::RDP, target::state, and TARGET_HALTED.
COMMAND_HANDLER | ( | em357_handle_mass_erase_command | ) |
Definition at line 856 of file em357.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), em357_mass_erase(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | em357_handle_unlock_command | ) |
Definition at line 781 of file em357.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), em357_erase_options(), em357_write_options(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, NULL, target::state, and TARGET_HALTED.
|
static |
Definition at line 733 of file em357.c.
References bank, em357_probe(), ERROR_OK, and em357_flash_bank::probed.
|
static |
Definition at line 335 of file em357.c.
References bank, EM357_FLASH_AR, EM357_FLASH_CR, EM357_FLASH_KEYR, EM357_FPEC_CLK, em357_mass_erase(), em357_wait_status_busy(), ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_LOCK, FLASH_PER, FLASH_STRT, KEY1, KEY2, LOG_ERROR, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 179 of file em357.c.
References bank, EM357_FLASH_CR, EM357_FLASH_KEYR, EM357_FLASH_OPTKEYR, em357_read_options(), em357_wait_status_busy(), ERROR_OK, FLASH_OPTER, FLASH_OPTWRE, FLASH_STRT, KEY1, KEY2, NULL, em357_flash_bank::option_bytes, em357_options::RDP, and target_write_u32().
Referenced by COMMAND_HANDLER(), and em357_protect().
|
inlinestatic |
Definition at line 101 of file em357.c.
References bank, EM357_FLASH_SR, status, and target_read_u32().
Referenced by em357_wait_status_busy().
|
static |
Definition at line 817 of file em357.c.
References bank, EM357_FLASH_CR, EM357_FLASH_KEYR, EM357_FPEC_CLK, em357_wait_status_busy(), ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_LOCK, FLASH_MER, FLASH_STRT, KEY1, KEY2, LOG_ERROR, target::state, TARGET_HALTED, and target_write_u32().
Referenced by COMMAND_HANDLER(), and em357_erase().
|
static |
Definition at line 661 of file em357.c.
References bank, EM357_FPEC_CLK, ERROR_OK, LOG_INFO, LOG_WARNING, em357_flash_bank::ppage_size, em357_flash_bank::probed, and target_write_u32().
Referenced by em357_auto_probe().
|
static |
Definition at line 383 of file em357.c.
References bank, bit(), em357_erase_options(), EM357_FLASH_WRPR, em357_write_options(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_WARNING, NULL, em357_flash_bank::option_bytes, em357_flash_bank::ppage_size, em357_options::protection, protection, target::state, status, TARGET_HALTED, and target_read_u32().
|
static |
Definition at line 300 of file em357.c.
References bank, EM357_FLASH_WRPR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, em357_flash_bank::ppage_size, protection, target::state, TARGET_HALTED, and target_read_u32().
|
static |
Definition at line 148 of file em357.c.
References bank, EM357_FLASH_OBR, EM357_FLASH_WRPR, ERROR_OK, LOG_INFO, NULL, OPT_READOUT, em357_flash_bank::option_bytes, em357_options::protection, em357_options::RDP, target_read_u32(), and em357_options::user_options.
Referenced by em357_erase_options().
|
static |
Definition at line 107 of file em357.c.
References alive_sleep(), bank, EM357_FLASH_SR, em357_get_flash_status(), ERROR_FAIL, ERROR_OK, FLASH_BSY, FLASH_PGERR, FLASH_WRPRTERR, LOG_DEBUG, LOG_ERROR, status, and target_write_u32().
Referenced by em357_erase(), em357_erase_options(), em357_mass_erase(), em357_write(), and em357_write_options().
|
static |
Definition at line 571 of file em357.c.
References bank, buffer, count, EM357_FLASH_CR, EM357_FLASH_KEYR, EM357_FPEC_CLK, em357_wait_status_busy(), em357_write_block(), ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FLASH_LOCK, FLASH_PG, KEY1, KEY2, LOG_ERROR, LOG_WARNING, offset, TARGET_HALTED, target_write_u16(), and target_write_u32().
|
static |
Definition at line 444 of file em357.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(), EM357_FLASH_SR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FLASH_PGERR, FLASH_WRPRTERR, init_reg_param(), LOG_ERROR, LOG_WARNING, NULL, offset, PARAM_IN_OUT, PARAM_OUT, source, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_run_algorithm(), target_write_buffer(), and target_write_u32().
Referenced by em357_write().
|
static |
Definition at line 225 of file em357.c.
References bank, EM357_FLASH_CR, EM357_FLASH_KEYR, EM357_FLASH_OPTKEYR, EM357_OB_RDP, EM357_OB_WRP0, EM357_OB_WRP1, EM357_OB_WRP2, em357_wait_status_busy(), ERROR_OK, FLASH_LOCK, FLASH_OPTPG, FLASH_OPTWRE, KEY1, KEY2, NULL, em357_flash_bank::option_bytes, em357_options::protection, em357_options::RDP, target_write_u16(), and target_write_u32().
Referenced by COMMAND_HANDLER(), and em357_protect().
FLASH_BANK_COMMAND_HANDLER | ( | em357_flash_bank_command | ) |
Definition at line 86 of file em357.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and em357_flash_bank::probed.
|
static |
|
static |
const struct flash_driver em357_flash |