OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | str9xpec_flash_controller |
Macros | |
#define | ISC_ADDRESS_SHIFT 0x11 |
#define | ISC_BLANK_CHECK 0x60 |
#define | ISC_CLR_STATUS 0x13 |
#define | ISC_CONFIGURATION 0x07 |
#define | ISC_DISABLE 0x0F |
#define | ISC_ENABLE 0x0C |
#define | ISC_ERASE 0x30 |
#define | ISC_IDCODE 0xFE |
#define | ISC_MFG_READ 0x4C |
#define | ISC_NOOP 0x10 |
#define | ISC_PROGRAM 0x20 |
#define | ISC_PROGRAM_SECURITY 0x22 |
#define | ISC_PROGRAM_UC 0x23 |
#define | ISC_READ 0x50 |
#define | ISC_STATUS_BUSY 0x04 |
#define | ISC_STATUS_ERROR 0x03 |
#define | ISC_STATUS_INT_ERROR 0x30 |
#define | ISC_STATUS_MODE 0x08 |
#define | ISC_STATUS_SECURITY 0x40 |
#define | STR9XPEC_OPT_CSMAPBIT 48 |
#define | STR9XPEC_OPT_LVDSELBIT 50 |
#define | STR9XPEC_OPT_LVDTHRESBIT 49 |
#define | STR9XPEC_OPT_LVDWARNBIT 51 |
#define | STR9XPEC_OPT_OTPBIT 63 |
Enumerations | |
enum | str9xpec_status_codes { STR9XPEC_INVALID_COMMAND = 1 , STR9XPEC_ISC_SUCCESS = 2 , STR9XPEC_ISC_DISABLED = 3 , STR9XPEC_ISC_INTFAIL = 32 } |
Functions | |
COMMAND_HANDLER (str9xpec_handle_flash_disable_turbo_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_enable_turbo_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_lock_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_cmap_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_lvdsel_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_lvdthd_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_lvdwarn_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_read_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_options_write_command) | |
COMMAND_HANDLER (str9xpec_handle_flash_unlock_command) | |
COMMAND_HANDLER (str9xpec_handle_part_id_command) | |
FLASH_BANK_COMMAND_HANDLER (str9xpec_flash_bank_command) | |
static int | str9xpec_blank_check (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | str9xpec_build_block_list (struct flash_bank *bank) |
static int | str9xpec_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | str9xpec_erase_area (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | str9xpec_erase_check (struct flash_bank *bank) |
static int | str9xpec_isc_disable (struct flash_bank *bank) |
static int | str9xpec_isc_enable (struct flash_bank *bank) |
static uint8_t | str9xpec_isc_status (struct jtag_tap *tap) |
static int | str9xpec_lock_device (struct flash_bank *bank) |
static int | str9xpec_probe (struct flash_bank *bank) |
static int | str9xpec_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | str9xpec_protect_check (struct flash_bank *bank) |
static int | str9xpec_read_config (struct flash_bank *bank) |
static int | str9xpec_set_address (struct flash_bank *bank, uint8_t sector) |
static int | str9xpec_set_instr (struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state) |
static int | str9xpec_unlock_device (struct flash_bank *bank) |
static int | str9xpec_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | str9xpec_write_options (struct flash_bank *bank) |
Variables | |
static const struct command_registration | str9xpec_command_handlers [] |
static const struct command_registration | str9xpec_config_command_handlers [] |
const struct flash_driver | str9xpec_flash |
#define ISC_ADDRESS_SHIFT 0x11 |
Definition at line 26 of file str9xpec.c.
#define ISC_BLANK_CHECK 0x60 |
Definition at line 33 of file str9xpec.c.
#define ISC_CLR_STATUS 0x13 |
Definition at line 27 of file str9xpec.c.
#define ISC_CONFIGURATION 0x07 |
Definition at line 22 of file str9xpec.c.
#define ISC_DISABLE 0x0F |
Definition at line 24 of file str9xpec.c.
#define ISC_ENABLE 0x0C |
Definition at line 23 of file str9xpec.c.
#define ISC_ERASE 0x30 |
Definition at line 31 of file str9xpec.c.
#define ISC_IDCODE 0xFE |
Definition at line 20 of file str9xpec.c.
#define ISC_MFG_READ 0x4C |
Definition at line 21 of file str9xpec.c.
#define ISC_NOOP 0x10 |
Definition at line 25 of file str9xpec.c.
#define ISC_PROGRAM 0x20 |
Definition at line 28 of file str9xpec.c.
#define ISC_PROGRAM_SECURITY 0x22 |
Definition at line 29 of file str9xpec.c.
#define ISC_PROGRAM_UC 0x23 |
Definition at line 30 of file str9xpec.c.
#define ISC_READ 0x50 |
Definition at line 32 of file str9xpec.c.
#define ISC_STATUS_BUSY 0x04 |
Definition at line 40 of file str9xpec.c.
#define ISC_STATUS_ERROR 0x03 |
Definition at line 41 of file str9xpec.c.
#define ISC_STATUS_INT_ERROR 0x30 |
Definition at line 38 of file str9xpec.c.
#define ISC_STATUS_MODE 0x08 |
Definition at line 39 of file str9xpec.c.
#define ISC_STATUS_SECURITY 0x40 |
Definition at line 37 of file str9xpec.c.
#define STR9XPEC_OPT_CSMAPBIT 48 |
Definition at line 45 of file str9xpec.c.
#define STR9XPEC_OPT_LVDSELBIT 50 |
Definition at line 47 of file str9xpec.c.
#define STR9XPEC_OPT_LVDTHRESBIT 49 |
Definition at line 46 of file str9xpec.c.
#define STR9XPEC_OPT_LVDWARNBIT 51 |
Definition at line 48 of file str9xpec.c.
#define STR9XPEC_OPT_OTPBIT 63 |
Definition at line 49 of file str9xpec.c.
Enumerator | |
---|---|
STR9XPEC_INVALID_COMMAND | |
STR9XPEC_ISC_SUCCESS | |
STR9XPEC_ISC_DISABLED | |
STR9XPEC_ISC_INTFAIL |
Definition at line 51 of file str9xpec.c.
COMMAND_HANDLER | ( | str9xpec_handle_flash_disable_turbo_command | ) |
Definition at line 1065 of file str9xpec.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, jtag_tap::enabled, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ISC_NOOP, jtag_add_tlr(), jtag_execute_queue(), jtag_tap::next_tap, NULL, str9xpec_set_instr(), str9xpec_flash_controller::tap, and TAP_IDLE.
COMMAND_HANDLER | ( | str9xpec_handle_flash_enable_turbo_command | ) |
Definition at line 1016 of file str9xpec.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), jtag_tap::enabled, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, jtag_execute_queue(), jtag_tap::next_tap, NULL, str9xpec_set_instr(), str9xpec_flash_controller::tap, and TAP_IDLE.
COMMAND_HANDLER | ( | str9xpec_handle_flash_lock_command | ) |
Definition at line 972 of file str9xpec.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, status, STR9XPEC_ISC_SUCCESS, and str9xpec_lock_device().
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_cmap_command | ) |
Definition at line 884 of file str9xpec.c.
References bank, buf_set_u32(), CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, NULL, str9xpec_flash_controller::options, and STR9XPEC_OPT_CSMAPBIT.
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_lvdsel_command | ) |
Definition at line 928 of file str9xpec.c.
References bank, buf_set_u32(), CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, NULL, str9xpec_flash_controller::options, and STR9XPEC_OPT_LVDSELBIT.
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_lvdthd_command | ) |
Definition at line 906 of file str9xpec.c.
References bank, buf_set_u32(), CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, NULL, str9xpec_flash_controller::options, and STR9XPEC_OPT_LVDTHRESBIT.
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_lvdwarn_command | ) |
Definition at line 950 of file str9xpec.c.
References bank, buf_set_u32(), CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, NULL, str9xpec_flash_controller::options, and STR9XPEC_OPT_LVDWARNBIT.
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_read_command | ) |
Definition at line 750 of file str9xpec.c.
References bank, buf_get_u32(), CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, NULL, str9xpec_flash_controller::options, status, STR9XPEC_ISC_SUCCESS, STR9XPEC_OPT_CSMAPBIT, STR9XPEC_OPT_LVDSELBIT, STR9XPEC_OPT_LVDTHRESBIT, STR9XPEC_OPT_LVDWARNBIT, STR9XPEC_OPT_OTPBIT, and str9xpec_read_config().
COMMAND_HANDLER | ( | str9xpec_handle_flash_options_write_command | ) |
Definition at line 860 of file str9xpec.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, status, STR9XPEC_ISC_SUCCESS, and str9xpec_write_options().
COMMAND_HANDLER | ( | str9xpec_handle_flash_unlock_command | ) |
Definition at line 992 of file str9xpec.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, status, STR9XPEC_ISC_SUCCESS, and str9xpec_unlock_device().
COMMAND_HANDLER | ( | str9xpec_handle_part_id_command | ) |
Definition at line 706 of file str9xpec.c.
References bank, buf_get_u32(), buffer, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), DIV_ROUND_UP, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_tap::idcode, scan_field::in_value, ISC_IDCODE, jtag_add_dr_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan_field::out_value, str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
FLASH_BANK_COMMAND_HANDLER | ( | str9xpec_flash_bank_command | ) |
Definition at line 264 of file str9xpec.c.
References jtag_tap::abs_chain_position, arm::arch_info, bank, buf_set_u32(), CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, str9xpec_flash_controller::isc_enable, arm7_9_common::jtag_info, jtag_tap_by_position(), NULL, str9xpec_flash_controller::options, str9xpec_build_block_list(), str9xpec_flash_controller::tap, and arm_jtag::tap.
|
static |
Definition at line 296 of file str9xpec.c.
References bank, buf_get_u32(), buf_set_u32(), buffer, DIV_ROUND_UP, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, scan_field::in_value, ISC_BLANK_CHECK, str9xpec_flash_controller::isc_enable, ISC_STATUS_ERROR, jtag_add_dr_scan(), jtag_add_sleep(), jtag_execute_queue(), LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, str9xpec_flash_controller::sector_bits, status, str9xpec_isc_disable(), str9xpec_isc_enable(), str9xpec_isc_status(), STR9XPEC_ISC_SUCCESS, str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
Referenced by str9xpec_erase_check().
|
static |
Definition at line 198 of file str9xpec.c.
References bank, ERROR_OK, LOG_ERROR, offset, and str9xpec_flash_controller::sector_bits.
Referenced by FLASH_BANK_COMMAND_HANDLER().
|
static |
Definition at line 436 of file str9xpec.c.
References bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, status, str9xpec_erase_area(), and STR9XPEC_ISC_SUCCESS.
|
static |
Definition at line 377 of file str9xpec.c.
References alive_sleep(), bank, buf_set_u32(), buffer, DIV_ROUND_UP, scan_field::in_value, str9xpec_flash_controller::isc_enable, ISC_ERASE, ISC_STATUS_BUSY, ISC_STATUS_ERROR, jtag_add_dr_scan(), jtag_add_sleep(), jtag_execute_queue(), LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, str9xpec_flash_controller::sector_bits, status, str9xpec_isc_disable(), str9xpec_isc_enable(), str9xpec_isc_status(), str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
Referenced by str9xpec_erase(), str9xpec_unlock_device(), and str9xpec_write_options().
|
static |
Definition at line 745 of file str9xpec.c.
References bank, and str9xpec_blank_check().
|
static |
Definition at line 143 of file str9xpec.c.
References bank, ERROR_OK, ERROR_TARGET_INVALID, ISC_DISABLE, str9xpec_flash_controller::isc_enable, ISC_STATUS_MODE, jtag_add_sleep(), LOG_DEBUG, status, str9xpec_isc_status(), str9xpec_set_instr(), str9xpec_flash_controller::tap, and TAP_IDLE.
Referenced by str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_lock_device(), str9xpec_write(), and str9xpec_write_options().
|
static |
Definition at line 117 of file str9xpec.c.
References bank, ERROR_OK, ERROR_TARGET_INVALID, ISC_ENABLE, str9xpec_flash_controller::isc_enable, ISC_STATUS_MODE, LOG_DEBUG, status, str9xpec_isc_status(), str9xpec_set_instr(), str9xpec_flash_controller::tap, and TAP_IDLE.
Referenced by str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_lock_device(), str9xpec_write(), and str9xpec_write_options().
|
static |
Definition at line 93 of file str9xpec.c.
References ERROR_OK, scan_field::in_value, ISC_NOOP, ISC_STATUS_ERROR, ISC_STATUS_SECURITY, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, LOG_INFO, NULL, scan_field::num_bits, scan_field::out_value, status, str9xpec_set_instr(), TAP_IDLE, and TAP_IRPAUSE.
Referenced by str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_isc_disable(), str9xpec_isc_enable(), and str9xpec_read_config().
|
static |
Definition at line 449 of file str9xpec.c.
References bank, scan_field::in_value, str9xpec_flash_controller::isc_enable, ISC_NOOP, ISC_PROGRAM_SECURITY, ISC_STATUS_BUSY, ISC_STATUS_ERROR, jtag_add_dr_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan_field::out_value, status, str9xpec_isc_disable(), str9xpec_isc_enable(), str9xpec_set_address(), str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
Referenced by COMMAND_HANDLER(), and str9xpec_protect().
|
static |
Definition at line 701 of file str9xpec.c.
References ERROR_OK.
|
static |
Definition at line 497 of file str9xpec.c.
References bank, buf_set_u32(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, LOG_DEBUG, str9xpec_flash_controller::options, str9xpec_flash_controller::sector_bits, status, STR9XPEC_ISC_SUCCESS, str9xpec_lock_device(), str9xpec_read_config(), str9xpec_unlock_device(), and str9xpec_write_options().
|
static |
Definition at line 357 of file str9xpec.c.
References bank, buf_get_u32(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ISC_STATUS_ERROR, str9xpec_flash_controller::options, str9xpec_flash_controller::sector_bits, status, STR9XPEC_ISC_SUCCESS, and str9xpec_read_config().
|
static |
Definition at line 171 of file str9xpec.c.
References bank, scan_field::in_value, ISC_CONFIGURATION, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, NULL, scan_field::num_bits, str9xpec_flash_controller::options, scan_field::out_value, status, str9xpec_isc_status(), str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
Referenced by COMMAND_HANDLER(), str9xpec_protect(), and str9xpec_protect_check().
|
static |
Definition at line 536 of file str9xpec.c.
References bank, ERROR_OK, scan_field::in_value, ISC_ADDRESS_SHIFT, jtag_add_dr_scan(), NULL, scan_field::num_bits, scan_field::out_value, str9xpec_set_instr(), str9xpec_flash_controller::tap, and TAP_IRPAUSE.
Referenced by str9xpec_lock_device(), str9xpec_write(), and str9xpec_write_options().
|
static |
Definition at line 71 of file str9xpec.c.
References buf_get_u32(), buf_set_u32(), jtag_tap::cur_instr, DIV_ROUND_UP, ERROR_OK, ERROR_TARGET_INVALID, scan_field::in_value, jtag_tap::ir_length, jtag_add_ir_scan(), NULL, scan_field::num_bits, and scan_field::out_value.
Referenced by COMMAND_HANDLER(), str9xpec_blank_check(), str9xpec_erase_area(), str9xpec_isc_disable(), str9xpec_isc_enable(), str9xpec_isc_status(), str9xpec_lock_device(), str9xpec_read_config(), str9xpec_set_address(), str9xpec_write(), and str9xpec_write_options().
|
static |
Definition at line 488 of file str9xpec.c.
References bank, status, and str9xpec_erase_area().
Referenced by COMMAND_HANDLER(), and str9xpec_protect().
|
static |
Definition at line 556 of file str9xpec.c.
References bank, buf_get_u32(), buffer, count, DIV_ROUND_UP, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, scan_field::in_value, str9xpec_flash_controller::isc_enable, ISC_NOOP, ISC_PROGRAM, ISC_STATUS_BUSY, ISC_STATUS_ERROR, jtag_add_dr_scan(), jtag_add_sleep(), jtag_execute_queue(), LOG_DEBUG, LOG_WARNING, NULL, scan_field::num_bits, offset, scan_field::out_value, str9xpec_flash_controller::sector_bits, status, str9xpec_isc_disable(), str9xpec_isc_enable(), STR9XPEC_ISC_SUCCESS, str9xpec_set_address(), str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
|
static |
Definition at line 803 of file str9xpec.c.
References bank, buf_set_u32(), scan_field::in_value, str9xpec_flash_controller::isc_enable, ISC_NOOP, ISC_PROGRAM, ISC_STATUS_BUSY, ISC_STATUS_ERROR, jtag_add_dr_scan(), jtag_add_sleep(), jtag_execute_queue(), NULL, scan_field::num_bits, str9xpec_flash_controller::options, scan_field::out_value, status, str9xpec_erase_area(), str9xpec_isc_disable(), str9xpec_isc_enable(), STR9XPEC_ISC_SUCCESS, str9xpec_set_address(), str9xpec_set_instr(), str9xpec_flash_controller::tap, TAP_IDLE, and TAP_IRPAUSE.
Referenced by COMMAND_HANDLER(), and str9xpec_protect().
|
static |
Definition at line 1065 of file str9xpec.c.
|
static |
Definition at line 1065 of file str9xpec.c.
const struct flash_driver str9xpec_flash |
Definition at line 1065 of file str9xpec.c.