OpenOCD
|
Go to the source code of this file.
Functions | |
static void | arc_jtag_enque_read_dr (struct arc_jtag *jtag_info, uint8_t *data, tap_state_t end_state) |
Read 4-byte word from data register. More... | |
static void | arc_jtag_enque_register_rw (struct arc_jtag *jtag_info, uint32_t *addr, uint8_t *read_buffer, const uint32_t *write_buffer, uint32_t count) |
static void | arc_jtag_enque_reset_transaction (struct arc_jtag *jtag_info) |
Run reset through transaction set. More... | |
static void | arc_jtag_enque_set_transaction (struct arc_jtag *jtag_info, uint32_t new_trans, tap_state_t end_state) |
Set transaction in command register. More... | |
static void | arc_jtag_enque_status_read (struct arc_jtag *const jtag_info, uint8_t *const buffer) |
static void | arc_jtag_enque_write_dr (struct arc_jtag *jtag_info, uint32_t data, tap_state_t end_state) |
Write 4-byte word to data register. More... | |
static void | arc_jtag_enque_write_ir (struct arc_jtag *jtag_info, uint32_t new_instr) |
int | arc_jtag_read_aux_reg (struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer) |
Read AUX registers. More... | |
int | arc_jtag_read_aux_reg_one (struct arc_jtag *jtag_info, uint32_t addr, uint32_t *value) |
Wrapper function to ease reading of one AUX register. More... | |
int | arc_jtag_read_core_reg (struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer) |
Read core registers. More... | |
int | arc_jtag_read_core_reg_one (struct arc_jtag *jtag_info, uint32_t addr, uint32_t *value) |
Wrapper function to ease reading of one core register. More... | |
int | arc_jtag_read_memory (struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, uint32_t *buffer, bool slow_memory) |
Read a sequence of 4-byte words from target memory. More... | |
static int | arc_jtag_read_registers (struct arc_jtag *jtag_info, uint32_t type, uint32_t *addr, uint32_t count, uint32_t *buffer) |
Read registers. More... | |
int | arc_jtag_startup (struct arc_jtag *jtag_info) |
int | arc_jtag_status (struct arc_jtag *const jtag_info, uint32_t *const value) |
Read STATUS register. More... | |
int | arc_jtag_write_aux_reg (struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer) |
Write AUX registers. More... | |
int | arc_jtag_write_aux_reg_one (struct arc_jtag *jtag_info, uint32_t addr, uint32_t value) |
Wrapper function to ease writing of one AUX register. More... | |
int | arc_jtag_write_core_reg (struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer) |
Write core registers. More... | |
int | arc_jtag_write_core_reg_one (struct arc_jtag *jtag_info, uint32_t addr, uint32_t value) |
Wrapper function to ease writing of one core register. More... | |
int | arc_jtag_write_memory (struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, const uint32_t *buffer) |
Write a sequence of 4-byte words into target memory. More... | |
static int | arc_jtag_write_registers (struct arc_jtag *jtag_info, uint32_t type, uint32_t *addr, uint32_t count, const uint32_t *buffer) |
Write registers. More... | |
|
static |
Read 4-byte word from data register.
Unlike arc_jtag_write_data, this function returns byte-buffer, caller must convert this data to required format himself. This is done, because it is impossible to convert data before jtag_execute_queue() is invoked, so it cannot be done inside this function, so it has to operate with byte-buffers. Write function on the other hand can "write-and-forget", data is converted to byte-buffer before jtag_execute_queue().
jtag_info | |
data | Array of bytes to read into. |
end_state | End state after reading. |
Definition at line 68 of file arc_jtag.c.
References jtag_add_dr_scan(), scan_field::num_bits, and arc_jtag::tap.
Referenced by arc_jtag_enque_register_rw(), arc_jtag_enque_status_read(), and arc_jtag_read_memory().
|
static |
Definition at line 200 of file arc_jtag.c.
References addr, ARC_JTAG_ADDRESS_REG, ARC_JTAG_DATA_REG, arc_jtag_enque_read_dr(), arc_jtag_enque_reset_transaction(), arc_jtag_enque_write_dr(), arc_jtag_enque_write_ir(), count, TAP_DRPAUSE, and TAP_IDLE.
Referenced by arc_jtag_read_registers(), and arc_jtag_write_registers().
|
static |
Run reset through transaction set.
None of the previous settings/commands/etc. are used anymore (or no influence).
Definition at line 149 of file arc_jtag.c.
References ARC_JTAG_CMD_NOP, arc_jtag_enque_set_transaction(), and TAP_IDLE.
Referenced by arc_jtag_enque_register_rw(), arc_jtag_read_memory(), arc_jtag_read_registers(), arc_jtag_startup(), arc_jtag_status(), arc_jtag_write_memory(), and arc_jtag_write_registers().
|
static |
Set transaction in command register.
This function sets instruction register and then transaction register, there is no need to invoke write_ir before invoking this function.
jtag_info | |
new_trans | Transaction to write to transaction command register. |
end_state | End state after writing. |
Definition at line 118 of file arc_jtag.c.
References arc_jtag_enque_write_ir(), ARC_TRANSACTION_CMD_REG, ARC_TRANSACTION_CMD_REG_LENGTH, buf_set_u32(), arc_jtag::cur_trans, jtag_add_dr_scan(), scan_field::num_bits, scan_field::out_value, and arc_jtag::tap.
Referenced by arc_jtag_enque_reset_transaction(), arc_jtag_read_memory(), arc_jtag_read_registers(), arc_jtag_write_memory(), and arc_jtag_write_registers().
|
static |
Definition at line 154 of file arc_jtag.c.
References arc_jtag_enque_read_dr(), arc_jtag_enque_write_ir(), ARC_JTAG_STATUS_REG, buffer, arc_jtag::tap, and TAP_IDLE.
Referenced by arc_jtag_status().
|
static |
Write 4-byte word to data register.
jtag_info | |
data | 4-byte word to write into data register. |
end_state | End state after writing. |
Definition at line 90 of file arc_jtag.c.
References buf_set_u32(), jtag_add_dr_scan(), scan_field::num_bits, scan_field::out_value, and arc_jtag::tap.
Referenced by arc_jtag_enque_register_rw(), arc_jtag_read_memory(), and arc_jtag_write_memory().
|
static |
Definition at line 24 of file arc_jtag.c.
References buf_get_u32(), buf_set_u32(), jtag_tap::cur_instr, jtag_tap::ir_length, jtag_add_ir_scan(), scan_field::num_bits, arc_jtag::tap, and TAP_IRPAUSE.
Referenced by arc_jtag_enque_register_rw(), arc_jtag_enque_set_transaction(), arc_jtag_enque_status_read(), arc_jtag_read_memory(), and arc_jtag_write_memory().
int arc_jtag_read_aux_reg | ( | struct arc_jtag * | jtag_info, |
uint32_t * | addr, | ||
uint32_t | count, | ||
uint32_t * | buffer | ||
) |
Read AUX registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
addr | Array of AUX register numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 414 of file arc_jtag.c.
References addr, ARC_JTAG_AUX_REG, arc_jtag_read_registers(), buffer, and count.
Referenced by arc_jtag_read_aux_reg_one(), and arc_save_context().
int arc_jtag_read_aux_reg_one | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t * | value | ||
) |
Wrapper function to ease reading of one AUX register.
Definition at line 398 of file arc_jtag.c.
References addr, and arc_jtag_read_aux_reg().
Referenced by arc_config_step(), arc_dcache_flush(), arc_dcache_invalidate(), arc_enable_interrupts(), arc_exit_debug(), arc_get_register(), arc_halt(), arc_l2cache_flush(), arc_l2cache_invalidate(), arc_resume(), COMMAND_HANDLER(), and zephyr_create().
int arc_jtag_read_core_reg | ( | struct arc_jtag * | jtag_info, |
uint32_t * | addr, | ||
uint32_t | count, | ||
uint32_t * | buffer | ||
) |
Read core registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
addr | Array of core register numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 366 of file arc_jtag.c.
References addr, ARC_JTAG_CORE_REG, arc_jtag_read_registers(), buffer, and count.
Referenced by arc_jtag_read_core_reg_one(), and arc_save_context().
int arc_jtag_read_core_reg_one | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t * | value | ||
) |
Wrapper function to ease reading of one core register.
Definition at line 350 of file arc_jtag.c.
References addr, and arc_jtag_read_core_reg().
Referenced by arc_get_register(), and COMMAND_HANDLER().
int arc_jtag_read_memory | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t | count, | ||
uint32_t * | buffer, | ||
bool | slow_memory | ||
) |
Read a sequence of 4-byte words from target memory.
We can read only 4byte words via JTAG.
This function read directly from the memory, so it can read invalid data if data cache hasn't been flushed before hand. It is responsibility of upper level to resolve this.
jtag_info | |
addr | Address of first word to read from. |
count | Amount of words to read. |
buffer | Array of words to read into. |
slow_memory | Whether this is a slow memory (DDR) or fast (CCM). |
Definition at line 484 of file arc_jtag.c.
References addr, ARC_JTAG_ADDRESS_REG, ARC_JTAG_DATA_REG, arc_jtag_enque_read_dr(), arc_jtag_enque_reset_transaction(), arc_jtag_enque_set_transaction(), arc_jtag_enque_write_dr(), arc_jtag_enque_write_ir(), ARC_JTAG_READ_FROM_MEMORY, buf_get_u32(), buffer, count, ERROR_FAIL, ERROR_OK, jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, arc_jtag::tap, TAP_DRPAUSE, and TAP_IDLE.
Referenced by arc_mem_read_block(), arc_mem_write_block16(), and arc_mem_write_block8().
|
static |
Read registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
type | Type of registers to read: core or aux. |
addr | Array of registers numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 277 of file arc_jtag.c.
References addr, ARC_JTAG_CORE_REG, arc_jtag_enque_register_rw(), arc_jtag_enque_reset_transaction(), arc_jtag_enque_set_transaction(), ARC_JTAG_READ_FROM_AUX_REG, ARC_JTAG_READ_FROM_CORE_REG, buf_get_u32(), buffer, count, ERROR_FAIL, ERROR_OK, jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, NULL, arc_jtag::tap, TAP_DRPAUSE, and type.
Referenced by arc_jtag_read_aux_reg(), and arc_jtag_read_core_reg().
int arc_jtag_startup | ( | struct arc_jtag * | jtag_info | ) |
Definition at line 169 of file arc_jtag.c.
References arc_jtag_enque_reset_transaction(), and jtag_execute_queue().
Referenced by arc_examine().
int arc_jtag_status | ( | struct arc_jtag *const | jtag_info, |
uint32_t *const | value | ||
) |
Read STATUS register.
Definition at line 179 of file arc_jtag.c.
References arc_jtag_enque_reset_transaction(), arc_jtag_enque_status_read(), buf_get_u32(), buffer, CHECK_RETVAL, ERROR_OK, jtag_execute_queue(), and arc_jtag::tap.
Referenced by arc_examine(), and arc_poll().
int arc_jtag_write_aux_reg | ( | struct arc_jtag * | jtag_info, |
uint32_t * | addr, | ||
uint32_t | count, | ||
const uint32_t * | buffer | ||
) |
Write AUX registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
addr | Array of registers numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 390 of file arc_jtag.c.
References addr, ARC_JTAG_AUX_REG, arc_jtag_write_registers(), buffer, and count.
Referenced by arc_jtag_write_aux_reg_one(), and arc_restore_context().
int arc_jtag_write_aux_reg_one | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t | value | ||
) |
Wrapper function to ease writing of one AUX register.
Definition at line 374 of file arc_jtag.c.
References addr, and arc_jtag_write_aux_reg().
Referenced by arc_config_step(), arc_dcache_flush(), arc_dcache_invalidate(), arc_enable_interrupts(), arc_exit_debug(), arc_halt(), arc_icache_invalidate(), arc_l2cache_flush(), arc_l2cache_invalidate(), arc_resume(), and COMMAND_HANDLER().
int arc_jtag_write_core_reg | ( | struct arc_jtag * | jtag_info, |
uint32_t * | addr, | ||
uint32_t | count, | ||
const uint32_t * | buffer | ||
) |
Write core registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
addr | Array of registers numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 342 of file arc_jtag.c.
References addr, ARC_JTAG_CORE_REG, arc_jtag_write_registers(), buffer, and count.
Referenced by arc_jtag_write_core_reg_one(), and arc_restore_context().
int arc_jtag_write_core_reg_one | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t | value | ||
) |
Wrapper function to ease writing of one core register.
Definition at line 326 of file arc_jtag.c.
References addr, and arc_jtag_write_core_reg().
int arc_jtag_write_memory | ( | struct arc_jtag * | jtag_info, |
uint32_t | addr, | ||
uint32_t | count, | ||
const uint32_t * | buffer | ||
) |
Write a sequence of 4-byte words into target memory.
We can write only 4byte words via JTAG, so any non-word writes should be handled at higher levels by read-modify-write.
This function writes directly to the memory, leaving any caches (if there are any) in inconsistent state. It is responsibility of upper level to resolve this.
jtag_info | |
addr | Address of first word to write into. |
count | Amount of word to write. |
buffer | Array to write into memory. |
Definition at line 436 of file arc_jtag.c.
References addr, ARC_JTAG_ADDRESS_REG, ARC_JTAG_DATA_REG, arc_jtag_enque_reset_transaction(), arc_jtag_enque_set_transaction(), arc_jtag_enque_write_dr(), arc_jtag_enque_write_ir(), ARC_JTAG_WRITE_TO_MEMORY, buffer, count, ERROR_OK, jtag_execute_queue(), LOG_DEBUG, TAP_DRPAUSE, and TAP_IDLE.
Referenced by arc_mem_write_block16(), arc_mem_write_block32(), and arc_mem_write_block8().
|
static |
Write registers.
addr is an array of addresses, and those addresses can be in any order, though it is recommended that they are in sequential order where possible, as this reduces number of JTAG commands to transfer.
jtag_info | |
type | Type of registers to write: core or aux. |
addr | Array of registers numbers. |
count | Amount of registers in arrays. |
buffer | Array of register values. |
Definition at line 242 of file arc_jtag.c.
References addr, ARC_JTAG_CORE_REG, arc_jtag_enque_register_rw(), arc_jtag_enque_reset_transaction(), arc_jtag_enque_set_transaction(), ARC_JTAG_WRITE_TO_AUX_REG, ARC_JTAG_WRITE_TO_CORE_REG, buffer, count, ERROR_FAIL, jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, NULL, TAP_DRPAUSE, and type.
Referenced by arc_jtag_write_aux_reg(), and arc_jtag_write_core_reg().