OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | npcx_flash_bank |
struct | npcx_flash_info |
Macros | |
#define | NPCX_FLASH_TIMEOUT_MS 8000 |
Enumerations | |
enum | npcx_flash_device_index { NPCX_FLASH_256KB = 0 , NPCX_FLASH_512KB = 1 , NPCX_FLASH_1MB = 2 , NPCX_FLASH_UNKNOWN } |
Functions | |
FLASH_BANK_COMMAND_HANDLER (npcx_flash_bank_command) | |
static int | npcx_auto_probe (struct flash_bank *bank) |
static int | npcx_chip_erase (struct flash_bank *bank) |
static int | npcx_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | npcx_get_flash (uint32_t flash_id) |
static enum npcx_flash_device_index | npcx_get_flash_id (struct flash_bank *bank, uint32_t *flash_id) |
static int | npcx_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | npcx_init (struct flash_bank *bank) |
static int | npcx_probe (struct flash_bank *bank) |
static int | npcx_quit (struct flash_bank *bank) |
static int | npcx_wait_algo_done (struct flash_bank *bank, uint32_t params_addr) |
static int | npcx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const struct npcx_flash_info | flash_info [] |
static const uint8_t | npcx_algo [] |
const struct flash_driver | npcx_flash |
FLASH_BANK_COMMAND_HANDLER | ( | npcx_flash_bank_command | ) |
Definition at line 295 of file npcx.c.
References bank, CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_INVALID, npcx_flash_bank::fiu_ver, LOG_ERROR, LOG_WARNING, and npcx_flash_bank::sector_length.
|
static |
Definition at line 284 of file npcx.c.
References bank, ERROR_OK, npcx_probe(), and npcx_flash_bank::probed.
Referenced by npcx_chip_erase(), npcx_erase(), and npcx_write().
|
static |
Definition at line 338 of file npcx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, npcx_flash_bank::fiu_ver, LOG_ERROR, npcx_auto_probe(), npcx_init(), npcx_quit(), npcx_wait_algo_done(), npcx_flash_bank::params_addr, target::state, target_buffer_set_u32(), TARGET_HALTED, and target_write_buffer().
Referenced by npcx_erase().
|
static |
Definition at line 386 of file npcx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, npcx_flash_bank::fiu_ver, length, LOG_ERROR, npcx_auto_probe(), npcx_chip_erase(), npcx_init(), npcx_quit(), npcx_wait_algo_done(), npcx_flash_bank::params_addr, npcx_flash_bank::sector_length, target::state, target_buffer_set_u32(), TARGET_HALTED, and target_write_buffer().
|
static |
Definition at line 224 of file npcx.c.
References ARRAY_SIZE, flash_info, and NPCX_FLASH_UNKNOWN.
Referenced by npcx_probe().
|
static |
Definition at line 152 of file npcx.c.
References bank, ERROR_FAIL, ERROR_OK, keep_alive(), LOG_TARGET_ERROR, NPCX_FLASH_TIMEOUT_MS, status, target_read_u32(), and timeval_ms().
Referenced by npcx_probe().
|
static |
|
static |
Definition at line 77 of file npcx.c.
References working_area::address, npcx_flash_bank::algo_code, npcx_flash_bank::algo_size, npcx_flash_bank::algo_working_size, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, npcx_flash_bank::armv7m_info, bank, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_INFO, LOG_TARGET_ERROR, NULL, target_alloc_working_area(), target_free_working_area(), target_start_algorithm(), target_write_buffer(), and npcx_flash_bank::working_area.
Referenced by npcx_chip_erase(), npcx_erase(), and npcx_write().
|
static |
Definition at line 234 of file npcx.c.
References npcx_flash_bank::algo_code, npcx_flash_bank::algo_size, npcx_flash_bank::algo_working_size, bank, npcx_flash_bank::buffer_addr, ERROR_FAIL, ERROR_OK, npcx_flash_bank::flash, flash_info, LOG_ERROR, npcx_algo, npcx_get_flash(), npcx_get_flash_id(), npcx_flash_bank::params_addr, npcx_flash_bank::probed, npcx_flash_bank::sector_length, and npcx_flash_info::size.
Referenced by npcx_auto_probe().
|
static |
Definition at line 134 of file npcx.c.
References npcx_flash_bank::armv7m_info, bank, NPCX_FLASH_TIMEOUT_MS, NULL, target_free_working_area(), target_halt(), target_wait_algorithm(), and npcx_flash_bank::working_area.
Referenced by npcx_chip_erase(), npcx_erase(), and npcx_write().
|
static |
Definition at line 152 of file npcx.c.
Referenced by npcx_chip_erase(), npcx_erase(), and npcx_write().
|
static |
Definition at line 445 of file npcx.c.
References bank, buffer, npcx_flash_bank::buffer_addr, count, ERROR_OK, ERROR_TARGET_NOT_HALTED, npcx_flash_bank::fiu_ver, LOG_ERROR, npcx_auto_probe(), npcx_init(), npcx_quit(), npcx_wait_algo_done(), offset, npcx_flash_bank::params_addr, size, target::state, target_buffer_set_u32(), TARGET_HALTED, and target_write_buffer().
|
static |
Definition at line 21 of file npcx.c.
Referenced by npcx_get_flash(), and npcx_probe().
|
static |
const struct flash_driver npcx_flash |