OpenOCD
|
Go to the source code of this file.
Functions | |
static int | adbg_burst_command (struct or1k_jtag *jtag_info, uint32_t opcode, uint32_t address, uint16_t length_words) |
static uint32_t | adbg_compute_crc (uint32_t crc, uint32_t data_in, int length_bits) |
static int | adbg_ctrl_read (struct or1k_jtag *jtag_info, uint32_t regidx, uint32_t *data, int length_bits) |
static int | adbg_ctrl_write (struct or1k_jtag *jtag_info, uint8_t regidx, uint32_t *cmd_data, int length_bits) |
static int | adbg_select_ctrl_reg (struct or1k_jtag *jtag_info, uint8_t regidx) |
static int | adbg_select_module (struct or1k_jtag *jtag_info, int chain) |
static int | adbg_wb_burst_read (struct or1k_jtag *jtag_info, int size, int count, uint32_t start_address, uint8_t *data) |
static int | adbg_wb_burst_write (struct or1k_jtag *jtag_info, const uint8_t *data, int size, int count, unsigned long start_address) |
static int | find_status_bit (void *_buf, int len) |
static int | or1k_adv_cpu_reset (struct or1k_jtag *jtag_info, int action) |
static int | or1k_adv_cpu_stall (struct or1k_jtag *jtag_info, int action) |
static int | or1k_adv_is_cpu_running (struct or1k_jtag *jtag_info, int *running) |
static int | or1k_adv_jtag_init (struct or1k_jtag *jtag_info) |
int | or1k_adv_jtag_jsp_xfer (struct or1k_jtag *jtag_info, int *out_len, unsigned char *out_buffer, int *in_len, unsigned char *in_buffer) |
static int | or1k_adv_jtag_read_cpu (struct or1k_jtag *jtag_info, uint32_t addr, int count, uint32_t *value) |
static int | or1k_adv_jtag_read_memory (struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, uint8_t *buffer) |
static int | or1k_adv_jtag_write_cpu (struct or1k_jtag *jtag_info, uint32_t addr, int count, const uint32_t *value) |
static int | or1k_adv_jtag_write_memory (struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size, int count, const uint8_t *buffer) |
int | or1k_du_adv_register (void) |
Variables | |
static const char *const | chain_name [] = {"WISHBONE", "CPU0", "CPU1", "JSP"} |
static struct or1k_du | or1k_du_adv |
#define ADBG_CRC_POLY 0xedb88320 |
Definition at line 75 of file or1k_du_adv.c.
#define ADBG_USE_HISPEED 1 |
Definition at line 41 of file or1k_du_adv.c.
#define BURST_READ_READY 1 |
Definition at line 124 of file or1k_du_adv.c.
#define CRC_LEN 4 |
Definition at line 130 of file or1k_du_adv.c.
#define DBG_CPU0_CMD_BREAD32 0x7 |
Definition at line 104 of file or1k_du_adv.c.
#define DBG_CPU0_CMD_BWRITE32 0x3 |
Definition at line 103 of file or1k_du_adv.c.
#define DBG_CPU0_CMD_IREG_SEL 0xd |
Definition at line 106 of file or1k_du_adv.c.
#define DBG_CPU0_CMD_IREG_WR 0x9 |
Definition at line 105 of file or1k_du_adv.c.
#define DBG_CPU0_CMD_NOP 0x0 |
Definition at line 102 of file or1k_du_adv.c.
#define DBG_CPU0_OPCODE_LEN 4 |
Definition at line 101 of file or1k_du_adv.c.
#define DBG_CPU0_REG_SEL_LEN 1 |
Definition at line 97 of file or1k_du_adv.c.
#define DBG_CPU0_REG_STATUS 0 |
Definition at line 98 of file or1k_du_adv.c.
#define DBG_CPU1_CMD_BREAD32 0x7 |
Definition at line 116 of file or1k_du_adv.c.
#define DBG_CPU1_CMD_BWRITE32 0x3 |
Definition at line 115 of file or1k_du_adv.c.
#define DBG_CPU1_CMD_IREG_SEL 0xd |
Definition at line 118 of file or1k_du_adv.c.
#define DBG_CPU1_CMD_IREG_WR 0x9 |
Definition at line 117 of file or1k_du_adv.c.
#define DBG_CPU1_CMD_NOP 0x0 |
Definition at line 114 of file or1k_du_adv.c.
#define DBG_CPU1_OPCODE_LEN 4 |
Definition at line 113 of file or1k_du_adv.c.
#define DBG_CPU1_REG_SEL_LEN 1 |
Definition at line 109 of file or1k_du_adv.c.
#define DBG_CPU1_REG_STATUS 0 |
Definition at line 110 of file or1k_du_adv.c.
#define DBG_CPU_CR_RESET 0x02 |
Definition at line 68 of file or1k_du_adv.c.
#define DBG_CPU_CR_STALL 0x01 |
Definition at line 67 of file or1k_du_adv.c.
#define DBG_MAX_MODULES 4 |
Definition at line 58 of file or1k_du_adv.c.
#define DBG_MODULE_SELECT_REG_SIZE 2 |
Definition at line 57 of file or1k_du_adv.c.
#define DBG_WB_CMD_BREAD16 0x6 |
Definition at line 91 of file or1k_du_adv.c.
#define DBG_WB_CMD_BREAD32 0x7 |
Definition at line 92 of file or1k_du_adv.c.
#define DBG_WB_CMD_BREAD8 0x5 |
Definition at line 90 of file or1k_du_adv.c.
#define DBG_WB_CMD_BWRITE16 0x2 |
Definition at line 88 of file or1k_du_adv.c.
#define DBG_WB_CMD_BWRITE32 0x3 |
Definition at line 89 of file or1k_du_adv.c.
#define DBG_WB_CMD_BWRITE8 0x1 |
Definition at line 87 of file or1k_du_adv.c.
#define DBG_WB_CMD_IREG_SEL 0xd |
Definition at line 94 of file or1k_du_adv.c.
#define DBG_WB_CMD_IREG_WR 0x9 |
Definition at line 93 of file or1k_du_adv.c.
#define DBG_WB_CMD_NOP 0x0 |
Definition at line 86 of file or1k_du_adv.c.
#define DBG_WB_OPCODE_LEN 4 |
Definition at line 85 of file or1k_du_adv.c.
#define DBG_WB_REG_ERROR 0 |
Definition at line 82 of file or1k_du_adv.c.
#define DBG_WB_REG_SEL_LEN 1 |
Definition at line 81 of file or1k_du_adv.c.
#define DC_CPU0 1 |
Definition at line 62 of file or1k_du_adv.c.
#define DC_CPU1 2 |
Definition at line 63 of file or1k_du_adv.c.
#define DC_JSP 3 |
Definition at line 64 of file or1k_du_adv.c.
#define DC_NONE -1 |
Definition at line 60 of file or1k_du_adv.c.
#define DC_WISHBONE 0 |
Definition at line 61 of file or1k_du_adv.c.
#define ENABLE_JSP_MULTI 4 |
Definition at line 52 of file or1k_du_adv.c.
#define ENABLE_JSP_SERVER 2 |
Definition at line 47 of file or1k_du_adv.c.
#define JSP_BANNER |
Definition at line 28 of file or1k_du_adv.c.
#define MAX_BURST_SIZE (4 * 1024) |
Definition at line 127 of file or1k_du_adv.c.
#define MAX_BUS_ERRORS 2 |
Definition at line 125 of file or1k_du_adv.c.
#define MAX_READ_BUSY_RETRY 2 |
Definition at line 121 of file or1k_du_adv.c.
#define MAX_READ_CRC_RETRY 2 |
Definition at line 122 of file or1k_du_adv.c.
#define MAX_READ_STATUS_WAIT 10 |
Definition at line 120 of file or1k_du_adv.c.
#define MAX_WRITE_CRC_RETRY 2 |
Definition at line 123 of file or1k_du_adv.c.
#define NO_OPTION 0 |
Definition at line 34 of file or1k_du_adv.c.
#define STATUS_BYTES 1 |
Definition at line 129 of file or1k_du_adv.c.
|
static |
Definition at line 412 of file or1k_du_adv.c.
References scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), NULL, scan_field::num_bits, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by adbg_wb_burst_read(), and adbg_wb_burst_write().
|
static |
Definition at line 136 of file or1k_du_adv.c.
References ADBG_CRC_POLY.
Referenced by adbg_wb_burst_read(), and adbg_wb_burst_write().
|
static |
Definition at line 355 of file or1k_du_adv.c.
References adbg_select_ctrl_reg(), DBG_CPU0_CMD_NOP, DBG_CPU0_OPCODE_LEN, DBG_CPU1_CMD_NOP, DBG_CPU1_OPCODE_LEN, DBG_WB_CMD_NOP, DBG_WB_OPCODE_LEN, DC_CPU0, DC_CPU1, DC_WISHBONE, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_ERROR, NULL, scan_field::num_bits, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by adbg_wb_burst_read(), adbg_wb_burst_write(), or1k_adv_cpu_reset(), or1k_adv_cpu_stall(), and or1k_adv_is_cpu_running().
|
static |
Definition at line 298 of file or1k_du_adv.c.
References adbg_select_ctrl_reg(), DBG_CPU0_CMD_IREG_WR, DBG_CPU0_OPCODE_LEN, DBG_CPU0_REG_SEL_LEN, DBG_CPU1_CMD_IREG_WR, DBG_CPU1_OPCODE_LEN, DBG_CPU1_REG_SEL_LEN, DBG_WB_CMD_IREG_WR, DBG_WB_OPCODE_LEN, DBG_WB_REG_SEL_LEN, DC_CPU0, DC_CPU1, DC_WISHBONE, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, NULL, scan_field::num_bits, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by adbg_wb_burst_read(), adbg_wb_burst_write(), or1k_adv_cpu_reset(), and or1k_adv_cpu_stall().
|
static |
Definition at line 245 of file or1k_du_adv.c.
References or1k_jtag::current_reg_idx, DBG_CPU0_CMD_IREG_SEL, DBG_CPU0_OPCODE_LEN, DBG_CPU0_REG_SEL_LEN, DBG_CPU1_CMD_IREG_SEL, DBG_CPU1_OPCODE_LEN, DBG_CPU1_REG_SEL_LEN, DBG_WB_CMD_IREG_SEL, DBG_WB_OPCODE_LEN, DBG_WB_REG_SEL_LEN, DC_CPU0, DC_CPU1, DC_WISHBONE, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_ERROR, NULL, scan_field::num_bits, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by adbg_ctrl_read(), and adbg_ctrl_write().
|
static |
Definition at line 212 of file or1k_du_adv.c.
References chain_name, DBG_MODULE_SELECT_REG_SIZE, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, NULL, scan_field::num_bits, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by or1k_adv_cpu_reset(), or1k_adv_cpu_stall(), or1k_adv_is_cpu_running(), or1k_adv_jtag_jsp_xfer(), or1k_adv_jtag_read_cpu(), or1k_adv_jtag_read_memory(), or1k_adv_jtag_write_cpu(), and or1k_adv_jtag_write_memory().
|
static |
Definition at line 433 of file or1k_du_adv.c.
References adbg_burst_command(), adbg_compute_crc(), adbg_ctrl_read(), adbg_ctrl_write(), ADBG_USE_HISPEED, addr, buffer_shr(), count, CRC_LEN, DBG_CPU0_CMD_BREAD32, DBG_CPU1_CMD_BREAD32, DBG_WB_CMD_BREAD16, DBG_WB_CMD_BREAD32, DBG_WB_CMD_BREAD8, DBG_WB_REG_ERROR, DC_CPU0, DC_CPU1, DC_WISHBONE, ERROR_FAIL, ERROR_OK, find_status_bit(), scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, MAX_BUS_ERRORS, MAX_READ_BUSY_RETRY, MAX_READ_CRC_RETRY, NULL, scan_field::num_bits, or1k_du::options, or1k_du_adv, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, size, STATUS_BYTES, or1k_jtag::tap, and TAP_IDLE.
Referenced by or1k_adv_jtag_read_cpu(), and or1k_adv_jtag_read_memory().
|
static |
Definition at line 589 of file or1k_du_adv.c.
References adbg_burst_command(), adbg_compute_crc(), adbg_ctrl_read(), adbg_ctrl_write(), ADBG_USE_HISPEED, addr, count, DBG_CPU0_CMD_BWRITE32, DBG_CPU1_CMD_BWRITE32, DBG_WB_CMD_BWRITE16, DBG_WB_CMD_BWRITE32, DBG_WB_CMD_BWRITE8, DBG_WB_REG_ERROR, DC_CPU0, DC_CPU1, DC_WISHBONE, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, MAX_BUS_ERRORS, MAX_WRITE_CRC_RETRY, NULL, scan_field::num_bits, or1k_du::options, or1k_du_adv, or1k_jtag::or1k_jtag_module_selected, scan_field::out_value, size, or1k_jtag::tap, TAP_DRSHIFT, and TAP_IDLE.
Referenced by or1k_adv_jtag_write_cpu(), and or1k_adv_jtag_write_memory().
|
static |
|
static |
Definition at line 828 of file or1k_du_adv.c.
References adbg_ctrl_read(), adbg_ctrl_write(), adbg_select_module(), CPU_RESET, DBG_CPU0_REG_STATUS, DBG_CPU_CR_RESET, DC_CPU0, ERROR_OK, or1k_adv_jtag_init(), and or1k_jtag::or1k_jtag_inited.
|
static |
Definition at line 764 of file or1k_du_adv.c.
References adbg_ctrl_read(), adbg_ctrl_write(), adbg_select_module(), CPU_STALL, DBG_CPU0_REG_STATUS, DBG_CPU_CR_STALL, DC_CPU0, ERROR_OK, or1k_adv_jtag_init(), and or1k_jtag::or1k_jtag_inited.
|
static |
Definition at line 794 of file or1k_du_adv.c.
References adbg_ctrl_read(), adbg_select_module(), DBG_CPU0_REG_STATUS, DBG_CPU_CR_STALL, DC_CPU0, DC_NONE, ERROR_OK, or1k_adv_jtag_init(), or1k_jtag::or1k_jtag_inited, and or1k_jtag::or1k_jtag_module_selected.
|
static |
Definition at line 170 of file or1k_du_adv.c.
References ADBG_USE_HISPEED, or1k_jtag::current_reg_idx, DBG_MAX_MODULES, DC_NONE, ENABLE_JSP_MULTI, ENABLE_JSP_SERVER, ERROR_OK, or1k_tap_ip::init, JSP_BANNER, jsp_init(), LOG_DEBUG, LOG_ERROR, LOG_INFO, or1k_du::options, or1k_du_adv, or1k_jtag::or1k_jtag_inited, or1k_jtag::or1k_jtag_module_selected, and or1k_jtag::tap_ip.
Referenced by or1k_adv_cpu_reset(), or1k_adv_cpu_stall(), or1k_adv_is_cpu_running(), or1k_adv_jtag_read_cpu(), or1k_adv_jtag_read_memory(), or1k_adv_jtag_write_cpu(), and or1k_adv_jtag_write_memory().
int or1k_adv_jtag_jsp_xfer | ( | struct or1k_jtag * | jtag_info, |
int * | out_len, | ||
unsigned char * | out_buffer, | ||
int * | in_len, | ||
unsigned char * | in_buffer | ||
) |
Definition at line 983 of file or1k_du_adv.c.
References adbg_select_module(), DC_JSP, ENABLE_JSP_MULTI, ERROR_OK, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, scan_field::num_bits, or1k_du::options, or1k_du_adv, or1k_jtag::or1k_jtag_inited, scan_field::out_value, or1k_jtag::tap, and TAP_IDLE.
Referenced by jsp_input(), and jsp_poll_read().
|
static |
Definition at line 730 of file or1k_du_adv.c.
References adbg_select_module(), adbg_wb_burst_read(), addr, count, DC_CPU0, ERROR_OK, or1k_adv_jtag_init(), and or1k_jtag::or1k_jtag_inited.
|
static |
Definition at line 858 of file or1k_du_adv.c.
References adbg_select_module(), adbg_wb_burst_read(), addr, buf_bswap16(), buf_bswap32(), buffer, count, DC_WISHBONE, target::endianness, ERROR_OK, LOG_DEBUG, MAX_BURST_SIZE, or1k_adv_jtag_init(), or1k_jtag::or1k_jtag_inited, size, or1k_jtag::target, and TARGET_BIG_ENDIAN.
|
static |
Definition at line 747 of file or1k_du_adv.c.
References adbg_select_module(), adbg_wb_burst_write(), addr, count, DC_CPU0, ERROR_OK, or1k_adv_jtag_init(), and or1k_jtag::or1k_jtag_inited.
|
static |
Definition at line 913 of file or1k_du_adv.c.
References adbg_select_module(), adbg_wb_burst_write(), addr, buf_bswap16(), buf_bswap32(), buffer, count, DC_WISHBONE, target::endianness, ERROR_FAIL, ERROR_OK, ERROR_TARGET_FAILURE, LOG_DEBUG, LOG_ERROR, MAX_BURST_SIZE, NULL, or1k_adv_jtag_init(), or1k_jtag::or1k_jtag_inited, size, or1k_jtag::target, and TARGET_BIG_ENDIAN.
int or1k_du_adv_register | ( | void | ) |
Definition at line 1083 of file or1k_du_adv.c.
References du_list, or1k_du::list, list_add_tail(), and or1k_du_adv.
Referenced by or1k_target_create().
|
static |
Definition at line 134 of file or1k_du_adv.c.
Referenced by adbg_select_module().
|
static |
Definition at line 1 of file or1k_du_adv.c.
Referenced by adbg_wb_burst_read(), adbg_wb_burst_write(), or1k_adv_jtag_init(), or1k_adv_jtag_jsp_xfer(), and or1k_du_adv_register().