24 assert(ejtag_info->
tap);
60 assert(ejtag_info->
tap);
84 tap = ejtag_info->
tap;
89 uint8_t t[8] = { 0 }, r[8];
112 uint32_t data_out, uint8_t *data_in)
114 assert(ejtag_info->
tap);
120 uint8_t scan_out[4] = { 0 };
152 assert(ejtag_info->
tap);
173 assert(ejtag_info->
tap);
227 LOG_ERROR(
"Failed to remove DCR MPbit!");
248 LOG_DEBUG(
"ejtag_ctrl: 0x%8.8" PRIx32
"", ejtag_ctrl);
254 LOG_ERROR(
"Failed to enter Debug Mode!");
311 LOG_DEBUG(
"EJTAG v2.0: features:%s%s%s%s%s%s%s%s",
320 LOG_DEBUG(
"EJTAG v2.0: Break Channels: %" PRIu8,
334 LOG_DEBUG(
"EJTAG main: features:%s%s%s%s%s",
370 LOG_DEBUG(
"EJTAG: Version 1 or 2.0 Detected");
373 LOG_DEBUG(
"EJTAG: Version 2.5 Detected");
376 LOG_DEBUG(
"EJTAG: Version 2.6 Detected");
379 LOG_DEBUG(
"EJTAG: Version 3.1 Detected");
382 LOG_DEBUG(
"EJTAG: Version 4.1 Detected");
385 LOG_DEBUG(
"EJTAG: Version 5.1 Detected");
388 LOG_DEBUG(
"EJTAG: Unknown Version Detected");
394 LOG_DEBUG(
"EJTAG: DMA Access Mode detected. Disabling to "
395 "workaround current broken code.");
428 uint8_t t[4] = {0, 0, 0, 0};
435 fields[1].
in_value = (uint8_t *) data;
439 if (!write_t && data)
450 const uint32_t code_enable[] = {
467 const uint32_t code_disable[] = {
492 const uint32_t *code = enable_step ? code_enable : code_disable;
493 unsigned code_len = enable_step ?
ARRAY_SIZE(code_enable) :
502 const uint32_t code[] = {
521 tap = ejtag_info->
tap;
526 uint8_t t[8] = {0, 0, 0, 0, 0, 0, 0, 0};
541 fields[1].
in_value = (uint8_t *) data;
545 if (!write_t && data)
static void buf_set_u64(uint8_t *_buffer, unsigned first, unsigned num, uint64_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned first, unsigned num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
static uint64_t buf_get_u64(const uint8_t *_buffer, unsigned first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 64-bit word.
int jtag_execute_queue(void)
For software FIFO implementations, the queued commands can be executed during this call or earlier.
void jtag_add_sleep(uint32_t us)
void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap_state_t state)
Generate an IR SCAN with a list of scan fields with one entry for each enabled TAP.
void jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, tap_state_t state)
Generate a DR SCAN using the fields passed to the function.
void jtag_add_callback(jtag_callback1_t f, jtag_callback_data_t data0)
A simpler version of jtag_add_callback4().
intptr_t jtag_callback_data_t
Defines the type of data passed to the jtag_callback_t interface.
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
#define MIPS32_XORI(isa, tar, src, val)
#define MIPS32_MTC0(isa, gpr, cpr, sel)
#define MIPS32_LUI(isa, reg, val)
#define MIPS32_ORI(isa, tar, src, val)
#define MIPS32_MFC0(isa, gpr, cpr, sel)
#define MIPS32_B(isa, off)
int mips32_dmaacc_read_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, void *buf)
int mips32_dmaacc_write_mem(struct mips_ejtag *ejtag_info, uint32_t addr, int size, int count, const void *buf)
void pracc_queue_free(struct pracc_queue_info *ctx)
int mips32_pracc_queue_exec(struct mips_ejtag *ejtag_info, struct pracc_queue_info *ctx, uint32_t *buf, bool check_last)
void pracc_queue_init(struct pracc_queue_info *ctx)
void pracc_add(struct pracc_queue_info *ctx, uint32_t addr, uint32_t instr)
#define MIPS64_MFC0(gpr, cpr, sel)
#define MIPS64_SD(reg, off, base)
#define MIPS64_LUI(reg, val)
#define MIPS64_ORI(src, tar, val)
#define MIPS64_LD(reg, off, base)
#define MIPS64_AND(reg, off, val)
#define MIPS64_MTC0(gpr, cpr, sel)
int mips64_pracc_exec(struct mips_ejtag *ejtag_info, unsigned code_len, const uint32_t *code, unsigned num_param_in, uint64_t *param_in, unsigned num_param_out, uint64_t *param_out)
#define MIPS64_PRACC_STACK
int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint8_t *data)
int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write_t, uint32_t *data)
int mips_ejtag_drscan_64(struct mips_ejtag *ejtag_info, uint64_t *data)
int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info)
static int disable_dcr_mp(struct mips_ejtag *ejtag_info)
void mips_ejtag_drscan_32_out(struct mips_ejtag *ejtag_info, uint32_t data)
void mips_ejtag_set_instr(struct mips_ejtag *ejtag_info, uint32_t new_instr)
int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data)
int mips64_ejtag_config_step(struct mips_ejtag *ejtag_info, bool enable_step)
void mips_ejtag_drscan_8_out(struct mips_ejtag *ejtag_info, uint8_t data)
static void ejtag_main_print_imp(struct mips_ejtag *ejtag_info)
static int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info)
int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info)
int mips_ejtag_enter_debug(struct mips_ejtag *ejtag_info)
static void mips_ejtag_init_mmr(struct mips_ejtag *ejtag_info)
static void mips_ejtag_drscan_32_queued(struct mips_ejtag *ejtag_info, uint32_t data_out, uint8_t *data_in)
static void ejtag_v20_print_imp(struct mips_ejtag *ejtag_info)
int mips64_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, bool write_t, uint64_t *data)
int mips64_ejtag_exit_debug(struct mips_ejtag *ejtag_info)
void mips_ejtag_add_scan_96(struct mips_ejtag *ejtag_info, uint32_t ctrl, uint32_t data, uint8_t *in_scan_buf)
static void ejtag_v26_print_imp(struct mips_ejtag *ejtag_info)
int mips_ejtag_config_step(struct mips_ejtag *ejtag_info, int enable_step)
int mips_ejtag_init(struct mips_ejtag *ejtag_info)
#define EJTAG_V20_IMP_NODB
#define EJTAG_CTRL_PROBEN
#define EJTAG_V20_DBV_OFFS
#define EJTAG_INST_IDCODE
#define EJTAG_V20_DBM_OFFS
#define EJTAG_V20_IMP_BCHANNELS_SHIFT
#define EJTAG_V20_IMP_COMPLEX_BREAK
#define EJTAG_V25_DBAN_STEP
#define EJTAG_V20_IBM_OFFS
#define EJTAG_INST_CONTROL
#define EJTAG_V26_IMP_R3K
#define EJTAG_V20_IMP_NOIB
#define EJTAG_V20_DBC_OFFS
#define EJTAG_V25_DBASID_OFFS
#define EJTAG_V25_DBC_OFFS
#define EJTAG_V20_IBC_OFFS
#define EJTAG_V20_IBAN_STEP
#define EJTAG_V20_IMP_EADDR_NO32BIT
#define EJTAG_V25_IBASID_OFFS
#define EJTAG_V20_IMP_BCHANNELS_MASK
#define EJTAG_V20_IMP_SDBBP
static void mips_le_to_h_u64(jtag_callback_data_t arg)
static void mips_le_to_h_u32(jtag_callback_data_t arg)
#define EJTAG_V25_DBV_OFFS
#define EJTAG_CTRL_JTAGBRK
#define EJTAG_V25_IBM_OFFS
#define EJTAG_V25_IBAN_STEP
#define EJTAG_V26_IMP_DINT
#define EJTAG_V20_IMP_ICACHE_COH
#define EJTAG_V25_DBM_OFFS
#define EJTAG_V25_IBC_OFFS
#define EJTAG_V20_IMP_DCACHE_COH
#define EJTAG_V20_IMP_NOPB
#define EJTAG_CTRL_SETDEV
#define EJTAG_V20_DBAN_STEP
#define EJTAG_INST_IMPCODE
struct rtt_control ctrl
Control block.
uint8_t * cur_instr
current instruction
int ir_length
size of instruction register
uint32_t ejtag_ibasid_offs
uint32_t ejtag_dbasid_offs
unsigned int ejtag_version
uint32_t ejtag_iba_step_size
uint32_t ejtag_dba_step_size
struct pa_list * pracc_list
struct mips_ejtag * ejtag_info
This structure defines a single scan field in the scan.
int num_bits
The number of bits this field specifies.
uint8_t * in_value
A pointer to a 32-bit memory location for data scanned out.
const uint8_t * out_value
A pointer to value to be scanned into the device.
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.