]> git.sur5r.net Git - openocd/blob - src/target/arm11_dbgtap.h
Remove FSF address from GPL notices
[openocd] / src / target / arm11_dbgtap.h
1 /***************************************************************************
2  *   Copyright (C) 2008 digenius technology GmbH.                          *
3  *   Michael Bruck                                                         *
4  *                                                                         *
5  *   Copyright (C) 2008,2009 Oyvind Harboe oyvind.harboe@zylin.com         *
6  *                                                                         *
7  *   This program is free software; you can redistribute it and/or modify  *
8  *   it under the terms of the GNU General Public License as published by  *
9  *   the Free Software Foundation; either version 2 of the License, or     *
10  *   (at your option) any later version.                                   *
11  *                                                                         *
12  *   This program is distributed in the hope that it will be useful,       *
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
15  *   GNU General Public License for more details.                          *
16  *                                                                         *
17  *   You should have received a copy of the GNU General Public License     *
18  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
19  ***************************************************************************/
20
21 #ifndef ARM11_DBGTAP_H
22 #define ARM11_DBGTAP_H
23
24 #include "arm11.h"
25
26 /* ARM11 internals */
27
28 void arm11_setup_field(struct arm11_common *arm11, int num_bits,
29                 void *in_data, void *out_data, struct scan_field *field);
30 void arm11_add_IR(struct arm11_common *arm11,
31                 uint8_t instr, tap_state_t state);
32 int arm11_add_debug_SCAN_N(struct arm11_common *arm11,
33                 uint8_t chain, tap_state_t state);
34 int arm11_read_DSCR(struct arm11_common *arm11);
35 int arm11_write_DSCR(struct arm11_common *arm11, uint32_t dscr);
36
37 int arm11_run_instr_data_prepare(struct arm11_common *arm11);
38 int arm11_run_instr_data_finish(struct arm11_common *arm11);
39 int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode);
40 int arm11_run_instr_data_to_core(struct arm11_common *arm11,
41                 uint32_t opcode, uint32_t *data, size_t count);
42 int arm11_run_instr_data_to_core_noack(struct arm11_common *arm11,
43                 uint32_t opcode, uint32_t *data, size_t count);
44 int arm11_run_instr_data_to_core1(struct arm11_common *arm11,
45                 uint32_t opcode, uint32_t data);
46 int arm11_run_instr_data_from_core(struct arm11_common *arm11,
47                 uint32_t opcode, uint32_t *data, size_t count);
48 int arm11_run_instr_data_from_core_via_r0(struct arm11_common *arm11,
49                 uint32_t opcode, uint32_t *data);
50 int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11,
51                 uint32_t opcode, uint32_t data);
52
53 void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
54                 tap_state_t state);
55
56 /**
57  * Used with arm11_sc7_run to make a list of read/write commands for
58  * scan chain 7
59  */
60 struct arm11_sc7_action {
61         bool write;     /**< Access mode: true for write, false for read. */
62         uint8_t address;/**< Register address mode. Use enum #arm11_sc7 */
63         /**
64          * If write then set this to value to be written.  In read mode
65          * this receives the read value when the function returns.
66          */
67         uint32_t value;
68 };
69
70 int arm11_sc7_run(struct arm11_common *arm11,
71                 struct arm11_sc7_action *actions, size_t count);
72
73 /* Mid-level helper functions */
74 int arm11_sc7_clear_vbw(struct arm11_common *arm11);
75 int arm11_sc7_set_vcr(struct arm11_common *arm11, uint32_t value);
76
77 int arm11_read_memory_word(struct arm11_common *arm11,
78                 uint32_t address, uint32_t *result);
79
80 int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr);
81 int arm11_bpwp_flush(struct arm11_common *arm11);
82
83 #endif  /* ARM11_DBGTAP_H */