contrib/firmware: add new adapter ANGIE's firmware/bitstream code
[openocd.git] / contrib / firmware / angie / c / include / msgtypes.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /****************************************************************************
3 File : msgtypes.h *
4 Contents : Definition of the commands supported by NanoXplore *
5 USB-JTAG ANGIE adapter hardware. *
6 Based on openULINK project code by: Martin Schmoelzer. *
7 Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
8 <aboudjelida@nanoxplore.com> *
9 <ahmederrachedbjld@gmail.com> *
10 *****************************************************************************/
11
12 /**
13 * @file
14 * Definition of the commands supported by the ANGIE firmware.
15 *
16 * Basically, two types of commands can be distinguished:
17 * - Commands with fixed payload size
18 * - Commands with variable payload size
19 *
20 * SCAN commands (in all variations) carry payloads of variable size, all
21 * other commands carry payloads of fixed size.
22 *
23 * In the case of SCAN commands, the payload size (n) is calculated by
24 * dividing the scan_size_bits variable by 8, rounding up the result.
25 *
26 * Offset zero always contains the command ID.
27 *
28 ****************************************************************************
29 * CMD_SCAN_IN, CMD_SLOW_SCAN_IN: *
30 * *
31 * OUT: *
32 * offset 1: scan_size_bytes *
33 * offset 2: bits_last_byte *
34 * offset 3: tms_count_start + tms_count_end *
35 * offset 4: tms_sequence_start *
36 * offset 5: tms_sequence_end *
37 * *
38 * IN: *
39 * offset 0..n: TDO data *
40 ****************************************************************************
41 * CMD_SCAN_OUT, CMD_SLOW_SCAN_OUT: *
42 * *
43 * OUT: *
44 * offset 1: scan_size_bytes *
45 * offset 2: bits_last_byte *
46 * offset 3: tms_count_start + tms_count_end *
47 * offset 4: tms_sequence_start *
48 * offset 5: tms_sequence_end *
49 * offset 6..x: TDI data *
50 ****************************************************************************
51 * CMD_SCAN_IO, CMD_SLOW_SCAN_IO: *
52 * *
53 * OUT: *
54 * offset 1: scan_size_bytes *
55 * offset 2: bits_last_byte *
56 * offset 3: tms_count_start + tms_count_end *
57 * offset 4: tms_sequence_start *
58 * offset 5: tms_sequence_end *
59 * offset 6..x: TDI data *
60 * *
61 * IN: *
62 * offset 0..n: TDO data *
63 ****************************************************************************
64 * CMD_CLOCK_TMS, CMD_SLOW_CLOCK_TMS: *
65 * *
66 * OUT: *
67 * offset 1: tms_count *
68 * offset 2: tms_sequence *
69 ****************************************************************************
70 * CMD_CLOCK_TCK, CMD_SLOW_CLOCK_TCK: *
71 * *
72 * OUT: *
73 * offset 1: low byte of tck_count *
74 * offset 2: high byte of tck_count *
75 ****************************************************************************
76 * CMD_CLOCK_SLEEP_US: *
77 * *
78 * OUT: *
79 * offset 1: low byte of sleep_us *
80 * offset 2: high byte of sleep_us *
81 ****************************************************************************
82 * CMD_CLOCK_SLEEP_MS: *
83 * *
84 * OUT: *
85 * offset 1: low byte of sleep_ms *
86 * offset 2: high byte of sleep_ms *
87 ****************************************************************************
88 * CMD_GET_SIGNALS: *
89 * *
90 * IN: *
91 * offset 0: current state of input signals *
92 * offset 1: current state of output signals *
93 ****************************************************************************
94 * CMD_SET_SIGNALS: *
95 * *
96 * OUT: *
97 * offset 1: signals that should be de-asserted *
98 * offset 2: signals that should be asserted *
99 ****************************************************************************
100 * CMD_CONFIGURE_TCK_FREQ: *
101 * *
102 * OUT: *
103 * offset 1: delay value for scan_in function *
104 * offset 2: delay value for scan_out function *
105 * offset 3: delay value for scan_io function *
106 * offset 4: delay value for clock_tck function *
107 * offset 5: delay value for clock_tms function *
108 ****************************************************************************
109 * CMD_SET_LEDS: *
110 * *
111 * OUT: *
112 * offset 1: LED states: *
113 * Bit 0: turn COM LED on *
114 * Bit 1: turn RUN LED on *
115 * Bit 2: turn COM LED off *
116 * Bit 3: turn RUN LED off *
117 * Bits 7..4: Reserved *
118 ****************************************************************************
119 * CMD_TEST: *
120 * *
121 * OUT: *
122 * offset 1: unused dummy value *
123 ****************************************************************************
124 */
125
126 #ifndef __MSGTYPES_H
127 #define __MSGTYPES_H
128
129 /*
130 * Command IDs:
131 *
132 * Bits 7..6: Reserved, should always be zero
133 * Bits 5..0: Command ID. There are 62 usable IDs. Of this 63 available IDs,
134 * the IDs 0x00..0x1F are commands with variable payload size,
135 * the IDs 0x20..0x3F are commands with fixed payload size.
136 */
137
138 #define CMD_ID_MASK 0x3F
139
140 /* Commands with variable payload size */
141 #define CMD_SCAN_IN 0x00
142 #define CMD_SLOW_SCAN_IN 0x01
143 #define CMD_SCAN_OUT 0x02
144 #define CMD_SLOW_SCAN_OUT 0x03
145 #define CMD_SCAN_IO 0x04
146 #define CMD_SLOW_SCAN_IO 0x05
147
148 /* Commands with fixed payload size */
149 #define CMD_CLOCK_TMS 0x20
150 #define CMD_SLOW_CLOCK_TMS 0x21
151 #define CMD_CLOCK_TCK 0x22
152 #define CMD_SLOW_CLOCK_TCK 0x23
153 #define CMD_SLEEP_US 0x24
154 #define CMD_SLEEP_MS 0x25
155 #define CMD_GET_SIGNALS 0x26
156 #define CMD_SET_SIGNALS 0x27
157 #define CMD_CONFIGURE_TCK_FREQ 0x28
158 #define CMD_SET_LEDS 0x29
159 #define CMD_TEST 0x2A
160
161 /* JTAG signal definition for jtag_get_signals() -- Input signals! */
162 #define SIGNAL_TDO 1
163
164 /* JTAG signal definition for jtag_get_signals() -- Output signals! */
165 #define SIGNAL_TDI 8
166 #define SIGNAL_TMS 2
167 #define SIGNAL_TCK 4
168 #define SIGNAL_TRST 1
169 #define SIGNAL_SRST 32
170
171 #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)