OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | efm32_family_data |
struct | efm32_info |
struct | efm32x_flash_chip |
Enumerations | |
enum | efm32_bank_index { EFM32_BANK_INDEX_MAIN , EFM32_BANK_INDEX_USER_DATA , EFM32_BANK_INDEX_LOCK_BITS , EFM32_N_BANKS } |
Functions | |
COMMAND_HANDLER (efm32x_handle_debuglock_command) | |
static int | efm32x_auto_probe (struct flash_bank *bank) |
static int | efm32x_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | efm32x_erase_page (struct flash_bank *bank, uint32_t addr) |
static void | efm32x_free_driver_priv (struct flash_bank *bank) |
Remove flash structure corresponding to this bank, if and only if it's not used by any others. More... | |
static int | efm32x_get_bank_index (target_addr_t base) |
static int | efm32x_get_flash_size (struct flash_bank *bank, uint16_t *flash_sz) |
static int | efm32x_get_page_lock (struct flash_bank *bank, size_t page) |
static int | efm32x_get_part_family (struct flash_bank *bank, uint8_t *pfamily) |
static int | efm32x_get_part_num (struct flash_bank *bank, uint16_t *pnum) |
static int | efm32x_get_prod_rev (struct flash_bank *bank, uint8_t *prev) |
static int | efm32x_get_ram_size (struct flash_bank *bank, uint16_t *ram_sz) |
static int | efm32x_msc_lock (struct flash_bank *bank, int lock) |
static int | efm32x_priv_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t addr, uint32_t count) |
static int | efm32x_probe (struct flash_bank *bank) |
static int | efm32x_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | efm32x_protect_check (struct flash_bank *bank) |
static int | efm32x_read_info (struct flash_bank *bank) |
static int | efm32x_read_lock_data (struct flash_bank *bank) |
static int | efm32x_read_reg_u32 (struct flash_bank *bank, target_addr_t offset, uint32_t *value) |
static int | efm32x_set_page_lock (struct flash_bank *bank, size_t page, int set) |
static int | efm32x_set_reg_bits (struct flash_bank *bank, uint32_t reg, uint32_t bitmask, int set) |
static int | efm32x_set_wren (struct flash_bank *bank, int write_enable) |
static int | efm32x_wait_status (struct flash_bank *bank, int timeout, uint32_t wait_mask, int wait_for_set) |
static int | efm32x_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | efm32x_write_block (struct flash_bank *bank, const uint8_t *buf, uint32_t address, uint32_t count) |
static int | efm32x_write_lock_data (struct flash_bank *bank) |
static int | efm32x_write_only_lockbits (struct flash_bank *bank) |
static int | efm32x_write_reg_u32 (struct flash_bank *bank, target_addr_t offset, uint32_t value) |
static int | efm32x_write_word (struct flash_bank *bank, uint32_t addr, uint32_t val) |
FLASH_BANK_COMMAND_HANDLER (efm32x_flash_bank_command) | |
static int | get_efm32x_info (struct flash_bank *bank, struct command_invocation *cmd) |
Variables | |
static const struct efm32_family_data | efm32_families [] |
const struct flash_driver | efm32_flash |
static const struct command_registration | efm32x_command_handlers [] |
static const struct command_registration | efm32x_exec_command_handlers [] |
#define EFM32_MSC_DEV_INFO (EFM32_MSC_INFO_BASE+0x8000) |
#define EFM32_MSC_DI_FLASH_SZ (EFM32_MSC_DEV_INFO+0x1f8) |
#define EFM32_MSC_DI_PAGE_SIZE (EFM32_MSC_DEV_INFO+0x1e7) |
#define EFM32_MSC_DI_PART_FAMILY (EFM32_MSC_DEV_INFO+0x1fe) |
#define EFM32_MSC_DI_PART_NUM (EFM32_MSC_DEV_INFO+0x1fc) |
#define EFM32_MSC_DI_PROD_REV (EFM32_MSC_DEV_INFO+0x1ff) |
#define EFM32_MSC_DI_RAM_SZ (EFM32_MSC_DEV_INFO+0x1fa) |
#define EFM32_MSC_LOCK_BITS (EFM32_MSC_INFO_BASE+0x4000) |
#define EFM32_MSC_LOCK_BITS_EXTRA (EFM32_MSC_LOCK_BITS+LOCKWORDS_SZ) |
#define EFM32_MSC_USER_DATA EFM32_MSC_INFO_BASE |
enum efm32_bank_index |
COMMAND_HANDLER | ( | efm32x_handle_debuglock_command | ) |
Definition at line 1153 of file efm32.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), efm32x_write_lock_data(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, efm32x_flash_chip::lb_page, LOG_ERROR, NULL, target::state, and TARGET_HALTED.
|
static |
Definition at line 1101 of file efm32.c.
References bank, efm32x_get_bank_index(), efm32x_probe(), ERROR_OK, and efm32x_flash_chip::probed.
|
static |
Definition at line 499 of file efm32.c.
References bank, EFM32_MSC_LOCK_BITS, efm32x_erase_page(), efm32x_msc_lock(), efm32x_set_wren(), efm32x_write_only_lockbits(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 454 of file efm32.c.
References addr, bank, EFM32_FLASH_ERASE_TMO, EFM32_MSC_REG_ADDRB, EFM32_MSC_REG_STATUS, EFM32_MSC_REG_WRITECMD, EFM32_MSC_STATUS_BUSY_MASK, EFM32_MSC_STATUS_INVADDR_MASK, EFM32_MSC_STATUS_LOCKED_MASK, EFM32_MSC_WRITECMD_ERASEPAGE_MASK, EFM32_MSC_WRITECMD_LADDRIM_MASK, efm32x_read_reg_u32(), efm32x_set_reg_bits(), efm32x_wait_status(), efm32x_write_reg_u32(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, and status.
Referenced by efm32x_erase(), and efm32x_write_lock_data().
|
static |
Remove flash structure corresponding to this bank, if and only if it's not used by any others.
Definition at line 374 of file efm32.c.
References bank, NULL, and efm32x_flash_chip::refcount.
|
static |
Definition at line 88 of file efm32.c.
Referenced by efm32x_auto_probe(), efm32x_probe(), and FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 203 of file efm32.c.
References bank, EFM32_MSC_DI_FLASH_SZ, and target_read_u16().
Referenced by efm32x_read_info().
|
static |
Definition at line 658 of file efm32.c.
References bank, EFM32_FLASH_BASE, EFM32_MSC_LOCK_BITS, EFM32_MSC_USER_DATA, efm32x_flash_chip::lb_page, and mask.
Referenced by efm32x_protect_check().
|
static |
Definition at line 218 of file efm32.c.
References bank, EFM32_MSC_DI_PART_FAMILY, and target_read_u8().
Referenced by efm32x_read_info().
|
static |
Definition at line 213 of file efm32.c.
References bank, EFM32_MSC_DI_PART_NUM, and target_read_u16().
Referenced by efm32x_read_info().
|
static |
Definition at line 223 of file efm32.c.
References bank, EFM32_MSC_DI_PROD_REV, and target_read_u8().
Referenced by efm32x_read_info().
|
static |
Definition at line 208 of file efm32.c.
References bank, EFM32_MSC_DI_RAM_SZ, and target_read_u16().
Referenced by efm32x_read_info().
|
static |
Definition at line 415 of file efm32.c.
References bank, EFM32_MSC_LOCK_LOCKKEY, efm32x_write_reg_u32(), and efm32x_flash_chip::reg_lock.
Referenced by efm32x_erase(), and efm32x_priv_write().
|
static |
Definition at line 963 of file efm32.c.
References addr, bank, buffer, count, efm32x_msc_lock(), efm32x_set_wren(), efm32x_write_block(), efm32x_write_word(), ERROR_FAIL, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, target::state, and TARGET_HALTED.
Referenced by efm32x_write(), efm32x_write_lock_data(), and efm32x_write_only_lockbits().
|
static |
Definition at line 1048 of file efm32.c.
References bank, EFM32_FLASH_BASE, efm32x_get_bank_index(), efm32x_read_info(), efm32x_read_lock_data(), ERROR_OK, efm32_info::family_data, efm32_info::flash_sz_kib, efm32x_flash_chip::info, efm32x_flash_chip::lb_page, LOCKWORDS_SZ, LOG_ERROR, LOG_INFO, efm32_family_data::name, NULL, efm32_info::page_size, efm32x_flash_chip::probed, and efm32_info::prod_rev.
Referenced by efm32x_auto_probe().
|
static |
Definition at line 704 of file efm32.c.
References bank, efm32x_set_page_lock(), efm32x_write_lock_data(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 1113 of file efm32.c.
References bank, efm32x_get_page_lock(), efm32x_read_lock_data(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 246 of file efm32.c.
References ARRAY_SIZE, bank, efm32_families, EFM32_MSC_DI_PAGE_SIZE, EFM32_MSC_REG_LOCK, EFM32_MSC_REG_LOCK_SERIES1, EFM32_MSC_REGBASE, EFM32_MSC_REGBASE_SERIES1, efm32x_get_flash_size(), efm32x_get_part_family(), efm32x_get_part_num(), efm32x_get_prod_rev(), efm32x_get_ram_size(), EFM_FAMILY_ID_GIANT_GECKO, EFM_FAMILY_ID_LEOPARD_GECKO, ERROR_FAIL, ERROR_OK, efm32_info::family_data, efm32_info::flash_sz_kib, efm32x_flash_chip::info, LOG_ERROR, efm32_family_data::msc_regbase, efm32_family_data::page_size, efm32_info::page_size, efm32_info::part_family, efm32_info::part_num, efm32_info::prod_rev, efm32_info::ram_sz_kib, efm32x_flash_chip::reg_base, efm32x_flash_chip::reg_lock, efm32_family_data::series, and target_read_u8().
Referenced by efm32x_probe(), and get_efm32x_info().
|
static |
Definition at line 537 of file efm32.c.
References bank, EFM32_MSC_LOCK_BITS, ERROR_OK, efm32x_flash_chip::lb_page, LOG_ERROR, NULL, and target_read_u32().
Referenced by efm32x_probe(), and efm32x_protect_check().
|
static |
Definition at line 228 of file efm32.c.
References bank, offset, efm32x_flash_chip::reg_base, and target_read_u32().
Referenced by efm32x_erase_page(), efm32x_set_reg_bits(), efm32x_wait_status(), and efm32x_write_word().
|
static |
Definition at line 682 of file efm32.c.
References bank, EFM32_FLASH_BASE, ERROR_FAIL, ERROR_OK, efm32x_flash_chip::lb_page, LOG_ERROR, and mask.
Referenced by efm32x_protect().
|
static |
Definition at line 391 of file efm32.c.
References bank, efm32x_read_reg_u32(), efm32x_write_reg_u32(), and ERROR_OK.
Referenced by efm32x_erase_page(), efm32x_set_wren(), and efm32x_write_word().
|
static |
Definition at line 409 of file efm32.c.
References bank, EFM32_MSC_REG_WRITECTRL, EFM32_MSC_WRITECTRL_WREN_MASK, and efm32x_set_reg_bits().
Referenced by efm32x_erase(), and efm32x_priv_write().
|
static |
Definition at line 422 of file efm32.c.
References alive_sleep(), bank, EFM32_MSC_REG_STATUS, EFM32_MSC_STATUS_ERASEABORTED_MASK, efm32x_read_reg_u32(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, LOG_WARNING, and status.
Referenced by efm32x_erase_page(), and efm32x_write_word().
|
static |
Definition at line 1038 of file efm32.c.
References bank, buffer, count, EFM32_MSC_LOCK_BITS, efm32x_priv_write(), ERROR_FAIL, LOCKWORDS_SZ, LOG_ERROR, and offset.
|
static |
Definition at line 732 of file efm32.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_get_u32(), buf_set_u32(), armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, count, destroy_reg_param(), EFM32_MSC_STATUS_INVADDR_MASK, EFM32_MSC_STATUS_LOCKED_MASK, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), LOG_ERROR, LOG_WARNING, NULL, PARAM_IN_OUT, PARAM_OUT, efm32x_flash_chip::reg_base, source, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_run_flash_async_algorithm(), and target_write_buffer().
Referenced by efm32x_priv_write().
|
static |
Definition at line 619 of file efm32.c.
References bank, EFM32_MSC_LOCK_BITS, EFM32_MSC_LOCK_BITS_EXTRA, efm32x_erase_page(), efm32x_priv_write(), efm32x_write_only_lockbits(), ERROR_OK, efm32x_flash_chip::info, LOCKWORDS_SZ, LOG_ERROR, NULL, efm32_info::page_size, and target_read_buffer().
Referenced by COMMAND_HANDLER(), and efm32x_protect().
|
static |
Definition at line 613 of file efm32.c.
References bank, EFM32_MSC_LOCK_BITS, efm32x_priv_write(), efm32x_flash_chip::lb_page, and LOCKWORDS_SZ.
Referenced by efm32x_erase(), and efm32x_write_lock_data().
|
static |
Definition at line 237 of file efm32.c.
References bank, offset, efm32x_flash_chip::reg_base, and target_write_u32().
Referenced by efm32x_erase_page(), efm32x_msc_lock(), efm32x_set_reg_bits(), and efm32x_write_word().
|
static |
Definition at line 888 of file efm32.c.
References addr, bank, EFM32_FLASH_WDATAREADY_TMO, EFM32_FLASH_WRITE_TMO, EFM32_MSC_REG_ADDRB, EFM32_MSC_REG_STATUS, EFM32_MSC_REG_WDATA, EFM32_MSC_REG_WRITECMD, EFM32_MSC_STATUS_BUSY_MASK, EFM32_MSC_STATUS_INVADDR_MASK, EFM32_MSC_STATUS_LOCKED_MASK, EFM32_MSC_STATUS_WDATAREADY_MASK, EFM32_MSC_WRITECMD_LADDRIM_MASK, EFM32_MSC_WRITECMD_WRITEONCE_MASK, efm32x_read_reg_u32(), efm32x_set_reg_bits(), efm32x_wait_status(), efm32x_write_reg_u32(), ERROR_FAIL, ERROR_OK, keep_alive(), LOG_DEBUG, LOG_ERROR, and status.
Referenced by efm32x_priv_write().
FLASH_BANK_COMMAND_HANDLER | ( | efm32x_flash_bank_command | ) |
Definition at line 333 of file efm32.c.
References bank, CMD_ARGC, efm32_flash, efm32x_get_bank_index(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_bank_list(), efm32x_flash_chip::lb_page, LOCKWORDS_SZ, LOG_ERROR, flash_bank::next, NULL, and efm32x_flash_chip::refcount.
|
static |
Definition at line 1137 of file efm32.c.
References bank, cmd, command_print_sameline(), efm32x_read_info(), ERROR_OK, efm32_info::family_data, efm32x_flash_chip::info, LOG_ERROR, efm32_family_data::name, and efm32_info::prod_rev.
|
static |
Definition at line 88 of file efm32.c.
Referenced by efm32x_read_info().
const struct flash_driver efm32_flash |
Definition at line 88 of file efm32.c.
Referenced by FLASH_BANK_COMMAND_HANDLER().
|
static |
|
static |