jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / jtag / drivers / OpenULINK / include / msgtypes.h
blobae61ddbf905588764ebd6840725c7e85fab15b9d
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2011 by Martin Schmoelzer *
5 * <martin.schmoelzer@student.tuwien.ac.at> *
6 ***************************************************************************/
8 /**
9 * @file
10 * Definition of the commands supported by the OpenULINK firmware.
12 * Basically, two types of commands can be distinguished:
13 * - Commands with fixed payload size
14 * - Commands with variable payload size
16 * SCAN commands (in all variations) carry payloads of variable size, all
17 * other commands carry payloads of fixed size.
19 * In the case of SCAN commands, the payload size (n) is calculated by
20 * dividing the scan_size_bits variable by 8, rounding up the result.
22 * Offset zero always contains the command ID.
24 ****************************************************************************
25 * CMD_SCAN_IN, CMD_SLOW_SCAN_IN: *
26 * *
27 * OUT: *
28 * offset 1: scan_size_bytes *
29 * offset 2: bits_last_byte *
30 * offset 3: tms_count_start + tms_count_end *
31 * offset 4: tms_sequence_start *
32 * offset 5: tms_sequence_end *
33 * *
34 * IN: *
35 * offset 0..n: TDO data *
36 ****************************************************************************
37 * CMD_SCAN_OUT, CMD_SLOW_SCAN_OUT: *
38 * *
39 * OUT: *
40 * offset 1: scan_size_bytes *
41 * offset 2: bits_last_byte *
42 * offset 3: tms_count_start + tms_count_end *
43 * offset 4: tms_sequence_start *
44 * offset 5: tms_sequence_end *
45 * offset 6..x: TDI data *
46 ****************************************************************************
47 * CMD_SCAN_IO, CMD_SLOW_SCAN_IO: *
48 * *
49 * OUT: *
50 * offset 1: scan_size_bytes *
51 * offset 2: bits_last_byte *
52 * offset 3: tms_count_start + tms_count_end *
53 * offset 4: tms_sequence_start *
54 * offset 5: tms_sequence_end *
55 * offset 6..x: TDI data *
56 * *
57 * IN: *
58 * offset 0..n: TDO data *
59 ****************************************************************************
60 * CMD_CLOCK_TMS, CMD_SLOW_CLOCK_TMS: *
61 * *
62 * OUT: *
63 * offset 1: tms_count *
64 * offset 2: tms_sequence *
65 ****************************************************************************
66 * CMD_CLOCK_TCK, CMD_SLOW_CLOCK_TCK: *
67 * *
68 * OUT: *
69 * offset 1: low byte of tck_count *
70 * offset 2: high byte of tck_count *
71 ****************************************************************************
72 * CMD_CLOCK_SLEEP_US: *
73 * *
74 * OUT: *
75 * offset 1: low byte of sleep_us *
76 * offset 2: high byte of sleep_us *
77 ****************************************************************************
78 * CMD_CLOCK_SLEEP_MS: *
79 * *
80 * OUT: *
81 * offset 1: low byte of sleep_ms *
82 * offset 2: high byte of sleep_ms *
83 ****************************************************************************
84 * CMD_GET_SIGNALS: *
85 * *
86 * IN: *
87 * offset 0: current state of input signals *
88 * offset 1: current state of output signals *
89 ****************************************************************************
90 * CMD_SET_SIGNALS: *
91 * *
92 * OUT: *
93 * offset 1: signals that should be de-asserted *
94 * offset 2: signals that should be asserted *
95 ****************************************************************************
96 * CMD_CONFIGURE_TCK_FREQ: *
97 * *
98 * OUT: *
99 * offset 1: delay value for scan_in function *
100 * offset 2: delay value for scan_out function *
101 * offset 3: delay value for scan_io function *
102 * offset 4: delay value for clock_tck function *
103 * offset 5: delay value for clock_tms function *
104 ****************************************************************************
105 * CMD_SET_LEDS: *
107 * OUT: *
108 * offset 1: LED states: *
109 * Bit 0: turn COM LED on *
110 * Bit 1: turn RUN LED on *
111 * Bit 2: turn COM LED off *
112 * Bit 3: turn RUN LED off *
113 * Bits 7..4: Reserved *
114 ****************************************************************************
115 * CMD_TEST: *
117 * OUT: *
118 * offset 1: unused dummy value *
119 ****************************************************************************
122 #ifndef __MSGTYPES_H
123 #define __MSGTYPES_H
126 * Command IDs:
128 * Bits 7..6: Reserved, should always be zero
129 * Bits 5..0: Command ID. There are 62 usable IDs. Of this 63 available IDs,
130 * the IDs 0x00..0x1F are commands with variable payload size,
131 * the IDs 0x20..0x3F are commands with fixed payload size.
134 #define CMD_ID_MASK 0x3F
136 /* Commands with variable payload size */
137 #define CMD_SCAN_IN 0x00
138 #define CMD_SLOW_SCAN_IN 0x01
139 #define CMD_SCAN_OUT 0x02
140 #define CMD_SLOW_SCAN_OUT 0x03
141 #define CMD_SCAN_IO 0x04
142 #define CMD_SLOW_SCAN_IO 0x05
144 /* Commands with fixed payload size */
145 #define CMD_CLOCK_TMS 0x20
146 #define CMD_SLOW_CLOCK_TMS 0x21
147 #define CMD_CLOCK_TCK 0x22
148 #define CMD_SLOW_CLOCK_TCK 0x23
149 #define CMD_SLEEP_US 0x24
150 #define CMD_SLEEP_MS 0x25
151 #define CMD_GET_SIGNALS 0x26
152 #define CMD_SET_SIGNALS 0x27
153 #define CMD_CONFIGURE_TCK_FREQ 0x28
154 #define CMD_SET_LEDS 0x29
155 #define CMD_TEST 0x2A
157 /* JTAG signal definition for jtag_get_signals() -- Input signals! */
158 #define SIGNAL_TDO (1<<0)
159 #define SIGNAL_BRKOUT (1<<1)
160 #define SIGNAL_TRAP (1<<2)
161 #define SIGNAL_RTCK (1<<3)
163 /* JTAG signal definition for jtag_get_signals() -- Output signals! */
164 #define SIGNAL_TDI (1<<0)
165 #define SIGNAL_TMS (1<<1)
166 #define SIGNAL_TCK (1<<2)
167 #define SIGNAL_TRST (1<<3)
168 #define SIGNAL_BRKIN (1<<4)
169 #define SIGNAL_RESET (1<<5)
170 #define SIGNAL_OCDSE (1<<6)
172 /* LED definitions for CMD_SET_LEDS and CMD_CLEAR_LEDS commands */
173 #define COM_LED_ON (1<<0)
174 #define RUN_LED_ON (1<<1)
175 #define COM_LED_OFF (1<<2)
176 #define RUN_LED_OFF (1<<3)
178 #endif