OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | arc_jtag |
Macros | |
#define | ARC_JTAG_ADDRESS_REG 0xA /* SoC address to access */ |
#define | ARC_JTAG_AUX_REG 0x1 |
#define | ARC_JTAG_CMD_NOP 0x3 |
#define | ARC_JTAG_CORE_REG 0x0 |
#define | ARC_JTAG_DATA_REG 0xB /* Data read/written from SoC */ |
#define | ARC_JTAG_READ_FROM_AUX_REG 0x6 |
#define | ARC_JTAG_READ_FROM_CORE_REG 0x5 |
#define | ARC_JTAG_READ_FROM_MEMORY 0x4 |
#define | ARC_JTAG_STAT_RU 0x10 |
#define | ARC_JTAG_STATUS_REG 0x8 |
#define | ARC_JTAG_WRITE_TO_AUX_REG 0x2 |
#define | ARC_JTAG_WRITE_TO_CORE_REG 0x1 |
#define | ARC_JTAG_WRITE_TO_MEMORY 0x0 |
#define | ARC_TRANSACTION_CMD_REG 0x9 /* Command to perform */ |
#define | ARC_TRANSACTION_CMD_REG_LENGTH 4 |
Functions | |
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 *buffer) |
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... | |
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, const uint32_t buffer) |
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... | |
#define ARC_JTAG_ADDRESS_REG 0xA /* SoC address to access */ |
Definition at line 19 of file arc_jtag.h.
#define ARC_JTAG_AUX_REG 0x1 |
Definition at line 35 of file arc_jtag.h.
#define ARC_JTAG_CMD_NOP 0x3 |
Definition at line 29 of file arc_jtag.h.
#define ARC_JTAG_CORE_REG 0x0 |
Definition at line 34 of file arc_jtag.h.
#define ARC_JTAG_DATA_REG 0xB /* Data read/written from SoC */ |
Definition at line 20 of file arc_jtag.h.
#define ARC_JTAG_READ_FROM_AUX_REG 0x6 |
Definition at line 32 of file arc_jtag.h.
#define ARC_JTAG_READ_FROM_CORE_REG 0x5 |
Definition at line 31 of file arc_jtag.h.
#define ARC_JTAG_READ_FROM_MEMORY 0x4 |
Definition at line 30 of file arc_jtag.h.
#define ARC_JTAG_STAT_RU 0x10 |
Definition at line 23 of file arc_jtag.h.
#define ARC_JTAG_STATUS_REG 0x8 |
Definition at line 18 of file arc_jtag.h.
#define ARC_JTAG_WRITE_TO_AUX_REG 0x2 |
Definition at line 28 of file arc_jtag.h.
#define ARC_JTAG_WRITE_TO_CORE_REG 0x1 |
Definition at line 27 of file arc_jtag.h.
#define ARC_JTAG_WRITE_TO_MEMORY 0x0 |
Definition at line 26 of file arc_jtag.h.
#define ARC_TRANSACTION_CMD_REG 0x9 /* Command to perform */ |
Definition at line 14 of file arc_jtag.h.
#define ARC_TRANSACTION_CMD_REG_LENGTH 4 |
Definition at line 15 of file arc_jtag.h.
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_get_register(), arc_halt(), arc_l2cache_flush(), arc_l2cache_invalidate(), arc_resume(), jim_arc_get_aux_reg(), 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 * | buffer | ||
) |
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 jim_arc_get_core_reg().
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().
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_halt(), arc_icache_invalidate(), arc_l2cache_flush(), arc_l2cache_invalidate(), arc_resume(), and jim_arc_set_aux_reg().
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, | ||
const uint32_t | buffer | ||
) |
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().