OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | pa_list |
struct | pracc_queue_info |
Macros | |
#define | LOWER16(addr) ((addr) & 0xFFFF) |
#define | MIPS32_FASTDATA_HANDLER_SIZE 0x80 |
#define | MIPS32_PRACC_BASE_ADDR 0xFF200000 |
#define | MIPS32_PRACC_FASTDATA_AREA 0xFF200000 |
#define | MIPS32_PRACC_FASTDATA_SIZE 16 |
#define | MIPS32_PRACC_PARAM_OUT 0xFF202000 |
#define | MIPS32_PRACC_TEXT 0xFF200200 |
#define | NEG16(v) (((~(v)) + 1) & 0xFFFF) |
#define | PRACC_BLOCK 128 /* 1 Kbyte */ |
#define | PRACC_MAX_CODE (MIPS32_PRACC_PARAM_OUT - MIPS32_PRACC_TEXT) |
#define | PRACC_MAX_INSTRUCTIONS (PRACC_MAX_CODE / 4) |
#define | PRACC_OUT_OFFSET (MIPS32_PRACC_PARAM_OUT - MIPS32_PRACC_BASE_ADDR) |
#define | PRACC_UPPER_BASE_ADDR (MIPS32_PRACC_BASE_ADDR >> 16) |
#define | SWAP16(v) ((LOWER16(v) << 16) | (UPPER16(v))) |
#define | UPPER16(addr) ((addr) >> 16) |
Functions | |
int | mips32_cp0_read (struct mips_ejtag *ejtag_info, uint32_t *val, uint32_t cp0_reg, uint32_t cp0_sel) |
mips32_cp0_read More... | |
int | mips32_cp0_write (struct mips_ejtag *ejtag_info, uint32_t val, uint32_t cp0_reg, uint32_t cp0_sel) |
mips32_cp0_write More... | |
int | mips32_pracc_fastdata_xfer (struct mips_ejtag *ejtag_info, struct working_area *source, int write_t, uint32_t addr, int count, uint32_t *buf) |
int | mips32_pracc_queue_exec (struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx, uint32_t *buf, bool check_last) |
int | mips32_pracc_read_mem (struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf) |
int | mips32_pracc_read_regs (struct mips_ejtag *ejtag_info, uint32_t *regs) |
int | mips32_pracc_write_mem (struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, const void *buf) |
int | mips32_pracc_write_regs (struct mips_ejtag *ejtag_info, uint32_t *regs) |
void | pracc_add (struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr) |
void | pracc_queue_free (struct pracc_queue_info *ctx) |
void | pracc_queue_init (struct pracc_queue_info *ctx) |
static void | pracc_swap16_array (struct mips_ejtag *ejtag_info, uint32_t *buf, int count) |
Definition at line 32 of file mips32_pracc.h.
#define MIPS32_FASTDATA_HANDLER_SIZE 0x80 |
Definition at line 30 of file mips32_pracc.h.
#define MIPS32_PRACC_BASE_ADDR 0xFF200000 |
Definition at line 21 of file mips32_pracc.h.
#define MIPS32_PRACC_FASTDATA_AREA 0xFF200000 |
Definition at line 19 of file mips32_pracc.h.
#define MIPS32_PRACC_FASTDATA_SIZE 16 |
Definition at line 20 of file mips32_pracc.h.
#define MIPS32_PRACC_PARAM_OUT 0xFF202000 |
Definition at line 23 of file mips32_pracc.h.
#define MIPS32_PRACC_TEXT 0xFF200200 |
Definition at line 22 of file mips32_pracc.h.
#define NEG16 | ( | v | ) | (((~(v)) + 1) & 0xFFFF) |
Definition at line 33 of file mips32_pracc.h.
#define PRACC_BLOCK 128 /* 1 Kbyte */ |
Definition at line 37 of file mips32_pracc.h.
#define PRACC_MAX_CODE (MIPS32_PRACC_PARAM_OUT - MIPS32_PRACC_TEXT) |
Definition at line 26 of file mips32_pracc.h.
#define PRACC_MAX_INSTRUCTIONS (PRACC_MAX_CODE / 4) |
Definition at line 27 of file mips32_pracc.h.
#define PRACC_OUT_OFFSET (MIPS32_PRACC_PARAM_OUT - MIPS32_PRACC_BASE_ADDR) |
Definition at line 28 of file mips32_pracc.h.
#define PRACC_UPPER_BASE_ADDR (MIPS32_PRACC_BASE_ADDR >> 16) |
Definition at line 25 of file mips32_pracc.h.
Definition at line 34 of file mips32_pracc.h.
Definition at line 31 of file mips32_pracc.h.
int mips32_cp0_read | ( | struct mips_ejtag * | ejtag_info, |
uint32_t * | val, | ||
uint32_t | cp0_reg, | ||
uint32_t | cp0_sel | ||
) |
mips32_cp0_read
Simulates mfc0 ASM instruction (Move From C0), i.e. implements copro C0 Register read.
[in] | ejtag_info | |
[in] | val | Storage to hold read value |
[in] | cp0_reg | Number of copro C0 register we want to read |
[in] | cp0_sel | Select for the given C0 register |
Definition at line 547 of file mips32_pracc.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, pracc_queue_info::isa, LOWER16, MIPS32_B, MIPS32_LUI, MIPS32_MFC0, MIPS32_ORI, MIPS32_PRACC_PARAM_OUT, mips32_pracc_queue_exec(), MIPS32_SW, NEG16, pracc_add(), PRACC_OUT_OFFSET, pracc_queue_free(), pracc_queue_init(), PRACC_UPPER_BASE_ADDR, mips_ejtag::reg8, pracc_queue_info::retval, and UPPER16.
Referenced by COMMAND_HANDLER(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem(), and mips32_read_config_regs().
int mips32_cp0_write | ( | struct mips_ejtag * | ejtag_info, |
uint32_t | val, | ||
uint32_t | cp0_reg, | ||
uint32_t | cp0_sel | ||
) |
mips32_cp0_write
Simulates mtc0 ASM instruction (Move To C0), i.e. implements copro C0 Register read.
[in] | ejtag_info | |
[in] | val | Value to be written |
[in] | cp0_reg | Number of copro C0 register we want to write to |
[in] | cp0_sel | Select for the given C0 register |
Definition at line 566 of file mips32_pracc.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, pracc_queue_info::isa, MIPS32_B, MIPS32_MFC0, MIPS32_MTC0, mips32_pracc_queue_exec(), NEG16, NULL, pracc_add(), pracc_add_li32(), pracc_queue_free(), pracc_queue_init(), and pracc_queue_info::retval.
Referenced by COMMAND_HANDLER().
int mips32_pracc_fastdata_xfer | ( | struct mips_ejtag * | ejtag_info, |
struct working_area * | source, | ||
int | write_t, | ||
uint32_t | addr, | ||
int | count, | ||
uint32_t * | buf | ||
) |
Definition at line 910 of file mips32_pracc.c.
References adapter_get_speed_khz(), addr, ARRAY_SIZE, count, pracc_queue_info::ejtag_info, EJTAG_INST_DATA, EJTAG_INST_FASTDATA, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, mips_ejtag::fast_access_save, pracc_queue_info::isa, mips_ejtag::isa, jtag_add_clocks(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, LOWER16, MIPS32_ADDI, MIPS32_BNE, MIPS32_FASTDATA_HANDLER_SIZE, MIPS32_JR, MIPS32_LUI, MIPS32_LW, MIPS32_MFC0, MIPS32_NOP, MIPS32_ORI, MIPS32_PRACC_FASTDATA_AREA, mips32_pracc_finish(), mips32_pracc_read_ctrl_addr(), MIPS32_PRACC_TEXT, mips32_pracc_write_mem(), MIPS32_SW, MIPS32_XORI, mips_ejtag_drscan_32_out(), mips_ejtag_fastdata_scan(), mips_ejtag_set_instr(), mips_ejtag::mode, NEG16, mips_ejtag::pa_addr, pracc_swap16_array(), pracc_queue_info::retval, mips_ejtag::scan_delay, source, TARGET_PRIxADDR, UPPER16, and wait_for_pracc_rw().
Referenced by mips_m4k_bulk_write_memory().
int mips32_pracc_queue_exec | ( | struct mips_ejtag * | ejtag_info, |
struct pracc_queue_info * | ctx, | ||
uint32_t * | buf, | ||
bool | check_last | ||
) |
Definition at line 343 of file mips32_pracc.c.
References adapter_get_speed_khz(), addr, pa_list::addr, buf_get_u32(), pracc_queue_info::code_count, ctrl, mips_ejtag::ejtag_ctrl, EJTAG_CTRL_PRACC, EJTAG_CTRL_PRNW, EJTAG_INST_ALL, mips_ejtag::endianness, ERROR_FAIL, ERROR_OK, pa_list::instr, mips_ejtag::isa, jtag_add_clocks(), jtag_execute_queue(), LOG_ERROR, mips32_pracc_exec(), MIPS32_PRACC_PARAM_OUT, MIPS32_PRACC_TEXT, mips_ejtag_add_scan_96(), mips_ejtag_set_instr(), mips_ejtag::mode, pracc_queue_info::pracc_list, pracc_queue_info::retval, mips_ejtag::scan_delay, pracc_queue_info::store_count, and SWAP16.
Referenced by ath79_spi_bitbang_chunk(), mips32_cp0_read(), mips32_cp0_write(), mips32_pracc_read_mem(), mips32_pracc_read_regs(), mips32_pracc_read_u32(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem_generic(), mips32_pracc_write_regs(), mips_ejtag_config_step(), and mips_ejtag_exit_debug().
int mips32_pracc_read_mem | ( | struct mips_ejtag * | ejtag_info, |
uint32_t | addr, | ||
int | size, | ||
int | count, | ||
void * | buf | ||
) |
Definition at line 466 of file mips32_pracc.c.
References addr, pracc_queue_info::code_count, count, pracc_queue_info::ejtag_info, ERROR_OK, pracc_queue_info::isa, LOG_ERROR, LOWER16, MIPS32_B, MIPS32_LBU, MIPS32_LHU, MIPS32_LUI, MIPS32_LW, MIPS32_MFC0, MIPS32_PRACC_PARAM_OUT, mips32_pracc_queue_exec(), mips32_pracc_read_u32(), MIPS32_SW, NEG16, NULL, pracc_add(), pracc_add_li32(), PRACC_OUT_OFFSET, pracc_queue_free(), pracc_queue_init(), PRACC_UPPER_BASE_ADDR, mips_ejtag::reg8, mips_ejtag::reg9, pracc_queue_info::retval, size, pracc_queue_info::store_count, and UPPER16.
Referenced by mips_m4k_read_memory().
int mips32_pracc_read_regs | ( | struct mips_ejtag * | ejtag_info, |
uint32_t * | regs | ||
) |
Definition at line 861 of file mips32_pracc.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, pracc_queue_info::isa, MIPS32_B, MIPS32_LUI, MIPS32_MFC0, MIPS32_MFHI, MIPS32_MFLO, MIPS32_MTC0, MIPS32_PRACC_PARAM_OUT, mips32_pracc_queue_exec(), MIPS32_SW, NEG16, pracc_add(), PRACC_OUT_OFFSET, pracc_queue_free(), pracc_queue_init(), PRACC_UPPER_BASE_ADDR, mips_ejtag::reg8, mips_ejtag::reg9, regs, and pracc_queue_info::retval.
Referenced by mips32_save_context().
int mips32_pracc_write_mem | ( | struct mips_ejtag * | ejtag_info, |
uint32_t | addr, | ||
int | size, | ||
int | count, | ||
const void * | buf | ||
) |
If we are in the cacheable region and cache is activated, we must clean D$ (if Cache Coherency Attribute is set to 3) + invalidate I$ after we did the write, so that changes do not continue to live only in D$ (if CCA = 3), but to be replicated in I$ also (maybe we wrote the instructions)
Check cacheability bits coherency algorithm is the region cacheable or uncached. If cacheable we have to synchronize the cache
Definition at line 771 of file mips32_pracc.c.
References addr, count, pracc_queue_info::ejtag_info, ERROR_FAIL, ERROR_OK, KSEG0, KSEG1, KSEG2, KSEG3, KSEGX, KUSEG, LOG_DEBUG, MIPS32_CONFIG0_AR_MASK, MIPS32_CONFIG0_AR_SHIFT, MIPS32_CONFIG0_K0_MASK, MIPS32_CONFIG0_K0_SHIFT, MIPS32_CONFIG0_K23_MASK, MIPS32_CONFIG0_K23_SHIFT, MIPS32_CONFIG0_KU_MASK, MIPS32_CONFIG0_KU_SHIFT, mips32_cp0_read(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem_generic(), pracc_queue_info::retval, and size.
Referenced by mips32_pracc_fastdata_xfer(), and mips_m4k_write_memory().
int mips32_pracc_write_regs | ( | struct mips_ejtag * | ejtag_info, |
uint32_t * | regs | ||
) |
Definition at line 826 of file mips32_pracc.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, pracc_queue_info::isa, LOWER16, MIPS32_B, MIPS32_LUI, MIPS32_MTC0, MIPS32_MTHI, MIPS32_MTLO, MIPS32_ORI, mips32_pracc_queue_exec(), NEG16, NULL, pracc_add(), pracc_add_li32(), pracc_queue_free(), pracc_queue_init(), mips_ejtag::reg8, mips_ejtag::reg9, regs, pracc_queue_info::retval, and UPPER16.
Referenced by mips32_restore_context().
void pracc_add | ( | struct pracc_queue_info * | ctx, |
uint32_t | addr, | ||
uint32_t | instr | ||
) |
Definition at line 306 of file mips32_pracc.c.
References addr, pa_list::addr, pracc_queue_info::code_count, ERROR_FAIL, ERROR_OK, pa_list::instr, pracc_queue_info::max_code, PRACC_BLOCK, pracc_queue_info::pracc_list, pracc_queue_info::retval, and pracc_queue_info::store_count.
Referenced by ath79_pracc_addn(), ath79_spi_bitbang_codegen(), mips32_cp0_read(), mips32_cp0_write(), mips32_pracc_read_mem(), mips32_pracc_read_regs(), mips32_pracc_read_u32(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem_generic(), mips32_pracc_write_regs(), mips_ejtag_config_step(), and pracc_add_li32().
|
inline |
Definition at line 338 of file mips32_pracc.c.
References pracc_queue_info::pracc_list.
Referenced by ath79_spi_bitbang_chunk(), mips32_cp0_read(), mips32_cp0_write(), mips32_pracc_read_mem(), mips32_pracc_read_regs(), mips32_pracc_read_u32(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem_generic(), mips32_pracc_write_regs(), and mips_ejtag_config_step().
|
inline |
Definition at line 296 of file mips32_pracc.c.
References pracc_queue_info::code_count, pracc_queue_info::ejtag_info, ERROR_OK, pracc_queue_info::isa, mips_ejtag::isa, pracc_queue_info::max_code, NULL, pracc_queue_info::pracc_list, pracc_queue_info::retval, and pracc_queue_info::store_count.
Referenced by ath79_spi_bitbang_chunk(), mips32_cp0_read(), mips32_cp0_write(), mips32_pracc_read_mem(), mips32_pracc_read_regs(), mips32_pracc_read_u32(), mips32_pracc_synchronize_cache(), mips32_pracc_write_mem_generic(), mips32_pracc_write_regs(), and mips_ejtag_config_step().
|
inlinestatic |
Definition at line 102 of file mips32_pracc.h.
References count, mips_ejtag::endianness, mips_ejtag::isa, and SWAP16.
Referenced by mips32_blank_check_memory(), mips32_checksum_memory(), mips32_pracc_clean_text_jump(), and mips32_pracc_fastdata_xfer().