OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | max32xxx_flash_bank |
Macros | |
#define | ARM_PID_DEFAULT_CM3 0xB4C3 |
#define | ARM_PID_DEFAULT_CM4 0xB4C4 |
#define | ARM_PID_REG 0xE00FFFE0 |
#define | FLASH_BL_CTRL_23 0x00020000 |
#define | FLASH_BL_CTRL_IFREN 0x00000001 |
#define | FLSH_ADDR 0x000 |
#define | FLSH_BL_CTRL 0x170 |
#define | FLSH_CLKDIV 0x004 |
#define | FLSH_CN 0x008 |
#define | FLSH_CN_ERASE_CODE_MASK 0x0000FF00 |
#define | FLSH_CN_ERASE_CODE_ME 0x0000AA00 |
#define | FLSH_CN_ERASE_CODE_PGE 0x00005500 |
#define | FLSH_CN_ME 0x00000002 |
#define | FLSH_CN_PEND 0x01000000 |
#define | FLSH_CN_PGE 0x00000004 |
#define | FLSH_CN_UNLOCK_MASK 0xF0000000 |
#define | FLSH_CN_UNLOCK_VALUE 0x20000000 |
#define | FLSH_CN_WR 0x00000001 |
#define | FLSH_DATA0 0x030 |
#define | FLSH_DATA1 0x034 |
#define | FLSH_DATA2 0x038 |
#define | FLSH_DATA3 0x03C |
#define | FLSH_INT 0x024 |
#define | FLSH_INT_AF 0x00000002 |
#define | FLSH_MD 0x020 |
#define | FLSH_PROT 0x300 |
#define | MAX326XX_ID 0x4D |
#define | MAX326XX_ID_REG 0x40000838 |
#define | PR1E_ADDR 0x00C |
#define | PR2E_ADDR 0x014 |
#define | PR2S_ADDR 0x010 |
#define | PR3E_ADDR 0x01C |
#define | PR3S_ADDR 0x018 |
Functions | |
COMMAND_HANDLER (max32xxx_handle_mass_erase_command) | |
COMMAND_HANDLER (max32xxx_handle_protection_check_command) | |
COMMAND_HANDLER (max32xxx_handle_protection_clr_command) | |
COMMAND_HANDLER (max32xxx_handle_protection_set_command) | |
FLASH_BANK_COMMAND_HANDLER (max32xxx_flash_bank_command) | |
static int | get_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | max32xxx_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | max32xxx_flash_op_post (struct flash_bank *bank) |
static int | max32xxx_flash_op_pre (struct flash_bank *bank) |
static int | max32xxx_mass_erase (struct flash_bank *bank) |
static int | max32xxx_probe (struct flash_bank *bank) |
static int | max32xxx_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | max32xxx_protect_check (struct flash_bank *bank) |
static int | max32xxx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | max32xxx_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t wcount) |
Variables | |
static const struct command_registration | max32xxx_command_handlers [] |
static const struct command_registration | max32xxx_exec_command_handlers [] |
const struct flash_driver | max32xxx_flash |
static const uint8_t | write_code [] |
#define ARM_PID_DEFAULT_CM3 0xB4C3 |
Definition at line 56 of file max32xxx.c.
#define ARM_PID_DEFAULT_CM4 0xB4C4 |
Definition at line 57 of file max32xxx.c.
#define ARM_PID_REG 0xE00FFFE0 |
Definition at line 35 of file max32xxx.c.
#define FLASH_BL_CTRL_23 0x00020000 |
Definition at line 53 of file max32xxx.c.
#define FLASH_BL_CTRL_IFREN 0x00000001 |
Definition at line 54 of file max32xxx.c.
#define FLSH_ADDR 0x000 |
Definition at line 18 of file max32xxx.c.
#define FLSH_BL_CTRL 0x170 |
Definition at line 32 of file max32xxx.c.
#define FLSH_CLKDIV 0x004 |
Definition at line 19 of file max32xxx.c.
#define FLSH_CN 0x008 |
Definition at line 20 of file max32xxx.c.
#define FLSH_CN_ERASE_CODE_MASK 0x0000FF00 |
Definition at line 46 of file max32xxx.c.
#define FLSH_CN_ERASE_CODE_ME 0x0000AA00 |
Definition at line 48 of file max32xxx.c.
#define FLSH_CN_ERASE_CODE_PGE 0x00005500 |
Definition at line 47 of file max32xxx.c.
#define FLSH_CN_ME 0x00000002 |
Definition at line 51 of file max32xxx.c.
#define FLSH_CN_PEND 0x01000000 |
Definition at line 44 of file max32xxx.c.
#define FLSH_CN_PGE 0x00000004 |
Definition at line 50 of file max32xxx.c.
#define FLSH_CN_UNLOCK_MASK 0xF0000000 |
Definition at line 41 of file max32xxx.c.
#define FLSH_CN_UNLOCK_VALUE 0x20000000 |
Definition at line 42 of file max32xxx.c.
#define FLSH_CN_WR 0x00000001 |
Definition at line 52 of file max32xxx.c.
#define FLSH_DATA0 0x030 |
Definition at line 28 of file max32xxx.c.
#define FLSH_DATA1 0x034 |
Definition at line 29 of file max32xxx.c.
#define FLSH_DATA2 0x038 |
Definition at line 30 of file max32xxx.c.
#define FLSH_DATA3 0x03C |
Definition at line 31 of file max32xxx.c.
#define FLSH_INT 0x024 |
Definition at line 27 of file max32xxx.c.
#define FLSH_INT_AF 0x00000002 |
Definition at line 39 of file max32xxx.c.
#define FLSH_MD 0x020 |
Definition at line 26 of file max32xxx.c.
#define FLSH_PROT 0x300 |
Definition at line 33 of file max32xxx.c.
#define MAX326XX_ID 0x4D |
Definition at line 58 of file max32xxx.c.
#define MAX326XX_ID_REG 0x40000838 |
Definition at line 36 of file max32xxx.c.
#define PR1E_ADDR 0x00C |
Definition at line 21 of file max32xxx.c.
#define PR2E_ADDR 0x014 |
Definition at line 23 of file max32xxx.c.
#define PR2S_ADDR 0x010 |
Definition at line 22 of file max32xxx.c.
#define PR3E_ADDR 0x01C |
Definition at line 25 of file max32xxx.c.
#define PR3S_ADDR 0x018 |
Definition at line 24 of file max32xxx.c.
COMMAND_HANDLER | ( | max32xxx_handle_mass_erase_command | ) |
Definition at line 749 of file max32xxx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_OK, and max32xxx_mass_erase().
COMMAND_HANDLER | ( | max32xxx_handle_protection_check_command | ) |
Definition at line 882 of file max32xxx.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_OK, info, LOG_WARNING, and max32xxx_protect_check().
COMMAND_HANDLER | ( | max32xxx_handle_protection_clr_command | ) |
Definition at line 826 of file max32xxx.c.
References addr, bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_FAIL, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, info, LOG_WARNING, and max32xxx_protect().
COMMAND_HANDLER | ( | max32xxx_handle_protection_set_command | ) |
Definition at line 770 of file max32xxx.c.
References addr, bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_FAIL, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, info, LOG_WARNING, and max32xxx_protect().
FLASH_BANK_COMMAND_HANDLER | ( | max32xxx_flash_bank_command | ) |
Definition at line 81 of file max32xxx.c.
References bank, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_FLASH_BANK_INVALID, ERROR_OK, info, and LOG_WARNING.
|
static |
Definition at line 106 of file max32xxx.c.
References bank, cmd, command_print_sameline(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, and info.
|
static |
Definition at line 224 of file max32xxx.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLSH_ADDR, FLSH_CN, FLSH_CN_ERASE_CODE_PGE, FLSH_CN_PEND, FLSH_INT, FLSH_INT_AF, info, LOG_ERROR, LOG_WARNING, max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_mass_erase(), TARGET_HALTED, target_read_u32(), and target_write_u32().
|
static |
Definition at line 179 of file max32xxx.c.
References bank, ERROR_OK, FLSH_CN, FLSH_CN_UNLOCK_MASK, FLSH_INT, info, target_read_u32(), and target_write_u32().
Referenced by max32xxx_erase(), max32xxx_mass_erase(), and max32xxx_write().
|
static |
Definition at line 121 of file max32xxx.c.
References bank, ERROR_FAIL, ERROR_FLASH_BUSY, ERROR_OK, FLASH_BL_CTRL_23, FLASH_BL_CTRL_IFREN, FLSH_BL_CTRL, FLSH_CLKDIV, FLSH_CN, FLSH_CN_ERASE_CODE_MASK, FLSH_CN_ME, FLSH_CN_PEND, FLSH_CN_PGE, FLSH_CN_UNLOCK_MASK, FLSH_CN_UNLOCK_VALUE, FLSH_CN_WR, FLSH_INT, info, LOG_ERROR, LOG_WARNING, target_read_u32(), and target_write_u32().
Referenced by max32xxx_erase(), max32xxx_mass_erase(), and max32xxx_write().
|
static |
Definition at line 678 of file max32xxx.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLSH_CN, FLSH_CN_ERASE_CODE_ME, FLSH_CN_PEND, FLSH_INT, FLSH_INT_AF, info, LOG_ERROR, LOG_WARNING, max32xxx_flash_op_post(), max32xxx_flash_op_pre(), NULL, target::state, TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER(), and max32xxx_erase().
|
static |
Definition at line 632 of file max32xxx.c.
References ARM_PID_DEFAULT_CM3, ARM_PID_DEFAULT_CM4, ARM_PID_REG, bank, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, info, LOG_DEBUG, LOG_WARNING, MAX326XX_ID, MAX326XX_ID_REG, max32xxx_protect_check(), and target_read_u32().
|
static |
Definition at line 309 of file max32xxx.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLSH_PROT, info, LOG_ERROR, TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 195 of file max32xxx.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, FLSH_PROT, info, and target_read_u32().
Referenced by COMMAND_HANDLER(), and max32xxx_probe().
|
static |
Definition at line 427 of file max32xxx.c.
References bank, buffer, count, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FLSH_ADDR, FLSH_CN, FLSH_CN_PEND, FLSH_DATA0, FLSH_INT, FLSH_INT_AF, info, LOG_DEBUG, LOG_ERROR, LOG_WARNING, max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_write_block(), offset, TARGET_HALTED, target_read_u32(), target_write_buffer(), and target_write_u32().
|
static |
Definition at line 350 of file max32xxx.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, info, init_reg_param(), LOG_DEBUG, LOG_ERROR, NULL, offset, PARAM_OUT, source, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_name(), target_run_flash_async_algorithm(), target_write_buffer(), and write_code.
Referenced by max32xxx_write().
|
static |
Definition at line 882 of file max32xxx.c.
|
static |
Definition at line 882 of file max32xxx.c.
const struct flash_driver max32xxx_flash |
Definition at line 882 of file max32xxx.c.
|
static |
Definition at line 74 of file max32xxx.c.
Referenced by max32xxx_write_block(), and xmc1xxx_write().