OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | kinetis_chip |
struct | kinetis_flash_bank |
struct | kinetis_type |
Functions | |
COMMAND_HANDLER (kinetis_check_flash_security_status) | |
COMMAND_HANDLER (kinetis_create_banks_handler) | |
COMMAND_HANDLER (kinetis_disable_wdog_handler) | |
COMMAND_HANDLER (kinetis_fcf_source_handler) | |
COMMAND_HANDLER (kinetis_fopt_handler) | |
COMMAND_HANDLER (kinetis_mdm_halt) | |
COMMAND_HANDLER (kinetis_mdm_mass_erase) | |
COMMAND_HANDLER (kinetis_mdm_reset) | |
COMMAND_HANDLER (kinetis_nvm_partition) | |
FLASH_BANK_COMMAND_HANDLER (kinetis_flash_bank_command) | |
static int | kinetis_auto_probe (struct flash_bank *bank) |
static int | kinetis_blank_check (struct flash_bank *bank) |
static int | kinetis_check_run_mode (struct kinetis_chip *k_chip) |
static int | kinetis_chip_options (struct kinetis_chip *k_chip, int argc, const char *argv[]) |
static int | kinetis_create_missing_banks (struct kinetis_chip *k_chip) |
static int | kinetis_disable_wdog (struct kinetis_chip *k_chip) |
static int | kinetis_disable_wdog32 (struct target *target, uint32_t wdog_base) |
static int | kinetis_disable_wdog_algo (struct target *target, size_t code_size, const uint8_t *code, uint32_t wdog_base) |
static int | kinetis_disable_wdog_kx (struct target *target) |
static int | kinetis_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | kinetis_fill_fcf (struct flash_bank *bank, uint8_t *fcf) |
static void | kinetis_free_driver_priv (struct flash_bank *bank) |
static int | kinetis_ftfx_clear_error (struct target *target) |
static int | kinetis_ftfx_command (struct target *target, uint8_t fcmd, uint32_t faddr, uint8_t fccob4, uint8_t fccob5, uint8_t fccob6, uint8_t fccob7, uint8_t fccob8, uint8_t fccob9, uint8_t fccoba, uint8_t fccobb, uint8_t *ftfx_fstat) |
static int | kinetis_ftfx_decode_error (uint8_t fstat) |
static int | kinetis_ftfx_prepare (struct target *target) |
static struct kinetis_chip * | kinetis_get_chip (struct target *target) |
static int | kinetis_info (struct flash_bank *bank, struct command_invocation *cmd) |
static void | kinetis_invalidate_flash_cache (struct kinetis_chip *k_chip) |
static int | kinetis_make_ram_ready (struct target *target) |
static int | kinetis_mdm_poll_register (struct adiv5_dap *dap, unsigned int reg, uint32_t mask, uint32_t value, uint32_t timeout_ms) |
static int | kinetis_mdm_read_register (struct adiv5_dap *dap, unsigned int reg, uint32_t *result) |
static int | kinetis_mdm_write_register (struct adiv5_dap *dap, unsigned int reg, uint32_t value) |
static int | kinetis_probe (struct flash_bank *bank) |
static int | kinetis_probe_chip (struct kinetis_chip *k_chip) |
static int | kinetis_probe_chip_s32k (struct kinetis_chip *k_chip) |
static int | kinetis_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | kinetis_protect_check (struct flash_bank *bank) |
static int | kinetis_read_pmstat (struct kinetis_chip *k_chip, uint8_t *pmstat) |
static int | kinetis_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | kinetis_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t wcount) |
static int | kinetis_write_inner (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | kinetis_write_sections (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static bool | allow_fcf_writes |
static bool | create_banks |
static uint8_t | fcf_fopt = 0xff |
static const struct command_registration | kinetis_command_handler [] |
static const struct command_registration | kinetis_exec_command_handlers [] |
const struct flash_driver | kinetis_flash |
static const uint8_t | kinetis_flash_write_code [] |
static const uint32_t | kinetis_known_mdm_ids [] |
static const struct command_registration | kinetis_security_command_handlers [] |
static const struct kinetis_type | kinetis_types_old [] |
#define KINETIS_SDID_DIEID_K22FN128 0x00000680 /* smaller pflash with FTFA */ |
#define KINETIS_SDID_DIEID_K24FN1M 0x00000300 /* Detect Errata 7534 */ |
#define KINETIS_SDID_PROJECTID_MASK KINETIS_SDID_DIEID_MASK |
#define KINETIS_SDID_S32K_SERIES_MASK 0xFF000000 /* GENERATION + SUBSERIES */ |
COMMAND_HANDLER | ( | kinetis_check_flash_security_status | ) |
Definition at line 763 of file kinetis.c.
References armv7m_common::arm, cortex_m_common::armv7m, ARRAY_SIZE, CMD_CTX, arm::dap, adiv5_ap::dap, dap_get_ap(), dap_put_ap(), dap_queue_ap_read(), dap_run(), ERROR_OK, get_current_target(), jtag_poll_set_enabled(), kinetis_known_mdm_ids, kinetis_mdm_read_register(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, MDM_AP, MDM_REG_ID, MDM_REG_STAT, MDM_STAT_FREADY, MDM_STAT_SYSSEC, adiv5_dap::ops, and target_to_cm().
COMMAND_HANDLER | ( | kinetis_create_banks_handler | ) |
Definition at line 3332 of file kinetis.c.
References CMD_ARGC, create_banks, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | kinetis_disable_wdog_handler | ) |
Definition at line 1225 of file kinetis.c.
References CMD_ARGC, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, get_current_target(), kinetis_disable_wdog(), and kinetis_get_chip().
COMMAND_HANDLER | ( | kinetis_fcf_source_handler | ) |
Definition at line 3292 of file kinetis.c.
References allow_fcf_writes, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and LOG_WARNING.
COMMAND_HANDLER | ( | kinetis_fopt_handler | ) |
Definition at line 3318 of file kinetis.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and fcf_fopt.
COMMAND_HANDLER | ( | kinetis_mdm_halt | ) |
Definition at line 507 of file kinetis.c.
References alive_sleep(), armv7m_common::arm, cortex_m_common::armv7m, target_type::assert_reset, CMD_CTX, arm::dap, target_type::deassert_reset, ERROR_FAIL, ERROR_OK, get_current_target(), jtag_poll_set_enabled(), kinetis_mdm_read_register(), kinetis_mdm_write_register(), LOG_DEBUG, LOG_ERROR, MDM_ACCESS_TIMEOUT, MDM_CTRL_CORE_HOLD_RES, MDM_REG_CTRL, MDM_REG_STAT, MDM_STAT_FREADY, MDM_STAT_SYSRES, MDM_STAT_SYSSEC, target::reset_halt, target_poll(), target_to_cm(), timeval_ms(), and target::type.
COMMAND_HANDLER | ( | kinetis_mdm_mass_erase | ) |
Definition at line 611 of file kinetis.c.
References adapter_assert_reset(), adapter_deassert_reset(), alive_sleep(), armv7m_common::arm, cortex_m_common::armv7m, target_type::assert_reset, CMD_CTX, arm::dap, target_type::deassert_reset, ERROR_FAIL, ERROR_OK, get_current_target(), jtag_get_reset_config(), jtag_poll_set_enabled(), kinetis_mdm_poll_register(), kinetis_mdm_read_register(), kinetis_mdm_write_register(), LOG_ERROR, LOG_INFO, MDM_CTRL_FMEIP, MDM_CTRL_SYS_RES_REQ, MDM_REG_CTRL, MDM_REG_STAT, MDM_STAT_FMEEN, MDM_STAT_FREADY, MDM_STAT_SYSRES, target::reset_halt, RESET_HAS_SRST, target_poll(), target_to_cm(), timeval_ms(), and target::type.
COMMAND_HANDLER | ( | kinetis_mdm_reset | ) |
Definition at line 570 of file kinetis.c.
References armv7m_common::arm, cortex_m_common::armv7m, CMD_CTX, arm::dap, ERROR_FAIL, ERROR_OK, get_current_target(), kinetis_mdm_poll_register(), kinetis_mdm_write_register(), LOG_ERROR, MDM_CTRL_SYS_RES_REQ, MDM_REG_CTRL, MDM_REG_STAT, MDM_STAT_SYSRES, and target_to_cm().
COMMAND_HANDLER | ( | kinetis_nvm_partition | ) |
Definition at line 3139 of file kinetis.c.
References kinetis_chip::banks, kinetis_chip::chip_type, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, COMMAND_PARSE_ON_OFF, command_print(), kinetis_chip::CT_S32K, ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FTFX_CMD_PGMPART, get_current_target(), kinetis_check_run_mode(), kinetis_ftfx_command(), kinetis_ftfx_prepare(), kinetis_get_chip(), LOG_ERROR, LOG_INFO, NULL, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, kinetis_flash_bank::probed, kinetis_chip::probed, kinetis_chip::sim_base, kinetis_chip::sim_fcfg1, SIM_FCFG1_OFFSET, and target_read_u32().
FLASH_BANK_COMMAND_HANDLER | ( | kinetis_flash_bank_command | ) |
Definition at line 918 of file kinetis.c.
References kinetis_flash_bank::bank, bank, kinetis_flash_bank::bank_number, kinetis_chip::banks, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, kinetis_flash_bank::k_chip, kinetis_chip_options(), kinetis_get_chip(), KINETIS_MAX_BANKS, LOG_ERROR, LOG_INFO, kinetis_chip::num_banks, kinetis_chip::target, and target.
|
static |
Definition at line 3041 of file kinetis.c.
References bank, ERROR_OK, kinetis_probe(), and kinetis_flash_bank::probed.
Referenced by kinetis_fill_fcf().
|
static |
Definition at line 3070 of file kinetis.c.
References bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, kinetis_flash_bank::flash_class, kinetis_chip::flash_support, kinetis_chip::FS_NO_CMD_BLOCKSTAT, FTFX_CMD_BLOCKSTAT, FTFX_CMD_SECTSTAT, kinetis_flash_bank::k_chip, kinetis_check_run_mode(), kinetis_ftfx_clear_error(), kinetis_ftfx_command(), kinetis_ftfx_prepare(), LOG_DEBUG, LOG_WARNING, kinetis_flash_bank::prog_base, and kinetis_chip::sim_fcfg1.
|
static |
Definition at line 1600 of file kinetis.c.
References ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, kinetis_read_pmstat(), LOG_ERROR, LOG_INFO, MC_PMCTRL, PM_CTRL_RUNM_RUN, PM_STAT_RUN, PM_STAT_VLPR, SMC32_PMCTRL, SMC_PMCTRL, target::state, kinetis_chip::sysmodectrlr_type, kinetis_chip::target, target, TARGET_HALTED, target_write_u32(), and target_write_u8().
Referenced by COMMAND_HANDLER(), kinetis_blank_check(), kinetis_erase(), and kinetis_write().
|
static |
Definition at line 904 of file kinetis.c.
References kinetis_chip::chip_type, ERROR_OK, kinetis_flash_bank::k_chip, LOG_ERROR, NULL, and kinetis_chip::sim_base.
Referenced by FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 978 of file kinetis.c.
References kinetis_flash_bank::bank, bank, kinetis_flash_bank::bank_number, kinetis_chip::banks, ERROR_FAIL, ERROR_OK, flash_bank_add(), FLASH_WRITE_GAP_SECTOR, kinetis_flash_bank::k_chip, kinetis_flash, KINETIS_MAX_BANKS, LOG_ERROR, name, kinetis_chip::num_banks, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, kinetis_chip::target, and target_name().
Referenced by kinetis_probe_chip(), and kinetis_probe_chip_s32k().
|
static |
Definition at line 1169 of file kinetis.c.
References kinetis_chip::chip_type, ERROR_FAIL, ERROR_OK, kinetis_disable_wdog32(), kinetis_disable_wdog_kx(), kinetis_probe_chip(), kinetis_probe_chip_s32k(), LOG_ERROR, LOG_INFO, kinetis_chip::probed, SIM_COPC, kinetis_chip::target, target_read_u8(), target_write_u8(), kinetis_chip::watchdog_type, WDOG32_KE1X, and WDOG32_KL28.
Referenced by COMMAND_HANDLER(), and kinetis_write_inner().
|
static |
Definition at line 1136 of file kinetis.c.
References ERROR_FAIL, ERROR_OK, kinetis_disable_wdog_algo(), LOG_ERROR, LOG_INFO, target_read_u32(), and WDOG32_CS_OFFSET.
Referenced by kinetis_disable_wdog().
|
static |
Definition at line 1060 of file kinetis.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, buf_set_u32(), armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_OK, ERROR_TARGET_NOT_HALTED, init_reg_param(), LOG_ERROR, NULL, PARAM_OUT, target::state, target_alloc_working_area(), target_free_working_area(), TARGET_HALTED, target_run_algorithm(), target_write_buffer(), and reg_param::value.
Referenced by kinetis_disable_wdog32(), and kinetis_disable_wdog_kx().
|
static |
Definition at line 1104 of file kinetis.c.
References ERROR_FAIL, ERROR_OK, kinetis_disable_wdog_algo(), LOG_INFO, target_read_u16(), WDOG_BASE, and WDOG_STCTRLH_OFFSET.
Referenced by kinetis_disable_wdog().
|
static |
Definition at line 1693 of file kinetis.c.
References allow_fcf_writes, bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FCF_ADDRESS, FCF_SIZE, FTFX_CMD_SECTERASE, kinetis_flash_bank::k_chip, kinetis_check_run_mode(), kinetis_fill_fcf(), kinetis_ftfx_command(), kinetis_ftfx_prepare(), kinetis_invalidate_flash_cache(), kinetis_write_inner(), LOG_DEBUG, LOG_WARNING, NULL, and kinetis_flash_bank::prog_base.
|
static |
Definition at line 1461 of file kinetis.c.
References kinetis_flash_bank::bank, bank, kinetis_chip::banks, ERROR_OK, FCF_FDPROT, FCF_FOPT, fcf_fopt, FCF_FPROT, FCF_FSEC, FCF_SIZE, kinetis_flash_bank::flash_class, flash_sector::is_protected, kinetis_flash_bank::k_chip, kinetis_auto_probe(), LOG_WARNING, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, flash_bank::num_prot_blocks, flash_bank::prot_blocks, and target_buffer_set_u32().
Referenced by kinetis_erase(), and kinetis_write().
|
static |
Definition at line 962 of file kinetis.c.
References bank, kinetis_flash_bank::k_chip, and kinetis_chip::num_banks.
|
static |
Definition at line 1263 of file kinetis.c.
References FTFX_FSTAT, and target_write_u8().
Referenced by kinetis_blank_check(), and kinetis_ftfx_prepare().
|
static |
Definition at line 1520 of file kinetis.c.
References ERROR_OK, FTFX_FCCOB3, FTFX_FSTAT, kinetis_ftfx_decode_error(), LOG_DEBUG, target_read_u8(), target_write_memory(), target_write_u8(), and timeval_ms().
Referenced by COMMAND_HANDLER(), kinetis_blank_check(), kinetis_erase(), kinetis_make_ram_ready(), kinetis_write_inner(), and kinetis_write_sections().
|
static |
Definition at line 1242 of file kinetis.c.
References ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, and LOG_ERROR.
Referenced by kinetis_ftfx_command(), and kinetis_write_block().
|
static |
Definition at line 1270 of file kinetis.c.
References ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FTFX_FSTAT, kinetis_ftfx_clear_error(), LOG_ERROR, and target_read_u8().
Referenced by COMMAND_HANDLER(), kinetis_blank_check(), kinetis_erase(), and kinetis_write().
|
static |
Definition at line 883 of file kinetis.c.
References flash_bank::driver, flash_bank::driver_priv, flash_bank_list(), kinetis_flash_bank::k_chip, kinetis_flash, flash_bank::next, NULL, and flash_bank::target.
Referenced by COMMAND_HANDLER(), and FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 3051 of file kinetis.c.
References bank, cmd, command_print_sameline(), ERROR_OK, kinetis_flash_bank::flash_class, kinetis_flash_bank::k_chip, kinetis_chip::name, and TARGET_ADDR_FMT.
|
static |
Definition at line 1660 of file kinetis.c.
References kinetis_chip::cache_type, FMC_PFB01CR, MCM_PLACR, MSCM_OCMDR0, MSCM_OCMDR1, kinetis_chip::target, target_write_u32(), and target_write_u8().
Referenced by kinetis_erase(), and kinetis_write_inner().
|
static |
Definition at line 1751 of file kinetis.c.
References ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FTFX_CMD_SETFLEXRAM, FTFX_FCNFG, kinetis_ftfx_command(), NULL, and target_read_u8().
Referenced by kinetis_write_inner().
|
static |
Definition at line 482 of file kinetis.c.
References alive_sleep(), adiv5_ap::dap, ERROR_FAIL, ERROR_OK, kinetis_mdm_read_register(), LOG_DEBUG, mask, and timeval_ms().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 456 of file kinetis.c.
References adiv5_ap::dap, dap_get_ap(), dap_put_ap(), dap_queue_ap_read(), dap_run(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, and MDM_AP.
Referenced by COMMAND_HANDLER(), and kinetis_mdm_poll_register().
|
static |
Definition at line 428 of file kinetis.c.
References adiv5_ap::dap, dap_get_ap(), dap_put_ap(), dap_queue_ap_write(), dap_run(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, and MDM_AP.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 2894 of file kinetis.c.
References alloc_block_array(), bank, kinetis_flash_bank::bank_number, kinetis_chip::chip_type, kinetis_chip::CT_S32K, kinetis_chip::dflash_size, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, kinetis_chip::fcfg2_maxaddr0_shifted, kinetis_chip::fcfg2_maxaddr1_shifted, kinetis_flash_bank::flash_class, kinetis_flash_bank::k_chip, kinetis_probe_chip(), kinetis_probe_chip_s32k(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, MAX, NULL, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, kinetis_chip::nvm_base, kinetis_chip::nvm_sector_size, kinetis_chip::nvm_size, kinetis_chip::pflash_base, kinetis_chip::pflash_sector_size, kinetis_chip::pflash_size, kinetis_flash_bank::probed, kinetis_chip::probed, kinetis_flash_bank::prog_base, kinetis_flash_bank::protection_block, kinetis_flash_bank::protection_size, kinetis_flash_bank::sector_size, and kinetis_chip::sim_fcfg2.
Referenced by kinetis_auto_probe().
|
static |
Definition at line 2264 of file kinetis.c.
References ARRAY_SIZE, kinetis_chip::cache_type, create_banks, kinetis_chip::dflash_size, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, kinetis_chip::fcfg2_maxaddr0_shifted, kinetis_chip::fcfg2_maxaddr1_shifted, kinetis_chip::flash_support, FLEXRAM, kinetis_create_missing_banks(), KINETIS_K_REVID_MASK, KINETIS_K_REVID_SHIFT, KINETIS_K_SDID_K10_M100, KINETIS_K_SDID_K10_M120, KINETIS_K_SDID_K10_M50, KINETIS_K_SDID_K10_M72, KINETIS_K_SDID_K11, KINETIS_K_SDID_K12, KINETIS_K_SDID_K20_M100, KINETIS_K_SDID_K20_M120, KINETIS_K_SDID_K20_M50, KINETIS_K_SDID_K20_M72, KINETIS_K_SDID_K21_M120, KINETIS_K_SDID_K21_M50, KINETIS_K_SDID_K22_M120, KINETIS_K_SDID_K22_M50, KINETIS_K_SDID_K30_M100, KINETIS_K_SDID_K30_M72, KINETIS_K_SDID_K40_M100, KINETIS_K_SDID_K40_M72, KINETIS_K_SDID_K50_M72, KINETIS_K_SDID_K51_M72, KINETIS_K_SDID_K53, KINETIS_K_SDID_K60_M100, KINETIS_K_SDID_K60_M150, KINETIS_K_SDID_K70_M150, KINETIS_K_SDID_TYPE_MASK, KINETIS_SDID_DIEID_K22FN128, KINETIS_SDID_DIEID_K22FN256, KINETIS_SDID_DIEID_K22FN512, KINETIS_SDID_DIEID_K24FN1M, KINETIS_SDID_DIEID_K24FN256, KINETIS_SDID_DIEID_MASK, KINETIS_SDID_FAMILYID_K0X, KINETIS_SDID_FAMILYID_K1X, KINETIS_SDID_FAMILYID_K2X, KINETIS_SDID_FAMILYID_K3X, KINETIS_SDID_FAMILYID_K4X, KINETIS_SDID_FAMILYID_K5X, KINETIS_SDID_FAMILYID_K6X, KINETIS_SDID_FAMILYID_K8X, KINETIS_SDID_FAMILYID_KL8X, KINETIS_SDID_FAMILYID_MASK, KINETIS_SDID_FAMILYID_SHIFT, KINETIS_SDID_K_SERIES_MASK, KINETIS_SDID_PROJECTID_KE1XF, KINETIS_SDID_PROJECTID_KE1XZ, KINETIS_SDID_PROJECTID_MASK, KINETIS_SDID_SERIESID_K, KINETIS_SDID_SERIESID_KE, KINETIS_SDID_SERIESID_KL, KINETIS_SDID_SERIESID_KV, KINETIS_SDID_SERIESID_KW, KINETIS_SDID_SERIESID_MASK, KINETIS_SDID_SUBFAMID_KX0, KINETIS_SDID_SUBFAMID_KX1, KINETIS_SDID_SUBFAMID_KX2, KINETIS_SDID_SUBFAMID_KX3, KINETIS_SDID_SUBFAMID_KX4, KINETIS_SDID_SUBFAMID_KX5, KINETIS_SDID_SUBFAMID_KX6, KINETIS_SDID_SUBFAMID_KX7, KINETIS_SDID_SUBFAMID_KX8, KINETIS_SDID_SUBFAMID_MASK, KINETIS_SDID_SUBFAMID_SHIFT, KINETIS_SOPT1_RAMSIZE_K24FN1M, KINETIS_SOPT1_RAMSIZE_MASK, kinetis_types_old, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, kinetis_chip::max_flash_prog_size, kinetis_chip::name, name, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, kinetis_chip::nvm_base, kinetis_chip::nvm_sector_size, kinetis_chip::nvm_size, kinetis_chip::pflash_base, kinetis_chip::pflash_sector_size, kinetis_chip::pflash_size, kinetis_chip::probed, kinetis_chip::progr_accel_ram, SIM_BASE, kinetis_chip::sim_base, SIM_BASE_KL28, kinetis_chip::sim_fcfg1, SIM_FCFG1_OFFSET, kinetis_chip::sim_fcfg2, SIM_FCFG2_OFFSET, kinetis_chip::sim_sdid, SIM_SDID_OFFSET, SIM_SOPT1_OFFSET, kinetis_chip::sysmodectrlr_type, kinetis_chip::target, target_read_u32(), and kinetis_chip::watchdog_type.
Referenced by kinetis_disable_wdog(), and kinetis_probe().
|
static |
Definition at line 2096 of file kinetis.c.
References kinetis_chip::cache_type, create_banks, kinetis_chip::dflash_size, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, kinetis_chip::flash_support, FLEXRAM, kinetis_create_missing_banks(), KINETIS_SDID_S32K_DERIVATE_KXX2, KINETIS_SDID_S32K_DERIVATE_KXX3, KINETIS_SDID_S32K_DERIVATE_KXX4, KINETIS_SDID_S32K_DERIVATE_KXX5, KINETIS_SDID_S32K_DERIVATE_KXX6, KINETIS_SDID_S32K_DERIVATE_KXX8, KINETIS_SDID_S32K_DERIVATE_MASK, KINETIS_SDID_S32K_SERIES_K11X, KINETIS_SDID_S32K_SERIES_K14X, KINETIS_SDID_S32K_SERIES_MASK, LOG_ERROR, LOG_INFO, kinetis_chip::max_flash_prog_size, kinetis_chip::name, kinetis_chip::num_nvm_blocks, kinetis_chip::num_pflash_blocks, kinetis_chip::nvm_base, kinetis_chip::nvm_sector_size, kinetis_chip::nvm_size, kinetis_chip::pflash_base, kinetis_chip::pflash_sector_size, kinetis_chip::pflash_size, kinetis_chip::probed, kinetis_chip::progr_accel_ram, SIM_BASE, kinetis_chip::sim_base, kinetis_chip::sim_fcfg1, SIM_FCFG1_OFFSET, kinetis_chip::sim_fcfg2, kinetis_chip::sim_sdid, SIM_SDID_OFFSET, kinetis_chip::target, target_read_u32(), and kinetis_chip::watchdog_type.
Referenced by kinetis_disable_wdog(), and kinetis_probe().
|
static |
Definition at line 1393 of file kinetis.c.
References allow_fcf_writes, bank, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, LOG_ERROR, and LOG_INFO.
|
static |
Definition at line 1416 of file kinetis.c.
References bank, ERROR_FLASH_BANK_INVALID, ERROR_OK, kinetis_flash_bank::FC_FLEX_NVM, kinetis_flash_bank::FC_PFLASH, kinetis_flash_bank::flash_class, FTFX_FDPROT, FTFX_FPROT3, LOG_ERROR, kinetis_flash_bank::protection_block, target_read_u32(), and target_read_u8().
|
static |
Definition at line 1569 of file kinetis.c.
References ERROR_FAIL, ERROR_OK, PM_STAT_RUN, PM_STAT_VLPR, PMC_REGSC, SMC32_PMSTAT, SMC_PMSTAT, kinetis_chip::sysmodectrlr_type, kinetis_chip::target, target_read_u32(), and target_read_u8().
Referenced by kinetis_check_run_mode().
|
static |
Definition at line 1979 of file kinetis.c.
References allow_fcf_writes, bank, buffer, count, ERROR_OK, FCF_ADDRESS, FCF_FDPROT, FCF_FOPT, FCF_FPROT, FCF_FSEC, FCF_SIZE, kinetis_chip::flash_support, kinetis_chip::FS_ECC, kinetis_chip::FS_PROGRAM_LONGWORD, kinetis_flash_bank::k_chip, kinetis_check_run_mode(), kinetis_fill_fcf(), kinetis_ftfx_prepare(), kinetis_write_inner(), LOG_INFO, LOG_WARNING, offset, kinetis_flash_bank::prog_base, and target_read_memory().
|
static |
Definition at line 1302 of file kinetis.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, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FTFX_FSTAT, init_reg_param(), kinetis_flash_write_code, kinetis_ftfx_decode_error(), LOG_ERROR, LOG_WARNING, NULL, offset, PARAM_IN_OUT, PARAM_OUT, kinetis_flash_bank::prog_base, source, target_alloc_working_area(), target_free_working_area(), target_get_working_area_avail(), target_read_u8(), target_run_flash_async_algorithm(), target_write_buffer(), and target_write_u8().
Referenced by kinetis_write_inner().
|
static |
Definition at line 1879 of file kinetis.c.
References bank, buffer, count, ERROR_FAIL, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, kinetis_chip::flash_support, kinetis_chip::FS_PROGRAM_LONGWORD, kinetis_chip::FS_PROGRAM_SECTOR, FTFX_CMD_LWORDPROG, kinetis_flash_bank::k_chip, keep_alive(), kinetis_disable_wdog(), kinetis_ftfx_command(), kinetis_invalidate_flash_cache(), kinetis_make_ram_ready(), kinetis_write_block(), kinetis_write_sections(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, NULL, offset, kinetis_flash_bank::prog_base, and TARGET_ADDR_FMT.
Referenced by kinetis_erase(), and kinetis_write().
|
static |
Definition at line 1782 of file kinetis.c.
References bank, buffer, count, ERROR_OK, FCF_ADDRESS, FCF_SIZE, kinetis_chip::flash_support, kinetis_chip::FS_WIDTH_256BIT, FTFX_CMD_SECTWRITE, kinetis_flash_bank::k_chip, keep_alive(), kinetis_ftfx_command(), LOG_DEBUG, LOG_ERROR, kinetis_chip::max_flash_prog_size, NULL, offset, kinetis_flash_bank::prog_base, kinetis_chip::progr_accel_ram, kinetis_flash_bank::sector_size, size, TARGET_ADDR_FMT, and target_write_memory().
Referenced by kinetis_write_inner().
|
static |
Definition at line 415 of file kinetis.c.
Referenced by COMMAND_HANDLER(), kinetis_erase(), kinetis_protect(), and kinetis_write().
|
static |
Definition at line 417 of file kinetis.c.
Referenced by COMMAND_HANDLER(), kinetis_probe_chip(), and kinetis_probe_chip_s32k().
|
static |
Definition at line 416 of file kinetis.c.
Referenced by COMMAND_HANDLER(), and kinetis_fill_fcf().
|
static |
|
static |
const struct flash_driver kinetis_flash |
Definition at line 417 of file kinetis.c.
Referenced by kinetis_create_missing_banks(), and kinetis_get_chip().
|
static |
|
static |
Definition at line 751 of file kinetis.c.
Referenced by COMMAND_HANDLER().
|
static |
|
static |
Definition at line 1 of file kinetis.c.
Referenced by kinetis_probe_chip().