239f196a55ff92986969e02ccc010dd6f5a79972
[openocd.git] / src / jtag / drivers / rlink_dtc_cmd.h
1 /***************************************************************************
2 * Copyright (C) 2008 Lou Deluxe *
3 * lou.openocd012@fixit.nospammail.net *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
18
19 /* A command position with the high nybble of 0x0 is reserved for an error condition.
20 * If executed, it stops the DTC and raises the ERROR flag */
21
22 #define DTC_CMD_SHIFT_TMS_BYTES(bytes) ((0x1 << 4) | ((bytes) - 1))
23 /* Shift 1-16 bytes out TMS. TDI is 0. */
24 /* Bytes to shift follow. */
25
26 #define DTC_CMD_SHIFT_TDI_BYTES(bytes) ((0x2 << 4) | ((bytes) - 1))
27 /* Shift 1-16 bytes out TDI. TMS is 0. */
28 /* Bytes to shift follow. */
29
30 #define DTC_CMD_SHIFT_TDI_AND_TMS_BYTES(bytes) ((0x3 << 4) | ((bytes) - 1))
31 /* Shift 1-16 byte pairs out TDI and TMS. */
32 /* Byte pairs to shift follow in TDI, TMS order. */
33
34 #define DTC_CMD_SHIFT_TDO_BYTES(bytes) ((0x4 << 4) | ((bytes) - 1))
35 /* Shift 1-16 bytes in TDO. TMS is unaffected. */
36 /* Reply buffer contains bytes shifted in. */
37
38 #define DTC_CMD_SHIFT_TDIO_BYTES(bytes) ((0x6 << 4) | ((bytes) - 1))
39 /* Shift 1-16 bytes out TDI and in TDO. TMS is unaffected. */
40
41 #define DTC_CMD_SHIFT_TMS_TDI_BIT_PAIR(tms, tdi, tdo) ((0x8 << 4) | (\
42 (tms) ? (1 << 0) : 0 \
43 ) | (\
44 (tdi) ? (1 << 1) : 0 \
45 ) | (\
46 (tdo) ? (1 << 3) : 0 \
47 ))
48 /* Single bit shift.
49 * tms and tdi are the levels shifted out on TMS and TDI, respectively.
50 * tdo indicates whether a byte will be returned in the reply buffer with its
51 * least significant bit set to reflect TDO
52 * Care should be taken when tdo is zero, as the underlying code actually does put
53 * that byte in the reply buffer. Setting tdo to zero just moves the pointer back.
54 * The result is that if this command is executed when the reply buffer is already full,
55 * a byte will be written erroneously to memory not belonging to the reply buffer.
56 * This could be worked around at the expense of DTC code space and speed. */
57
58 #define DTC_CMD_SHIFT_TMS_BITS(bits) ((0x9 << 4) | ((bits) - 1))
59 /* Shift 1-8 bits out TMS. */
60 /* Bits to be shifted out are left justified in the following byte. */
61
62 #define DTC_CMD_SHIFT_TDIO_BITS(bits) ((0xe << 4) | ((bits) - 1))
63 /* Shift 1-8 bits out TDI and in TDO, TMS is unaffected. */
64 /* Bits to be shifted out are left justified in the following byte. */
65 /* Bits shifted in are right justified in the byte placed in the reply buffer. */
66
67 #define DTC_CMD_STOP (0xf << 4)
68 /* Stop processing the command buffer and wait for the next one. */
69 /* A shared status byte is updated with bit 0 set when this has happened,
70 * and it is cleared when a new command buffer becomes ready.
71 * The host can poll that byte to see when it is safe to read a reply. */

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)