OpenOCD
|
Go to the source code of this file.
Macros | |
#define | AT49BV6416 0x00d6 |
#define | AT49BV6416T 0x00d2 |
#define | CFI_MAX_INTEL_CODESIZE 256 |
Functions | |
int | cfi_auto_probe (struct flash_bank *bank) |
static void | cfi_command (struct flash_bank *bank, uint8_t cmd, uint8_t *cmd_buf) |
static uint32_t | cfi_command_val (struct flash_bank *bank, uint8_t cmd) |
int | cfi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static void | cfi_fixup (struct flash_bank *bank, const struct cfi_fixup *fixups) |
static void | cfi_fixup_0002_erase_regions (struct flash_bank *bank, const void *param) |
static void | cfi_fixup_0002_polling_bits (struct flash_bank *bank, const void *param) |
static void | cfi_fixup_0002_unlock_addresses (struct flash_bank *bank, const void *param) |
static void | cfi_fixup_0002_write_buffer (struct flash_bank *bank, const void *param) |
static void | cfi_fixup_reversed_erase_regions (struct flash_bank *bank, const void *param) |
uint32_t | cfi_flash_address (struct flash_bank *bank, int sector, uint32_t offset) |
int | cfi_flash_bank_cmd (struct flash_bank *bank, unsigned int argc, const char **argv) |
int | cfi_get_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | cfi_get_u8 (struct flash_bank *bank, int sector, uint32_t offset, uint8_t *val) |
static void | cfi_intel_clear_status_register (struct flash_bank *bank) |
static int | cfi_intel_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | cfi_intel_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | cfi_intel_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | cfi_intel_protect_check (struct flash_bank *bank) |
static int | cfi_intel_wait_status_busy (struct flash_bank *bank, int timeout, uint8_t *val) |
static int | cfi_intel_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t count) |
static int | cfi_intel_write_word (struct flash_bank *bank, uint8_t *word, uint32_t address) |
static int | cfi_intel_write_words (struct flash_bank *bank, const uint8_t *word, uint32_t wordcount, uint32_t address) |
int | cfi_probe (struct flash_bank *bank) |
int | cfi_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
int | cfi_protect_check (struct flash_bank *bank) |
static int | cfi_query_string (struct flash_bank *bank, int address) |
static int | cfi_query_u16 (struct flash_bank *bank, int sector, uint32_t offset, uint16_t *val) |
static int | cfi_query_u32 (struct flash_bank *bank, int sector, uint32_t offset, uint32_t *val) |
static int | cfi_query_u8 (struct flash_bank *bank, int sector, uint32_t offset, uint8_t *val) |
static int | cfi_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | cfi_read_0002_pri_ext (struct flash_bank *bank) |
static int | cfi_read_atmel_pri_ext (struct flash_bank *bank) |
static int | cfi_read_intel_pri_ext (struct flash_bank *bank) |
static int | cfi_read_spansion_pri_ext (struct flash_bank *bank) |
int | cfi_reset (struct flash_bank *bank) |
int | cfi_send_command (struct flash_bank *bank, uint8_t cmd, uint32_t address) |
static int | cfi_spansion_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | cfi_spansion_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | cfi_spansion_protect_check (struct flash_bank *bank) |
int | cfi_spansion_unlock_seq (struct flash_bank *bank) |
int | cfi_spansion_wait_status_busy (struct flash_bank *bank, int timeout) |
static int | cfi_spansion_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t count) |
static int | cfi_spansion_write_block_mips (struct flash_bank *bank, const uint8_t *buffer, uint32_t address, uint32_t count) |
static int | cfi_spansion_write_word (struct flash_bank *bank, uint8_t *word, uint32_t address) |
static int | cfi_spansion_write_words (struct flash_bank *bank, const uint8_t *word, uint32_t wordcount, uint32_t address) |
int | cfi_target_read_memory (struct flash_bank *bank, target_addr_t addr, uint32_t count, uint8_t *buffer) |
static int | cfi_target_write_memory (struct flash_bank *bank, target_addr_t addr, uint32_t count, const uint8_t *buffer) |
static int | cfi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
int | cfi_write_word (struct flash_bank *bank, uint8_t *word, uint32_t address) |
static int | cfi_write_words (struct flash_bank *bank, const uint8_t *word, uint32_t wordcount, uint32_t address) |
FLASH_BANK_COMMAND_HANDLER (cfi_flash_bank_command) | |
Variables | |
static const struct cfi_fixup | cfi_0001_fixups [] |
static const struct cfi_fixup | cfi_0002_fixups [] |
const struct flash_driver | cfi_flash |
static const int | cfi_status_poll_mask_dq6_dq7 = CFI_STATUS_POLL_MASK_DQ6_DQ7 |
static const struct cfi_unlock_addresses | cfi_unlock_addresses [] |
int cfi_auto_probe | ( | struct flash_bank * | bank | ) |
Definition at line 2864 of file cfi.c.
References bank, cfi_probe(), ERROR_OK, and cfi_flash_bank::probed.
|
static |
Definition at line 143 of file cfi.c.
References bank, CFI_MAX_BUS_WIDTH, cmd, cfi_flash_bank::endianness, and TARGET_LITTLE_ENDIAN.
Referenced by cfi_command_val(), and cfi_send_command().
|
static |
Definition at line 1096 of file cfi.c.
References bank, cfi_command(), CFI_MAX_BUS_WIDTH, cmd, LOG_ERROR, target_buffer_get_u16(), and target_buffer_get_u32().
Referenced by cfi_intel_write_block(), cfi_spansion_write_block(), and cfi_spansion_write_block_mips().
int cfi_erase | ( | struct flash_bank * | bank, |
unsigned int | first, | ||
unsigned int | last | ||
) |
Definition at line 931 of file cfi.c.
References bank, cfi_intel_erase(), cfi_spansion_erase(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, cfi_flash_bank::pri_id, cfi_flash_bank::qry, and TARGET_HALTED.
|
static |
Definition at line 89 of file cfi.c.
References bank, CFI_ID_ANY, CFI_MFR_ANY, cfi_flash_bank::device_id, cfi_fixup::fixup, and cfi_flash_bank::manufacturer.
Referenced by cfi_probe().
|
static |
Definition at line 2460 of file cfi.c.
References cfi_spansion_pri_ext::_reversed_geometry, bank, cfi_flash_bank::erase_region_info, LOG_DEBUG, cfi_flash_bank::num_erase_regions, param, cfi_flash_bank::pri_ext, and cfi_spansion_pri_ext::top_bottom.
|
static |
Definition at line 2490 of file cfi.c.
References bank, param, and cfi_flash_bank::status_poll_mask.
|
static |
Definition at line 2480 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, bank, param, cfi_flash_bank::pri_ext, cfi_unlock_addresses::unlock1, and cfi_unlock_addresses::unlock2.
|
static |
Definition at line 3030 of file cfi.c.
References bank, and cfi_flash_bank::buf_write_timeout_typ.
|
static |
Definition at line 2451 of file cfi.c.
References cfi_spansion_pri_ext::_reversed_geometry, bank, param, and cfi_flash_bank::pri_ext.
uint32_t cfi_flash_address | ( | struct flash_bank * | bank, |
int | sector, | ||
uint32_t | offset | ||
) |
Definition at line 100 of file cfi.c.
References bank, LOG_ERROR, offset, and cfi_flash_bank::x16_as_x8.
Referenced by cfi_get_u8(), cfi_intel_clear_status_register(), cfi_intel_erase(), cfi_intel_protect(), cfi_intel_protect_check(), cfi_intel_write_word(), cfi_intel_write_words(), cfi_probe(), cfi_query_string(), cfi_query_u16(), cfi_query_u32(), cfi_query_u8(), cfi_read_atmel_pri_ext(), cfi_read_spansion_pri_ext(), cfi_reset(), cfi_spansion_erase(), cfi_spansion_protect_check(), cfi_spansion_unlock_seq(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), cfi_spansion_write_word(), cfi_spansion_write_words(), and rpchf_spansion_write_words().
int cfi_flash_bank_cmd | ( | struct flash_bank * | bank, |
unsigned int | argc, | ||
const char ** | argv | ||
) |
Definition at line 778 of file cfi.c.
References bank, CFI_MAX_BUS_WIDTH, CFI_MAX_CHIP_WIDTH, cfi_flash_bank::data_swap, cfi_flash_bank::endianness, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, cfi_flash_bank::jedec_probe, LOG_ERROR, cfi_flash_bank::qry, TARGET_BIG_ENDIAN, TARGET_LITTLE_ENDIAN, and cfi_flash_bank::x16_as_x8.
Referenced by FLASH_BANK_COMMAND_HANDLER().
int cfi_get_info | ( | struct flash_bank * | bank, |
struct command_invocation * | cmd | ||
) |
Definition at line 2956 of file cfi.c.
References cfi_flash_bank::alt_addr, cfi_flash_bank::alt_id, bank, cfi_flash_bank::block_erase_timeout_max, cfi_flash_bank::block_erase_timeout_typ, cfi_flash_bank::buf_write_timeout_max, cfi_flash_bank::buf_write_timeout_typ, cfi_intel_info(), cfi_spansion_info(), cfi_flash_bank::chip_erase_timeout_max, cfi_flash_bank::chip_erase_timeout_typ, cmd, command_print_sameline(), cfi_flash_bank::dev_size, cfi_flash_bank::device_id, ERROR_OK, cfi_flash_bank::interface_desc, LOG_ERROR, cfi_flash_bank::manufacturer, cfi_flash_bank::max_buf_write_size, cfi_flash_bank::not_cfi, cfi_flash_bank::pri_addr, cfi_flash_bank::pri_id, cfi_flash_bank::qry, cfi_flash_bank::vcc_max, cfi_flash_bank::vcc_min, cfi_flash_bank::vpp_max, cfi_flash_bank::vpp_min, cfi_flash_bank::word_write_timeout_max, and cfi_flash_bank::word_write_timeout_typ.
|
static |
Definition at line 197 of file cfi.c.
References bank, cfi_flash_address(), CFI_MAX_BUS_WIDTH, cfi_target_read_memory(), cfi_flash_bank::endianness, ERROR_OK, offset, and TARGET_LITTLE_ENDIAN.
Referenced by cfi_intel_protect(), cfi_intel_protect_check(), cfi_intel_wait_status_busy(), cfi_spansion_protect_check(), and cfi_spansion_wait_status_busy().
|
static |
Definition at line 307 of file cfi.c.
References bank, cfi_flash_address(), and cfi_send_command().
Referenced by cfi_intel_erase(), cfi_intel_protect(), cfi_intel_wait_status_busy(), cfi_intel_write_block(), cfi_intel_write_word(), and cfi_intel_write_words().
|
static |
Definition at line 840 of file cfi.c.
References bank, cfi_flash_bank::block_erase_timeout, cfi_flash_address(), cfi_intel_clear_status_register(), cfi_intel_wait_status_busy(), cfi_send_command(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, status, and TARGET_ADDR_FMT.
Referenced by cfi_erase().
|
static |
Definition at line 746 of file cfi.c.
References bank, cfi_intel_pri_ext::blk_status_reg_mask, cmd, command_print_sameline(), ERROR_OK, cfi_intel_pri_ext::fact_prot_reg_size, cfi_intel_pri_ext::feature_support, cfi_intel_pri_ext::major_version, cfi_intel_pri_ext::minor_version, cfi_intel_pri_ext::num_protection_fields, cfi_intel_pri_ext::pri, cfi_flash_bank::pri_ext, cfi_intel_pri_ext::prot_reg_addr, cfi_intel_pri_ext::suspend_cmd_support, cfi_intel_pri_ext::user_prot_reg_size, cfi_intel_pri_ext::vcc_optimal, and cfi_intel_pri_ext::vpp_optimal.
Referenced by cfi_get_info().
|
static |
Definition at line 961 of file cfi.c.
References bank, cfi_flash_address(), cfi_get_u8(), cfi_intel_clear_status_register(), cfi_intel_wait_status_busy(), cfi_send_command(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, cfi_intel_pri_ext::feature_support, LOG_ERROR, cfi_flash_bank::pri_ext, and status.
Referenced by cfi_protect().
|
static |
Definition at line 2872 of file cfi.c.
References bank, cfi_intel_pri_ext::blk_status_reg_mask, cfi_flash_address(), cfi_get_u8(), cfi_send_command(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, and cfi_flash_bank::pri_ext.
Referenced by cfi_protect_check().
|
static |
Definition at line 312 of file cfi.c.
References alive_sleep(), bank, cfi_get_u8(), cfi_intel_clear_status_register(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, and status.
Referenced by cfi_intel_erase(), cfi_intel_protect(), cfi_intel_write_block(), cfi_intel_write_word(), and cfi_intel_write_words().
|
static |
Definition at line 1116 of file cfi.c.
References working_area::address, ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_STATE_ARM, bank, buf_get_u32(), buf_set_u32(), buffer, cfi_command_val(), cfi_intel_clear_status_register(), cfi_intel_wait_status_busy(), CFI_MAX_INTEL_CODESIZE, arm_algorithm::common_magic, arm_algorithm::core_mode, arm_algorithm::core_state, count, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), is_arm(), keep_alive(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, PARAM_IN, PARAM_OUT, source, status, TARGET_ADDR_FMT, target_alloc_working_area(), target_alloc_working_area_try(), target_buffer_set_u32_array(), target_free_working_area(), target_run_algorithm(), target_to_arm(), and target_write_buffer().
Referenced by cfi_write().
|
static |
Definition at line 1956 of file cfi.c.
References bank, cfi_flash_address(), cfi_intel_clear_status_register(), cfi_intel_wait_status_busy(), cfi_send_command(), cfi_target_write_memory(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, status, TARGET_ADDR_FMT, and cfi_flash_bank::word_write_timeout.
Referenced by cfi_write_word().
|
static |
Definition at line 1988 of file cfi.c.
References bank, cfi_flash_bank::buf_write_timeout, cfi_flash_address(), cfi_intel_clear_status_register(), cfi_intel_wait_status_busy(), cfi_send_command(), cfi_target_write_memory(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, cfi_flash_bank::max_buf_write_size, status, and TARGET_ADDR_FMT.
Referenced by cfi_write_words().
int cfi_probe | ( | struct flash_bank * | bank | ) |
Definition at line 2532 of file cfi.c.
References cfi_flash_bank::alt_addr, cfi_flash_bank::alt_id, bank, cfi_flash_bank::block_erase_timeout, cfi_flash_bank::block_erase_timeout_max, cfi_flash_bank::block_erase_timeout_typ, cfi_flash_bank::buf_write_timeout, cfi_flash_bank::buf_write_timeout_max, cfi_flash_bank::buf_write_timeout_typ, cfi_0001_fixups, cfi_0002_fixups, cfi_fixup(), cfi_fixup_non_cfi(), cfi_flash_address(), CFI_MAX_BUS_WIDTH, cfi_query_string(), cfi_query_u16(), cfi_query_u32(), cfi_query_u8(), cfi_read_0002_pri_ext(), cfi_read_intel_pri_ext(), cfi_reset(), cfi_send_command(), CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7, cfi_target_read_memory(), cfi_flash_bank::chip_erase_timeout, cfi_flash_bank::chip_erase_timeout_max, cfi_flash_bank::chip_erase_timeout_typ, cfi_flash_bank::dev_size, cfi_flash_bank::device_id, DIV_ROUND_UP, cfi_flash_bank::erase_region_info, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, cfi_flash_bank::interface_desc, cfi_flash_bank::jedec_probe, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_USER, LOG_WARNING, cfi_flash_bank::manufacturer, cfi_flash_bank::max_buf_write_size, cfi_flash_bank::not_cfi, NULL, cfi_flash_bank::num_erase_regions, offset, cfi_flash_bank::pri_addr, cfi_flash_bank::pri_id, cfi_flash_bank::probed, cfi_flash_bank::qry, cfi_flash_bank::status_poll_mask, target_buffer_get_u16(), target_buffer_get_u32(), TARGET_HALTED, cfi_flash_bank::vcc_max, cfi_flash_bank::vcc_min, cfi_flash_bank::vpp_max, cfi_flash_bank::vpp_min, cfi_flash_bank::word_write_timeout, cfi_flash_bank::word_write_timeout_max, and cfi_flash_bank::word_write_timeout_typ.
Referenced by cfi_auto_probe().
int cfi_protect | ( | struct flash_bank * | bank, |
int | set, | ||
unsigned int | first, | ||
unsigned int | last | ||
) |
Definition at line 1073 of file cfi.c.
References bank, cfi_intel_protect(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_WARNING, cfi_flash_bank::pri_id, cfi_flash_bank::qry, and TARGET_HALTED.
int cfi_protect_check | ( | struct flash_bank * | bank | ) |
Definition at line 2930 of file cfi.c.
References bank, cfi_intel_protect_check(), cfi_spansion_protect_check(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, cfi_flash_bank::pri_id, cfi_flash_bank::qry, and TARGET_HALTED.
|
static |
Definition at line 2499 of file cfi.c.
References bank, cfi_flash_address(), cfi_query_u8(), cfi_reset(), cfi_send_command(), ERROR_FLASH_BANK_INVALID, ERROR_OK, LOG_DEBUG, LOG_ERROR, and cfi_flash_bank::qry.
Referenced by cfi_probe().
|
static |
Definition at line 223 of file cfi.c.
References bank, cfi_flash_address(), CFI_MAX_BUS_WIDTH, cfi_target_read_memory(), cfi_flash_bank::endianness, ERROR_OK, offset, TARGET_LITTLE_ENDIAN, and cfi_flash_bank::x16_as_x8.
Referenced by cfi_probe(), and cfi_read_intel_pri_ext().
|
static |
Definition at line 251 of file cfi.c.
References bank, cfi_flash_address(), CFI_MAX_BUS_WIDTH, cfi_target_read_memory(), cfi_flash_bank::endianness, ERROR_OK, offset, TARGET_LITTLE_ENDIAN, and cfi_flash_bank::x16_as_x8.
Referenced by cfi_probe(), and cfi_read_intel_pri_ext().
|
static |
Definition at line 174 of file cfi.c.
References bank, cfi_flash_address(), CFI_MAX_BUS_WIDTH, cfi_target_read_memory(), cfi_flash_bank::endianness, ERROR_OK, offset, and TARGET_LITTLE_ENDIAN.
Referenced by cfi_probe(), cfi_query_string(), cfi_read_atmel_pri_ext(), cfi_read_intel_pri_ext(), and cfi_read_spansion_pri_ext().
|
static |
Definition at line 2213 of file cfi.c.
References bank, buffer, CFI_MAX_BUS_WIDTH, cfi_target_read_memory(), count, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, LOG_INFO, offset, cfi_flash_bank::qry, and TARGET_HALTED.
|
static |
Definition at line 710 of file cfi.c.
References bank, CFI_MFR_ATMEL, cfi_read_atmel_pri_ext(), cfi_read_spansion_pri_ext(), and cfi_flash_bank::manufacturer.
Referenced by cfi_probe().
|
static |
Definition at line 606 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, AT49BV6416, AT49BV6416T, bank, cfi_atmel_pri_ext::bottom_boot, cfi_atmel_pri_ext::burst_mode, cfi_flash_address(), cfi_query_u8(), cfi_send_command(), CFI_UNLOCK_555_2AA, cfi_flash_bank::device_id, cfi_spansion_pri_ext::erase_suspend, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, cfi_atmel_pri_ext::features, LOG_DEBUG, LOG_ERROR, cfi_spansion_pri_ext::major_version, cfi_atmel_pri_ext::major_version, cfi_spansion_pri_ext::minor_version, cfi_atmel_pri_ext::minor_version, cfi_atmel_pri_ext::page_mode, cfi_spansion_pri_ext::pri, cfi_atmel_pri_ext::pri, cfi_flash_bank::pri_addr, cfi_flash_bank::pri_ext, cfi_spansion_pri_ext::top_bottom, cfi_unlock_addresses::unlock1, and cfi_unlock_addresses::unlock2.
Referenced by cfi_read_0002_pri_ext().
|
static |
Definition at line 409 of file cfi.c.
References bank, cfi_intel_pri_ext::blk_status_reg_mask, cfi_query_u16(), cfi_query_u32(), cfi_query_u8(), cfi_reset(), ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, cfi_intel_pri_ext::fact_prot_reg_size, cfi_intel_pri_ext::feature_support, LOG_DEBUG, LOG_ERROR, LOG_WARNING, cfi_intel_pri_ext::major_version, cfi_intel_pri_ext::minor_version, cfi_intel_pri_ext::num_protection_fields, cfi_intel_pri_ext::pri, cfi_flash_bank::pri_addr, cfi_flash_bank::pri_ext, cfi_intel_pri_ext::prot_reg_addr, cfi_intel_pri_ext::suspend_cmd_support, cfi_intel_pri_ext::user_prot_reg_size, cfi_intel_pri_ext::vcc_optimal, and cfi_intel_pri_ext::vpp_optimal.
Referenced by cfi_probe().
|
static |
Definition at line 505 of file cfi.c.
References cfi_spansion_pri_ext::_reversed_geometry, cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, bank, cfi_spansion_pri_ext::blk_prot, cfi_spansion_pri_ext::blk_prot_unprot, cfi_spansion_pri_ext::burst_mode, cfi_flash_address(), cfi_query_u8(), cfi_send_command(), CFI_UNLOCK_555_2AA, cfi_spansion_pri_ext::erase_suspend, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, LOG_DEBUG, LOG_ERROR, cfi_spansion_pri_ext::major_version, cfi_spansion_pri_ext::minor_version, cfi_spansion_pri_ext::page_mode, cfi_spansion_pri_ext::pri, cfi_flash_bank::pri_addr, cfi_flash_bank::pri_ext, cfi_spansion_pri_ext::silicon_revision, cfi_spansion_pri_ext::simultaneous_ops, cfi_spansion_pri_ext::tmp_blk_unprotected, cfi_spansion_pri_ext::top_bottom, cfi_unlock_addresses::unlock1, cfi_unlock_addresses::unlock2, cfi_spansion_pri_ext::vpp_max, and cfi_spansion_pri_ext::vpp_min.
Referenced by cfi_read_0002_pri_ext().
int cfi_reset | ( | struct flash_bank * | bank | ) |
Definition at line 282 of file cfi.c.
References bank, cfi_flash_address(), cfi_send_command(), cfi_flash_bank::device_id, ERROR_OK, and cfi_flash_bank::manufacturer.
Referenced by cfi_probe(), cfi_query_string(), cfi_read_intel_pri_ext(), cfi_write(), and rpchf_write().
int cfi_send_command | ( | struct flash_bank * | bank, |
uint8_t | cmd, | ||
uint32_t | address | ||
) |
Definition at line 162 of file cfi.c.
References bank, cfi_command(), CFI_MAX_BUS_WIDTH, cfi_target_write_memory(), and cmd.
Referenced by cfi_intel_clear_status_register(), cfi_intel_erase(), cfi_intel_protect(), cfi_intel_protect_check(), cfi_intel_write_word(), cfi_intel_write_words(), cfi_probe(), cfi_query_string(), cfi_read_atmel_pri_ext(), cfi_read_spansion_pri_ext(), cfi_reset(), cfi_spansion_erase(), cfi_spansion_protect_check(), cfi_spansion_unlock_seq(), cfi_spansion_write_word(), cfi_spansion_write_words(), and rpchf_spansion_write_words().
|
static |
Definition at line 893 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, bank, cfi_flash_bank::block_erase_timeout, cfi_flash_address(), cfi_send_command(), cfi_spansion_unlock_seq(), cfi_spansion_wait_status_busy(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, cfi_flash_bank::pri_ext, and TARGET_ADDR_FMT.
Referenced by cfi_erase().
|
static |
Definition at line 720 of file cfi.c.
References bank, cfi_spansion_pri_ext::blk_prot, cmd, command_print_sameline(), cfi_spansion_pri_ext::erase_suspend, ERROR_OK, cfi_spansion_pri_ext::major_version, cfi_spansion_pri_ext::minor_version, cfi_spansion_pri_ext::pri, cfi_flash_bank::pri_ext, cfi_spansion_pri_ext::silicon_revision, cfi_spansion_pri_ext::vpp_max, and cfi_spansion_pri_ext::vpp_min.
Referenced by cfi_get_info().
|
static |
Definition at line 2901 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, bank, cfi_flash_address(), cfi_get_u8(), cfi_send_command(), cfi_spansion_unlock_seq(), ERROR_OK, and cfi_flash_bank::pri_ext.
Referenced by cfi_protect_check().
int cfi_spansion_unlock_seq | ( | struct flash_bank * | bank | ) |
Definition at line 876 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, bank, cfi_flash_address(), cfi_send_command(), ERROR_OK, and cfi_flash_bank::pri_ext.
Referenced by cfi_spansion_erase(), cfi_spansion_protect_check(), cfi_spansion_write_word(), cfi_spansion_write_words(), and rpchf_spansion_write_words().
int cfi_spansion_wait_status_busy | ( | struct flash_bank * | bank, |
int | timeout | ||
) |
Definition at line 363 of file cfi.c.
References alive_sleep(), bank, cfi_get_u8(), ERROR_FLASH_BUSY, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, status, and cfi_flash_bank::status_poll_mask.
Referenced by cfi_spansion_erase(), cfi_spansion_write_word(), cfi_spansion_write_words(), and rpchf_spansion_write_words().
|
static |
Definition at line 1577 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, working_area::address, ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_MODE_THREAD, ARM_STATE_ARM, ARMV7M_COMMON_MAGIC, bank, buf_get_u32(), buf_set_u32(), buffer, cfi_command_val(), cfi_flash_address(), cfi_spansion_write_block_mips(), arm_algorithm::common_magic, armv7m_algorithm::common_magic, arm_algorithm::core_mode, armv7m_algorithm::core_mode, arm_algorithm::core_state, count, destroy_reg_param(), ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, working_area::free, init_reg_param(), is_arm(), is_armv7m(), LOG_ERROR, LOG_WARNING, NULL, PARAM_IN, PARAM_OUT, cfi_flash_bank::pri_ext, source, status, cfi_flash_bank::status_poll_mask, target_alloc_working_area(), target_alloc_working_area_try(), target_buffer_set_u32_array(), target_free_all_working_areas(), target_free_working_area(), target_run_algorithm(), target_to_arm(), target_to_armv7m(), target_type_name(), and target_write_buffer().
Referenced by cfi_write().
|
static |
Definition at line 1365 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, cfi_spansion_pri_ext::_unlock2, working_area::address, bank, buf_get_u32(), buf_set_u32(), buffer, cfi_command_val(), cfi_flash_address(), mips32_algorithm::common_magic, count, destroy_reg_param(), ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, working_area::free, init_reg_param(), mips32_algorithm::isa_mode, LOG_ERROR, LOG_WARNING, MIPS32_ADDI, MIPS32_AND, MIPS32_B, MIPS32_BEQ, MIPS32_BNE, MIPS32_COMMON_MAGIC, MIPS32_ISA_MIPS32, MIPS32_LHU, MIPS32_LUI, MIPS32_NOP, MIPS32_ORI, MIPS32_SDBBP, MIPS32_SH, MIPS32_SRL, MIPS32_XOR, NEG16, NULL, PARAM_IN, PARAM_OUT, cfi_flash_bank::pri_ext, source, status, cfi_flash_bank::status_poll_mask, target_alloc_working_area(), target_alloc_working_area_try(), target_buffer_set_u32_array(), target_free_all_working_areas(), target_free_working_area(), target_run_algorithm(), and target_write_buffer().
Referenced by cfi_spansion_write_block().
|
static |
Definition at line 2072 of file cfi.c.
References cfi_spansion_pri_ext::_unlock1, bank, cfi_flash_address(), cfi_send_command(), cfi_spansion_unlock_seq(), cfi_spansion_wait_status_busy(), cfi_target_write_memory(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, cfi_flash_bank::pri_ext, TARGET_ADDR_FMT, and cfi_flash_bank::word_write_timeout.
Referenced by cfi_write_word().
|
static |
Definition at line 2103 of file cfi.c.
References bank, cfi_flash_bank::buf_write_timeout, cfi_flash_address(), cfi_send_command(), cfi_spansion_unlock_seq(), cfi_spansion_wait_status_busy(), cfi_target_write_memory(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, cfi_flash_bank::max_buf_write_size, and TARGET_ADDR_FMT.
Referenced by cfi_write_words().
int cfi_target_read_memory | ( | struct flash_bank * | bank, |
target_addr_t | addr, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Definition at line 131 of file cfi.c.
References addr, bank, buffer, count, cfi_flash_bank::read_mem, and target_read_memory().
Referenced by cfi_get_u8(), cfi_probe(), cfi_query_u16(), cfi_query_u32(), cfi_query_u8(), cfi_read(), cfi_write(), and rpchf_write().
|
static |
Definition at line 119 of file cfi.c.
References addr, bank, buffer, count, target_write_memory(), and cfi_flash_bank::write_mem.
Referenced by cfi_intel_write_word(), cfi_intel_write_words(), cfi_send_command(), cfi_spansion_write_word(), and cfi_spansion_write_words().
|
static |
Definition at line 2281 of file cfi.c.
References bank, buf_bswap16(), buf_bswap32(), buffer, cfi_intel_write_block(), CFI_MAX_BUS_WIDTH, cfi_reset(), cfi_spansion_write_block(), cfi_target_read_memory(), cfi_write_word(), cfi_write_words(), count, cfi_flash_bank::data_swap, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, LOG_INFO, cfi_flash_bank::max_buf_write_size, NULL, offset, cfi_flash_bank::pri_id, cfi_flash_bank::qry, and TARGET_HALTED.
int cfi_write_word | ( | struct flash_bank * | bank, |
uint8_t * | word, | ||
uint32_t | address | ||
) |
Definition at line 2170 of file cfi.c.
References bank, cfi_intel_write_word(), cfi_spansion_write_word(), ERROR_FLASH_OPERATION_FAILED, LOG_ERROR, and cfi_flash_bank::pri_id.
Referenced by cfi_write(), and rpchf_write().
|
static |
Definition at line 2188 of file cfi.c.
References bank, cfi_flash_bank::buf_write_timeout_typ, cfi_intel_write_words(), cfi_spansion_write_words(), ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_OPERATION_FAILED, LOG_DEBUG, LOG_ERROR, and cfi_flash_bank::pri_id.
Referenced by cfi_write().
FLASH_BANK_COMMAND_HANDLER | ( | cfi_flash_bank_command | ) |
|
static |
|
static |
Definition at line 45 of file cfi.c.
Referenced by cfi_probe().
const struct flash_driver cfi_flash |
|
static |
|
static |