OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | esirisc_flash_bank |
Macros | |
#define | ADDRESS 0x20 /* Erase/Program Address */ |
#define | CONTROL 0x00 /* Control Register */ |
#define | CONTROL_AP (1<<8) /* Auto-Program */ |
#define | CONTROL_E (1<<3) /* Erase */ |
#define | CONTROL_EP (1<<4) /* Erase Page */ |
#define | CONTROL_ERC (1<<6) /* Erase Reference Cell */ |
#define | CONTROL_P (1<<5) /* Program Flash */ |
#define | CONTROL_R (1<<7) /* Recall Trim Code */ |
#define | CONTROL_SLM (1<<0) /* Sleep Mode */ |
#define | CONTROL_TIMEOUT 5000 /* 5s */ |
#define | CONTROL_WP (1<<1) /* Register Write Protect */ |
#define | FLASH_PAGE_SIZE 4096 |
#define | NUM_NS_PER_S 1000000000ULL |
#define | PB_DATA 0x24 /* Program Buffer Data */ |
#define | PB_INDEX 0x28 /* Program Buffer Index */ |
#define | PB_MAX 32 |
#define | REDUN_0 0x30 /* Redundant Address 0 */ |
#define | REDUN_1 0x34 /* Redundant Address 1 */ |
#define | REDUN_P(x) (((x) << 12) & 0x7f000) /* Redundant Page Address */ |
#define | REDUN_R (1<<0) /* Used */ |
#define | STATUS 0x2c /* Status Register */ |
#define | STATUS_BO (1<<4) /* Brown Out */ |
#define | STATUS_BUSY (1<<0) /* Busy (Erase/Program) */ |
#define | STATUS_DIS (1<<3) /* Discharged */ |
#define | STATUS_DR (1<<2) /* Disable Redundancy */ |
#define | STATUS_WER (1<<1) /* Write Protect Error */ |
#define | TERASE 40000000 /* 40ms */ |
#define | TIMING0 0x04 /* Timing Register 0 */ |
#define | TIMING0_F(x) (((x) << 16) & 0xffff0000) /* Tnvh Clock Cycles */ |
#define | TIMING0_R(x) (((x) << 0) & 0x3f) /* Read Wait States */ |
#define | TIMING1 0x08 /* Timing Register 1 */ |
#define | TIMING1_E(x) (((x) << 0) & 0xffffff) /* Tme/Terase/Tre Clock Cycles */ |
#define | TIMING2 0x0c /* Timing Register 2 */ |
#define | TIMING2_H(x) (((x) << 16) & 0xff0000) /* Clock Cycles in 100ns */ |
#define | TIMING2_P(x) (((x) << 0) & 0xffff) /* Tprog Clock Cycles */ |
#define | TIMING2_T(x) (((x) << 24) & 0xf000000) /* Clock Cycles in 10ns */ |
#define | TME 20000000 /* 20ms */ |
#define | TNVH 5000 /* 5us */ |
#define | TPROG 40000 /* 40us */ |
#define | TRE 40000000 /* 40ms */ |
#define | UNLOCK1 0x18 /* Unlock 1 */ |
#define | UNLOCK2 0x1c /* Unlock 2 */ |
Variables | |
const struct flash_driver | esirisc_flash |
static const struct command_registration | esirisc_flash_command_handlers [] |
static const struct command_registration | esirisc_flash_exec_command_handlers [] |
#define ADDRESS 0x20 /* Erase/Program Address */ |
Definition at line 29 of file esirisc_flash.c.
#define CONTROL 0x00 /* Control Register */ |
Definition at line 23 of file esirisc_flash.c.
#define CONTROL_AP (1<<8) /* Auto-Program */ |
Definition at line 44 of file esirisc_flash.c.
#define CONTROL_E (1<<3) /* Erase */ |
Definition at line 39 of file esirisc_flash.c.
#define CONTROL_EP (1<<4) /* Erase Page */ |
Definition at line 40 of file esirisc_flash.c.
#define CONTROL_ERC (1<<6) /* Erase Reference Cell */ |
Definition at line 42 of file esirisc_flash.c.
#define CONTROL_P (1<<5) /* Program Flash */ |
Definition at line 41 of file esirisc_flash.c.
#define CONTROL_R (1<<7) /* Recall Trim Code */ |
Definition at line 43 of file esirisc_flash.c.
#define CONTROL_SLM (1<<0) /* Sleep Mode */ |
Definition at line 37 of file esirisc_flash.c.
#define CONTROL_TIMEOUT 5000 /* 5s */ |
Definition at line 83 of file esirisc_flash.c.
#define CONTROL_WP (1<<1) /* Register Write Protect */ |
Definition at line 38 of file esirisc_flash.c.
#define FLASH_PAGE_SIZE 4096 |
Definition at line 84 of file esirisc_flash.c.
#define NUM_NS_PER_S 1000000000ULL |
Definition at line 87 of file esirisc_flash.c.
#define PB_DATA 0x24 /* Program Buffer Data */ |
Definition at line 30 of file esirisc_flash.c.
#define PB_INDEX 0x28 /* Program Buffer Index */ |
Definition at line 31 of file esirisc_flash.c.
#define PB_MAX 32 |
Definition at line 85 of file esirisc_flash.c.
#define REDUN_0 0x30 /* Redundant Address 0 */ |
Definition at line 33 of file esirisc_flash.c.
#define REDUN_1 0x34 /* Redundant Address 1 */ |
Definition at line 34 of file esirisc_flash.c.
#define REDUN_P | ( | x | ) | (((x) << 12) & 0x7f000) /* Redundant Page Address */ |
Definition at line 63 of file esirisc_flash.c.
#define REDUN_R (1<<0) /* Used */ |
Definition at line 62 of file esirisc_flash.c.
#define STATUS 0x2c /* Status Register */ |
Definition at line 32 of file esirisc_flash.c.
#define STATUS_BO (1<<4) /* Brown Out */ |
Definition at line 59 of file esirisc_flash.c.
#define STATUS_BUSY (1<<0) /* Busy (Erase/Program) */ |
Definition at line 55 of file esirisc_flash.c.
#define STATUS_DIS (1<<3) /* Discharged */ |
Definition at line 58 of file esirisc_flash.c.
#define STATUS_DR (1<<2) /* Disable Redundancy */ |
Definition at line 57 of file esirisc_flash.c.
#define STATUS_WER (1<<1) /* Write Protect Error */ |
Definition at line 56 of file esirisc_flash.c.
#define TERASE 40000000 /* 40ms */ |
Definition at line 78 of file esirisc_flash.c.
#define TIMING0 0x04 /* Timing Register 0 */ |
Definition at line 24 of file esirisc_flash.c.
#define TIMING0_F | ( | x | ) | (((x) << 16) & 0xffff0000) /* Tnvh Clock Cycles */ |
Definition at line 48 of file esirisc_flash.c.
#define TIMING0_R | ( | x | ) | (((x) << 0) & 0x3f) /* Read Wait States */ |
Definition at line 47 of file esirisc_flash.c.
#define TIMING1 0x08 /* Timing Register 1 */ |
Definition at line 25 of file esirisc_flash.c.
#define TIMING1_E | ( | x | ) | (((x) << 0) & 0xffffff) /* Tme/Terase/Tre Clock Cycles */ |
Definition at line 49 of file esirisc_flash.c.
#define TIMING2 0x0c /* Timing Register 2 */ |
Definition at line 26 of file esirisc_flash.c.
#define TIMING2_H | ( | x | ) | (((x) << 16) & 0xff0000) /* Clock Cycles in 100ns */ |
Definition at line 51 of file esirisc_flash.c.
#define TIMING2_P | ( | x | ) | (((x) << 0) & 0xffff) /* Tprog Clock Cycles */ |
Definition at line 50 of file esirisc_flash.c.
#define TIMING2_T | ( | x | ) | (((x) << 24) & 0xf000000) /* Clock Cycles in 10ns */ |
Definition at line 52 of file esirisc_flash.c.
#define TME 20000000 /* 20ms */ |
Definition at line 77 of file esirisc_flash.c.
#define TNVH 5000 /* 5us */ |
Definition at line 76 of file esirisc_flash.c.
#define TPROG 40000 /* 40us */ |
Definition at line 80 of file esirisc_flash.c.
#define TRE 40000000 /* 40ms */ |
Definition at line 79 of file esirisc_flash.c.
#define UNLOCK1 0x18 /* Unlock 1 */ |
Definition at line 27 of file esirisc_flash.c.
#define UNLOCK2 0x1c /* Unlock 2 */ |
Definition at line 28 of file esirisc_flash.c.
COMMAND_HANDLER | ( | handle_esirisc_flash_mass_erase_command | ) |
Definition at line 493 of file esirisc_flash.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and esirisc_flash_mass_erase().
COMMAND_HANDLER | ( | handle_esirisc_flash_ref_erase_command | ) |
Definition at line 513 of file esirisc_flash.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and esirisc_flash_ref_erase().
|
static |
Definition at line 469 of file esirisc_flash.c.
References bank, ERROR_OK, esirisc_flash_probe(), and esirisc_flash_bank::probed.
|
static |
Definition at line 174 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, STATUS, status, STATUS_WER, and target_read_u32().
Referenced by esirisc_flash_control().
|
static |
Definition at line 189 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, ERROR_OK, STATUS, STATUS_WER, and target_write_u32().
Referenced by esirisc_flash_control().
|
static |
Definition at line 219 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, CONTROL, CONTROL_TIMEOUT, ERROR_OK, esirisc_flash_check_status(), esirisc_flash_clear_status(), esirisc_flash_wait(), LOG_ERROR, and target_write_u32().
Referenced by esirisc_flash_erase(), esirisc_flash_mass_erase(), esirisc_flash_recall(), esirisc_flash_ref_erase(), and esirisc_flash_write().
|
static |
Definition at line 136 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, CONTROL, CONTROL_WP, ERROR_OK, esirisc_flash_unlock(), target_read_u32(), and target_write_u32().
Referenced by esirisc_flash_erase(), esirisc_flash_init(), esirisc_flash_mass_erase(), esirisc_flash_ref_erase(), and esirisc_flash_write().
|
static |
Definition at line 155 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, CONTROL, CONTROL_WP, ERROR_OK, esirisc_flash_unlock(), target_read_u32(), and target_write_u32().
Referenced by esirisc_flash_erase(), esirisc_flash_init(), esirisc_flash_mass_erase(), esirisc_flash_ref_erase(), and esirisc_flash_write().
|
static |
Definition at line 242 of file esirisc_flash.c.
References ADDRESS, bank, esirisc_flash_bank::cfg, CONTROL_EP, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_flash_control(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), FLASH_PAGE_SIZE, LOG_ERROR, target::state, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 317 of file esirisc_flash.c.
References bank, buffer, esirisc_flash_bank::cfg, count, DIV_ROUND_UP, ERROR_OK, MIN, esirisc_common::num_bits, PB_DATA, PB_INDEX, target_to_esirisc(), target_write_buffer(), and target_write_u32().
Referenced by esirisc_flash_write().
|
static |
Definition at line 479 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, esirisc_flash_bank::clock, cmd, command_print_sameline(), ERROR_OK, and esirisc_flash_bank::wait_states.
|
static |
Definition at line 408 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, ERROR_OK, esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), esirisc_flash_num_cycles(), esirisc_flash_recall(), LOG_DEBUG, LOG_ERROR, target_write_u32(), TERASE, TIMING0, TIMING0_F, TIMING0_R, TIMING1, TIMING1_E, TIMING2, TIMING2_H, TIMING2_P, TIMING2_T, TNVH, TPROG, and esirisc_flash_bank::wait_states.
Referenced by esirisc_flash_probe().
|
static |
Definition at line 271 of file esirisc_flash.c.
References ADDRESS, bank, esirisc_flash_bank::cfg, CONTROL_E, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_flash_control(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), LOG_ERROR, target::state, TARGET_HALTED, and target_write_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 394 of file esirisc_flash.c.
References bank, esirisc_flash_bank::clock, and NUM_NS_PER_S.
Referenced by esirisc_flash_init().
|
static |
Definition at line 446 of file esirisc_flash.c.
References alloc_block_array(), bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_flash_init(), FLASH_PAGE_SIZE, LOG_ERROR, esirisc_flash_bank::probed, target::state, and TARGET_HALTED.
Referenced by esirisc_flash_auto_probe().
|
static |
Definition at line 237 of file esirisc_flash.c.
References bank, CONTROL_R, and esirisc_flash_control().
Referenced by esirisc_flash_init().
|
static |
Definition at line 298 of file esirisc_flash.c.
References bank, CONTROL_ERC, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_flash_control(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), LOG_ERROR, target::state, and TARGET_HALTED.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 124 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, ERROR_OK, target_write_u32(), UNLOCK1, and UNLOCK2.
Referenced by esirisc_flash_disable_protect(), and esirisc_flash_enable_protect().
|
static |
Definition at line 199 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, ERROR_OK, ERROR_TARGET_TIMEOUT, keep_alive(), STATUS, status, STATUS_BUSY, target_read_u32(), and timeval_ms().
Referenced by esirisc_flash_control().
|
static |
Definition at line 348 of file esirisc_flash.c.
References ADDRESS, bank, buffer, esirisc_flash_bank::cfg, CONTROL_P, count, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_flash_control(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), esirisc_flash_fill_pb(), LOG_ERROR, MIN, offset, PB_MAX, target::state, TARGET_HALTED, and target_write_u32().
FLASH_BANK_COMMAND_HANDLER | ( | esirisc_flash_bank_command | ) |
Definition at line 98 of file esirisc_flash.c.
References bank, esirisc_flash_bank::cfg, esirisc_flash_bank::clock, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, esirisc_flash_command_handlers, register_commands(), and esirisc_flash_bank::wait_states.
const struct flash_driver esirisc_flash |
Definition at line 513 of file esirisc_flash.c.
|
static |
Definition at line 1 of file esirisc_flash.c.
Referenced by FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 513 of file esirisc_flash.c.