openocd: src/target: replace the GPL-2.0-or-later license tag
[fw/openocd] / src / target / etb.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4  *   Copyright (C) 2007 by Dominic Rath                                    *
5  *   Dominic.Rath@gmx.de                                                   *
6  ***************************************************************************/
7
8 #ifndef OPENOCD_TARGET_ETB_H
9 #define OPENOCD_TARGET_ETB_H
10
11 /* ETB registers */
12 enum {
13         ETB_ID = 0x00,
14         ETB_RAM_DEPTH = 0x01,
15         ETB_RAM_WIDTH = 0x02,
16         ETB_STATUS = 0x03,
17         ETB_RAM_DATA = 0x04,
18         ETB_RAM_READ_POINTER = 0x05,
19         ETB_RAM_WRITE_POINTER = 0x06,
20         ETB_TRIGGER_COUNTER = 0x07,
21         ETB_CTRL = 0x08,
22 };
23
24 struct etb {
25         struct etm_context *etm_ctx;
26         struct jtag_tap *tap;
27         uint32_t cur_scan_chain;
28         struct reg_cache *reg_cache;
29
30         /* ETB parameters */
31         uint32_t ram_depth;
32         uint32_t ram_width;
33
34         /** how much trace buffer to fill after trigger */
35         unsigned trigger_percent;
36 };
37
38 struct etb_reg {
39         uint32_t addr;
40         struct etb *etb;
41 };
42
43 extern struct etm_capture_driver etb_capture_driver;
44
45 struct reg_cache *etb_build_reg_cache(struct etb *etb);
46
47 #endif /* OPENOCD_TARGET_ETB_H */