OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | xmc4xxx_command_seq |
struct | xmc4xxx_flash_bank |
Functions | |
COMMAND_HANDLER (xmc4xxx_handle_flash_password_command) | |
COMMAND_HANDLER (xmc4xxx_handle_flash_unprotect_command) | |
FLASH_BANK_COMMAND_HANDLER (xmc4xxx_flash_bank_command) | |
static int | xmc4xxx_clear_flash_status (struct flash_bank *bank) |
static int | xmc4xxx_enter_page_mode (struct flash_bank *bank) |
static int | xmc4xxx_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | xmc4xxx_erase_sector (struct flash_bank *bank, uint32_t address, bool user_config) |
static int | xmc4xxx_flash_protect (struct flash_bank *bank, int level, bool read_protect, unsigned int first, unsigned int last) |
static int | xmc4xxx_flash_unprotect (struct flash_bank *bank, int32_t level) |
static int | xmc4xxx_get_flash_status (struct flash_bank *bank, uint32_t *status) |
static int | xmc4xxx_get_info_command (struct flash_bank *bank, struct command_invocation *cmd) |
static int | xmc4xxx_get_sector_start_addr (struct flash_bank *bank, unsigned int sector, uint32_t *ret_addr) |
static int | xmc4xxx_load_bank_layout (struct flash_bank *bank) |
static int | xmc4xxx_probe (struct flash_bank *bank) |
static int | xmc4xxx_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | xmc4xxx_protect_check (struct flash_bank *bank) |
static int | xmc4xxx_temp_unprotect (struct flash_bank *bank, int user_level) |
static int | xmc4xxx_wait_status_busy (struct flash_bank *bank, int timeout) |
static int | xmc4xxx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | xmc4xxx_write_command_sequence (struct flash_bank *bank, struct xmc4xxx_command_seq *seq, int seq_len) |
static int | xmc4xxx_write_page (struct flash_bank *bank, const uint8_t *pg_buf, uint32_t offset, bool user_config) |
Variables | |
static const unsigned int | sector_capacity_12 [12] |
static const unsigned int | sector_capacity_16 [16] |
static const unsigned int | sector_capacity_8 [8] |
static const unsigned int | sector_capacity_9 [9] |
static const struct command_registration | xmc4xxx_command_handlers [] |
static const struct command_registration | xmc4xxx_exec_command_handlers [] |
const struct flash_driver | xmc4xxx_flash |
#define FCON_ESLDIS_MASK (0x01 << FCON_ESLDIS) |
#define FCON_PFDBERM_MASK (0x01 << FCON_PFDBERM) |
#define FCON_PFSBERM_MASK (0x01 << FCON_PFSBERM) |
#define FCON_PROERM_MASK (0x01 << FCON_PROERM) |
#define FCON_SLEEP_MASK (0x01 << FCON_SLEEP) |
#define FCON_SQERM_MASK (0x01 << FCON_SQERM) |
#define FCON_VOPERM_MASK (0x01 << FCON_VOPERM) |
#define FCON_WSECPF_MASK (0x01 << FCON_WSECPF) |
#define FCON_WSPFLASH_MASK (0x0f << FCON_WSPFLASH) |
#define FLASH_CMD_CLEAR_STATUS FLASH_CMD_ERASE_1 |
#define FLASH_CMD_ENTER_PAGEMODE FLASH_CMD_ERASE_1 |
#define FLASH_CMD_ERASE_3 FLASH_CMD_ERASE_1 |
#define FLASH_CMD_ERASE_4 FLASH_CMD_ERASE_1 |
#define FLASH_CMD_ERASE_5 FLASH_CMD_ERASE_2 |
#define FLASH_CMD_TEMP_UNPROT_1 FLASH_CMD_ERASE_1 |
#define FLASH_CMD_TEMP_UNPROT_2 FLASH_CMD_ERASE_2 |
#define FLASH_CMD_TEMP_UNPROT_4 FLASH_CMD_ERASE_2 |
#define FLASH_CMD_TEMP_UNPROT_5 FLASH_CMD_ERASE_2 |
#define FLASH_CMD_WRITE_PAGE_1 FLASH_CMD_ERASE_1 |
#define FLASH_CMD_WRITE_PAGE_2 FLASH_CMD_ERASE_2 |
#define FLASH_CMD_WRITE_PAGE_3 FLASH_CMD_ERASE_1 |
#define FLASH_REG_FLASH0_FCON (FLASH_REG_BASE | 0x2014) |
#define FLASH_REG_FLASH0_FSR (FLASH_REG_BASE | 0x2010) |
#define FLASH_REG_FLASH0_ID (FLASH_REG_BASE | 0x2008) |
#define FLASH_REG_FLASH0_MARP (FLASH_REG_BASE | 0x2018) |
#define FLASH_REG_FLASH0_PROCON0 (FLASH_REG_BASE | 0x2020) |
#define FLASH_REG_FLASH0_PROCON1 (FLASH_REG_BASE | 0x2024) |
#define FLASH_REG_FLASH0_PROCON2 (FLASH_REG_BASE | 0x2028) |
#define FLASH_REG_PMU_ID (FLASH_REG_BASE | 0x0508) |
#define FLASH_REG_PREF_PCON (FLASH_REG_BASE | 0x4000) |
#define FSR_FABUSY_MASK (0x01 << FSR_FABUSY) |
#define FSR_PFDBER_MASK (0x01 << FSR_PFDBER) |
#define FSR_PFOPER_MASK (0x01 << FSR_PFOPER) |
#define FSR_PFPAGE_MASK (0x01 << FSR_PFPAGE) |
#define FSR_PFSBER_MASK (0x01 << FSR_PFSBER) |
#define FSR_RPRODIS_MASK (0x01 << FSR_RPRODIS) |
#define FSR_RPROIN_MASK (0x01 << FSR_RPROIN) |
#define FSR_WPRODIS0_MASK (0x01 << FSR_WPRODIS0) |
#define FSR_WPRODIS1_MASK (0x01 << FSR_WPRODIS1) |
#define FSR_WPROIN0_MASK (0x01 << FSR_WPROIN0) |
#define FSR_WPROIN1_MASK (0x01 << FSR_WPROIN1) |
#define FSR_WPROIN2_MASK (0x01 << FSR_WPROIN2) |
#define MARP_MARGIN_MASK (0x0f << MARP_MARGIN) |
#define MARP_TRAPDIS_MASK (0x01 << MARP_TRAPDIS) |
#define PROCON_RPRO_MASK (0x01 << PROCON_RPRO) |
#define PROCON_S0L_MASK (0x01 << PROCON_S0L) |
#define PROCON_S10_S11L_MASK (0x01 << PROCON_S10_S11L) |
#define PROCON_S1L_MASK (0x01 << PROCON_S1L) |
#define PROCON_S2L_MASK (0x01 << PROCON_S2L) |
#define PROCON_S3L_MASK (0x01 << PROCON_S3L) |
#define PROCON_S4L_MASK (0x01 << PROCON_S4L) |
#define PROCON_S5L_MASK (0x01 << PROCON_S5L) |
#define PROCON_S6L_MASK (0x01 << PROCON_S6L) |
#define PROCON_S7L_MASK (0x01 << PROCON_S7L) |
#define PROCON_S8L_MASK (0x01 << PROCON_S8L) |
#define PROCON_S9L_MASK (0x01 << PROCON_S9L) |
COMMAND_HANDLER | ( | xmc4xxx_handle_flash_password_command | ) |
Definition at line 1243 of file xmc4xxx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, xmc4xxx_flash_bank::pw1, xmc4xxx_flash_bank::pw2, and xmc4xxx_flash_bank::pw_set.
COMMAND_HANDLER | ( | xmc4xxx_handle_flash_unprotect_command | ) |
Definition at line 1278 of file xmc4xxx.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and xmc4xxx_flash_unprotect().
FLASH_BANK_COMMAND_HANDLER | ( | xmc4xxx_flash_bank_command | ) |
Definition at line 1231 of file xmc4xxx.c.
References bank, ERROR_FLASH_OPERATION_FAILED, and ERROR_OK.
|
static |
Definition at line 412 of file xmc4xxx.c.
References bank, ERROR_OK, FLASH_CMD_CLEAR_STATUS, LOG_ERROR, LOG_INFO, and target_write_u32().
Referenced by xmc4xxx_erase(), and xmc4xxx_write().
|
static |
Definition at line 577 of file xmc4xxx.c.
References bank, ERROR_FAIL, ERROR_OK, FLASH_CMD_ENTER_PAGEMODE, FSR_PFPAGE_MASK, FSR_SQER_MASK, LOG_ERROR, status, target_write_u32(), and xmc4xxx_get_flash_status().
Referenced by xmc4xxx_write_page().
|
static |
Definition at line 530 of file xmc4xxx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_OP_TIMEOUT, LOG_DEBUG, LOG_ERROR, xmc4xxx_flash_bank::probed, TARGET_HALTED, xmc4xxx_clear_flash_status(), xmc4xxx_erase_sector(), xmc4xxx_get_sector_start_addr(), xmc4xxx_probe(), and xmc4xxx_wait_status_busy().
|
static |
Definition at line 470 of file xmc4xxx.c.
References xmc4xxx_command_seq::address, ARRAY_SIZE, bank, ERROR_FAIL, ERROR_OK, FLASH_CMD_ERASE_1, FLASH_CMD_ERASE_2, FLASH_CMD_ERASE_3, FLASH_CMD_ERASE_4, FLASH_CMD_ERASE_5, FLASH_OP_TIMEOUT, FLASH_REG_FLASH0_FSR, FSR_ERASE_MASK, FSR_SQER_MASK, LOG_ERROR, xmc4xxx_command_seq::magic, status, target_read_u32(), xmc4xxx_wait_status_busy(), and xmc4xxx_write_command_sequence().
Referenced by xmc4xxx_erase(), and xmc4xxx_flash_unprotect().
|
static |
Definition at line 1014 of file xmc4xxx.c.
References bank, ERROR_FAIL, ERROR_OK, FLASH_PROTECT_CONFIRMATION_CODE, FSR_RPROIN_MASK, FSR_WPROIN0_MASK, FSR_WPROIN1_MASK, FSR_WPROIN2_MASK, LOG_DEBUG, LOG_ERROR, PROCON_RPRO_MASK, xmc4xxx_flash_bank::pw1, xmc4xxx_flash_bank::pw2, status, target_buffer_set_u32(), UCB0_BASE, UCB1_BASE, UCB2_BASE, xmc4xxx_get_flash_status(), and xmc4xxx_write_page().
Referenced by xmc4xxx_protect().
|
static |
Definition at line 988 of file xmc4xxx.c.
References addr, bank, ERROR_FAIL, ERROR_OK, LOG_ERROR, UCB0_BASE, UCB1_BASE, and xmc4xxx_erase_sector().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 427 of file xmc4xxx.c.
References bank, ERROR_OK, FLASH_REG_FLASH0_FSR, LOG_ERROR, status, and target_read_u32().
Referenced by xmc4xxx_enter_page_mode(), xmc4xxx_flash_protect(), xmc4xxx_temp_unprotect(), xmc4xxx_wait_status_busy(), and xmc4xxx_write_page().
|
static |
Definition at line 795 of file xmc4xxx.c.
References bank, cmd, command_print_sameline(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_WARNING, NULL, xmc4xxx_flash_bank::read_protected, SCU_ID_CHIP, SCU_REG_BASE, TARGET_HALTED, target_read_u32(), and xmc4xxx_flash_bank::write_prot_otp.
|
static |
Definition at line 399 of file xmc4xxx.c.
References bank, ERROR_FAIL, and ERROR_OK.
Referenced by xmc4xxx_erase().
|
static |
Definition at line 266 of file xmc4xxx.c.
References bank, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, NULL, sector_capacity_12, sector_capacity_16, sector_capacity_8, and sector_capacity_9.
Referenced by xmc4xxx_probe().
|
static |
Definition at line 317 of file xmc4xxx.c.
References bank, config, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_ID_XMC4100_4200, FLASH_ID_XMC4300_XMC4700_4800, FLASH_ID_XMC4400, FLASH_ID_XMC4500, FLASH_REG_FLASH0_ID, LOG_DEBUG, LOG_ERROR, LOG_WARNING, xmc4xxx_flash_bank::probed, SCU_ID_CHIP, SCU_REG_BASE, TARGET_HALTED, target_read_u32(), and xmc4xxx_load_bank_layout().
Referenced by xmc4xxx_erase(), and xmc4xxx_write().
|
static |
Definition at line 1131 of file xmc4xxx.c.
References bank, ERROR_FAIL, LOG_ERROR, LOG_WARNING, xmc4xxx_flash_bank::pw_set, xmc4xxx_flash_protect(), and xmc4xxx_temp_unprotect().
|
static |
Definition at line 1157 of file xmc4xxx.c.
References ARRAY_SIZE, bank, ERROR_OK, FLASH_REG_FLASH0_PROCON0, FLASH_REG_FLASH0_PROCON1, FLASH_REG_FLASH0_PROCON2, LOG_ERROR, PROCON_RPRO_MASK, xmc4xxx_flash_bank::read_protected, target_read_u32(), and xmc4xxx_flash_bank::write_prot_otp.
|
static |
Definition at line 939 of file xmc4xxx.c.
References ARRAY_SIZE, bank, ERROR_FAIL, ERROR_OK, FLASH_CMD_TEMP_UNPROT_1, FLASH_CMD_TEMP_UNPROT_2, FLASH_CMD_TEMP_UNPROT_3, FLASH_CMD_TEMP_UNPROT_4, FLASH_CMD_TEMP_UNPROT_5, FLASH_CMD_TEMP_UNPROT_6, FSR_WPRODIS0, LOG_ERROR, LOG_INFO, xmc4xxx_command_seq::magic, xmc4xxx_flash_bank::pw1, xmc4xxx_flash_bank::pw2, status, xmc4xxx_get_flash_status(), and xmc4xxx_write_command_sequence().
Referenced by xmc4xxx_protect().
|
static |
Definition at line 439 of file xmc4xxx.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, FSR_PBUSY_MASK, FSR_PROER_MASK, keep_alive(), LOG_ERROR, status, and xmc4xxx_get_flash_status().
Referenced by xmc4xxx_erase(), xmc4xxx_erase_sector(), and xmc4xxx_write_page().
|
static |
Definition at line 712 of file xmc4xxx.c.
References bank, buffer, count, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_INFO, MIN, offset, xmc4xxx_flash_bank::probed, TARGET_ADDR_FMT, TARGET_HALTED, xmc4xxx_clear_flash_status(), xmc4xxx_probe(), and xmc4xxx_write_page().
|
static |
Definition at line 250 of file xmc4xxx.c.
References xmc4xxx_command_seq::address, bank, ERROR_OK, xmc4xxx_command_seq::magic, and target_write_u32().
Referenced by xmc4xxx_erase_sector(), xmc4xxx_temp_unprotect(), and xmc4xxx_write_page().
|
static |
Definition at line 608 of file xmc4xxx.c.
References xmc4xxx_command_seq::address, ARRAY_SIZE, bank, ERROR_FAIL, ERROR_OK, FLASH_CMD_LOAD_PAGE_1, FLASH_CMD_LOAD_PAGE_2, FLASH_CMD_WRITE_PAGE_1, FLASH_CMD_WRITE_PAGE_2, FLASH_CMD_WRITE_PAGE_3, FLASH_OP_TIMEOUT, FSR_PROG_MASK, FSR_SQER_MASK, LOG_DEBUG, LOG_ERROR, xmc4xxx_command_seq::magic, offset, status, target_buffer_get_u32(), target_write_u32(), xmc4xxx_enter_page_mode(), xmc4xxx_get_flash_status(), xmc4xxx_wait_status_busy(), and xmc4xxx_write_command_sequence().
Referenced by xmc4xxx_flash_protect(), and xmc4xxx_write().
|
static |
Definition at line 242 of file xmc4xxx.c.
Referenced by xmc4xxx_load_bank_layout().
|
static |
Definition at line 246 of file xmc4xxx.c.
Referenced by xmc4xxx_load_bank_layout().
|
static |
Definition at line 234 of file xmc4xxx.c.
Referenced by xmc4xxx_load_bank_layout().
|
static |
Definition at line 238 of file xmc4xxx.c.
Referenced by xmc4xxx_load_bank_layout().
|
static |
|
static |
const struct flash_driver xmc4xxx_flash |