OpenOCD
arm11_dbgtap.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2008 digenius technology GmbH. *
5  * Michael Bruck *
6  * *
7  * Copyright (C) 2008,2009 Oyvind Harboe oyvind.harboe@zylin.com *
8  ***************************************************************************/
9 
10 #ifndef OPENOCD_TARGET_ARM11_DBGTAP_H
11 #define OPENOCD_TARGET_ARM11_DBGTAP_H
12 
13 #include "arm11.h"
14 
15 /* ARM11 internals */
16 
17 void arm11_setup_field(struct arm11_common *arm11, int num_bits,
18  void *in_data, void *out_data, struct scan_field *field);
19 void arm11_add_ir(struct arm11_common *arm11,
20  uint8_t instr, tap_state_t state);
21 int arm11_add_debug_scan_n(struct arm11_common *arm11,
22  uint8_t chain, tap_state_t state);
23 int arm11_read_dscr(struct arm11_common *arm11);
24 int arm11_write_dscr(struct arm11_common *arm11, uint32_t dscr);
25 
27 int arm11_run_instr_data_finish(struct arm11_common *arm11);
28 int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode);
30  uint32_t opcode, uint32_t *data, size_t count);
32  uint32_t opcode, uint32_t *data, size_t count);
34  uint32_t opcode, uint32_t data);
36  uint32_t opcode, uint32_t *data, size_t count);
38  uint32_t opcode, uint32_t *data);
40  uint32_t opcode, uint32_t data);
41 
42 void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
44 
50  bool write;
51  uint8_t address;
56  uint32_t value;
57 };
58 
59 int arm11_sc7_run(struct arm11_common *arm11,
60  struct arm11_sc7_action *actions, size_t count);
61 
62 /* Mid-level helper functions */
63 int arm11_sc7_clear_vbw(struct arm11_common *arm11);
64 int arm11_sc7_set_vcr(struct arm11_common *arm11, uint32_t value);
65 
66 int arm11_read_memory_word(struct arm11_common *arm11,
67  uint32_t address, uint32_t *result);
68 
69 int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr);
70 void arm11_dpm_deinit(struct arm11_common *arm11);
71 int arm11_bpwp_flush(struct arm11_common *arm11);
72 
73 #endif /* OPENOCD_TARGET_ARM11_DBGTAP_H */
int arm11_run_instr_data_to_core1(struct arm11_common *arm11, uint32_t opcode, uint32_t data)
Execute an instruction via ITR while handing data into the core via DTR.
Definition: arm11_dbgtap.c:704
int arm11_run_instr_data_to_core_noack(struct arm11_common *arm11, uint32_t opcode, uint32_t *data, size_t count)
Execute one instruction via ITR repeatedly while passing data to the core via DTR on each execution.
Definition: arm11_dbgtap.c:636
int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11, uint32_t opcode, uint32_t data)
Load data into core via DTR then move it to r0 then execute one instruction via ITR.
Definition: arm11_dbgtap.c:820
void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields, tap_state_t state)
Definition: arm11_dbgtap.c:54
int arm11_bpwp_flush(struct arm11_common *arm11)
Flush any pending breakpoint and watchpoint updates.
int arm11_read_memory_word(struct arm11_common *arm11, uint32_t address, uint32_t *result)
Read word from address.
Definition: arm11_dbgtap.c:980
int arm11_read_dscr(struct arm11_common *arm11)
Read and save the Debug Status and Control Register (DSCR).
Definition: arm11_dbgtap.c:265
int arm11_write_dscr(struct arm11_common *arm11, uint32_t dscr)
Write the Debug Status and Control Register (DSCR)
Definition: arm11_dbgtap.c:303
int arm11_run_instr_data_from_core(struct arm11_common *arm11, uint32_t opcode, uint32_t *data, size_t count)
Execute one instruction via ITR repeatedly while reading data from the core via DTR on each execution...
Definition: arm11_dbgtap.c:727
int arm11_sc7_clear_vbw(struct arm11_common *arm11)
Clear VCR and all breakpoints and watchpoints via scan chain 7.
Definition: arm11_dbgtap.c:933
int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr)
Set up high-level debug module utilities.
void arm11_add_ir(struct arm11_common *arm11, uint8_t instr, tap_state_t state)
Write JTAG instruction register.
Definition: arm11_dbgtap.c:124
int arm11_run_instr_data_finish(struct arm11_common *arm11)
Cleanup after ITR/DTR operations from the arm11_run_instr...
Definition: arm11_dbgtap.c:362
int arm11_run_instr_data_prepare(struct arm11_common *arm11)
Prepare the stage for ITR/DTR operations from the arm11_run_instr...
Definition: arm11_dbgtap.c:343
int arm11_run_instr_data_from_core_via_r0(struct arm11_common *arm11, uint32_t opcode, uint32_t *data)
Execute one instruction via ITR then load r0 into DTR and read DTR from core.
Definition: arm11_dbgtap.c:793
void arm11_setup_field(struct arm11_common *arm11, int num_bits, void *in_data, void *out_data, struct scan_field *field)
Code de-clutter: Construct struct scan_field to write out a value.
Definition: arm11_dbgtap.c:75
int arm11_sc7_set_vcr(struct arm11_common *arm11, uint32_t value)
Write VCR register.
Definition: arm11_dbgtap.c:962
void arm11_dpm_deinit(struct arm11_common *arm11)
int arm11_run_instr_data_to_core(struct arm11_common *arm11, uint32_t opcode, uint32_t *data, size_t count)
Execute one instruction via ITR repeatedly while passing data to the core via DTR on each execution.
Definition: arm11_dbgtap.c:450
int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode)
Execute one instruction via ITR.
Definition: arm11_dbgtap.c:427
int arm11_add_debug_scan_n(struct arm11_common *arm11, uint8_t chain, tap_state_t state)
Select and write to Scan Chain Register (SCREG)
Definition: arm11_dbgtap.c:183
int arm11_sc7_run(struct arm11_common *arm11, struct arm11_sc7_action *actions, size_t count)
Apply reads and writes to scan chain 7.
Definition: arm11_dbgtap.c:844
enum tap_state tap_state_t
Defines JTAG Test Access Port states.
Used with arm11_sc7_run to make a list of read/write commands for scan chain 7.
Definition: arm11_dbgtap.h:49
uint8_t address
Register address mode.
Definition: arm11_dbgtap.h:51
uint32_t value
If write then set this to value to be written.
Definition: arm11_dbgtap.h:56
bool write
Access mode: true for write, false for read.
Definition: arm11_dbgtap.h:50
Definition: jtag.h:100
This structure defines a single scan field in the scan.
Definition: jtag.h:86
uint8_t state[4]
Definition: vdebug.c:21
uint8_t count[4]
Definition: vdebug.c:22