OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | nrf52_ficr_info |
struct | nrf5_info::nrf5_bank |
struct | nrf5_device_package |
struct | nrf5_device_spec |
struct | nrf5_ficr_map |
struct | nrf5_info |
struct | nrf5_map |
Macros | |
#define | NRF51_DEVICE_DEF(id, pt, var, bcode, fsize) |
#define | NRF5_FICR_REG(offset) (NRF51_52_FICR_BASE + (offset)) |
#define | NRF5_UICR_REG(offset) (NRF51_52_UICR_BASE + (offset)) |
#define | WATCHDOG_REFRESH_VALUE 0x6e524635 |
Functions | |
COMMAND_HANDLER (nrf5_handle_mass_erase_command) | |
FLASH_BANK_COMMAND_HANDLER (nrf5_flash_bank_command) | |
static int | nrf51_52_partno_check (struct nrf5_info *chip) |
static int | nrf51_get_ram_size (struct target *target, uint32_t *ram_size) |
static int | nrf51_protect_check_clenr0 (struct flash_bank *bank) |
static int | nrf51_protect_clenr0 (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | nrf52_protect_check_bprot (struct flash_bank *bank) |
static int | nrf53_91_partno_check (struct nrf5_info *chip) |
static int | nrf5_auto_probe (struct flash_bank *bank) |
static bool | nrf5_bank_is_probed (const struct flash_bank *bank) |
static bool | nrf5_bank_is_uicr (const struct nrf5_bank *nbank) |
static bool | nrf5_chip_is_probed (const struct flash_bank *bank) |
static const char * | nrf5_decode_info_package (uint32_t package) |
static int | nrf5_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | nrf5_erase_page (struct flash_bank *bank, struct nrf5_info *chip, struct flash_sector *sector) |
static void | nrf5_free_driver_priv (struct flash_bank *bank) |
static struct nrf5_info * | nrf5_get_chip (struct target *target) |
static int | nrf5_get_chip_type_str (const struct nrf5_info *chip, char *buf, unsigned int buf_size) |
static int | nrf5_info (struct flash_bank *bank, struct command_invocation *cmd) |
static bool | nrf5_info_variant_to_str (uint32_t variant, char *bf, bool swap) |
static int | nrf5_ll_flash_write (struct nrf5_info *chip, uint32_t address, const uint8_t *buffer, uint32_t bytes) |
static int | nrf5_nvmc_erase_enable (struct nrf5_info *chip) |
static int | nrf5_nvmc_read_only (struct nrf5_info *chip) |
static int | nrf5_nvmc_read_u32 (struct nrf5_info *chip, uint32_t reg_offset, uint32_t *value) |
static int | nrf5_nvmc_write_enable (struct nrf5_info *chip) |
static int | nrf5_nvmc_write_u32 (struct nrf5_info *chip, uint32_t reg_offset, uint32_t value) |
static int | nrf5_probe (struct flash_bank *bank) |
static int | nrf5_probe_chip (struct flash_bank *bank) |
static int | nrf5_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | nrf5_protect_check (struct flash_bank *bank) |
static int | nrf5_read_ficr_info_part (struct nrf5_info *chip, const struct nrf5_map *map, const struct nrf5_ficr_map *ficr_offsets) |
static int | nrf5_read_ficr_more_info (struct nrf5_info *chip) |
static int | nrf5_setup_bank (struct flash_bank *bank) |
static int | nrf5_wait_for_nvmc (struct nrf5_info *chip) |
static int | nrf5_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const struct nrf5_ficr_map | nrf51_52_ficr_offsets |
static const struct nrf5_map | nrf51_52_map |
const struct flash_driver nrf5_flash | nrf51_flash |
static const struct nrf5_device_package | nrf52_packages_table [] |
static const struct nrf5_ficr_map | nrf53_91_ficr_offsets |
static const struct nrf5_map | nrf53app_91_map |
static const struct nrf5_map | nrf53net_map |
static const struct command_registration | nrf5_command_handlers [] |
static const struct command_registration | nrf5_exec_command_handlers [] |
const struct flash_driver | nrf5_flash |
static const struct nrf5_device_spec | nrf5_known_devices_table [] |
static const struct nrf5_ficr_map | nrf91new_ficr_offsets |
#define NRF51_DEVICE_DEF | ( | id, | |
pt, | |||
var, | |||
bcode, | |||
fsize | |||
) |
#define NRF5_FICR_REG | ( | offset | ) | (NRF51_52_FICR_BASE + (offset)) |
#define NRF5_UICR_REG | ( | offset | ) | (NRF51_52_UICR_BASE + (offset)) |
anonymous enum |
enum nrf5_features |
enum nrf5_ficr_registers |
enum nrf5_nvmc_registers |
enum nrf5_uicr_registers |
COMMAND_HANDLER | ( | nrf5_handle_mass_erase_command | ) |
Definition at line 1423 of file nrf5.c.
References bank, CMD_CTX, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, nrf5_info::features, get_current_target(), get_flash_bank_by_addr(), LOG_ERROR, LOG_INFO, NRF51_FICR_PPFC, NRF5_FEATURE_SERIES_51, NRF5_FLASH_BASE, nrf5_nvmc_erase_enable(), NRF5_NVMC_ERASEALL, nrf5_nvmc_read_only(), nrf5_nvmc_write_u32(), nrf5_wait_for_nvmc(), NULL, target::state, TARGET_HALTED, and target_read_u32().
FLASH_BANK_COMMAND_HANDLER | ( | nrf5_flash_bank_command | ) |
Definition at line 1371 of file nrf5.c.
References nrf5_info::bank, bank, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, LOG_ERROR, LOG_WARNING, NRF51_52_UICR_BASE, nrf51_flash, NRF53APP_91_UICR_BASE, NRF53NET_FLASH_BASE, NRF53NET_UICR_BASE, NRF5_FLASH_BASE, nrf5_get_chip(), NULL, nrf5_info::refcount, nrf5_info::target, and TARGET_ADDR_FMT.
|
static |
Definition at line 726 of file nrf5.c.
References ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, nrf5_info::features, nrf5_info::ficr_info, LOG_DEBUG, NRF5_FEATURE_ACL_PROT, NRF5_FEATURE_BPROT, NRF5_FEATURE_SERIES_51, NRF5_FEATURE_SERIES_52, and nrf52_ficr_info::part.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 804 of file nrf5.c.
References ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, NRF51_FICR_NUMRAMBLOCK, NRF51_FICR_SIZERAMBLOCK0, and target_read_u32().
Referenced by nrf5_probe_chip().
|
static |
Definition at line 474 of file nrf5.c.
References bank, ERROR_OK, LOG_ERROR, NRF51_FICR_CLENR0, NRF51_UICR_CLENR0, nrf5_info::target, and target_read_u32().
Referenced by nrf5_erase(), nrf5_protect_check(), and nrf5_write().
|
static |
Definition at line 551 of file nrf5.c.
References bank, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_INFO, NRF51_FICR_PPFC, NRF51_UICR_CLENR0, nrf5_nvmc_read_only(), nrf5_nvmc_write_enable(), nrf5_wait_for_nvmc(), nrf5_info::target, target_read_u32(), and target_write_u32().
Referenced by nrf5_protect().
|
static |
Definition at line 506 of file nrf5.c.
References ARRAY_SIZE, bank, bit(), ERROR_OK, NRF5_BPROT_BASE, nrf5_info::target, and target_read_u32().
Referenced by nrf5_protect_check().
|
static |
Definition at line 761 of file nrf5.c.
References ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, nrf5_info::features, nrf5_info::ficr_info, LOG_DEBUG, NRF5_FEATURE_ERASE_BY_FLASH_WR, NRF5_FEATURE_SERIES_53, NRF5_FEATURE_SERIES_91, and nrf52_ficr_info::part.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 1049 of file nrf5.c.
References bank, ERROR_OK, nrf5_bank_is_probed(), nrf5_chip_is_probed(), nrf5_probe_chip(), and nrf5_setup_bank().
|
static |
|
static |
Definition at line 358 of file nrf5.c.
References nrf5_info::bank.
Referenced by nrf5_protect(), and nrf5_protect_check().
|
static |
Definition at line 351 of file nrf5.c.
References bank, and nrf5_info::chip_probed.
Referenced by nrf5_auto_probe().
|
static |
Definition at line 656 of file nrf5.c.
References ARRAY_SIZE, nrf5_device_package::code, and nrf52_packages_table.
Referenced by nrf5_get_chip_type_str().
|
static |
Definition at line 1283 of file nrf5.c.
References bank, ERROR_FLASH_PROTECTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, nrf5_info::features, LOG_ERROR, nrf51_protect_check_clenr0(), nrf5_erase_page(), NRF5_FEATURE_SERIES_51, nrf5_nvmc_erase_enable(), nrf5_nvmc_read_only(), and TARGET_HALTED.
|
static |
Definition at line 1064 of file nrf5.c.
References alive_sleep(), bank, default_flash_blank_check(), ERROR_FAIL, ERROR_OK, nrf5_info::features, flash_sector::is_erased, LOG_DEBUG, LOG_ERROR, nrf5_info::map, NRF51_FICR_PPFC, NRF5_FEATURE_ERASE_BY_FLASH_WR, NRF5_FEATURE_SERIES_51, NRF5_FEATURE_SERIES_91, NRF5_NVMC_ERASEPAGE, NRF5_NVMC_ERASEUICR, nrf5_nvmc_write_u32(), nrf5_wait_for_nvmc(), flash_sector::offset, nrf5_info::target, target_read_u32(), target_write_u32(), and nrf5_map::uicr_base.
Referenced by nrf5_erase().
|
static |
Definition at line 1335 of file nrf5.c.
References bank, NULL, and nrf5_info::refcount.
Definition at line 1349 of file nrf5.c.
References flash_bank::driver, flash_bank::driver_priv, flash_bank_list(), flash_bank::next, nrf51_flash, nrf5_flash, NULL, and flash_bank::target.
Referenced by FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 665 of file nrf5.c.
References nrf5_device_spec::build_code, ERROR_FAIL, ERROR_OK, nrf5_info::features, nrf5_info::ficr_info, nrf5_info::ficr_info_valid, nrf5_info::hwid, LOG_ERROR, nrf5_decode_info_package(), NRF5_FEATURE_SERIES_53, NRF5_FEATURE_SERIES_91, nrf5_info_variant_to_str(), nrf52_ficr_info::package, nrf52_ficr_info::part, nrf5_device_spec::part, nrf5_info::spec, nrf52_ficr_info::variant, and nrf5_device_spec::variant.
Referenced by nrf5_info(), and nrf5_probe_chip().
|
static |
Definition at line 698 of file nrf5.c.
References bank, cmd, command_print_sameline(), ERROR_FAIL, ERROR_OK, nrf5_info::flash_num_sectors, nrf5_info::flash_page_size, nrf5_get_chip_type_str(), and nrf5_info::ram_size_kb.
|
static |
Definition at line 636 of file nrf5.c.
References h_u32_to_be(), and h_u32_to_le().
Referenced by nrf5_get_chip_type_str().
|
static |
Definition at line 1129 of file nrf5.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, ARRAY_SIZE, buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), LOG_DEBUG, LOG_WARNING, nrf5_info::map, nrf5_wait_for_nvmc(), NULL, PARAM_IN_OUT, PARAM_OUT, source, nrf5_info::target, target_alloc_working_area(), target_free_working_area(), target_run_flash_async_algorithm(), target_write_buffer(), target_write_memory(), nrf5_map::watchdog_refresh_addr, and WATCHDOG_REFRESH_VALUE.
Referenced by nrf5_write().
|
static |
Definition at line 405 of file nrf5.c.
References ERROR_OK, LOG_ERROR, NRF5_NVMC_CONFIG, NRF5_NVMC_CONFIG_EEN, nrf5_nvmc_write_u32(), and nrf5_wait_for_nvmc().
Referenced by COMMAND_HANDLER(), and nrf5_erase().
|
static |
Definition at line 451 of file nrf5.c.
References ERROR_OK, LOG_ERROR, NRF5_NVMC_CONFIG, NRF5_NVMC_CONFIG_REN, nrf5_nvmc_write_u32(), and nrf5_wait_for_nvmc().
Referenced by COMMAND_HANDLER(), nrf51_protect_clenr0(), nrf5_erase(), and nrf5_write().
|
static |
Definition at line 364 of file nrf5.c.
References nrf5_info::map, nrf5_map::nvmc_base, nrf5_info::target, and target_read_u32().
Referenced by nrf5_wait_for_nvmc().
|
static |
Definition at line 428 of file nrf5.c.
References ERROR_OK, LOG_ERROR, NRF5_NVMC_CONFIG, NRF5_NVMC_CONFIG_WEN, nrf5_nvmc_write_u32(), and nrf5_wait_for_nvmc().
Referenced by nrf51_protect_clenr0(), and nrf5_write().
|
static |
Definition at line 369 of file nrf5.c.
References nrf5_info::map, nrf5_map::nvmc_base, nrf5_info::target, and target_write_u32().
Referenced by COMMAND_HANDLER(), nrf5_erase_page(), nrf5_nvmc_erase_enable(), nrf5_nvmc_read_only(), and nrf5_nvmc_write_enable().
|
static |
Definition at line 1039 of file nrf5.c.
References bank, ERROR_OK, nrf5_probe_chip(), and nrf5_setup_bank().
|
static |
Definition at line 837 of file nrf5.c.
References ARRAY_SIZE, bank, nrf5_info::chip_probed, nrf5_ficr_map::codepagesize, nrf5_ficr_map::codesize, nrf5_ficr_map::configid, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, nrf5_device_spec::features, nrf5_info::features, nrf5_map::ficr_base, nrf5_info::ficr_info, nrf5_info::ficr_info_valid, nrf5_info::ficr_offsets, nrf5_info::flash_num_sectors, nrf5_info::flash_page_size, nrf5_device_spec::hwid, nrf5_info::hwid, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, nrf5_info::map, nrf51_52_ficr_offsets, nrf51_52_map, nrf51_52_partno_check(), nrf51_get_ram_size(), nrf53_91_ficr_offsets, nrf53_91_partno_check(), nrf53app_91_map, NRF53APP_91_UICR_BASE, NRF53NET_FLASH_BASE, nrf53net_map, NRF53NET_UICR_BASE, NRF5_FEATURE_SERIES_51, NRF5_FLASH_BASE, nrf5_get_chip_type_str(), nrf5_known_devices_table, nrf5_read_ficr_info_part(), nrf5_read_ficr_more_info(), nrf91new_ficr_offsets, NULL, nrf52_ficr_info::part, nrf5_device_spec::part, nrf52_ficr_info::ram, nrf5_info::ram_size_kb, nrf5_info::spec, nrf5_info::target, and target_read_u32().
Referenced by nrf5_auto_probe(), and nrf5_probe().
|
static |
Definition at line 612 of file nrf5.c.
References bank, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_TARGET_NOT_HALTED, nrf5_info::features, LOG_ERROR, nrf51_protect_clenr0(), nrf5_bank_is_uicr(), NRF5_FEATURE_SERIES_51, and TARGET_HALTED.
|
static |
Definition at line 531 of file nrf5.c.
References bank, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, nrf5_info::features, LOG_WARNING, nrf51_protect_check_clenr0(), nrf52_protect_check_bprot(), nrf5_bank_is_uicr(), NRF5_FEATURE_BPROT, and NRF5_FEATURE_SERIES_51.
|
static |
Definition at line 713 of file nrf5.c.
References ERROR_OK, nrf5_map::ficr_base, nrf5_info::ficr_info, nrf5_ficr_map::info_part, LOG_DEBUG, nrf52_ficr_info::part, nrf5_info::target, and target_read_u32().
Referenced by nrf5_probe_chip().
|
static |
Definition at line 780 of file nrf5.c.
References ERROR_OK, nrf5_map::ficr_base, nrf5_info::ficr_info, nrf5_info::ficr_offsets, nrf52_ficr_info::flash, nrf5_ficr_map::info_flash, nrf5_ficr_map::info_package, nrf5_ficr_map::info_ram, nrf5_ficr_map::info_variant, nrf5_info::map, nrf52_ficr_info::package, nrf52_ficr_info::ram, nrf5_info::target, target_read_u32(), and nrf52_ficr_info::variant.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 997 of file nrf5.c.
References alloc_block_array(), nrf5_info::bank, bank, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, nrf5_info::ficr_info, nrf5_info::ficr_info_valid, nrf52_ficr_info::flash, nrf5_map::flash_base, nrf5_info::flash_num_sectors, nrf5_info::flash_page_size, nrf5_device_spec::flash_size_kb, LOG_ERROR, LOG_WARNING, nrf5_info::map, nrf5_info::nrf5_bank::probed, nrf5_info::spec, TARGET_ADDR_FMT, and nrf5_map::uicr_base.
Referenced by nrf5_auto_probe(), and nrf5_probe().
|
static |
Definition at line 374 of file nrf5.c.
References alive_sleep(), ERROR_FLASH_BUSY, ERROR_OK, ERROR_WAIT, keep_alive(), LOG_DEBUG, LOG_ERROR, nrf5_nvmc_read_u32(), NRF5_NVMC_READY, and timeval_ms().
Referenced by COMMAND_HANDLER(), nrf51_protect_clenr0(), nrf5_erase_page(), nrf5_ll_flash_write(), nrf5_nvmc_erase_enable(), nrf5_nvmc_read_only(), and nrf5_nvmc_write_enable().
|
static |
Definition at line 1223 of file nrf5.c.
References bank, buffer, count, ERROR_FLASH_PROTECTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, nrf5_info::features, flash_sector::is_protected, LOG_ERROR, nrf51_protect_check_clenr0(), NRF5_FEATURE_SERIES_51, nrf5_ll_flash_write(), nrf5_nvmc_read_only(), nrf5_nvmc_write_enable(), flash_sector::offset, offset, flash_sector::size, and TARGET_HALTED.
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
const struct flash_driver nrf51_flash |
Definition at line 1 of file nrf5.c.
Referenced by FLASH_BANK_COMMAND_HANDLER(), and nrf5_get_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_decode_info_package().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
|
static |
|
static |
const struct flash_driver nrf5_flash |
Definition at line 1423 of file nrf5.c.
Referenced by nrf5_get_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().
|
static |
Definition at line 1 of file nrf5.c.
Referenced by nrf5_probe_chip().