OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | cfi_atmel_pri_ext |
struct | cfi_fixup |
struct | cfi_flash_bank |
struct | cfi_intel_pri_ext |
struct | cfi_spansion_pri_ext |
struct | cfi_unlock_addresses |
Macros | |
#define | CFI_ID_ANY 0xffff |
#define | CFI_MAX_BUS_WIDTH 4 |
#define | CFI_MAX_CHIP_WIDTH 4 |
#define | CFI_MFR_AMD 0x0001 |
#define | CFI_MFR_AMIC 0x0037 |
#define | CFI_MFR_ANY 0xffff |
#define | CFI_MFR_ATMEL 0x001F |
#define | CFI_MFR_EON 0x007F |
#define | CFI_MFR_FUJITSU 0x0004 |
#define | CFI_MFR_MX 0x00C2 |
#define | CFI_MFR_SST 0x00BF |
#define | CFI_MFR_ST 0x0020 /* STMicroelectronics */ |
#define | CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7 0xE0 /* DQ5..DQ7 */ |
#define | CFI_STATUS_POLL_MASK_DQ6_DQ7 0xC0 /* DQ6..DQ7 */ |
Enumerations | |
enum | { CFI_UNLOCK_555_2AA , CFI_UNLOCK_5555_2AAA } |
Functions | |
int | cfi_auto_probe (struct flash_bank *bank) |
int | cfi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
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) |
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) |
int | cfi_reset (struct flash_bank *bank) |
int | cfi_send_command (struct flash_bank *bank, uint8_t cmd, uint32_t address) |
int | cfi_spansion_unlock_seq (struct flash_bank *bank) |
int | cfi_spansion_wait_status_busy (struct flash_bank *bank, int timeout) |
int | cfi_target_read_memory (struct flash_bank *bank, target_addr_t addr, uint32_t count, uint8_t *buffer) |
int | cfi_write_word (struct flash_bank *bank, uint8_t *word, uint32_t address) |
anonymous enum |
int cfi_auto_probe | ( | struct flash_bank * | bank | ) |
Definition at line 2863 of file cfi.c.
References bank, cfi_probe(), ERROR_OK, and cfi_flash_bank::probed.
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.
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 2955 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.
int cfi_probe | ( | struct flash_bank * | bank | ) |
Definition at line 2531 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 2929 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.
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().
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().
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().
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().