OpenOCD
arc_jtag.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2013-2014,2019-2020 Synopsys, Inc. *
5  * Frank Dols <frank.dols@synopsys.com> *
6  * Mischa Jonker <mischa.jonker@synopsys.com> *
7  * Anton Kolesov <anton.kolesov@synopsys.com> *
8  * Evgeniy Didin <didin@synopsys.com> *
9  ***************************************************************************/
10 
11 #ifndef OPENOCD_TARGET_ARC_JTAG_H
12 #define OPENOCD_TARGET_ARC_JTAG_H
13 
14 #define ARC_TRANSACTION_CMD_REG 0x9 /* Command to perform */
15 #define ARC_TRANSACTION_CMD_REG_LENGTH 4
16 
17 /* Jtag status register, value is placed in IR to read jtag status register */
18 #define ARC_JTAG_STATUS_REG 0x8
19 #define ARC_JTAG_ADDRESS_REG 0xA /* SoC address to access */
20 #define ARC_JTAG_DATA_REG 0xB /* Data read/written from SoC */
21 
22 /* Jtag status register field */
23 #define ARC_JTAG_STAT_RU 0x10
24 
25 /* ARC Jtag transactions */
26 #define ARC_JTAG_WRITE_TO_MEMORY 0x0
27 #define ARC_JTAG_WRITE_TO_CORE_REG 0x1
28 #define ARC_JTAG_WRITE_TO_AUX_REG 0x2
29 #define ARC_JTAG_CMD_NOP 0x3
30 #define ARC_JTAG_READ_FROM_MEMORY 0x4
31 #define ARC_JTAG_READ_FROM_CORE_REG 0x5
32 #define ARC_JTAG_READ_FROM_AUX_REG 0x6
33 
34 #define ARC_JTAG_CORE_REG 0x0
35 #define ARC_JTAG_AUX_REG 0x1
36 
37 
38 struct arc_jtag {
39  struct jtag_tap *tap;
40  uint32_t cur_trans;
41 };
42 
43 /* ----- Exported JTAG functions ------------------------------------------- */
44 
45 int arc_jtag_startup(struct arc_jtag *jtag_info);
46 int arc_jtag_status(struct arc_jtag *const jtag_info, uint32_t *const value);
47 
48 int arc_jtag_write_core_reg(struct arc_jtag *jtag_info, uint32_t *addr,
49  uint32_t count, const uint32_t *buffer);
50 int arc_jtag_read_core_reg(struct arc_jtag *jtag_info, uint32_t *addr,
51  uint32_t count, uint32_t *buffer);
52 int arc_jtag_write_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr,
53  const uint32_t buffer);
54 int arc_jtag_read_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr,
55  uint32_t *buffer);
56 
57 int arc_jtag_write_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr,
58  uint32_t count, const uint32_t *buffer);
59 int arc_jtag_write_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr,
60  uint32_t value);
61 int arc_jtag_read_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr,
62  uint32_t count, uint32_t *buffer);
63 int arc_jtag_read_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr,
64  uint32_t *value);
65 
66 int arc_jtag_write_memory(struct arc_jtag *jtag_info, uint32_t addr,
67  uint32_t count, const uint32_t *buffer);
68 int arc_jtag_read_memory(struct arc_jtag *jtag_info, uint32_t addr,
69  uint32_t count, uint32_t *buffer, bool slow_memory);
70 #endif /* OPENOCD_TARGET_ARC_JTAG_H */
int arc_jtag_startup(struct arc_jtag *jtag_info)
Definition: arc_jtag.c:169
int arc_jtag_write_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer)
Write core registers.
Definition: arc_jtag.c:342
int arc_jtag_status(struct arc_jtag *const jtag_info, uint32_t *const value)
Read STATUS register.
Definition: arc_jtag.c:179
int arc_jtag_read_memory(struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, uint32_t *buffer, bool slow_memory)
Read a sequence of 4-byte words from target memory.
Definition: arc_jtag.c:484
int arc_jtag_write_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t value)
Wrapper function to ease writing of one AUX register.
Definition: arc_jtag.c:374
int arc_jtag_write_memory(struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, const uint32_t *buffer)
Write a sequence of 4-byte words into target memory.
Definition: arc_jtag.c:436
int arc_jtag_read_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t *buffer)
Wrapper function to ease reading of one core register.
Definition: arc_jtag.c:350
int arc_jtag_read_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer)
Read core registers.
Definition: arc_jtag.c:366
int arc_jtag_read_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t *value)
Wrapper function to ease reading of one AUX register.
Definition: arc_jtag.c:398
int arc_jtag_write_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer)
Write AUX registers.
Definition: arc_jtag.c:390
int arc_jtag_write_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr, const uint32_t buffer)
Wrapper function to ease writing of one core register.
Definition: arc_jtag.c:326
int arc_jtag_read_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer)
Read AUX registers.
Definition: arc_jtag.c:414
uint32_t addr
Definition: nuttx.c:65
struct jtag_tap * tap
Definition: arc_jtag.h:39
uint32_t cur_trans
Definition: arc_jtag.h:40
Definition: jtag.h:100
uint8_t count[4]
Definition: vdebug.c:22