OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | npcx_flash_bank |
struct | npcx_flash_info |
Macros | |
#define | NPCX_FLASH_BASE_ADDR 0x64000000 |
#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 299 of file npcx.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, npcx_flash_bank::family_name, LOG_ERROR, NULL, and npcx_flash_bank::sector_length.
|
static |
Definition at line 288 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 323 of file npcx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, 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 370 of file npcx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, 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 228 of file npcx.c.
References ARRAY_SIZE, flash_info, and NPCX_FLASH_UNKNOWN.
Referenced by npcx_probe().
|
static |
Definition at line 154 of file npcx.c.
References bank, ERROR_FAIL, ERROR_OK, npcx_flash_bank::family_name, keep_alive(), LOG_ERROR, NPCX_FLASH_TIMEOUT_MS, npcx_flash_bank::params_addr, 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, npcx_flash_bank::family_name, LOG_ERROR, LOG_INFO, 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 238 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_FLASH_BASE_ADDR, 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 136 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 154 of file npcx.c.
Referenced by npcx_chip_erase(), npcx_erase(), and npcx_write().
|
static |
Definition at line 428 of file npcx.c.
References bank, buffer, npcx_flash_bank::buffer_addr, count, ERROR_OK, ERROR_TARGET_NOT_HALTED, 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 20 of file npcx.c.
Referenced by npcx_get_flash(), and npcx_probe().
|
static |
const struct flash_driver npcx_flash |