OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | niietcm4_flash_bank |
Private data for flash driver. More... | |
Macros | |
#define | BF_LOCK_ADDR 0x40 |
#define | BOOTFLASH_BASE 0xA001C000 |
#define | CHIPID_ADDR 0xF0000000 |
#define | FCIC (BOOTFLASH_BASE + 0x14) |
#define | FCIC_CLR_OPCMLT (1<<0) /* Clear completion flag in register FCIS */ |
#define | FCIC_CLR_OPERROR (1<<1) /* Clear error flag in register FCIS */ |
#define | FCIM (BOOTFLASH_BASE + 0x10) |
#define | FCIS (BOOTFLASH_BASE + 0x0C) |
#define | FCIS_OP_CMLT (1<<0) /* Completion flag operation */ |
#define | FCIS_OP_ERROR (1<<1) /* Flag operation error */ |
#define | FLASH_DRIVER_VER 0x00010000 |
#define | FMA (BOOTFLASH_BASE + 0x00) |
#define | FMC (BOOTFLASH_BASE + 0x08) |
#define | FMC_FULL_ERASE (1<<2) /* Erase full flash */ |
#define | FMC_MAGIC_KEY (MAGIC_KEY<<16) /* Operation run command */ |
#define | FMC_PAGE_ERASE (1<<1) /* Page erase the main region */ |
#define | FMC_PAGEERASE_IFB (1<<5) /* Erase page of info region */ |
#define | FMC_WRITE (1<<0) /* Writing in main region */ |
#define | FMC_WRITE_IFB (1<<4) /* Writing in info region */ |
#define | FMD1 (BOOTFLASH_BASE + 0x04) |
#define | FMD2 (BOOTFLASH_BASE + 0x50) |
#define | FMD3 (BOOTFLASH_BASE + 0x54) |
#define | FMD4 (BOOTFLASH_BASE + 0x58) |
#define | INFO_MEM_TYPE 1 |
#define | INFOWORD0_ADDR 0x00 |
#define | INFOWORD0_BOOTFROM_IFB (1<<0) /* Boot from bootflash or bootflash_ifb */ |
#define | INFOWORD0_BOOTFROM_IFB_POS 0 |
#define | INFOWORD0_EN_GPIO (1<<1) /* Remap to 0x00000000 extmem or bootflash */ |
#define | INFOWORD0_EN_GPIO_POS 1 |
#define | INFOWORD0_EXTMEM_SEL_POS 3 /* Choose altfunc of gpio to work with extmem */ |
#define | INFOWORD1_ADDR 0x01 |
#define | INFOWORD1_PINNUM_POS 0 /* Choose gpio pin number to control extmem boot */ |
#define | INFOWORD1_PORTNUM_POS 4 /* Choose gpio port to control extmem boot */ |
#define | INFOWORD2_ADDR 0x02 |
#define | INFOWORD2_LOCK_IFB_BF (1<<0) /* Protect info part of bootflash */ |
#define | INFOWORD3_ADDR 0x03 |
#define | INFOWORD3_LOCK_IFB_UF (1<<0) /* Protect info part of userflash */ |
#define | K1921VK01T_ID 0x00000000 |
#define | MAGIC_KEY 0xA442 |
#define | MAIN_MEM_TYPE 0 |
#define | SERVICE_MODE_ERASE_ADDR 0x80030164 |
#define | UF_LOCK_ADDR 0x80 |
#define | UFCIC (USERFLASH_BASE + 0x14) |
#define | UFCIC_CLR_OPCMLT (1<<0) /* Clear completion flag in register FCIS */ |
#define | UFCIC_CLR_OPERROR (1<<1) /* Clear error flag in register FCIS */ |
#define | UFCIM (USERFLASH_BASE + 0x10) |
#define | UFCIS (USERFLASH_BASE + 0x0C) |
#define | UFCIS_OP_CMLT (1<<0) /* Completion flag operation */ |
#define | UFCIS_OP_ERROR (1<<1) /* Flag operation error */ |
#define | UFMA (USERFLASH_BASE + 0x00) |
#define | UFMC (USERFLASH_BASE + 0x08) |
#define | UFMC_FULL_ERASE (1<<2) /* Erase full flash */ |
#define | UFMC_MAGIC_KEY (MAGIC_KEY<<16) /* Operation run command */ |
#define | UFMC_PAGE_ERASE (1<<1) /* Paged erase the main region */ |
#define | UFMC_PAGEERASE_IFB (1<<5) /* Erase page of info region */ |
#define | UFMC_READ (1<<3) /* Reading from main region */ |
#define | UFMC_READ_IFB (1<<6) /* Reading from info region */ |
#define | UFMC_WRITE (1<<0) /* Writing in main region */ |
#define | UFMC_WRITE_IFB (1<<4) /* Writing in info region */ |
#define | UFMD (USERFLASH_BASE + 0x04) |
#define | USERFLASH_BASE 0xA0022000 |
#define | USERFLASH_PAGE_SIZE 256 |
#define | USERFLASH_PAGE_TOTALNUM 256 |
Functions | |
COMMAND_HANDLER (niietcm4_handle_bflash_info_remap_command) | |
COMMAND_HANDLER (niietcm4_handle_driver_info_command) | |
COMMAND_HANDLER (niietcm4_handle_extmem_boot_command) | |
COMMAND_HANDLER (niietcm4_handle_extmem_cfg_command) | |
COMMAND_HANDLER (niietcm4_handle_service_mode_erase_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_erase_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_full_erase_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_protect_check_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_protect_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_read_byte_command) | |
COMMAND_HANDLER (niietcm4_handle_uflash_write_byte_command) | |
FLASH_BANK_COMMAND_HANDLER (niietcm4_flash_bank_command) | |
static int | get_niietcm4_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | niietcm4_auto_probe (struct flash_bank *bank) |
static int | niietcm4_dump_uflash_page (struct flash_bank *bank, uint32_t *dump, int page_num, int mem_type) |
Dump page of userflash region. More... | |
static int | niietcm4_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | niietcm4_load_uflash_page (struct flash_bank *bank, uint32_t *dump, int page_num, int mem_type) |
Load modified page dump to userflash region page. More... | |
static int | niietcm4_mass_erase (struct flash_bank *bank) |
static int | niietcm4_opstatus_check (struct flash_bank *bank) |
Wait while operation with bootflash being performed and check result status. More... | |
static int | niietcm4_probe (struct flash_bank *bank) |
static int | niietcm4_probe_k1921vk01t (struct flash_bank *bank) |
static int | niietcm4_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | niietcm4_protect_check (struct flash_bank *bank) |
static int | niietcm4_uflash_page_erase (struct flash_bank *bank, int page_num, int mem_type) |
Erase one page of userflash info or main region. More... | |
static int | niietcm4_uflash_protect (struct flash_bank *bank, int mem_type, int set, unsigned int first, unsigned int last) |
Enable or disable protection of userflash pages. More... | |
static int | niietcm4_uopstatus_check (struct flash_bank *bank) |
Wait while operation with userflash being performed and check result status. More... | |
static int | niietcm4_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | niietcm4_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const struct command_registration | niietcm4_command_handlers [] |
static const struct command_registration | niietcm4_exec_command_handlers [] |
const struct flash_driver | niietcm4_flash |
#define BF_LOCK_ADDR 0x40 |
Definition at line 108 of file niietcm4.c.
#define BOOTFLASH_BASE 0xA001C000 |
Definition at line 32 of file niietcm4.c.
#define CHIPID_ADDR 0xF0000000 |
Definition at line 18 of file niietcm4.c.
#define FCIC (BOOTFLASH_BASE + 0x14) |
Definition at line 38 of file niietcm4.c.
Definition at line 57 of file niietcm4.c.
Definition at line 58 of file niietcm4.c.
#define FCIM (BOOTFLASH_BASE + 0x10) |
Definition at line 37 of file niietcm4.c.
#define FCIS (BOOTFLASH_BASE + 0x0C) |
Definition at line 36 of file niietcm4.c.
#define FCIS_OP_CMLT (1<<0) /* Completion flag operation */ |
Definition at line 53 of file niietcm4.c.
#define FCIS_OP_ERROR (1<<1) /* Flag operation error */ |
Definition at line 54 of file niietcm4.c.
#define FLASH_DRIVER_VER 0x00010000 |
Definition at line 17 of file niietcm4.c.
#define FMA (BOOTFLASH_BASE + 0x00) |
Definition at line 33 of file niietcm4.c.
#define FMC (BOOTFLASH_BASE + 0x08) |
Definition at line 35 of file niietcm4.c.
#define FMC_FULL_ERASE (1<<2) /* Erase full flash */ |
Definition at line 47 of file niietcm4.c.
Definition at line 50 of file niietcm4.c.
#define FMC_PAGE_ERASE (1<<1) /* Page erase the main region */ |
Definition at line 46 of file niietcm4.c.
#define FMC_PAGEERASE_IFB (1<<5) /* Erase page of info region */ |
Definition at line 49 of file niietcm4.c.
#define FMC_WRITE (1<<0) /* Writing in main region */ |
Definition at line 45 of file niietcm4.c.
#define FMC_WRITE_IFB (1<<4) /* Writing in info region */ |
Definition at line 48 of file niietcm4.c.
#define FMD1 (BOOTFLASH_BASE + 0x04) |
Definition at line 34 of file niietcm4.c.
#define FMD2 (BOOTFLASH_BASE + 0x50) |
Definition at line 39 of file niietcm4.c.
#define FMD3 (BOOTFLASH_BASE + 0x54) |
Definition at line 40 of file niietcm4.c.
#define FMD4 (BOOTFLASH_BASE + 0x58) |
Definition at line 41 of file niietcm4.c.
#define INFO_MEM_TYPE 1 |
Definition at line 27 of file niietcm4.c.
#define INFOWORD0_ADDR 0x00 |
Definition at line 91 of file niietcm4.c.
#define INFOWORD0_BOOTFROM_IFB (1<<0) /* Boot from bootflash or bootflash_ifb */ |
Definition at line 92 of file niietcm4.c.
#define INFOWORD0_BOOTFROM_IFB_POS 0 |
Definition at line 94 of file niietcm4.c.
#define INFOWORD0_EN_GPIO (1<<1) /* Remap to 0x00000000 extmem or bootflash */ |
Definition at line 93 of file niietcm4.c.
#define INFOWORD0_EN_GPIO_POS 1 |
Definition at line 95 of file niietcm4.c.
#define INFOWORD0_EXTMEM_SEL_POS 3 /* Choose altfunc of gpio to work with extmem */ |
Definition at line 96 of file niietcm4.c.
#define INFOWORD1_ADDR 0x01 |
Definition at line 98 of file niietcm4.c.
#define INFOWORD1_PINNUM_POS 0 /* Choose gpio pin number to control extmem boot */ |
Definition at line 99 of file niietcm4.c.
#define INFOWORD1_PORTNUM_POS 4 /* Choose gpio port to control extmem boot */ |
Definition at line 100 of file niietcm4.c.
#define INFOWORD2_ADDR 0x02 |
Definition at line 102 of file niietcm4.c.
#define INFOWORD2_LOCK_IFB_BF (1<<0) /* Protect info part of bootflash */ |
Definition at line 103 of file niietcm4.c.
#define INFOWORD3_ADDR 0x03 |
Definition at line 105 of file niietcm4.c.
#define INFOWORD3_LOCK_IFB_UF (1<<0) /* Protect info part of userflash */ |
Definition at line 106 of file niietcm4.c.
#define K1921VK01T_ID 0x00000000 |
Definition at line 19 of file niietcm4.c.
#define MAGIC_KEY 0xA442 |
Definition at line 29 of file niietcm4.c.
#define MAIN_MEM_TYPE 0 |
Definition at line 26 of file niietcm4.c.
#define SERVICE_MODE_ERASE_ADDR 0x80030164 |
Definition at line 28 of file niietcm4.c.
#define UF_LOCK_ADDR 0x80 |
Definition at line 109 of file niietcm4.c.
#define UFCIC (USERFLASH_BASE + 0x14) |
Definition at line 70 of file niietcm4.c.
Definition at line 87 of file niietcm4.c.
Definition at line 88 of file niietcm4.c.
#define UFCIM (USERFLASH_BASE + 0x10) |
Definition at line 69 of file niietcm4.c.
#define UFCIS (USERFLASH_BASE + 0x0C) |
Definition at line 68 of file niietcm4.c.
#define UFCIS_OP_CMLT (1<<0) /* Completion flag operation */ |
Definition at line 83 of file niietcm4.c.
#define UFCIS_OP_ERROR (1<<1) /* Flag operation error */ |
Definition at line 84 of file niietcm4.c.
#define UFMA (USERFLASH_BASE + 0x00) |
Definition at line 65 of file niietcm4.c.
#define UFMC (USERFLASH_BASE + 0x08) |
Definition at line 67 of file niietcm4.c.
#define UFMC_FULL_ERASE (1<<2) /* Erase full flash */ |
Definition at line 75 of file niietcm4.c.
Definition at line 80 of file niietcm4.c.
#define UFMC_PAGE_ERASE (1<<1) /* Paged erase the main region */ |
Definition at line 74 of file niietcm4.c.
#define UFMC_PAGEERASE_IFB (1<<5) /* Erase page of info region */ |
Definition at line 78 of file niietcm4.c.
#define UFMC_READ (1<<3) /* Reading from main region */ |
Definition at line 76 of file niietcm4.c.
#define UFMC_READ_IFB (1<<6) /* Reading from info region */ |
Definition at line 79 of file niietcm4.c.
#define UFMC_WRITE (1<<0) /* Writing in main region */ |
Definition at line 73 of file niietcm4.c.
#define UFMC_WRITE_IFB (1<<4) /* Writing in info region */ |
Definition at line 77 of file niietcm4.c.
#define UFMD (USERFLASH_BASE + 0x04) |
Definition at line 66 of file niietcm4.c.
#define USERFLASH_BASE 0xA0022000 |
Definition at line 64 of file niietcm4.c.
#define USERFLASH_PAGE_SIZE 256 |
Definition at line 61 of file niietcm4.c.
#define USERFLASH_PAGE_TOTALNUM 256 |
Definition at line 62 of file niietcm4.c.
COMMAND_HANDLER | ( | niietcm4_handle_bflash_info_remap_command | ) |
Definition at line 704 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, INFOWORD0_ADDR, INFOWORD0_BOOTFROM_IFB, LOG_ERROR, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), target::state, TARGET_HALTED, and USERFLASH_PAGE_SIZE.
COMMAND_HANDLER | ( | niietcm4_handle_driver_info_command | ) |
Definition at line 921 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and FLASH_DRIVER_VER.
COMMAND_HANDLER | ( | niietcm4_handle_extmem_boot_command | ) |
Definition at line 831 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, INFOWORD0_ADDR, INFOWORD0_EN_GPIO, LOG_ERROR, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), target::state, TARGET_HALTED, and USERFLASH_PAGE_SIZE.
COMMAND_HANDLER | ( | niietcm4_handle_extmem_cfg_command | ) |
Definition at line 754 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, INFOWORD0_ADDR, INFOWORD0_EXTMEM_SEL_POS, INFOWORD1_ADDR, INFOWORD1_PINNUM_POS, INFOWORD1_PORTNUM_POS, LOG_ERROR, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), target::state, TARGET_HALTED, and USERFLASH_PAGE_SIZE.
COMMAND_HANDLER | ( | niietcm4_handle_service_mode_erase_command | ) |
Definition at line 882 of file niietcm4.c.
References bank, busy_sleep(), CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, SERVICE_MODE_ERASE_ADDR, status, target_read_u32(), and target_write_u32().
COMMAND_HANDLER | ( | niietcm4_handle_uflash_erase_command | ) |
Definition at line 518 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, niietcm4_uflash_page_erase(), target::state, and TARGET_HALTED.
COMMAND_HANDLER | ( | niietcm4_handle_uflash_full_erase_command | ) |
Definition at line 480 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, niietcm4_uopstatus_check(), target::state, TARGET_HALTED, target_write_u32(), UFMA, UFMC, UFMC_FULL_ERASE, UFMC_MAGIC_KEY, and UFMD.
COMMAND_HANDLER | ( | niietcm4_handle_uflash_protect_check_command | ) |
Definition at line 561 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, INFO_MEM_TYPE, INFOWORD3_ADDR, INFOWORD3_LOCK_IFB_UF, LOG_ERROR, niietcm4_uopstatus_check(), target::state, TARGET_HALTED, target_read_u32(), target_write_u32(), UF_LOCK_ADDR, UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_READ_IFB, UFMD, USERFLASH_PAGE_SIZE, and USERFLASH_PAGE_TOTALNUM.
COMMAND_HANDLER | ( | niietcm4_handle_uflash_protect_command | ) |
Definition at line 652 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, niietcm4_uflash_protect(), target::state, and TARGET_HALTED.
COMMAND_HANDLER | ( | niietcm4_handle_uflash_read_byte_command | ) |
Definition at line 377 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, niietcm4_uopstatus_check(), target_read_u32(), target_write_u32(), UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_READ, UFMC_READ_IFB, and UFMD.
COMMAND_HANDLER | ( | niietcm4_handle_uflash_write_byte_command | ) |
Definition at line 424 of file niietcm4.c.
References bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), target::state, TARGET_HALTED, and USERFLASH_PAGE_SIZE.
FLASH_BANK_COMMAND_HANDLER | ( | niietcm4_flash_bank_command | ) |
Definition at line 1038 of file niietcm4.c.
References bank, niietcm4_flash_bank::bflash_info_remap, niietcm4_flash_bank::chip_name, niietcm4_flash_bank::chipid, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, niietcm4_flash_bank::extmem_boot, niietcm4_flash_bank::extmem_boot_altfunc, niietcm4_flash_bank::extmem_boot_pin, niietcm4_flash_bank::extmem_boot_port, NULL, niietcm4_flash_bank::probed, niietcm4_flash_bank::uflash_info_pagetotal, niietcm4_flash_bank::uflash_info_size, niietcm4_flash_bank::uflash_pagetotal, niietcm4_flash_bank::uflash_size, and niietcm4_flash_bank::uflash_width.
|
static |
Definition at line 1709 of file niietcm4.c.
References bank, niietcm4_flash_bank::chip_brief, niietcm4_flash_bank::chip_name, cmd, command_print_sameline(), and ERROR_OK.
|
static |
Definition at line 1701 of file niietcm4.c.
References bank, ERROR_OK, niietcm4_probe(), and niietcm4_flash_bank::probed.
|
static |
Dump page of userflash region.
If we want to change some settings, we have to dump it full, because userflash is flash(not EEPROM). And correct write to flash can be performed only after erase. So without dump, changing one registers will clear others.
Definition at line 219 of file niietcm4.c.
References bank, ERROR_OK, INFO_MEM_TYPE, niietcm4_uopstatus_check(), target_read_u32(), target_write_u32(), UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_READ, UFMC_READ_IFB, UFMD, and USERFLASH_PAGE_SIZE.
Referenced by COMMAND_HANDLER(), niietcm4_protect(), and niietcm4_uflash_protect().
|
static |
Definition at line 1156 of file niietcm4.c.
References bank, niietcm4_flash_bank::bflash_info_remap, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FMA, FMC, FMC_MAGIC_KEY, FMC_PAGE_ERASE, FMC_PAGEERASE_IFB, LOG_ERROR, niietcm4_mass_erase(), niietcm4_opstatus_check(), TARGET_HALTED, and target_write_u32().
|
static |
Load modified page dump to userflash region page.
Definition at line 255 of file niietcm4.c.
References bank, ERROR_OK, INFO_MEM_TYPE, niietcm4_uopstatus_check(), target_write_u32(), UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_WRITE, UFMC_WRITE_IFB, UFMD, and USERFLASH_PAGE_SIZE.
Referenced by COMMAND_HANDLER(), niietcm4_protect(), and niietcm4_uflash_protect().
|
static |
Definition at line 1135 of file niietcm4.c.
References bank, ERROR_OK, FMC, FMC_FULL_ERASE, FMC_MAGIC_KEY, niietcm4_opstatus_check(), and target_write_u32().
Referenced by niietcm4_erase().
|
static |
Wait while operation with bootflash being performed and check result status.
Definition at line 142 of file niietcm4.c.
References bank, busy_sleep(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, FCIC, FCIC_CLR_OPCMLT, FCIC_CLR_OPERROR, FCIS, FCIS_OP_ERROR, LOG_ERROR, target_read_u32(), and target_write_u32().
Referenced by niietcm4_erase(), niietcm4_mass_erase(), and niietcm4_write().
|
static |
Definition at line 1664 of file niietcm4.c.
References bank, CHIPID_ADDR, ERROR_OK, K1921VK01T_ID, LOG_INFO, niietcm4_probe_k1921vk01t(), NULL, niietcm4_flash_bank::probed, and target_read_u32().
Referenced by niietcm4_auto_probe().
|
static |
Definition at line 1463 of file niietcm4.c.
References bank, niietcm4_flash_bank::bflash_info_remap, niietcm4_flash_bank::chip_brief, niietcm4_flash_bank::chip_name, ERROR_OK, niietcm4_flash_bank::extmem_boot, niietcm4_flash_bank::extmem_boot_altfunc, niietcm4_flash_bank::extmem_boot_pin, niietcm4_flash_bank::extmem_boot_port, INFOWORD0_BOOTFROM_IFB_POS, INFOWORD0_EN_GPIO_POS, INFOWORD0_EXTMEM_SEL_POS, INFOWORD1_PINNUM_POS, INFOWORD1_PORTNUM_POS, niietcm4_uopstatus_check(), TARGET_ADDR_FMT, target_read_u32(), target_write_u32(), niietcm4_flash_bank::uflash_info_pagetotal, niietcm4_flash_bank::uflash_info_size, niietcm4_flash_bank::uflash_pagetotal, niietcm4_flash_bank::uflash_size, niietcm4_flash_bank::uflash_width, UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_READ_IFB, and UFMD.
Referenced by niietcm4_probe().
|
static |
Definition at line 1203 of file niietcm4.c.
References bank, BF_LOCK_ADDR, niietcm4_flash_bank::bflash_info_remap, ERROR_OK, ERROR_TARGET_NOT_HALTED, INFOWORD2_ADDR, INFOWORD2_LOCK_IFB_BF, LOG_ERROR, LOG_INFO, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), target::state, TARGET_HALTED, and USERFLASH_PAGE_SIZE.
|
static |
Definition at line 1067 of file niietcm4.c.
References bank, BF_LOCK_ADDR, niietcm4_flash_bank::bflash_info_remap, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, INFOWORD2_ADDR, INFOWORD2_LOCK_IFB_BF, niietcm4_uopstatus_check(), target_read_u32(), target_write_u32(), UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_READ_IFB, and UFMD.
|
static |
Erase one page of userflash info or main region.
Definition at line 291 of file niietcm4.c.
References bank, ERROR_OK, INFO_MEM_TYPE, niietcm4_uopstatus_check(), target_write_u32(), UFMA, UFMC, UFMC_MAGIC_KEY, UFMC_PAGE_ERASE, UFMC_PAGEERASE_IFB, UFMD, and USERFLASH_PAGE_SIZE.
Referenced by COMMAND_HANDLER(), niietcm4_protect(), and niietcm4_uflash_protect().
|
static |
Enable or disable protection of userflash pages.
Definition at line 322 of file niietcm4.c.
References bank, ERROR_OK, INFO_MEM_TYPE, INFOWORD2_ADDR, INFOWORD3_LOCK_IFB_UF, niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_uflash_page_erase(), UF_LOCK_ADDR, and USERFLASH_PAGE_SIZE.
Referenced by COMMAND_HANDLER().
|
static |
Wait while operation with userflash being performed and check result status.
Definition at line 179 of file niietcm4.c.
References bank, busy_sleep(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_ERROR, target_read_u32(), target_write_u32(), UFCIC, UFCIC_CLR_OPCMLT, UFCIC_CLR_OPERROR, UFCIS, and UFCIS_OP_ERROR.
Referenced by COMMAND_HANDLER(), niietcm4_dump_uflash_page(), niietcm4_load_uflash_page(), niietcm4_probe_k1921vk01t(), niietcm4_protect_check(), and niietcm4_uflash_page_erase().
|
static |
Definition at line 1359 of file niietcm4.c.
References bank, niietcm4_flash_bank::bflash_info_remap, buffer, count, ERROR_FAIL, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FMA, FMC, FMC_MAGIC_KEY, FMC_WRITE, FMC_WRITE_IFB, FMD1, FMD2, FMD3, FMD4, LOG_ERROR, LOG_INFO, LOG_WARNING, niietcm4_opstatus_check(), niietcm4_write_block(), NULL, offset, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 1265 of file niietcm4.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, niietcm4_flash_bank::bflash_info_remap, buf_get_u32(), buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, count, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, FMC_MAGIC_KEY, FMC_WRITE, FMC_WRITE_IFB, init_reg_param(), LOG_ERROR, LOG_WARNING, NULL, offset, PARAM_IN_OUT, PARAM_OUT, source, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), target_run_flash_async_algorithm(), and target_write_buffer().
Referenced by niietcm4_write().
|
static |
Definition at line 921 of file niietcm4.c.
|
static |
Definition at line 921 of file niietcm4.c.
const struct flash_driver niietcm4_flash |
Definition at line 1709 of file niietcm4.c.