OpenOCD
cfi.h File Reference
This graph shows which files directly or indirectly include this file:

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)
 

Macro Definition Documentation

◆ CFI_ID_ANY

#define CFI_ID_ANY   0xffff

Definition at line 175 of file cfi.h.

◆ CFI_MAX_BUS_WIDTH

#define CFI_MAX_BUS_WIDTH   4

Definition at line 177 of file cfi.h.

◆ CFI_MAX_CHIP_WIDTH

#define CFI_MAX_CHIP_WIDTH   4

Definition at line 178 of file cfi.h.

◆ CFI_MFR_AMD

#define CFI_MFR_AMD   0x0001

Definition at line 165 of file cfi.h.

◆ CFI_MFR_AMIC

#define CFI_MFR_AMIC   0x0037

Definition at line 169 of file cfi.h.

◆ CFI_MFR_ANY

#define CFI_MFR_ANY   0xffff

Definition at line 174 of file cfi.h.

◆ CFI_MFR_ATMEL

#define CFI_MFR_ATMEL   0x001F

Definition at line 167 of file cfi.h.

◆ CFI_MFR_EON

#define CFI_MFR_EON   0x007F

Definition at line 172 of file cfi.h.

◆ CFI_MFR_FUJITSU

#define CFI_MFR_FUJITSU   0x0004

Definition at line 166 of file cfi.h.

◆ CFI_MFR_MX

#define CFI_MFR_MX   0x00C2

Definition at line 171 of file cfi.h.

◆ CFI_MFR_SST

#define CFI_MFR_SST   0x00BF

Definition at line 170 of file cfi.h.

◆ CFI_MFR_ST

#define CFI_MFR_ST   0x0020 /* STMicroelectronics */

Definition at line 168 of file cfi.h.

◆ CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7

#define CFI_STATUS_POLL_MASK_DQ5_DQ6_DQ7   0xE0 /* DQ5..DQ7 */

Definition at line 11 of file cfi.h.

◆ CFI_STATUS_POLL_MASK_DQ6_DQ7

#define CFI_STATUS_POLL_MASK_DQ6_DQ7   0xC0 /* DQ6..DQ7 */

Definition at line 12 of file cfi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CFI_UNLOCK_555_2AA 
CFI_UNLOCK_5555_2AAA 

Definition at line 129 of file cfi.h.

Function Documentation

◆ cfi_auto_probe()

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.

◆ cfi_erase()

int cfi_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)

◆ cfi_flash_address()

◆ cfi_flash_bank_cmd()

◆ cfi_get_info()

◆ cfi_probe()

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().

◆ cfi_protect()

int cfi_protect ( struct flash_bank bank,
int  set,
unsigned int  first,
unsigned int  last 
)

◆ cfi_protect_check()

◆ cfi_reset()

◆ cfi_send_command()

◆ cfi_spansion_unlock_seq()

◆ cfi_spansion_wait_status_busy()

◆ cfi_target_read_memory()

int cfi_target_read_memory ( struct flash_bank bank,
target_addr_t  addr,
uint32_t  count,
uint8_t *  buffer 
)

◆ cfi_write_word()

int cfi_write_word ( struct flash_bank bank,
uint8_t *  word,
uint32_t  address 
)