jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / jtag / drivers / OpenULINK / include / msgtypes.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4 * Copyright (C) 2011 by Martin Schmoelzer *
5 * <martin.schmoelzer@student.tuwien.ac.at> *
6 ***************************************************************************/
7
8 /**
9 * @file
10 * Definition of the commands supported by the OpenULINK firmware.
11 *
12 * Basically, two types of commands can be distinguished:
13 * - Commands with fixed payload size
14 * - Commands with variable payload size
15 *
16 * SCAN commands (in all variations) carry payloads of variable size, all
17 * other commands carry payloads of fixed size.
18 *
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.
21 *
22 * Offset zero always contains the command ID.
23 *
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: *
106 * *
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: *
116 * *
117 * OUT: *
118 * offset 1: unused dummy value *
119 ****************************************************************************
120 */
121
122 #ifndef __MSGTYPES_H
123 #define __MSGTYPES_H
124
125 /*
126 * Command IDs:
127 *
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.
132 */
133
134 #define CMD_ID_MASK 0x3F
135
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
143
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
156
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)
162
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)
171
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)
177
178 #endif

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)