OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | max32xxx_flash_bank |
Macros | |
#define | ARM_PID_DEFAULT_CM3 0x0000B4C3 |
#define | ARM_PID_DEFAULT_CM4 0x0000B4C4 |
#define | ARM_PID_REG 0xE00FFFE0 |
#define | FLC_ADDR 0x00000000 |
#define | FLC_BL_CTRL 0x00000170 |
#define | FLC_BL_CTRL_23 0x00020000 |
#define | FLC_BL_CTRL_IFREN 0x00000001 |
#define | FLC_CLKDIV 0x00000004 |
#define | FLC_CN 0x00000008 |
#define | FLC_CN_32BIT 0x00000010 |
#define | FLC_CN_ERASE_CODE_MASK 0x0000FF00 |
#define | FLC_CN_ERASE_CODE_ME 0x0000AA00 |
#define | FLC_CN_ERASE_CODE_PGE 0x00005500 |
#define | FLC_CN_ME 0x00000002 |
#define | FLC_CN_ME 0x00000002 |
#define | FLC_CN_PEND 0x01000000 |
#define | FLC_CN_PGE 0x00000004 |
#define | FLC_CN_PGE 0x00000004 |
#define | FLC_CN_UNLOCK_MASK 0xF0000000 |
#define | FLC_CN_UNLOCK_VALUE 0x20000000 |
#define | FLC_CN_WR 0x00000001 |
#define | FLC_CN_WR 0x00000001 |
#define | FLC_DATA0 0x00000030 |
#define | FLC_DATA1 0x00000034 |
#define | FLC_DATA2 0x00000038 |
#define | FLC_DATA3 0x0000003C |
#define | FLC_INT 0x00000024 |
#define | FLC_INT_AF 0x00000002 |
#define | FLC_MD 0x00000020 |
#define | FLC_PR1E_ADDR 0x0000000C |
#define | FLC_PR2E_ADDR 0x00000014 |
#define | FLC_PR2S_ADDR 0x00000010 |
#define | FLC_PR3E_ADDR 0x0000001C |
#define | FLC_PR3S_ADDR 0x00000018 |
#define | FLC_PROT 0x00000300 |
#define | MASK_ACCESS_VIOLATIONS (0xFFFFFCFC) |
#define | MASK_BURST_COMPLETE (0xF488FFEE & ~0x04000000) |
#define | MASK_DISABLE_INTS (0xFFFFFCFC) |
#define | MASK_ERASE_COMPLETE (0xF48800ED & ~0x04000000) |
#define | MASK_FLASH_BUSY (0x048800E0 & ~0x04000000) |
#define | MASK_FLASH_ERASE (0xF588FFEF & ~0x04000000) |
#define | MASK_FLASH_ERASED (0xF48800EB & ~0x04000000) |
#define | MASK_FLASH_LOCK (0xF588FFEF & ~0x04000000) |
#define | MASK_FLASH_UNLOCKED (0xF588FFEF & ~0x04000000) |
#define | MASK_FLASH_WRITE (0xF588FFEF & ~0x04000000) |
#define | MASK_MASS_ERASE (0xF588FFEF & ~0x04000000) |
#define | MASK_REMAINING_COMPLETE (0xF488FFEE & ~0x04000000) |
#define | MASK_WRITE_ALIGNED (0xF588FFEF & ~0x04000000) |
#define | MASK_WRITE_BURST (0xF588FFEF & ~0x04000000) |
#define | MASK_WRITE_COMPLETE (0xF488FFEE & ~0x04000000) |
#define | MASK_WRITE_REMAINING (0xF588FFEF & ~0x04000000) |
#define | MAX326XX_ID 0x0000004D |
#define | MAX326XX_ID_REG 0x40000838 |
#define | OPTIONS_128 0x01 |
#define | OPTIONS_AUTH 0x04 |
#define | OPTIONS_COUNT 0x08 |
#define | OPTIONS_ENC 0x02 |
#define | OPTIONS_INTER 0x10 |
#define | OPTIONS_KEYSIZE 0x40 |
#define | OPTIONS_RELATIVE_XOR 0x20 |
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 bool | max32xxx_flash_busy (uint32_t flash_cn) |
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 len) |
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_arm [] |
#define ARM_PID_DEFAULT_CM3 0x0000B4C3 |
Definition at line 78 of file max32xxx.c.
#define ARM_PID_DEFAULT_CM4 0x0000B4C4 |
Definition at line 79 of file max32xxx.c.
#define ARM_PID_REG 0xE00FFFE0 |
Definition at line 37 of file max32xxx.c.
#define FLC_ADDR 0x00000000 |
Definition at line 20 of file max32xxx.c.
#define FLC_BL_CTRL 0x00000170 |
Definition at line 34 of file max32xxx.c.
#define FLC_BL_CTRL_23 0x00020000 |
Definition at line 58 of file max32xxx.c.
#define FLC_BL_CTRL_IFREN 0x00000001 |
Definition at line 59 of file max32xxx.c.
#define FLC_CLKDIV 0x00000004 |
Definition at line 21 of file max32xxx.c.
#define FLC_CN 0x00000008 |
Definition at line 22 of file max32xxx.c.
#define FLC_CN_32BIT 0x00000010 |
Definition at line 50 of file max32xxx.c.
#define FLC_CN_ERASE_CODE_MASK 0x0000FF00 |
Definition at line 47 of file max32xxx.c.
#define FLC_CN_ERASE_CODE_ME 0x0000AA00 |
Definition at line 49 of file max32xxx.c.
#define FLC_CN_ERASE_CODE_PGE 0x00005500 |
Definition at line 48 of file max32xxx.c.
#define FLC_CN_ME 0x00000002 |
Definition at line 55 of file max32xxx.c.
#define FLC_CN_ME 0x00000002 |
Definition at line 55 of file max32xxx.c.
#define FLC_CN_PEND 0x01000000 |
Definition at line 46 of file max32xxx.c.
#define FLC_CN_PGE 0x00000004 |
Definition at line 54 of file max32xxx.c.
#define FLC_CN_PGE 0x00000004 |
Definition at line 54 of file max32xxx.c.
#define FLC_CN_UNLOCK_MASK 0xF0000000 |
Definition at line 43 of file max32xxx.c.
#define FLC_CN_UNLOCK_VALUE 0x20000000 |
Definition at line 44 of file max32xxx.c.
#define FLC_CN_WR 0x00000001 |
Definition at line 56 of file max32xxx.c.
#define FLC_CN_WR 0x00000001 |
Definition at line 56 of file max32xxx.c.
#define FLC_DATA0 0x00000030 |
Definition at line 30 of file max32xxx.c.
#define FLC_DATA1 0x00000034 |
Definition at line 31 of file max32xxx.c.
#define FLC_DATA2 0x00000038 |
Definition at line 32 of file max32xxx.c.
#define FLC_DATA3 0x0000003C |
Definition at line 33 of file max32xxx.c.
#define FLC_INT 0x00000024 |
Definition at line 29 of file max32xxx.c.
#define FLC_INT_AF 0x00000002 |
Definition at line 41 of file max32xxx.c.
#define FLC_MD 0x00000020 |
Definition at line 28 of file max32xxx.c.
#define FLC_PR1E_ADDR 0x0000000C |
Definition at line 23 of file max32xxx.c.
#define FLC_PR2E_ADDR 0x00000014 |
Definition at line 25 of file max32xxx.c.
#define FLC_PR2S_ADDR 0x00000010 |
Definition at line 24 of file max32xxx.c.
#define FLC_PR3E_ADDR 0x0000001C |
Definition at line 27 of file max32xxx.c.
#define FLC_PR3S_ADDR 0x00000018 |
Definition at line 26 of file max32xxx.c.
#define FLC_PROT 0x00000300 |
Definition at line 35 of file max32xxx.c.
#define MASK_ACCESS_VIOLATIONS (0xFFFFFCFC) |
Definition at line 67 of file max32xxx.c.
#define MASK_BURST_COMPLETE (0xF488FFEE & ~0x04000000) |
Definition at line 72 of file max32xxx.c.
#define MASK_DISABLE_INTS (0xFFFFFCFC) |
Definition at line 62 of file max32xxx.c.
#define MASK_ERASE_COMPLETE (0xF48800ED & ~0x04000000) |
Definition at line 76 of file max32xxx.c.
#define MASK_FLASH_BUSY (0x048800E0 & ~0x04000000) |
Definition at line 61 of file max32xxx.c.
#define MASK_FLASH_ERASE (0xF588FFEF & ~0x04000000) |
Definition at line 65 of file max32xxx.c.
#define MASK_FLASH_ERASED (0xF48800EB & ~0x04000000) |
Definition at line 66 of file max32xxx.c.
#define MASK_FLASH_LOCK (0xF588FFEF & ~0x04000000) |
Definition at line 64 of file max32xxx.c.
#define MASK_FLASH_UNLOCKED (0xF588FFEF & ~0x04000000) |
Definition at line 63 of file max32xxx.c.
#define MASK_FLASH_WRITE (0xF588FFEF & ~0x04000000) |
Definition at line 68 of file max32xxx.c.
#define MASK_MASS_ERASE (0xF588FFEF & ~0x04000000) |
Definition at line 75 of file max32xxx.c.
#define MASK_REMAINING_COMPLETE (0xF488FFEE & ~0x04000000) |
Definition at line 74 of file max32xxx.c.
#define MASK_WRITE_ALIGNED (0xF588FFEF & ~0x04000000) |
Definition at line 69 of file max32xxx.c.
#define MASK_WRITE_BURST (0xF588FFEF & ~0x04000000) |
Definition at line 71 of file max32xxx.c.
#define MASK_WRITE_COMPLETE (0xF488FFEE & ~0x04000000) |
Definition at line 70 of file max32xxx.c.
#define MASK_WRITE_REMAINING (0xF588FFEF & ~0x04000000) |
Definition at line 73 of file max32xxx.c.
#define MAX326XX_ID 0x0000004D |
Definition at line 80 of file max32xxx.c.
#define MAX326XX_ID_REG 0x40000838 |
Definition at line 38 of file max32xxx.c.
#define OPTIONS_128 0x01 |
Definition at line 82 of file max32xxx.c.
#define OPTIONS_AUTH 0x04 |
Definition at line 84 of file max32xxx.c.
#define OPTIONS_COUNT 0x08 |
Definition at line 85 of file max32xxx.c.
#define OPTIONS_ENC 0x02 |
Definition at line 83 of file max32xxx.c.
#define OPTIONS_INTER 0x10 |
Definition at line 86 of file max32xxx.c.
#define OPTIONS_KEYSIZE 0x40 |
Definition at line 88 of file max32xxx.c.
#define OPTIONS_RELATIVE_XOR 0x20 |
Definition at line 87 of file max32xxx.c.
COMMAND_HANDLER | ( | max32xxx_handle_mass_erase_command | ) |
Definition at line 833 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 966 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 910 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 854 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 107 of file max32xxx.c.
References bank, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_FLASH_BANK_INVALID, ERROR_OK, info, and LOG_ERROR.
|
static |
Definition at line 128 of file max32xxx.c.
References bank, cmd, command_print_sameline(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, and info.
|
static |
Definition at line 250 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, FLC_ADDR, FLC_CN, FLC_CN_ERASE_CODE_PGE, FLC_CN_PGE, FLC_INT, FLC_INT_AF, info, LOG_ERROR, LOG_WARNING, max32xxx_flash_busy(), max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_mass_erase(), TARGET_HALTED, target_read_u32(), and target_write_u32().
|
static |
Definition at line 139 of file max32xxx.c.
References FLC_CN_ME, FLC_CN_PGE, and FLC_CN_WR.
Referenced by max32xxx_erase(), max32xxx_flash_op_pre(), max32xxx_mass_erase(), and max32xxx_write().
|
static |
Definition at line 205 of file max32xxx.c.
References bank, ERROR_OK, FLC_CN, FLC_CN_UNLOCK_MASK, FLC_INT, info, target_read_u32(), and target_write_u32().
Referenced by max32xxx_erase(), max32xxx_mass_erase(), and max32xxx_write().
|
static |
Definition at line 147 of file max32xxx.c.
References bank, ERROR_FAIL, ERROR_FLASH_BUSY, ERROR_OK, FLC_BL_CTRL, FLC_BL_CTRL_23, FLC_BL_CTRL_IFREN, FLC_CLKDIV, FLC_CN, FLC_CN_UNLOCK_MASK, FLC_CN_UNLOCK_VALUE, FLC_INT, info, LOG_ERROR, LOG_WARNING, max32xxx_flash_busy(), target_read_u32(), and target_write_u32().
Referenced by max32xxx_erase(), max32xxx_mass_erase(), and max32xxx_write().
|
static |
Definition at line 762 of file max32xxx.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLC_CN, FLC_CN_ERASE_CODE_ME, FLC_CN_ME, FLC_INT, FLC_INT_AF, info, LOG_ERROR, LOG_WARNING, max32xxx_flash_busy(), 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 716 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 335 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, FLC_PROT, info, LOG_ERROR, TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 221 of file max32xxx.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, FLC_PROT, info, and target_read_u32().
Referenced by COMMAND_HANDLER(), and max32xxx_probe().
|
static |
Definition at line 485 of file max32xxx.c.
References address, 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, FLC_ADDR, FLC_CN, FLC_CN_32BIT, FLC_CN_PEND, FLC_CN_WR, FLC_DATA0, FLC_INT, FLC_INT_AF, info, LOG_DEBUG, LOG_ERROR, max32xxx_flash_busy(), max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_write_block(), offset, OPTIONS_128, OPTIONS_ENC, TARGET_HALTED, target_read_u32(), target_write_buffer(), and target_write_u32().
|
static |
Definition at line 376 of file max32xxx.c.
References ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), buffer, buffer_size, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, info, init_mem_param(), init_reg_param(), LOG_DEBUG, LOG_ERROR, target_type::name, 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_type_name(), target_write_buffer(), target::type, and write_code_arm.
Referenced by max32xxx_write().
|
static |
Definition at line 966 of file max32xxx.c.
|
static |
Definition at line 966 of file max32xxx.c.
const struct flash_driver max32xxx_flash |
Definition at line 966 of file max32xxx.c.
|
static |
Definition at line 103 of file max32xxx.c.
Referenced by max32xxx_write_block().