OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | numicro_cpu_type |
struct | numicro_flash_bank |
struct | numicro_flash_bank_type |
Macros | |
#define | AHBCLK_ISP_EN (1 << 2) |
#define | AHBCLK_SRAM_EN (1 << 4) |
#define | AHBCLK_TICK_EN (1 << 5) |
#define | CONFIG0_LOCK_MASK (1 << 1) |
#define | IPRSTC1_CHIP_RST (1 << 0) |
#define | IPRSTC1_CPU_RST (1 << 1) |
#define | ISPCMD_CHIPERASE 0x26 /* Undocumented isp "Chip-Erase" command */ |
#define | ISPCMD_ERASE 0x22 |
#define | ISPCMD_READ 0x00 |
#define | ISPCMD_READ_CID 0x0B |
#define | ISPCMD_READ_DID 0x0C |
#define | ISPCMD_READ_UID 0x04 |
#define | ISPCMD_VECMAP 0x2E |
#define | ISPCMD_WRITE 0x21 |
#define | ISPCON_APUEN (1 << 3) |
#define | ISPCON_BS_AP (0 << 1) |
#define | ISPCON_BS_LP (1 << 1) |
#define | ISPCON_BS_MASK (1 << 1) |
#define | ISPCON_CFGUEN (1 << 4) |
#define | ISPCON_ISPEN (1 << 0) |
#define | ISPCON_ISPFF (1 << 6) |
#define | ISPCON_LDUEN (1 << 5) |
#define | ISPTRG_ISPGO (1 << 0) |
#define | NUMICRO_APROM_BASE 0x00000000 |
#define | NUMICRO_BANKS_GENERAL(aprom_size, data_size, ldrom_size, config_size) |
#define | NUMICRO_CONFIG0 0x5000C000 |
#define | NUMICRO_CONFIG1 0x5000C004 |
#define | NUMICRO_CONFIG_BASE 0x00300000 |
#define | NUMICRO_DATA_BASE 0x0001F000 |
#define | NUMICRO_FLASH_BASE 0x5000C000 |
#define | NUMICRO_FLASH_CHEAT 0x5000C01C /* Undocumented isp register(may be cheat register) */ |
#define | NUMICRO_FLASH_ISPADR 0x5000C004 |
#define | NUMICRO_FLASH_ISPCMD 0x5000C00C |
#define | NUMICRO_FLASH_ISPCON 0x5000C000 |
#define | NUMICRO_FLASH_ISPDAT 0x5000C008 |
#define | NUMICRO_FLASH_ISPTRG 0x5000C010 |
#define | NUMICRO_LDROM_BASE 0x00100000 |
#define | NUMICRO_MAX_FLASH_BANKS 4 |
#define | NUMICRO_PAGESIZE 512 |
#define | NUMICRO_SCS_AIRCR 0xE000ED0C |
#define | NUMICRO_SCS_BASE 0xE000E000 |
#define | NUMICRO_SCS_DEMCR 0xE000EDFC |
#define | NUMICRO_SCS_DHCSR 0xE000EDF0 |
#define | NUMICRO_SYS_BASE 0x50000000 |
#define | NUMICRO_SYS_IPRSTC1 0x50000008 |
#define | NUMICRO_SYS_WRPROT 0x50000100 |
#define | NUMICRO_SYSCLK_AHBCLK 0x50000204 |
#define | NUMICRO_SYSCLK_BASE 0x50000200 |
#define | NUMICRO_SYSCLK_CLKDIV 0x50000218 |
#define | NUMICRO_SYSCLK_CLKSEL0 0x50000210 |
#define | NUMICRO_SYSCLK_PWRCON 0x50000200 |
#define | PWRCON_OSC22M (1 << 2) |
#define | PWRCON_XTL12M (1 << 0) |
#define | REG_KEY1 0x59 |
#define | REG_KEY2 0x16 |
#define | REG_KEY3 0x88 |
#define | REG_LOCK 0x00 |
Functions | |
COMMAND_HANDLER (numicro_handle_chip_erase_command) | |
COMMAND_HANDLER (numicro_handle_read_isp_command) | |
COMMAND_HANDLER (numicro_handle_write_isp_command) | |
FLASH_BANK_COMMAND_HANDLER (numicro_flash_bank_command) | |
static int | numicro_auto_probe (struct flash_bank *bank) |
static int | numicro_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static uint32_t | numicro_fmc_cmd (struct target *target, uint32_t cmd, uint32_t addr, uint32_t wdata, uint32_t *rdata) |
static int | numicro_get_arm_arch (struct target *target) |
static int | numicro_get_cpu_type (struct target *target, const struct numicro_cpu_type **cpu) |
static int | numicro_get_flash_size (struct flash_bank *bank, const struct numicro_cpu_type *cpu, uint32_t *flash_size) |
static int | numicro_init_isp (struct target *target) |
static int | numicro_probe (struct flash_bank *bank) |
static int | numicro_protect_check (struct flash_bank *bank) |
static int | numicro_reg_unlock (struct target *target) |
static int | numicro_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | numicro_writeblock (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static uint32_t | m_address_bias_offset |
static uint32_t | m_page_size = NUMICRO_PAGESIZE |
static const struct command_registration | numicro_command_handlers [] |
static const struct command_registration | numicro_exec_command_handlers [] |
const struct flash_driver | numicro_flash |
static const uint8_t | numicro_flash_write_code [] |
static const uint8_t | numicro_m4_flash_write_code [] |
static const struct numicro_cpu_type | numicro_parts [] |
#define ISPCMD_CHIPERASE 0x26 /* Undocumented isp "Chip-Erase" command */ |
#define NUMICRO_BANKS_GENERAL | ( | aprom_size, | |
data_size, | |||
ldrom_size, | |||
config_size | |||
) |
#define NUMICRO_FLASH_CHEAT 0x5000C01C /* Undocumented isp register(may be cheat register) */ |
COMMAND_HANDLER | ( | numicro_handle_chip_erase_command | ) |
Definition at line 1192 of file numicro.c.
References CMD, CMD_ARGC, CMD_CTX, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), ISPCMD_CHIPERASE, numicro_fmc_cmd(), numicro_get_arm_arch(), and numicro_init_isp().
COMMAND_HANDLER | ( | numicro_handle_read_isp_command | ) |
Definition at line 1138 of file numicro.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), ISPCMD_READ, LOG_INFO, numicro_fmc_cmd(), numicro_get_arm_arch(), and numicro_init_isp().
COMMAND_HANDLER | ( | numicro_handle_write_isp_command | ) |
Definition at line 1165 of file numicro.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), ISPCMD_WRITE, LOG_INFO, numicro_fmc_cmd(), numicro_get_arm_arch(), and numicro_init_isp().
FLASH_BANK_COMMAND_HANDLER | ( | numicro_flash_bank_command | ) |
|
static |
Definition at line 1109 of file numicro.c.
References bank, ERROR_OK, numicro_probe(), and numicro_flash_bank::probed.
|
static |
Definition at line 855 of file numicro.c.
References bank, busy_sleep(), ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, ISPCMD_ERASE, ISPCON_ISPFF, ISPTRG_ISPGO, LOG_DEBUG, LOG_ERROR, LOG_INFO, m_address_bias_offset, NUMICRO_FLASH_ISPADR, NUMICRO_FLASH_ISPCMD, NUMICRO_FLASH_ISPCON, NUMICRO_FLASH_ISPTRG, numicro_get_arm_arch(), numicro_init_isp(), target::state, status, TARGET_ADDR_FMT, TARGET_HALTED, target_read_u32(), and target_write_u32().
|
static |
Definition at line 639 of file numicro.c.
References addr, busy_sleep(), cmd, ERROR_FAIL, ERROR_OK, ISPTRG_ISPGO, LOG_DEBUG, m_address_bias_offset, NUMICRO_FLASH_ISPADR, NUMICRO_FLASH_ISPCMD, NUMICRO_FLASH_ISPDAT, NUMICRO_FLASH_ISPTRG, status, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER(), and numicro_protect_check().
|
static |
Definition at line 543 of file numicro.c.
References arm::arch, armv7m_common::arm, ARM_ARCH_V6M, ERROR_OK, LOG_DEBUG, m_address_bias_offset, m_page_size, NUMICRO_PAGESIZE, and target_to_armv7m().
Referenced by COMMAND_HANDLER(), numicro_erase(), numicro_get_cpu_type(), numicro_protect_check(), and numicro_write().
|
static |
Definition at line 1027 of file numicro.c.
References ARRAY_SIZE, ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_INFO, LOG_WARNING, m_address_bias_offset, numicro_get_arm_arch(), numicro_parts, NUMICRO_SYS_BASE, and target_read_u32().
Referenced by numicro_probe().
|
static |
Definition at line 1053 of file numicro.c.
References numicro_cpu_type::bank, bank, numicro_flash_bank_type::base, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_INFO, numicro_cpu_type::n_banks, numicro_flash_bank_type::size, and TARGET_ADDR_FMT.
Referenced by numicro_probe().
|
static |
Definition at line 597 of file numicro.c.
References AHBCLK_ISP_EN, AHBCLK_SRAM_EN, AHBCLK_TICK_EN, ERROR_OK, ERROR_TARGET_NOT_HALTED, ISPCON_APUEN, ISPCON_CFGUEN, ISPCON_ISPEN, ISPCON_ISPFF, ISPCON_LDUEN, LOG_ERROR, m_address_bias_offset, NUMICRO_FLASH_CHEAT, NUMICRO_FLASH_ISPCON, numicro_reg_unlock(), NUMICRO_SYSCLK_AHBCLK, target::state, TARGET_HALTED, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER(), numicro_erase(), numicro_protect_check(), and numicro_write().
|
static |
Definition at line 1066 of file numicro.c.
References bank, numicro_flash_bank::cpu, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_WARNING, m_page_size, numicro_get_cpu_type(), numicro_get_flash_size(), offset, and numicro_flash_bank::probed.
Referenced by numicro_auto_probe().
|
static |
Definition at line 809 of file numicro.c.
References bank, config, CONFIG0_LOCK_MASK, ERROR_OK, ERROR_TARGET_NOT_HALTED, ISPCMD_READ, LOG_DEBUG, LOG_ERROR, LOG_INFO, m_address_bias_offset, NUMICRO_CONFIG0, NUMICRO_CONFIG1, numicro_fmc_cmd(), numicro_get_arm_arch(), numicro_init_isp(), target::state, and TARGET_HALTED.
|
static |
Definition at line 560 of file numicro.c.
References ERROR_OK, LOG_DEBUG, m_address_bias_offset, NUMICRO_SYS_WRPROT, REG_KEY1, REG_KEY2, REG_KEY3, target_read_u32(), and target_write_u32().
Referenced by numicro_init_isp().
|
static |
Definition at line 926 of file numicro.c.
References bank, buffer, busy_sleep(), count, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, ISPCMD_WRITE, ISPCON_ISPFF, ISPTRG_ISPGO, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, m_address_bias_offset, MIN, NUMICRO_FLASH_ISPADR, NUMICRO_FLASH_ISPCMD, NUMICRO_FLASH_ISPCON, NUMICRO_FLASH_ISPDAT, NUMICRO_FLASH_ISPTRG, numicro_get_arm_arch(), numicro_init_isp(), numicro_writeblock(), offset, target::state, status, TARGET_HALTED, target_read_u32(), target_write_memory(), and target_write_u32().
|
static |
Definition at line 692 of file numicro.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, bank, buf_set_u32(), buffer, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, count, destroy_reg_param(), ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), LOG_ERROR, LOG_WARNING, m_page_size, NULL, numicro_flash_write_code, numicro_m4_flash_write_code, NUMICRO_PAGESIZE, offset, PARAM_IN_OUT, PARAM_OUT, source, target_alloc_working_area(), target_free_working_area(), target_run_algorithm(), target_write_buffer(), and target::working_area_size.
Referenced by numicro_write().
|
static |
Definition at line 540 of file numicro.c.
Referenced by numicro_erase(), numicro_fmc_cmd(), numicro_get_arm_arch(), numicro_get_cpu_type(), numicro_init_isp(), numicro_protect_check(), numicro_reg_unlock(), and numicro_write().
|
static |
Definition at line 539 of file numicro.c.
Referenced by numicro_get_arm_arch(), numicro_probe(), and numicro_writeblock().
|
static |
|
static |
const struct flash_driver numicro_flash |
|
static |
|
static |
|
static |
Definition at line 1 of file numicro.c.
Referenced by numicro_get_cpu_type().