OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | pic32mx_devs_s |
struct | pic32mx_flash_bank |
Macros | |
#define | MX_17X_27X 2 /* PIC32mx17x/27x */ |
#define | MX_1XX_2XX 1 /* PIC32mx1xx/2xx */ |
#define | NVMCON_LVDERR (1 << 12) |
#define | NVMCON_LVDSTAT (1 << 11) |
#define | NVMCON_NVMERR (1 << 13) |
#define | NVMCON_NVMWR (1 << 15) |
#define | NVMCON_NVMWREN (1 << 14) |
#define | NVMCON_OP_NOP 0x0 |
#define | NVMCON_OP_PAGE_ERASE 0x4 |
#define | NVMCON_OP_PFM_ERASE 0x5 |
#define | NVMCON_OP_ROW_PROG 0x3 |
#define | NVMCON_OP_WORD_PROG 0x1 |
#define | NVMKEY1 0xAA996655 |
#define | NVMKEY2 0x556699AA |
#define | PIC32MX_BMXBOOTSZ 0xBF882070 |
#define | PIC32MX_BMXDRMSZ 0xBF882040 |
#define | PIC32MX_BMXPFMSZ 0xBF882060 |
#define | PIC32MX_DEVCFG0 0xBFC02FFC |
#define | PIC32MX_DEVCFG0_1XX_2XX 0xBFC00BFC |
#define | PIC32MX_DEVCFG1 0xBFC02FF8 |
#define | PIC32MX_DEVCFG2 0xBFC02FF4 |
#define | PIC32MX_DEVCFG3 0xBFC02FF0 |
#define | PIC32MX_DEVID 0xBF80F220 |
#define | PIC32MX_MANUF_ID 0x029 |
#define | PIC32MX_NVMADDR 0xBF80F420 |
#define | PIC32MX_NVMADDRCLR 0xBF80F424 |
#define | PIC32MX_NVMADDRINV 0xBF80F42C |
#define | PIC32MX_NVMADDRSET 0xBF80F428 |
#define | PIC32MX_NVMCON 0xBF80F400 |
#define | PIC32MX_NVMCONCLR 0xBF80F404 |
#define | PIC32MX_NVMCONINV 0xBF80F40C |
#define | PIC32MX_NVMCONSET 0xBF80F408 |
#define | PIC32MX_NVMDATA 0xBF80F430 |
#define | PIC32MX_NVMKEY 0xBF80F410 |
#define | PIC32MX_NVMSRCADDR 0xBF80F440 |
#define | PIC32MX_PHYS_BOOT_FLASH 0x1FC00000 |
#define | PIC32MX_PHYS_PERIPHERALS 0x1F800000 |
#define | PIC32MX_PHYS_PGM_FLASH 0x1D000000 |
#define | PIC32MX_PHYS_RAM 0x00000000 |
#define | virt2phys(v) ((v) & 0x1FFFFFFF) |
Functions | |
COMMAND_HANDLER (pic32mx_handle_pgm_word_command) | |
COMMAND_HANDLER (pic32mx_handle_unlock_command) | |
FLASH_BANK_COMMAND_HANDLER (pic32mx_flash_bank_command) | |
static int | pic32mx_auto_probe (struct flash_bank *bank) |
static int | pic32mx_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static uint32_t | pic32mx_get_flash_status (struct flash_bank *bank) |
static int | pic32mx_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | pic32mx_nvm_exec (struct flash_bank *bank, uint32_t op, uint32_t timeout) |
static int | pic32mx_probe (struct flash_bank *bank) |
static int | pic32mx_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | pic32mx_protect_check (struct flash_bank *bank) |
static uint32_t | pic32mx_wait_status_busy (struct flash_bank *bank, int timeout) |
static int | pic32mx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | pic32mx_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | pic32mx_write_word (struct flash_bank *bank, uint32_t address, uint32_t word) |
Variables | |
static const struct command_registration | pic32mx_command_handlers [] |
static const struct pic32mx_devs_s | pic32mx_devs [] |
static const struct command_registration | pic32mx_exec_command_handlers [] |
const struct flash_driver | pic32mx_flash |
static uint32_t | pic32mx_flash_write_code [] |
COMMAND_HANDLER | ( | pic32mx_handle_pgm_word_command | ) |
Definition at line 826 of file pic32mx.c.
References bank, flash_bank::base, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, NVMCON_LVDERR, NVMCON_NVMERR, pic32mx_write_word(), and status.
COMMAND_HANDLER | ( | pic32mx_handle_unlock_command | ) |
Definition at line 862 of file pic32mx.c.
References alive_sleep(), bank, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, command_print(), mips32_common::ejtag_info, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, jtag_add_sleep(), LOG_DEBUG, MCHP_ASERT_RST, MCHP_DE_ASSERT_RST, MCHP_ERASE, MCHP_STATUS, mips_m4k_common::mips32, mips_ejtag_drscan_8(), mips_ejtag_drscan_8_out(), mips_ejtag_set_instr(), MTAP_COMMAND, MTAP_SW_ETAP, MTAP_SW_MTAP, NULL, and target_to_m4k().
FLASH_BANK_COMMAND_HANDLER | ( | pic32mx_flash_bank_command | ) |
Definition at line 193 of file pic32mx.c.
References bank, CMD_ARGC, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and pic32mx_info().
|
static |
Definition at line 784 of file pic32mx.c.
References bank, ERROR_OK, pic32mx_info(), and pic32mx_probe().
|
static |
Definition at line 312 of file pic32mx.c.
References bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, NVMCON_LVDERR, NVMCON_NVMERR, NVMCON_OP_PAGE_ERASE, NVMCON_OP_PFM_ERASE, pic32mx_nvm_exec(), PIC32MX_NVMADDR, PIC32MX_PHYS_PGM_FLASH, status, TARGET_HALTED, target_write_u32(), and virt2phys.
|
static |
Definition at line 209 of file pic32mx.c.
References bank, PIC32MX_NVMCON, status, and target_read_u32().
Referenced by pic32mx_wait_status_busy().
|
static |
Definition at line 792 of file pic32mx.c.
References target::arch_info, bank, cmd, command_print_sameline(), mips32_common::ejtag_info, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, mips_ejtag::idcode, pic32mx_devs_s::name, name, pic32mx_devs, and PIC32MX_MANUF_ID.
Referenced by FLASH_BANK_COMMAND_HANDLER(), pic32mx_auto_probe(), pic32mx_probe(), pic32mx_protect_check(), and pic32mx_write_block().
|
static |
Definition at line 234 of file pic32mx.c.
References bank, NVMCON_NVMWR, NVMCON_NVMWREN, NVMKEY1, NVMKEY2, op, PIC32MX_NVMCON, PIC32MX_NVMCONCLR, PIC32MX_NVMCONSET, PIC32MX_NVMKEY, pic32mx_wait_status_busy(), status, and target_write_u32().
Referenced by pic32mx_erase(), and pic32mx_write_word().
|
static |
Definition at line 679 of file pic32mx.c.
References target::arch_info, bank, mips32_common::ejtag_info, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, mips_ejtag::idcode, LOG_INFO, LOG_WARNING, MX_17X_27X, MX_1XX_2XX, pic32mx_devs_s::name, name, PIC32MX_BMXBOOTSZ, PIC32MX_BMXPFMSZ, pic32mx_devs, pic32mx_info(), PIC32MX_MANUF_ID, PIC32MX_PHYS_BOOT_FLASH, target_read_u32(), and virt2phys.
Referenced by pic32mx_auto_probe().
|
static |
Definition at line 350 of file pic32mx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 256 of file pic32mx.c.
References bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, MX_17X_27X, MX_1XX_2XX, PIC32MX_DEVCFG0, PIC32MX_DEVCFG0_1XX_2XX, pic32mx_info(), PIC32MX_PHYS_BOOT_FLASH, target::state, TARGET_HALTED, target_read_u32(), and virt2phys.
|
static |
Definition at line 219 of file pic32mx.c.
References alive_sleep(), bank, LOG_DEBUG, NVMCON_NVMWR, pic32mx_get_flash_status(), and status.
Referenced by pic32mx_nvm_exec().
|
static |
Definition at line 596 of file pic32mx.c.
References bank, buffer, count, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, LOG_WARNING, NVMCON_LVDERR, NVMCON_NVMERR, offset, pic32mx_write_block(), pic32mx_write_word(), status, TARGET_ADDR_FMT, and TARGET_HALTED.
|
static |
Definition at line 432 of file pic32mx.c.
References working_area::address, ARRAY_SIZE, bank, buf_get_u32(), buf_set_u32(), buffer, mips32_algorithm::common_magic, count, destroy_reg_param(), ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), mips32_algorithm::isa_mode, LOG_ERROR, LOG_WARNING, MIPS32_COMMON_MAGIC, MIPS32_ISA_MIPS32, MX_17X_27X, MX_1XX_2XX, NULL, NVMCON_LVDERR, NVMCON_NVMERR, offset, PARAM_IN_OUT, PARAM_OUT, pic32mx_flash_write_code, pic32mx_info(), source, status, target_alloc_working_area(), target_alloc_working_area_try(), target_buffer_set_u32_array(), target_free_working_area(), target_run_algorithm(), target_write_buffer(), and virt2phys.
Referenced by pic32mx_write().
|
static |
Definition at line 586 of file pic32mx.c.
References bank, NVMCON_OP_WORD_PROG, pic32mx_nvm_exec(), PIC32MX_NVMADDR, PIC32MX_NVMDATA, target_write_u32(), and virt2phys.
Referenced by COMMAND_HANDLER(), and pic32mx_write().
|
static |
|
static |
Referenced by pic32mx_info(), and pic32mx_probe().
|
static |
const struct flash_driver pic32mx_flash |
|
static |
Definition at line 365 of file pic32mx.c.
Referenced by pic32mx_write_block().