8 #ifndef OPENOCD_JTAG_AICE_AICE_USB_H
9 #define OPENOCD_JTAG_AICE_AICE_USB_H
14 #define AICE_USB_TIMEOUT 5000
17 #define AICE_IN_BUFFER_SIZE 2048
18 #define AICE_OUT_BUFFER_SIZE 2048
19 #define AICE_IN_PACKETS_BUFFER_SIZE 2048
20 #define AICE_OUT_PACKETS_BUFFER_SIZE 2048
21 #define AICE_IN_BATCH_COMMAND_SIZE 512
22 #define AICE_OUT_BATCH_COMMAND_SIZE 512
23 #define AICE_IN_PACK_COMMAND_SIZE 2048
24 #define AICE_OUT_PACK_COMMAND_SIZE 2048
27 #define AICE_READ_CTRL_GET_ICE_STATE 0x00
28 #define AICE_READ_CTRL_GET_HARDWARE_VERSION 0x01
29 #define AICE_READ_CTRL_GET_FPGA_VERSION 0x02
30 #define AICE_READ_CTRL_GET_FIRMWARE_VERSION 0x03
31 #define AICE_READ_CTRL_GET_JTAG_PIN_STATUS 0x04
32 #define AICE_READ_CTRL_BATCH_BUF_INFO 0x22
33 #define AICE_READ_CTRL_BATCH_STATUS 0x23
34 #define AICE_READ_CTRL_BATCH_BUF0_STATE 0x31
35 #define AICE_READ_CTRL_BATCH_BUF4_STATE 0x39
36 #define AICE_READ_CTRL_BATCH_BUF5_STATE 0x3b
39 #define AICE_WRITE_CTRL_TCK_CONTROL 0x00
40 #define AICE_WRITE_CTRL_JTAG_PIN_CONTROL 0x01
41 #define AICE_WRITE_CTRL_CLEAR_TIMEOUT_STATUS 0x02
42 #define AICE_WRITE_CTRL_RESERVED 0x03
43 #define AICE_WRITE_CTRL_JTAG_PIN_STATUS 0x04
44 #define AICE_WRITE_CTRL_CUSTOM_DELAY 0x0d
45 #define AICE_WRITE_CTRL_BATCH_CTRL 0x20
46 #define AICE_WRITE_CTRL_BATCH_ITERATION 0x21
47 #define AICE_WRITE_CTRL_BATCH_DIM_SIZE 0x22
48 #define AICE_WRITE_CTRL_BATCH_CMD_BUF0_CTRL 0x30
49 #define AICE_WRITE_CTRL_BATCH_DATA_BUF0_CTRL 0x38
50 #define AICE_WRITE_CTRL_BATCH_DATA_BUF1_CTRL 0x3a
52 #define AICE_BATCH_COMMAND_BUFFER_0 0x0
53 #define AICE_BATCH_COMMAND_BUFFER_1 0x1
54 #define AICE_BATCH_COMMAND_BUFFER_2 0x2
55 #define AICE_BATCH_COMMAND_BUFFER_3 0x3
56 #define AICE_BATCH_DATA_BUFFER_0 0x4
57 #define AICE_BATCH_DATA_BUFFER_1 0x5
58 #define AICE_BATCH_DATA_BUFFER_2 0x6
59 #define AICE_BATCH_DATA_BUFFER_3 0x7
62 #define AICE_TCK_CONTROL_TCK3048 0x08
63 #define AICE_TCK_CONTROL_TCK_SCAN 0x10
66 #define AICE_JTAG_PIN_CONTROL_SRST 0x01
67 #define AICE_JTAG_PIN_CONTROL_TRST 0x02
68 #define AICE_JTAG_PIN_CONTROL_STOP 0x04
69 #define AICE_JTAG_PIN_CONTROL_RESTART 0x08
72 #define AICE_TCK_CONTROL_TCK_SCAN 0x10
75 #define AICE_CUSTOM_DELAY_SET_SRST 0x01
76 #define AICE_CUSTOM_DELAY_CLEAN_SRST 0x02
77 #define AICE_CUSTOM_DELAY_SET_DBGI 0x04
78 #define AICE_CUSTOM_DELAY_CLEAN_DBGI 0x08
79 #define AICE_CUSTOM_DELAY_SET_TRST 0x10
80 #define AICE_CUSTOM_DELAY_CLEAN_TRST 0x20
int aice_write_ctrl(uint32_t address, uint32_t data)
int aice_read_ctrl(uint32_t address, uint32_t *data)
struct aice_port_api_s aice_usb_api
enum nds_memory_access access_channel
enum nds_memory_select memory_select
enum aice_target_state_s core_state
uint32_t target_dtr_backup
struct libusb_device_handle * usb_handle
unsigned int usb_write_ep