target/aarch64: Call aarch64_init_debug_access() earlier in aarch64_deassert_reset()
[openocd.git] / src / target / arm11_dbgtap.h
blob541434edc4ea00e502461601490907b0c9ff74d9
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 ***************************************************************************/
21 #ifndef OPENOCD_TARGET_ARM11_DBGTAP_H
22 #define OPENOCD_TARGET_ARM11_DBGTAP_H
24 #include "arm11.h"
26 /* ARM11 internals */
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);
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);
53 void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
54 tap_state_t state);
56 /**
57 * Used with arm11_sc7_run to make a list of read/write commands for
58 * scan chain 7
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.
67 uint32_t value;
70 int arm11_sc7_run(struct arm11_common *arm11,
71 struct arm11_sc7_action *actions, size_t count);
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);
77 int arm11_read_memory_word(struct arm11_common *arm11,
78 uint32_t address, uint32_t *result);
80 int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr);
81 int arm11_bpwp_flush(struct arm11_common *arm11);
83 #endif /* OPENOCD_TARGET_ARM11_DBGTAP_H */