or1k: remove address of the Free Software Foundation
[openocd.git] / 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
16 #ifndef OR1K_DU
17 #define OR1K_DU
18
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22
23 #define CPU_STALL 0
24 #define CPU_UNSTALL 1
25
26 #define CPU_RESET 0
27 #define CPU_NOT_RESET 1
28
29 int or1k_du_adv_register(void);
30
31 /* Linear list over all available or1k debug unit */
32 extern struct list_head du_list;
33
34 struct or1k_du {
35 const char *name;
36 struct list_head list;
37 int options;
38
39 int (*or1k_jtag_init)(struct or1k_jtag *jtag_info);
40
41 int (*or1k_is_cpu_running)(struct or1k_jtag *jtag_info, int *running);
42
43 int (*or1k_cpu_stall)(struct or1k_jtag *jtag_info, int action);
44
45 int (*or1k_cpu_reset)(struct or1k_jtag *jtag_info, int action);
46
47 int (*or1k_jtag_read_cpu)(struct or1k_jtag *jtag_info,
48 uint32_t addr, int count, uint32_t *value);
49
50 int (*or1k_jtag_write_cpu)(struct or1k_jtag *jtag_info,
51 uint32_t addr, int count, const uint32_t *value);
52
53 int (*or1k_jtag_read_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
54 int count, uint8_t *buffer);
55
56 int (*or1k_jtag_write_memory)(struct or1k_jtag *jtag_info, uint32_t addr, uint32_t size,
57 int count, const uint8_t *buffer);
58 };
59
60 static inline struct or1k_du *or1k_jtag_to_du(struct or1k_jtag *jtag_info)
61 {
62 return (struct or1k_du *)jtag_info->du_core;
63 }
64
65 static inline struct or1k_du *or1k_to_du(struct or1k_common *or1k)
66 {
67 struct or1k_jtag *jtag = &or1k->jtag;
68 return (struct or1k_du *)jtag->du_core;
69 }
70
71 int or1k_adv_jtag_jsp_xfer(struct or1k_jtag *jtag_info,
72 int *out_len, unsigned char *out_buffer,
73 int *in_len, unsigned char *in_buffer);
74
75 #endif
76