OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | xcf_priv |
struct | xcf_status |
Macros | |
#define | ID_MEANINGFUL_MASK 0x0FFFFFFF |
#define | ID_XCF01S 0x05044093 |
#define | ID_XCF02S 0x05045093 |
#define | ID_XCF04S 0x05046093 |
#define | ID_XCF08P 0x05057093 |
#define | ID_XCF16P 0x05058093 |
#define | ID_XCF32P 0x05059093 |
#define | SECTOR_ERASE_TIMEOUT_MS (35 * 1000) |
#define | XCF_DATA_SECTOR_SIZE (1024 * 1024) |
#define | XCF_PAGE_SIZE 32 |
Functions | |
COMMAND_HANDLER (xcf_handle_ccb_command) | |
COMMAND_HANDLER (xcf_handle_configure_command) | |
static void | fill_sector_table (struct flash_bank *bank) |
static uint8_t | fill_select_block (unsigned int first, unsigned int last) |
FLASH_BANK_COMMAND_HANDLER (xcf_flash_bank_command) | |
static void | flip_u8 (uint8_t *out, const uint8_t *in, int len) |
static int | fpga_configure (struct flash_bank *bank) |
static unsigned int | gucr_num (const struct flash_bank *bank) |
static int | isc_adr_shift (struct flash_bank *bank, int adr) |
static int | isc_clear_protect (struct flash_bank *bank, unsigned int first, unsigned int last) |
static void | isc_data_read_out (struct flash_bank *bank, uint8_t *buffer, uint32_t count) |
static int | isc_enter (struct flash_bank *bank) |
static int | isc_erase_sectors (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | isc_leave (struct flash_bank *bank) |
static int | isc_program_ccb (struct flash_bank *bank, uint16_t ccb) |
static int | isc_program_data_page (struct flash_bank *bank, const uint8_t *page_buf) |
static int | isc_program_register (struct flash_bank *bank, const uint8_t *cmd, const uint8_t *data_buf, int num_bits, int64_t timeout_ms) |
static int | isc_program_singe_revision_sucr (struct flash_bank *bank) |
static int | isc_program_single_revision_btc (struct flash_bank *bank) |
static uint16_t | isc_read_ccb (struct flash_bank *bank) |
static int | isc_read_register (struct flash_bank *bank, const uint8_t *cmd, uint8_t *data_buf, int num_bits) |
static int | isc_set_data_done (struct flash_bank *bank, int sector) |
static int | isc_set_protect (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | isc_set_register (struct flash_bank *bank, const uint8_t *cmd, const uint8_t *data_buf, int num_bits, int64_t timeout_ms) |
static int | isc_wait_erase_program (struct flash_bank *bank, int64_t timeout_ms) |
static bool | need_bit_reverse (const uint8_t *buffer) |
static const char * | product_name (const struct flash_bank *bank) |
static struct xcf_status | read_status (struct flash_bank *bank) |
static int | read_write_data (struct flash_bank *bank, const uint8_t *w_buffer, uint8_t *r_buffer, bool write_flag, uint32_t offset, uint32_t count) |
static int | sector_state (uint8_t wrpt, int sector) |
static unsigned int | sucr_num (const struct flash_bank *bank) |
static int | xcf_auto_probe (struct flash_bank *bank) |
static int | xcf_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | xcf_erase_check (struct flash_bank *bank) |
static int | xcf_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | xcf_probe (struct flash_bank *bank) |
static int | xcf_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | xcf_protect_check (struct flash_bank *bank) |
static int | xcf_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | xcf_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const uint8_t | cmd_bypass [2] = {0xFF, 0xFF} |
static const uint8_t | cmd_isc_address_shift [2] = {0xEB, 0x00} |
static const uint8_t | cmd_isc_data_shift [2] = {0xED, 0x00} |
static const uint8_t | cmd_isc_disable [2] = {0xF0, 0x00} |
static const uint8_t | cmd_isc_enable [2] = {0xE8, 0x00} |
static const uint8_t | cmd_isc_erase [2] = {0xEC, 0x00} |
static const uint8_t | cmd_isc_program [2] = {0xEA, 0x00} |
static const uint8_t | cmd_xsc_blank_check [2] = {0x0D, 0x00} |
static const uint8_t | cmd_xsc_config [2] = {0xEE, 0x00} |
static const uint8_t | cmd_xsc_data_btc [2] = {0xF2, 0x00} |
static const uint8_t | cmd_xsc_data_ccb [2] = {0x0C, 0x00} |
static const uint8_t | cmd_xsc_data_done [2] = {0x09, 0x00} |
static const uint8_t | cmd_xsc_data_sucr [2] = {0x0E, 0x00} |
static const uint8_t | cmd_xsc_data_wrpt [2] = {0xF7, 0x00} |
static const uint8_t | cmd_xsc_op_status [2] = {0xE3, 0x00} |
static const uint8_t | cmd_xsc_read [2] = {0xEF, 0x00} |
static const uint8_t | cmd_xsc_unlock [2] = {0x55, 0xAA} |
static const struct command_registration | xcf_command_handlers [] |
static const struct command_registration | xcf_exec_command_handlers [] |
const struct flash_driver | xcf_flash |
static const char *const | xcf_name_list [] |
COMMAND_HANDLER | ( | xcf_handle_ccb_command | ) |
Definition at line 740 of file xcf.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, gucr_num(), isc_clear_protect(), isc_enter(), isc_erase_sectors(), isc_leave(), isc_program_ccb(), isc_program_singe_revision_sucr(), isc_program_single_revision_btc(), isc_read_ccb(), isc_set_data_done(), LOG_INFO, and sucr_num().
COMMAND_HANDLER | ( | xcf_handle_configure_command | ) |
Definition at line 823 of file xcf.c.
References bank, CALL_COMMAND_HANDLER, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and fpga_configure().
|
static |
Definition at line 101 of file xcf.c.
References bank, and XCF_DATA_SECTOR_SIZE.
Referenced by xcf_probe().
|
static |
Definition at line 208 of file xcf.c.
Referenced by isc_clear_protect(), and isc_erase_sectors().
FLASH_BANK_COMMAND_HANDLER | ( | xcf_flash_bank_command | ) |
|
static |
|
static |
Definition at line 538 of file xcf.c.
References bank, cmd_xsc_config, ERROR_OK, jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan, and TAP_IDLE.
Referenced by COMMAND_HANDLER().
|
static |
|
static |
Definition at line 336 of file xcf.c.
References bank, cmd_isc_address_shift, h_u24_to_le(), and isc_set_register().
Referenced by read_write_data().
|
static |
Definition at line 309 of file xcf.c.
References bank, cmd_xsc_unlock, fill_select_block(), and isc_set_register().
Referenced by COMMAND_HANDLER(), xcf_erase(), and xcf_protect().
|
static |
Definition at line 348 of file xcf.c.
References bank, buffer, cmd_xsc_read, count, jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan, and TAP_IDLE.
Referenced by read_write_data().
|
static |
Definition at line 141 of file xcf.c.
References bank, cmd_isc_enable, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, jtag_add_ir_scan(), jtag_execute_queue(), LOG_ERROR, NULL, read_status(), scan, status, and TAP_IDLE.
Referenced by COMMAND_HANDLER(), read_write_data(), xcf_erase(), xcf_erase_check(), xcf_protect(), and xcf_protect_check().
|
static |
Definition at line 327 of file xcf.c.
References bank, cmd_isc_erase, fill_select_block(), isc_set_register(), and SECTOR_ERASE_TIMEOUT_MS.
Referenced by COMMAND_HANDLER(), xcf_erase(), and xcf_protect().
|
static |
Definition at line 170 of file xcf.c.
References alive_sleep(), bank, cmd_isc_disable, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, jtag_add_ir_scan(), jtag_execute_queue(), LOG_ERROR, NULL, read_status(), scan, status, and TAP_IDLE.
Referenced by COMMAND_HANDLER(), read_write_data(), xcf_erase(), xcf_erase_check(), xcf_protect(), and xcf_protect_check().
|
static |
Definition at line 514 of file xcf.c.
References bank, cmd_xsc_data_ccb, h_u16_to_le(), and isc_program_register().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 343 of file xcf.c.
References bank, cmd_isc_data_shift, isc_program_register(), and XCF_PAGE_SIZE.
Referenced by read_write_data().
|
static |
Definition at line 281 of file xcf.c.
References bank, cmd, cmd_isc_program, isc_wait_erase_program(), jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan, TAP_DRSHIFT, TAP_IDLE, and TAP_IRSHIFT.
Referenced by isc_program_ccb(), isc_program_data_page(), isc_program_singe_revision_sucr(), isc_program_single_revision_btc(), isc_set_data_done(), and isc_set_protect().
|
static |
Definition at line 521 of file xcf.c.
References bank, cmd_xsc_data_sucr, and isc_program_register().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 527 of file xcf.c.
References bank, cmd_xsc_data_btc, h_u32_to_le(), and isc_program_register().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 497 of file xcf.c.
References bank, cmd_xsc_data_ccb, isc_read_register(), and le_to_h_u16().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 216 of file xcf.c.
References bank, cmd, jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan, TAP_DRSHIFT, and TAP_IDLE.
Referenced by isc_read_ccb(), isc_wait_erase_program(), and xcf_protect_check().
|
static |
Definition at line 370 of file xcf.c.
References bank, cmd_xsc_data_done, and isc_program_register().
Referenced by COMMAND_HANDLER(), and read_write_data().
|
static |
Definition at line 317 of file xcf.c.
References bank, cmd_xsc_data_wrpt, and isc_program_register().
Referenced by xcf_protect().
|
static |
Definition at line 255 of file xcf.c.
References bank, cmd, isc_wait_erase_program(), jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan, TAP_DRSHIFT, and TAP_IDLE.
Referenced by isc_adr_shift(), isc_clear_protect(), and isc_erase_sectors().
|
static |
Definition at line 236 of file xcf.c.
References bank, cmd_xsc_op_status, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, isc_read_register(), and timeval_ms().
Referenced by isc_program_register(), and isc_set_register().
|
static |
|
static |
Definition at line 86 of file xcf.c.
References bank, ID_MEANINGFUL_MASK, ID_XCF08P, ID_XCF16P, ID_XCF32P, and xcf_name_list.
Referenced by xcf_info(), and xcf_probe().
|
static |
Definition at line 101 of file xcf.c.
Referenced by isc_enter(), and isc_leave().
|
static |
Definition at line 416 of file xcf.c.
References bank, count, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_OK, flip_u8(), isc_adr_shift(), isc_data_read_out(), isc_enter(), isc_leave(), isc_program_data_page(), isc_set_data_done(), LOG_DEBUG, need_bit_reverse(), offset, XCF_DATA_SECTOR_SIZE, and XCF_PAGE_SIZE.
Referenced by xcf_read(), and xcf_write().
|
static |
Definition at line 200 of file xcf.c.
Referenced by xcf_erase_check(), and xcf_protect_check().
|
static |
|
static |
|
static |
Definition at line 695 of file xcf.c.
References bank, ERROR_FLASH_SECTOR_INVALID, isc_clear_protect(), isc_enter(), isc_erase_sectors(), and isc_leave().
|
static |
Definition at line 664 of file xcf.c.
References alive_sleep(), bank, cmd_xsc_blank_check, ERROR_OK, isc_enter(), isc_leave(), jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), NULL, scan, sector_state(), and TAP_IDLE.
|
static |
Definition at line 573 of file xcf.c.
References bank, cmd, command_print_sameline(), ERROR_OK, priv, and product_name().
|
static |
Definition at line 585 of file xcf.c.
References bank, ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, fill_sector_table(), id, ID_MEANINGFUL_MASK, ID_XCF08P, ID_XCF16P, ID_XCF32P, LOG_ERROR, LOG_INFO, priv, product_name(), and XCF_DATA_SECTOR_SIZE.
Referenced by xcf_auto_probe().
|
static |
Definition at line 722 of file xcf.c.
References bank, isc_clear_protect(), isc_enter(), isc_erase_sectors(), isc_leave(), and isc_set_protect().
|
static |
Definition at line 650 of file xcf.c.
References bank, cmd_xsc_data_wrpt, ERROR_OK, isc_enter(), isc_leave(), isc_read_register(), and sector_state().
|
static |
|
static |
|
static |
Definition at line 62 of file xcf.c.
Referenced by isc_adr_shift().
|
static |
Definition at line 63 of file xcf.c.
Referenced by isc_program_data_page().
|
static |
Definition at line 64 of file xcf.c.
Referenced by isc_leave().
|
static |
Definition at line 65 of file xcf.c.
Referenced by isc_enter().
|
static |
Definition at line 66 of file xcf.c.
Referenced by isc_erase_sectors().
|
static |
Definition at line 67 of file xcf.c.
Referenced by isc_program_register().
|
static |
Definition at line 69 of file xcf.c.
Referenced by xcf_erase_check().
|
static |
Definition at line 70 of file xcf.c.
Referenced by fpga_configure().
|
static |
Definition at line 71 of file xcf.c.
Referenced by isc_program_single_revision_btc().
|
static |
Definition at line 72 of file xcf.c.
Referenced by isc_program_ccb(), and isc_read_ccb().
|
static |
Definition at line 73 of file xcf.c.
Referenced by isc_set_data_done().
|
static |
Definition at line 74 of file xcf.c.
Referenced by isc_program_singe_revision_sucr().
|
static |
Definition at line 75 of file xcf.c.
Referenced by isc_set_protect(), and xcf_protect_check().
|
static |
Definition at line 76 of file xcf.c.
Referenced by isc_wait_erase_program().
|
static |
Definition at line 77 of file xcf.c.
Referenced by isc_data_read_out().
|
static |
Definition at line 78 of file xcf.c.
Referenced by isc_clear_protect().
|
static |
|
static |
const struct flash_driver xcf_flash |
|
static |
Definition at line 37 of file xcf.c.
Referenced by product_name().