OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | ambiqmicro_flash_bank |
Macros | |
#define | CHECK_STATUS(rc, msg) |
Check error, log error. More... | |
#define | FLASH_ERASE_LIST_MAIN_PAGES_FROM_SRAM 0x08000065 |
#define | FLASH_MASS_ERASE_MAIN_PAGES_FROM_SRAM 0x08000069 |
#define | FLASH_PROGRAM_MAIN_FROM_SRAM 0x0800005d |
#define | FLASH_PROGRAM_OTP_FROM_SRAM 0x08000061 |
#define | OTP_PROGRAM_KEY (0x87655678) |
#define | PROGRAM_KEY (0x12344321) |
Functions | |
static int | ambiqmicro_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | ambiqmicro_exec_command (struct target *target, uint32_t command, uint32_t flash_return_address) |
static int | ambiqmicro_mass_erase (struct flash_bank *bank) |
static int | ambiqmicro_otp_program (struct flash_bank *bank, uint32_t offset, uint32_t count) |
static int | ambiqmicro_probe (struct flash_bank *bank) |
static int | ambiqmicro_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | ambiqmicro_protect_check (struct flash_bank *bank) |
static int | ambiqmicro_read_part_info (struct flash_bank *bank) |
static int | ambiqmicro_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | ambiqmicro_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | check_flash_status (struct target *target, uint32_t address) |
Read flash status from bootloader. More... | |
COMMAND_HANDLER (ambiqmicro_handle_mass_erase_command) | |
COMMAND_HANDLER (ambiqmicro_handle_page_erase_command) | |
COMMAND_HANDLER (ambiqmicro_handle_program_otp_command) | |
Program the otp block. More... | |
FLASH_BANK_COMMAND_HANDLER (ambiqmicro_flash_bank_command) | |
static int | get_ambiqmicro_info (struct flash_bank *bank, struct command_invocation *cmd) |
Variables | |
static char * | ambiqmicro_classname [6] |
static const struct command_registration | ambiqmicro_command_handlers [] |
static const struct command_registration | ambiqmicro_exec_command_handlers [] |
const struct flash_driver | ambiqmicro_flash |
struct { | |
uint8_t class | |
const char * partname | |
uint8_t partno | |
} | ambiqmicro_parts [6] |
static const uint32_t | apollo_flash_size [] |
static const uint32_t | apollo_sram_size [] |
#define CHECK_STATUS | ( | rc, | |
msg | |||
) |
Check error, log error.
Definition at line 31 of file ambiqmicro.c.
#define FLASH_ERASE_LIST_MAIN_PAGES_FROM_SRAM 0x08000065 |
Definition at line 43 of file ambiqmicro.c.
#define FLASH_MASS_ERASE_MAIN_PAGES_FROM_SRAM 0x08000069 |
Definition at line 44 of file ambiqmicro.c.
#define FLASH_PROGRAM_MAIN_FROM_SRAM 0x0800005d |
Definition at line 41 of file ambiqmicro.c.
#define FLASH_PROGRAM_OTP_FROM_SRAM 0x08000061 |
Definition at line 42 of file ambiqmicro.c.
#define OTP_PROGRAM_KEY (0x87655678) |
Definition at line 39 of file ambiqmicro.c.
#define PROGRAM_KEY (0x12344321) |
Definition at line 38 of file ambiqmicro.c.
|
static |
Definition at line 400 of file ambiqmicro.c.
References ambiqmicro_exec_command(), ambiqmicro_mass_erase(), bank, CHECK_STATUS, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_ERASE_LIST_MAIN_PAGES_FROM_SRAM, LOG_ERROR, LOG_INFO, ambiqmicro_flash_bank::num_pages, ambiqmicro_flash_bank::probed, PROGRAM_KEY, TARGET_HALTED, and target_write_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 283 of file ambiqmicro.c.
References alive_sleep(), check_flash_status(), CHECK_STATUS, ERROR_OK, LOG_DEBUG, LOG_ERROR, target::state, TARGET_DEBUG_RUNNING, TARGET_HALTED, target_poll(), target_resume(), and TARGET_RUNNING.
Referenced by ambiqmicro_erase(), ambiqmicro_mass_erase(), ambiqmicro_otp_program(), and ambiqmicro_write_block().
|
static |
Definition at line 330 of file ambiqmicro.c.
References ambiqmicro_exec_command(), bank, CHECK_STATUS, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_MASS_ERASE_MAIN_PAGES_FROM_SRAM, LOG_ERROR, LOG_INFO, NULL, ambiqmicro_flash_bank::probed, PROGRAM_KEY, target::state, TARGET_HALTED, and target_write_u32().
Referenced by ambiqmicro_erase(), and COMMAND_HANDLER().
|
static |
Definition at line 666 of file ambiqmicro.c.
References ambiqmicro_exec_command(), bank, CHECK_STATUS, count, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_PROGRAM_OTP_FROM_SRAM, LOG_ERROR, LOG_INFO, NULL, offset, OTP_PROGRAM_KEY, ambiqmicro_flash_bank::probed, target::state, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 624 of file ambiqmicro.c.
References ambiqmicro_read_part_info(), bank, ERROR_OK, LOG_INFO, ambiqmicro_flash_bank::num_pages, ambiqmicro_flash_bank::pagesize, and ambiqmicro_flash_bank::probed.
|
static |
Definition at line 501 of file ambiqmicro.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_INFO, and TARGET_HALTED.
|
static |
Definition at line 246 of file ambiqmicro.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, LOG_ERROR, ambiqmicro_flash_bank::probed, and status.
|
static |
Definition at line 169 of file ambiqmicro.c.
References ambiqmicro_parts, apollo_flash_size, apollo_sram_size, ARRAY_SIZE, bank, ERROR_OK, ambiqmicro_flash_bank::flshsiz, LOG_DEBUG, LOG_ERROR, LOG_INFO, ambiqmicro_flash_bank::num_pages, ambiqmicro_flash_bank::pagesize, ambiqmicro_flash_bank::sramsiz, ambiqmicro_flash_bank::target_class, ambiqmicro_flash_bank::target_name, and target_read_u32().
Referenced by ambiqmicro_probe().
|
static |
Definition at line 611 of file ambiqmicro.c.
References ambiqmicro_write_block(), bank, buffer, count, ERROR_OK, LOG_ERROR, and offset.
|
static |
Definition at line 520 of file ambiqmicro.c.
References ambiqmicro_exec_command(), bank, buffer, CHECK_STATUS, count, ERROR_FAIL, ERROR_OK, FLASH_PROGRAM_MAIN_FROM_SRAM, LOG_DEBUG, LOG_ERROR, LOG_INFO, offset, PROGRAM_KEY, target_write_buffer(), and target_write_u32().
Referenced by ambiqmicro_write().
|
static |
Read flash status from bootloader.
Definition at line 264 of file ambiqmicro.c.
References ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, and target_read_u32().
Referenced by ambiqmicro_exec_command().
COMMAND_HANDLER | ( | ambiqmicro_handle_mass_erase_command | ) |
Definition at line 745 of file ambiqmicro.c.
References ambiqmicro_mass_erase(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | ambiqmicro_handle_page_erase_command | ) |
Definition at line 763 of file ambiqmicro.c.
References ambiqmicro_erase(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | ambiqmicro_handle_program_otp_command | ) |
Program the otp block.
Definition at line 791 of file ambiqmicro.c.
FLASH_BANK_COMMAND_HANDLER | ( | ambiqmicro_flash_bank_command | ) |
Definition at line 120 of file ambiqmicro.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ambiqmicro_flash_bank::probed, and ambiqmicro_flash_bank::target_name.
|
static |
Definition at line 139 of file ambiqmicro.c.
References ambiqmicro_classname, bank, cmd, command_print_sameline(), ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, LOG_ERROR, ambiqmicro_flash_bank::probed, ambiqmicro_flash_bank::target_class, and ambiqmicro_flash_bank::target_name.
|
static |
Definition at line 110 of file ambiqmicro.c.
Referenced by get_ambiqmicro_info().
|
static |
Definition at line 791 of file ambiqmicro.c.
|
static |
Definition at line 791 of file ambiqmicro.c.
const struct flash_driver ambiqmicro_flash |
Definition at line 791 of file ambiqmicro.c.
struct { ... } ambiqmicro_parts[6] |
Referenced by ambiqmicro_read_part_info().
|
static |
Definition at line 47 of file ambiqmicro.c.
Referenced by ambiqmicro_read_part_info().
|
static |
Definition at line 57 of file ambiqmicro.c.
Referenced by ambiqmicro_read_part_info().
uint8_t class |
Definition at line 98 of file ambiqmicro.c.
const char* partname |
Definition at line 100 of file ambiqmicro.c.
uint8_t partno |
Definition at line 99 of file ambiqmicro.c.
Referenced by cortex_m_examine().