jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / target / esirisc_jtag.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4 * Copyright (C) 2018 by Square, Inc. *
5 * Steven Stallion <stallion@squareup.com> *
6 * James Zhao <hjz@squareup.com> *
7 ***************************************************************************/
8
9 #ifndef OPENOCD_TARGET_ESIRISC_JTAG_H
10 #define OPENOCD_TARGET_ESIRISC_JTAG_H
11
12 #include <helper/types.h>
13 #include <jtag/jtag.h>
14
15 /* TAP Instructions */
16 #define INSTR_IDCODE 0x8
17 #define INSTR_DEBUG 0x9
18 #define INSTR_BYPASS 0xf
19 #define INSTR_LENGTH 4
20
21 /* eSi-Debug Commands */
22 #define DEBUG_NOP 0x00
23 #define DEBUG_READ_BYTE 0x10
24 #define DEBUG_READ_HWORD 0x20
25 #define DEBUG_READ_WORD 0x30
26 #define DEBUG_WRITE_BYTE 0x60
27 #define DEBUG_WRITE_HWORD 0x70
28 #define DEBUG_WRITE_WORD 0x80
29 #define DEBUG_READ_REG 0xb0
30 #define DEBUG_WRITE_REG 0xc0
31 #define DEBUG_READ_CSR 0xd0
32 #define DEBUG_WRITE_CSR 0xe0
33 #define DEBUG_ENABLE_DEBUG 0xf0
34 #define DEBUG_DISABLE_DEBUG 0xf2
35 #define DEBUG_ASSERT_RESET 0xf4
36 #define DEBUG_DEASSERT_RESET 0xf6
37 #define DEBUG_BREAK 0xf8
38 #define DEBUG_CONTINUE 0xfa
39 #define DEBUG_FLUSH_CACHES 0xfc
40
41 /* Exception IDs */
42 #define EID_OVERFLOW 0x3d
43 #define EID_CANT_DEBUG 0x3e
44 #define EID_NONE 0x3f
45
46 /* Byte Stuffing */
47 #define STUFF_MARKER 0x55
48 #define PAD_BYTE 0xaa
49
50 struct esirisc_jtag {
51 struct jtag_tap *tap;
52 uint8_t status;
53 };
54
55 bool esirisc_jtag_is_debug_active(struct esirisc_jtag *jtag_info);
56 bool esirisc_jtag_is_stopped(struct esirisc_jtag *jtag_info);
57 uint8_t esirisc_jtag_get_eid(struct esirisc_jtag *jtag_info);
58
59 int esirisc_jtag_read_byte(struct esirisc_jtag *jtag_info,
60 uint32_t address, uint8_t *data);
61 int esirisc_jtag_read_hword(struct esirisc_jtag *jtag_info,
62 uint32_t address, uint16_t *data);
63 int esirisc_jtag_read_word(struct esirisc_jtag *jtag_info,
64 uint32_t address, uint32_t *data);
65
66 int esirisc_jtag_write_byte(struct esirisc_jtag *jtag_info,
67 uint32_t address, uint8_t data);
68 int esirisc_jtag_write_hword(struct esirisc_jtag *jtag_info,
69 uint32_t address, uint16_t data);
70 int esirisc_jtag_write_word(struct esirisc_jtag *jtag_info,
71 uint32_t address, uint32_t data);
72
73 int esirisc_jtag_read_reg(struct esirisc_jtag *jtag_info,
74 uint8_t reg, uint32_t *data);
75 int esirisc_jtag_write_reg(struct esirisc_jtag *jtag_info,
76 uint8_t reg, uint32_t data);
77
78 int esirisc_jtag_read_csr(struct esirisc_jtag *jtag_info,
79 uint8_t bank, uint8_t csr, uint32_t *data);
80 int esirisc_jtag_write_csr(struct esirisc_jtag *jtag_info,
81 uint8_t bank, uint8_t csr, uint32_t data);
82
83 int esirisc_jtag_enable_debug(struct esirisc_jtag *jtag_info);
84 int esirisc_jtag_disable_debug(struct esirisc_jtag *jtag_info);
85
86 int esirisc_jtag_assert_reset(struct esirisc_jtag *jtag_info);
87 int esirisc_jtag_deassert_reset(struct esirisc_jtag *jtag_info);
88
89 int esirisc_jtag_break(struct esirisc_jtag *jtag_info);
90 int esirisc_jtag_continue(struct esirisc_jtag *jtag_info);
91
92 int esirisc_jtag_flush_caches(struct esirisc_jtag *jtag_info);
93
94 #endif /* OPENOCD_TARGET_ESIRISC_JTAG_H */

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)