]> git.sur5r.net Git - openocd/blob - src/target/openrisc/or1k_du.h
Make #include guard naming consistent
[openocd] / src / target / openrisc / or1k_du.h
1 /***************************************************************************
2  *   Copyright (C) 2013 Franck Jullien                                     *
3  *   elec4fun@gmail.com                                                    *
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 #ifndef OPENOCD_TARGET_OPENRISC_OR1K_DU_H
20 #define OPENOCD_TARGET_OPENRISC_OR1K_DU_H
21
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25
26 #define CPU_STALL       0
27 #define CPU_UNSTALL     1
28
29 #define CPU_RESET       0
30 #define CPU_NOT_RESET   1
31
32 int or1k_du_adv_register(void);
33
34 /* Linear list over all available or1k debug unit */
35 extern struct list_head du_list;
36
37 struct or1k_du {
38         const char *name;
39         struct list_head list;
40         int options;
41
42         int (*or1k_jtag_init)(struct or1k_jtag *jtag_info);
43
44         int (*or1k_is_cpu_running)(struct or1k_jtag *jtag_info, int *running);
45
46         int (*or1k_cpu_stall)(struct or1k_jtag *jtag_info, int action);
47
48         int (*or1k_cpu_reset)(struct or1k_jtag *jtag_info, int action);
49
50         int (*or1k_jtag_read_cpu)(struct or1k_jtag *jtag_info,
51                                   uint32_t addr, int count, uint32_t *value);
52
53         int (*or1k_jtag_write_cpu)(struct or1k_jtag *jtag_info,
54                                    uint32_t addr, int count, const uint32_t *value);
55
56         int (*or1k_jtag_read_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
57                                         int count, uint8_t *buffer);
58
59         int (*or1k_jtag_write_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
60                                          int count, const uint8_t *buffer);
61 };
62
63 static inline struct or1k_du *or1k_jtag_to_du(struct or1k_jtag *jtag_info)
64 {
65         return (struct or1k_du *)jtag_info->du_core;
66 }
67
68 static inline struct or1k_du *or1k_to_du(struct or1k_common *or1k)
69 {
70         struct or1k_jtag *jtag = &or1k->jtag;
71         return (struct or1k_du *)jtag->du_core;
72 }
73
74 int or1k_adv_jtag_jsp_xfer(struct or1k_jtag *jtag_info,
75                                   int *out_len, unsigned char *out_buffer,
76                                   int *in_len, unsigned char *in_buffer);
77
78 #endif /* OPENOCD_TARGET_OPENRISC_OR1K_DU_H */