OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | stellaris_flash_bank |
Macros | |
#define | AMASK 1 |
#define | AMISC 1 |
#define | DC0 0x008 |
#define | DC1 0x010 |
#define | DC2 0x014 |
#define | DC3 0x018 |
#define | DC4 0x01C |
#define | DID0 0x000 |
#define | DID0_VER(did0) ((did0 >> 28)&0x07) |
#define | DID1 0x004 |
#define | FLASH_CIM (FLASH_CONTROL_BASE | 0x010) |
#define | FLASH_CONTROL_BASE 0x400FD000 |
#define | FLASH_CRIS (FLASH_CONTROL_BASE | 0x00C) |
#define | FLASH_FMA (FLASH_CONTROL_BASE | 0x000) |
#define | FLASH_FMA_PPE(x) (2 * (x) + 1) /* for FMPPPEx */ |
#define | FLASH_FMA_PRE(x) (2 * (x)) /* for FMPPREx */ |
#define | FLASH_FMC (FLASH_CONTROL_BASE | 0x008) |
#define | FLASH_FMD (FLASH_CONTROL_BASE | 0x004) |
#define | FLASH_FSIZE (FLASH_CONTROL_BASE | 0xFC0) |
#define | FLASH_MISC (FLASH_CONTROL_BASE | 0x014) |
#define | FLASH_SSIZE (FLASH_CONTROL_BASE | 0xFC4) |
#define | FMC_COMT (1 << 3) |
#define | FMC_ERASE (1 << 1) |
#define | FMC_MERASE (1 << 2) |
#define | FMC_WRITE (1 << 0) |
#define | FMC_WRKEY (0xA442 << 16) |
#define | FMPPE 0x134 |
#define | FMPPE0 0x400 /* PPE1 = PPE0 + 4, etc */ |
#define | FMPRE 0x130 |
#define | FMPRE0 0x200 /* PRE1 = PRE0 + 4, etc */ |
#define | NVMSTAT 0x1a0 |
#define | PLLCFG 0x064 |
#define | PMASK 2 |
#define | PMISC 2 |
#define | RCC 0x060 |
#define | RCC2 0x070 |
#define | RIS 0x050 |
#define | SCB_BASE 0x400FE000 |
#define | USECRL 0x140 |
Functions | |
COMMAND_HANDLER (stellaris_handle_mass_erase_command) | |
COMMAND_HANDLER (stellaris_handle_recover_command) | |
Perform the Stellaris "Recovering a 'Locked' Device procedure. More... | |
FLASH_BANK_COMMAND_HANDLER (stellaris_flash_bank_command) | |
static int | get_stellaris_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | stellaris_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | stellaris_mass_erase (struct flash_bank *bank) |
static int | stellaris_probe (struct flash_bank *bank) |
static int | stellaris_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | stellaris_protect_check (struct flash_bank *bank) |
static void | stellaris_read_clock_info (struct flash_bank *bank) |
Read clock configuration and set stellaris_info->usec_clocks. More... | |
static int | stellaris_read_part_info (struct flash_bank *bank) |
static void | stellaris_set_flash_timing (struct flash_bank *bank) |
static int | stellaris_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | stellaris_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t wcount) |
Variables | |
static const unsigned int | rcc_xtal [32] |
static const char *const | stellaris_classname [] |
static const struct command_registration | stellaris_command_handlers [] |
static const struct command_registration | stellaris_exec_command_handlers [] |
const struct flash_driver | stellaris_flash |
struct { | |
uint8_t class | |
const char * partname | |
uint8_t partno | |
} | stellaris_parts [] |
static const uint8_t | stellaris_write_code [] |
#define AMASK 1 |
Definition at line 66 of file stellaris.c.
#define AMISC 1 |
Definition at line 63 of file stellaris.c.
#define DC0 0x008 |
Definition at line 31 of file stellaris.c.
#define DC1 0x010 |
Definition at line 32 of file stellaris.c.
#define DC2 0x014 |
Definition at line 33 of file stellaris.c.
#define DC3 0x018 |
Definition at line 34 of file stellaris.c.
#define DC4 0x01C |
Definition at line 35 of file stellaris.c.
#define DID0 0x000 |
Definition at line 29 of file stellaris.c.
#define DID0_VER | ( | did0 | ) | ((did0 >> 28)&0x07) |
Definition at line 25 of file stellaris.c.
#define DID1 0x004 |
Definition at line 30 of file stellaris.c.
#define FLASH_CIM (FLASH_CONTROL_BASE | 0x010) |
Definition at line 58 of file stellaris.c.
#define FLASH_CONTROL_BASE 0x400FD000 |
Definition at line 53 of file stellaris.c.
#define FLASH_CRIS (FLASH_CONTROL_BASE | 0x00C) |
Definition at line 57 of file stellaris.c.
#define FLASH_FMA (FLASH_CONTROL_BASE | 0x000) |
Definition at line 54 of file stellaris.c.
#define FLASH_FMA_PPE | ( | x | ) | (2 * (x) + 1) /* for FMPPPEx */ |
Definition at line 80 of file stellaris.c.
#define FLASH_FMA_PRE | ( | x | ) | (2 * (x)) /* for FMPPREx */ |
Definition at line 79 of file stellaris.c.
#define FLASH_FMC (FLASH_CONTROL_BASE | 0x008) |
Definition at line 56 of file stellaris.c.
#define FLASH_FMD (FLASH_CONTROL_BASE | 0x004) |
Definition at line 55 of file stellaris.c.
#define FLASH_FSIZE (FLASH_CONTROL_BASE | 0xFC0) |
Definition at line 60 of file stellaris.c.
#define FLASH_MISC (FLASH_CONTROL_BASE | 0x014) |
Definition at line 59 of file stellaris.c.
#define FLASH_SSIZE (FLASH_CONTROL_BASE | 0xFC4) |
Definition at line 61 of file stellaris.c.
#define FMC_COMT (1 << 3) |
Definition at line 71 of file stellaris.c.
#define FMC_ERASE (1 << 1) |
Definition at line 73 of file stellaris.c.
#define FMC_MERASE (1 << 2) |
Definition at line 72 of file stellaris.c.
#define FMC_WRITE (1 << 0) |
Definition at line 74 of file stellaris.c.
#define FMC_WRKEY (0xA442 << 16) |
Definition at line 70 of file stellaris.c.
#define FMPPE 0x134 |
Definition at line 45 of file stellaris.c.
#define FMPPE0 0x400 /* PPE1 = PPE0 + 4, etc */ |
Definition at line 49 of file stellaris.c.
#define FMPRE 0x130 |
Definition at line 44 of file stellaris.c.
#define FMPRE0 0x200 /* PRE1 = PRE0 + 4, etc */ |
Definition at line 48 of file stellaris.c.
#define NVMSTAT 0x1a0 |
Definition at line 41 of file stellaris.c.
#define PLLCFG 0x064 |
Definition at line 39 of file stellaris.c.
#define PMASK 2 |
Definition at line 67 of file stellaris.c.
#define PMISC 2 |
Definition at line 64 of file stellaris.c.
#define RCC 0x060 |
Definition at line 38 of file stellaris.c.
#define RCC2 0x070 |
Definition at line 40 of file stellaris.c.
#define RIS 0x050 |
Definition at line 37 of file stellaris.c.
#define SCB_BASE 0x400FE000 |
Definition at line 28 of file stellaris.c.
#define USECRL 0x140 |
Definition at line 51 of file stellaris.c.
COMMAND_HANDLER | ( | stellaris_handle_mass_erase_command | ) |
Definition at line 1299 of file stellaris.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stellaris_mass_erase().
COMMAND_HANDLER | ( | stellaris_handle_recover_command | ) |
Perform the Stellaris "Recovering a 'Locked' Device procedure.
This performs a mass erase and then restores all nonvolatile registers (including USER_* registers and flash lock bits) to their defaults. Accordingly, flash can be reprogrammed, and JTAG can be used.
NOTE that DustDevil parts (at least rev A0 silicon) have errata which can affect this operation if flash protection has been enabled.
Definition at line 1326 of file stellaris.c.
References adapter_assert_reset(), adapter_deassert_reset(), bank, CMD_ARGC, CMD_CTX, arm::dap, dap_to_jtag(), dap_to_swd(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_flash_bank_by_num_noprobe(), jtag_execute_queue(), jtag_get_reset_config(), LOG_ERROR, LOG_INFO, NULL, RESET_HAS_SRST, and target_to_arm().
FLASH_BANK_COMMAND_HANDLER | ( | stellaris_flash_bank_command | ) |
Definition at line 449 of file stellaris.c.
References bank, CMD_ARGC, stellaris_flash_bank::did1, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stellaris_flash_bank::target_name.
|
static |
Definition at line 472 of file stellaris.c.
References bank, cmd, command_print_sameline(), stellaris_flash_bank::did0, stellaris_flash_bank::did1, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, stellaris_flash_bank::mck_desc, stellaris_flash_bank::mck_freq, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, stellaris_flash_bank::rcc, stellaris_flash_bank::rcc2, stellaris_flash_bank::sramsiz, stellaris_classname, stellaris_read_clock_info(), stellaris_flash_bank::target_class, and stellaris_flash_bank::target_name.
|
static |
Definition at line 828 of file stellaris.c.
References AMASK, AMISC, bank, stellaris_flash_bank::did1, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_CIM, FLASH_CRIS, FLASH_FMA, FLASH_FMC, FLASH_MISC, FMC_ERASE, FMC_WRKEY, LOG_ERROR, LOG_WARNING, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, PMISC, stellaris_mass_erase(), stellaris_read_clock_info(), stellaris_set_flash_timing(), TARGET_HALTED, target_read_u32(), and target_write_u32().
|
static |
Definition at line 1249 of file stellaris.c.
References AMISC, bank, stellaris_flash_bank::did1, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_CIM, FLASH_FMA, FLASH_FMC, FLASH_MISC, FMC_MERASE, FMC_WRKEY, LOG_ERROR, NULL, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, PMISC, target::state, stellaris_read_clock_info(), stellaris_set_flash_timing(), TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER(), and stellaris_erase().
|
static |
Definition at line 1214 of file stellaris.c.
References bank, stellaris_flash_bank::did1, ERROR_OK, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, and stellaris_read_part_info().
|
static |
Definition at line 884 of file stellaris.c.
References AMASK, AMISC, bank, stellaris_flash_bank::did0, stellaris_flash_bank::did1, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FLASH_CIM, FLASH_CRIS, FLASH_FMA, FLASH_FMC, FLASH_MISC, FMC_COMT, FMC_WRKEY, FMPPE, FMPPE0, LOG_ERROR, LOG_WARNING, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, PMISC, SCB_BASE, target::state, stellaris_read_clock_info(), stellaris_set_flash_timing(), stellaris_flash_bank::target_class, TARGET_HALTED, target_read_u32(), and target_write_u32().
|
static |
Definition at line 780 of file stellaris.c.
References bank, stellaris_flash_bank::did1, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, FMPPE, FMPPE0, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, SCB_BASE, status, stellaris_flash_bank::target_class, and target_read_u32().
|
static |
Read clock configuration and set stellaris_info->usec_clocks.
Definition at line 567 of file stellaris.c.
References bank, stellaris_flash_bank::iosc_desc, stellaris_flash_bank::iosc_freq, LOG_DEBUG, stellaris_flash_bank::mck_desc, stellaris_flash_bank::mck_freq, PLLCFG, RCC, stellaris_flash_bank::rcc, RCC2, stellaris_flash_bank::rcc2, rcc_xtal, SCB_BASE, target_read_u32(), and stellaris_flash_bank::xtal_mask.
Referenced by get_stellaris_info(), stellaris_erase(), stellaris_mass_erase(), stellaris_protect(), and stellaris_write().
|
static |
Definition at line 650 of file stellaris.c.
References bank, DC0, stellaris_flash_bank::dc0, DC1, stellaris_flash_bank::dc1, DID0, stellaris_flash_bank::did0, DID0_VER, DID1, stellaris_flash_bank::did1, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FLASH_FSIZE, FLASH_SSIZE, stellaris_flash_bank::fsize, stellaris_flash_bank::iosc_desc, stellaris_flash_bank::iosc_freq, LOG_DEBUG, LOG_WARNING, stellaris_flash_bank::num_pages, stellaris_flash_bank::pagesize, partno, SCB_BASE, stellaris_flash_bank::sramsiz, stellaris_flash_bank::ssize, stellaris_parts, stellaris_flash_bank::target_class, stellaris_flash_bank::target_name, target_read_u32(), and stellaris_flash_bank::xtal_mask.
Referenced by stellaris_probe().
|
static |
Definition at line 519 of file stellaris.c.
References bank, LOG_DEBUG, stellaris_flash_bank::mck_freq, SCB_BASE, stellaris_flash_bank::target_class, target_write_u32(), and USECRL.
Referenced by stellaris_erase(), stellaris_mass_erase(), stellaris_protect(), and stellaris_write().
|
static |
Definition at line 1101 of file stellaris.c.
References AMASK, AMISC, bank, buffer, count, stellaris_flash_bank::did1, 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, FLASH_CIM, FLASH_CRIS, FLASH_FMA, FLASH_FMC, FLASH_FMD, FLASH_MISC, FMC_WRITE, FMC_WRKEY, LOG_DEBUG, LOG_ERROR, LOG_WARNING, offset, PMISC, stellaris_read_clock_info(), stellaris_set_flash_timing(), stellaris_write_block(), TARGET_HALTED, target_read_u32(), target_write_buffer(), and target_write_u32().
|
static |
Definition at line 1019 of file stellaris.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, init_reg_param(), LOG_DEBUG, LOG_ERROR, NULL, offset, PARAM_OUT, source, stellaris_write_code, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_name(), target_run_flash_async_algorithm(), and target_write_buffer().
Referenced by stellaris_write().
uint8_t class |
Definition at line 116 of file stellaris.c.
const char* partname |
Definition at line 118 of file stellaris.c.
uint8_t partno |
Definition at line 117 of file stellaris.c.
Referenced by stellaris_read_part_info().
|
static |
Definition at line 533 of file stellaris.c.
Referenced by stellaris_read_clock_info().
|
static |
Definition at line 429 of file stellaris.c.
Referenced by get_stellaris_info().
|
static |
Definition at line 1326 of file stellaris.c.
|
static |
Definition at line 1326 of file stellaris.c.
const struct flash_driver stellaris_flash |
Definition at line 1326 of file stellaris.c.
const { ... } stellaris_parts[] |
Referenced by stellaris_read_part_info().
|
static |
Definition at line 983 of file stellaris.c.
Referenced by stellaris_write_block().