OpenOCD
arm11_dbgtap.c File Reference
Include dependency graph for arm11_dbgtap.c:

Go to the source code of this file.

Macros

#define JTAG_DEBUG(expr ...)
 

Functions

static void arm11_add_debug_inst (struct arm11_common *arm11, uint32_t inst, uint8_t *flag, tap_state_t state)
 Queue a DR scan of the ITR register. More...
 
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) More...
 
void arm11_add_dr_scan_vc (struct jtag_tap *tap, int num_fields, struct scan_field *fields, tap_state_t state)
 
void arm11_add_ir (struct arm11_common *arm11, uint8_t instr, tap_state_t state)
 Write JTAG instruction register. More...
 
static void arm11_add_ir_scan_vc (struct jtag_tap *tap, struct scan_field *fields, tap_state_t state)
 
static int arm11_bpwp_disable (struct arm_dpm *dpm, unsigned int index_t)
 
static int arm11_bpwp_enable (struct arm_dpm *dpm, unsigned int index_t, uint32_t addr, uint32_t control)
 
int arm11_bpwp_flush (struct arm11_common *arm11)
 Flush any pending breakpoint and watchpoint updates. More...
 
void arm11_dpm_deinit (struct arm11_common *arm11)
 
static int arm11_dpm_finish (struct arm_dpm *dpm)
 
int arm11_dpm_init (struct arm11_common *arm11, uint32_t didr)
 Set up high-level debug module utilities. More...
 
static int arm11_dpm_instr_read_data_dcc (struct arm_dpm *dpm, uint32_t opcode, uint32_t *data)
 
static int arm11_dpm_instr_read_data_r0 (struct arm_dpm *dpm, uint32_t opcode, uint32_t *data)
 
static int arm11_dpm_instr_write_data_dcc (struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
 
static int arm11_dpm_instr_write_data_r0 (struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
 
static int arm11_dpm_prepare (struct arm_dpm *dpm)
 
static void arm11_in_handler_scan_n (uint8_t *in_value)
 Verify data shifted out from Scan Chain Register (SCREG). More...
 
static const char * arm11_ir_to_string (uint8_t ir)
 
int arm11_read_dscr (struct arm11_common *arm11)
 Read and save the Debug Status and Control Register (DSCR). More...
 
int arm11_read_memory_word (struct arm11_common *arm11, uint32_t address, uint32_t *result)
 Read word from address. More...
 
int arm11_run_instr_data_finish (struct arm11_common *arm11)
 Cleanup after ITR/DTR operations from the arm11_run_instr... More...
 
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. More...
 
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. More...
 
int arm11_run_instr_data_prepare (struct arm11_common *arm11)
 Prepare the stage for ITR/DTR operations from the arm11_run_instr... More...
 
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. More...
 
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. More...
 
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. More...
 
static int arm11_run_instr_data_to_core_noack_inner (struct jtag_tap *tap, uint32_t opcode, uint32_t *data, size_t count)
 
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. More...
 
static int arm11_run_instr_no_data (struct arm11_common *arm11, uint32_t *opcode, size_t count)
 Execute one or more instructions via ITR. More...
 
int arm11_run_instr_no_data1 (struct arm11_common *arm11, uint32_t opcode)
 Execute one instruction via ITR. More...
 
int arm11_sc7_clear_vbw (struct arm11_common *arm11)
 Clear VCR and all breakpoints and watchpoints via scan chain 7. More...
 
int arm11_sc7_run (struct arm11_common *arm11, struct arm11_sc7_action *actions, size_t count)
 Apply reads and writes to scan chain 7. More...
 
int arm11_sc7_set_vcr (struct arm11_common *arm11, uint32_t value)
 Write VCR register. More...
 
void arm11_setup_field (struct arm11_common *arm11, int num_bits, void *out_data, void *in_data, struct scan_field *field)
 Code de-clutter: Construct struct scan_field to write out a value. More...
 
int arm11_write_dscr (struct arm11_common *arm11, uint32_t dscr)
 Write the Debug Status and Control Register (DSCR) More...
 
static struct arm11_commondpm_to_arm11 (struct arm_dpm *dpm)
 

Variables

static const tap_state_t arm11_move_drpause_idle_drpause_with_delay []
 JTAG path for arm11_run_instr_data_to_core_noack. More...
 
static const tap_state_t arm11_move_pd_to_sd_via_cd []
 
static const tap_state_t arm11_move_pi_to_si_via_ci []
 

Macro Definition Documentation

◆ JTAG_DEBUG

#define JTAG_DEBUG (   expr ...)
Value:
do { if (0) \
LOG_DEBUG(expr); } while (0)

Definition at line 23 of file arm11_dbgtap.c.

Function Documentation

◆ arm11_add_debug_inst()

static void arm11_add_debug_inst ( struct arm11_common arm11,
uint32_t  inst,
uint8_t *  flag,
tap_state_t  state 
)
static

Queue a DR scan of the ITR register.

Caller must have selected scan chain 4 (ITR), possibly using ITRSEL.

Parameters
arm11Target state variable.
instAn ARM11 processor instruction/opcode.
flagOptional parameter to retrieve the Ready flag; this address will be written when the JTAG chain is scanned.
stateThe TAP state to enter after the DR scan.

Going through the TAP_DRUPDATE state writes ITR only if Ready was previously set. Only the Ready flag is readable by the scan.

An instruction loaded into ITR is executed when going through the TAP_IDLE state only if Ready was previously set and the debug state is properly set up. Depending on the instruction, you may also need to ensure that the rDTR is ready before that Run-Test/Idle state.

Definition at line 242 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_dr_scan_vc(), arm11_setup_field(), ARRAY_SIZE, flag, JTAG_DEBUG, NULL, state, target::tap, and arm::target.

Referenced by arm11_run_instr_data_from_core(), arm11_run_instr_data_to_core(), arm11_run_instr_data_to_core_noack(), and arm11_run_instr_no_data().

◆ arm11_add_debug_scan_n()

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)

This function sets the instruction register to SCAN_N and writes the data register with the selected chain number.

http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301f/Cacbjhfg.html

Parameters
arm11Target state variable.
chainScan chain that will be selected.
statePass the final TAP state or ARM11_TAP_DEFAULT for the default value (Pause-DR).

Changes the current scan chain if needed, transitions to the specified TAP state, and leaves the IR undefined.

The chain takes effect when Update-DR is passed (usually when subsequently the INTEXT/EXTEST instructions are written).

Warning
(Obsolete) Using this twice in a row will fail. The first call will end in Pause-DR. The second call, due to the IR caching, will not go through Capture-DR when shifting in the new scan chain number. As a result the verification in arm11_in_handler_scan_n() must fail.
Remarks
This adds to the JTAG command queue but does not execute it.

Definition at line 183 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_dr_scan_vc(), arm11_add_ir(), arm11_in_handler_scan_n(), ARM11_SCAN_N, arm11_setup_field(), ARM11_TAP_DEFAULT, arm_jtag::cur_scan_chain, jtag_add_statemove(), JTAG_DEBUG, jtag_execute_queue(), jtag_execute_queue_noclear(), arm11_common::jtag_info, state, target::tap, TAP_DRPAUSE, and arm::target.

Referenced by arm11_debug_entry(), arm11_examine(), arm11_leave_debug_state(), arm11_read_dscr(), arm11_run_instr_data_finish(), arm11_run_instr_data_prepare(), arm11_sc7_run(), and arm11_write_dscr().

◆ arm11_add_dr_scan_vc()

◆ arm11_add_ir()

void arm11_add_ir ( struct arm11_common arm11,
uint8_t  instr,
tap_state_t  state 
)

Write JTAG instruction register.

Parameters
arm11Target state variable.
instrAn ARM11 DBGTAP instruction. Use enum arm11_instructions.
statePass the final TAP state or ARM11_TAP_DEFAULT for the default value (Pause-IR).
Remarks
This adds to the JTAG command queue but does not execute it.

Definition at line 124 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_ir_scan_vc(), arm11_ir_to_string(), arm11_setup_field(), ARM11_TAP_DEFAULT, buf_get_u32(), jtag_tap::cur_instr, JTAG_DEBUG, NULL, state, target::tap, TAP_IRPAUSE, and arm::target.

Referenced by arm11_add_debug_scan_n(), arm11_debug_entry(), arm11_examine(), arm11_halt(), arm11_leave_debug_state(), arm11_read_dscr(), arm11_resume(), arm11_run_instr_data_from_core(), arm11_run_instr_data_to_core(), arm11_run_instr_data_to_core_noack(), arm11_run_instr_no_data(), arm11_sc7_run(), arm11_step(), and arm11_write_dscr().

◆ arm11_add_ir_scan_vc()

static void arm11_add_ir_scan_vc ( struct jtag_tap tap,
struct scan_field fields,
tap_state_t  state 
)
static

◆ arm11_bpwp_disable()

static int arm11_bpwp_disable ( struct arm_dpm dpm,
unsigned int  index_t 
)
static

◆ arm11_bpwp_enable()

static int arm11_bpwp_enable ( struct arm_dpm dpm,
unsigned int  index_t,
uint32_t  addr,
uint32_t  control 
)
static

◆ arm11_bpwp_flush()

int arm11_bpwp_flush ( struct arm11_common arm11)

Flush any pending breakpoint and watchpoint updates.

Definition at line 1110 of file arm11_dbgtap.c.

References arm11_sc7_run(), arm11_common::bpwp_actions, arm11_common::bpwp_n, and ERROR_OK.

Referenced by arm11_dpm_init(), and arm11_leave_debug_state().

◆ arm11_dpm_deinit()

void arm11_dpm_deinit ( struct arm11_common arm11)

◆ arm11_dpm_finish()

static int arm11_dpm_finish ( struct arm_dpm dpm)
static

Definition at line 1008 of file arm11_dbgtap.c.

References arm11_run_instr_data_finish(), arm11_common::dpm, and dpm_to_arm11().

Referenced by arm11_dpm_init().

◆ arm11_dpm_init()

◆ arm11_dpm_instr_read_data_dcc()

static int arm11_dpm_instr_read_data_dcc ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t *  data 
)
static

Definition at line 1027 of file arm11_dbgtap.c.

References arm11_run_instr_data_from_core(), arm11_common::dpm, and dpm_to_arm11().

Referenced by arm11_dpm_init().

◆ arm11_dpm_instr_read_data_r0()

static int arm11_dpm_instr_read_data_r0 ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t *  data 
)
static

◆ arm11_dpm_instr_write_data_dcc()

static int arm11_dpm_instr_write_data_dcc ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t  data 
)
static

Definition at line 1013 of file arm11_dbgtap.c.

References arm11_run_instr_data_to_core(), arm11_common::dpm, and dpm_to_arm11().

Referenced by arm11_dpm_init().

◆ arm11_dpm_instr_write_data_r0()

static int arm11_dpm_instr_write_data_r0 ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t  data 
)
static

Definition at line 1020 of file arm11_dbgtap.c.

References arm11_run_instr_data_to_core_via_r0(), arm11_common::dpm, and dpm_to_arm11().

Referenced by arm11_dpm_init().

◆ arm11_dpm_prepare()

static int arm11_dpm_prepare ( struct arm_dpm dpm)
static

Definition at line 1003 of file arm11_dbgtap.c.

References arm11_run_instr_data_prepare(), arm11_common::dpm, and dpm_to_arm11().

Referenced by arm11_dpm_init().

◆ arm11_in_handler_scan_n()

static void arm11_in_handler_scan_n ( uint8_t *  in_value)
static

Verify data shifted out from Scan Chain Register (SCREG).

Definition at line 145 of file arm11_dbgtap.c.

References ERROR_FAIL, scan_field::in_value, jtag_set_error(), and LOG_ERROR.

Referenced by arm11_add_debug_scan_n().

◆ arm11_ir_to_string()

static const char* arm11_ir_to_string ( uint8_t  ir)
static

◆ arm11_read_dscr()

int arm11_read_dscr ( struct arm11_common arm11)

Read and save the Debug Status and Control Register (DSCR).

Parameters
arm11Target state variable.
Returns
Error status; arm11->dscr is updated on success.
Remarks
This is a stand-alone function that executes the JTAG command queue. It does not require the ARM11 debug TAP to be in any particular state.

Definition at line 265 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_debug_scan_n(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_INTEST, arm11_setup_field(), ARM11_TAP_DEFAULT, CHECK_RETVAL, arm11_common::dscr, ERROR_OK, JTAG_DEBUG, jtag_execute_queue(), NULL, target::tap, TAP_DRPAUSE, and arm::target.

Referenced by arm11_check_init(), arm11_debug_entry(), arm11_halt(), arm11_leave_debug_state(), arm11_resume(), and arm11_step().

◆ arm11_read_memory_word()

int arm11_read_memory_word ( struct arm11_common arm11,
uint32_t  address,
uint32_t *  result 
)

Read word from address.

Parameters
arm11Target state variable.
addressMemory address to be read
resultPointer where to store result

Definition at line 975 of file arm11_dbgtap.c.

References arm11_sc7_action::address, arm11_run_instr_data_finish(), arm11_run_instr_data_from_core(), arm11_run_instr_data_prepare(), arm11_run_instr_data_to_core1(), CHECK_RETVAL, and ERROR_OK.

Referenced by arm11_step().

◆ arm11_run_instr_data_finish()

int arm11_run_instr_data_finish ( struct arm11_common arm11)

Cleanup after ITR/DTR operations from the arm11_run_instr...

group of functions

Put arm11_run_instr_data_prepare() and arm11_run_instr_data_finish() around a block of arm11_run_instr_... calls.

Any IDLE can lead to an instruction execution when scan chains 4 or 5 are selected and the IR holds INTEST or EXTEST. So we must disable that before any following activities lead to an IDLE.

Parameters
arm11Target state variable.

Definition at line 358 of file arm11_dbgtap.c.

References arm11_add_debug_scan_n(), and ARM11_TAP_DEFAULT.

Referenced by arm11_debug_entry(), arm11_dpm_finish(), arm11_leave_debug_state(), arm11_read_memory_inner(), arm11_read_memory_word(), and arm11_write_memory_inner().

◆ arm11_run_instr_data_from_core()

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.

Caller guarantees that processor is in debug state, that DSCR_ITR_EN is set, the ITR Ready flag is set (as seen on the previous entry to TAP_DRCAPTURE), and the DSCR sticky abort flag is clear.

The executed instruction must write data to DTR.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode
dataPointer to an array that receives the data words from the core
countNumber of data words and instruction repetitions

Definition at line 723 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_debug_inst(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_INTEST, ARM11_ITRSEL, arm11_setup_field(), ARM11_TAP_DEFAULT, ARRAY_SIZE, CHECK_RETVAL, count, ERROR_FAIL, ERROR_OK, JTAG_DEBUG, jtag_execute_queue(), LOG_WARNING, NULL, target::tap, TAP_DRPAUSE, TAP_IDLE, arm::target, and timeval_ms().

Referenced by arm11_dpm_instr_read_data_dcc(), arm11_read_memory_inner(), arm11_read_memory_word(), arm11_run_instr_data_from_core_via_r0(), and arm11_write_memory_inner().

◆ arm11_run_instr_data_from_core_via_r0()

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.

The first executed instruction (opcode) should write data to r0.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode to write r0 with the value of interest
dataPointer to a data word that receives the value from r0 after opcode was executed.

Definition at line 789 of file arm11_dbgtap.c.

References arm11_run_instr_data_from_core(), arm11_run_instr_no_data1(), and ERROR_OK.

Referenced by arm11_debug_entry(), and arm11_dpm_instr_read_data_r0().

◆ arm11_run_instr_data_prepare()

int arm11_run_instr_data_prepare ( struct arm11_common arm11)

Prepare the stage for ITR/DTR operations from the arm11_run_instr...

group of functions.

Put arm11_run_instr_data_prepare() and arm11_run_instr_data_finish() around a block of arm11_run_instr_... calls.

Select scan chain 5 to allow quick access to DTR. When scan chain 4 is needed to put in a register the ITRSel instruction shortcut is used instead of actually changing the Scan_N register.

Parameters
arm11Target state variable.

Definition at line 339 of file arm11_dbgtap.c.

References arm11_add_debug_scan_n(), and ARM11_TAP_DEFAULT.

Referenced by arm11_debug_entry(), arm11_dpm_prepare(), arm11_leave_debug_state(), arm11_read_memory_inner(), arm11_read_memory_word(), and arm11_write_memory_inner().

◆ arm11_run_instr_data_to_core()

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.

Caller guarantees that processor is in debug state, that DSCR_ITR_EN is set, the ITR Ready flag is set (as seen on the previous entry to TAP_DRCAPTURE), and the DSCR sticky abort flag is clear.

The executed instruction must read data from DTR.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode
dataPointer to the data words to be passed to the core
countNumber of data words and instruction repetitions

Definition at line 446 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_debug_inst(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_EXTEST, ARM11_INTEST, ARM11_ITRSEL, arm11_setup_field(), ARM11_TAP_DEFAULT, ARRAY_SIZE, CHECK_RETVAL, count, ERROR_FAIL, ERROR_OK, JTAG_DEBUG, jtag_execute_queue(), LOG_WARNING, NULL, target::tap, TAP_DRPAUSE, TAP_IDLE, arm::target, and timeval_ms().

Referenced by arm11_dpm_instr_write_data_dcc(), arm11_run_instr_data_to_core1(), and arm11_write_memory_inner().

◆ arm11_run_instr_data_to_core1()

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.

The executed instruction must read data from DTR.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode
dataData word to be passed to the core via DTR

Definition at line 700 of file arm11_dbgtap.c.

References arm11_run_instr_data_to_core().

Referenced by arm11_read_memory_inner(), arm11_read_memory_word(), arm11_run_instr_data_to_core_via_r0(), and arm11_write_memory_inner().

◆ arm11_run_instr_data_to_core_noack()

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.

Caller guarantees that processor is in debug state, that DSCR_ITR_EN is set, the ITR Ready flag is set (as seen on the previous entry to TAP_DRCAPTURE), and the DSCR sticky abort flag is clear.

No Ready check during transmission.

The executed instruction must read data from DTR.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode
dataPointer to the data words to be passed to the core
countNumber of data words and instruction repetitions

Definition at line 632 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_debug_inst(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_EXTEST, ARM11_INTEST, ARM11_ITRSEL, arm11_run_instr_data_to_core_noack_inner(), arm11_setup_field(), ARM11_TAP_DEFAULT, ARRAY_SIZE, count, ERROR_FAIL, ERROR_OK, scan_field::in_value, jtag_execute_queue(), LOG_ERROR, NULL, target::tap, TAP_DRPAUSE, and arm::target.

Referenced by arm11_write_memory_inner().

◆ arm11_run_instr_data_to_core_noack_inner()

static int arm11_run_instr_data_to_core_noack_inner ( struct jtag_tap tap,
uint32_t  opcode,
uint32_t *  data,
size_t  count 
)
static

◆ arm11_run_instr_data_to_core_via_r0()

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.

The final executed instruction (opcode) should read data from r0.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode to read r0 act upon it
dataData word that will be written to r0 before opcode is executed

Definition at line 816 of file arm11_dbgtap.c.

References arm11_run_instr_data_to_core1(), arm11_run_instr_no_data1(), and ERROR_OK.

Referenced by arm11_debug_entry(), arm11_dpm_instr_write_data_r0(), and arm11_leave_debug_state().

◆ arm11_run_instr_no_data()

static int arm11_run_instr_no_data ( struct arm11_common arm11,
uint32_t *  opcode,
size_t  count 
)
static

Execute one or more instructions via ITR.

Caller guarantees that processor is in debug state, that DSCR_ITR_EN is set, the ITR Ready flag is set (as seen on the previous entry to TAP_DRCAPTURE), and the DSCR sticky abort flag is clear.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodePointer to sequence of ARM opcodes
countNumber of opcodes to execute

Definition at line 377 of file arm11_dbgtap.c.

References arm11_add_debug_inst(), arm11_add_ir(), ARM11_ITRSEL, ARM11_TAP_DEFAULT, CHECK_RETVAL, count, ERROR_FAIL, ERROR_OK, flag, jtag_execute_queue(), LOG_WARNING, NULL, TAP_DRPAUSE, TAP_IDLE, and timeval_ms().

Referenced by arm11_run_instr_no_data1().

◆ arm11_run_instr_no_data1()

int arm11_run_instr_no_data1 ( struct arm11_common arm11,
uint32_t  opcode 
)

Execute one instruction via ITR.

Precondition
arm11_run_instr_data_prepare() / arm11_run_instr_data_finish() block
Parameters
arm11Target state variable.
opcodeARM opcode

Definition at line 423 of file arm11_dbgtap.c.

References arm11_run_instr_no_data().

Referenced by arm11_debug_entry(), arm11_read_memory_inner(), arm11_run_instr_data_from_core_via_r0(), arm11_run_instr_data_to_core_via_r0(), and arm11_write_memory_inner().

◆ arm11_sc7_clear_vbw()

int arm11_sc7_clear_vbw ( struct arm11_common arm11)

Clear VCR and all breakpoints and watchpoints via scan chain 7.

Parameters
arm11Target state variable.

Definition at line 928 of file arm11_dbgtap.c.

References arm11_sc7_action::address, ARM11_SC7_BCR0, arm11_sc7_run(), ARM11_SC7_VCR, arm11_common::brp, arm11_sc7_action::value, and arm11_sc7_action::write.

Referenced by arm11_check_init(), arm11_resume(), and arm11_step().

◆ arm11_sc7_run()

int arm11_sc7_run ( struct arm11_common arm11,
struct arm11_sc7_action actions,
size_t  count 
)

Apply reads and writes to scan chain 7.

See also
struct arm11_sc7_action
Parameters
arm11Target state variable.
actionsA list of read and/or write instructions
countNumber of instructions in the list.

Definition at line 840 of file arm11_dbgtap.c.

References arm11_sc7_action::address, arm11_common::arm, arm11_add_debug_scan_n(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_EXTEST, arm11_setup_field(), ARM11_TAP_DEFAULT, ARRAY_SIZE, CHECK_RETVAL, count, ERROR_FAIL, ERROR_OK, JTAG_DEBUG, jtag_execute_queue(), LOG_WARNING, target::tap, TAP_DRPAUSE, arm::target, timeval_ms(), arm11_sc7_action::value, and arm11_sc7_action::write.

Referenced by arm11_bpwp_flush(), arm11_resume(), arm11_sc7_clear_vbw(), arm11_sc7_set_vcr(), and arm11_step().

◆ arm11_sc7_set_vcr()

int arm11_sc7_set_vcr ( struct arm11_common arm11,
uint32_t  value 
)

Write VCR register.

Parameters
arm11Target state variable.
valueValue to be written

Definition at line 957 of file arm11_dbgtap.c.

References arm11_sc7_action::address, arm11_sc7_run(), ARM11_SC7_VCR, arm11_sc7_action::value, and arm11_sc7_action::write.

Referenced by arm11_assert_reset(), arm11_deassert_reset(), and arm11_resume().

◆ arm11_setup_field()

void arm11_setup_field ( struct arm11_common arm11,
int  num_bits,
void *  out_data,
void *  in_data,
struct scan_field field 
)

Code de-clutter: Construct struct scan_field to write out a value.

Parameters
arm11Target state variable.
num_bitsLength of the data field
out_datapointer to the data that will be sent out (data is read when it is added to the JTAG queue)
in_datapointer to the memory that will receive data that was clocked in (data is written when the JTAG queue is executed)
fieldtarget data structure that will be initialized

Definition at line 75 of file arm11_dbgtap.c.

References scan_field::in_value, scan_field::num_bits, and scan_field::out_value.

Referenced by arm11_add_debug_inst(), arm11_add_debug_scan_n(), arm11_add_ir(), arm11_debug_entry(), arm11_examine(), arm11_leave_debug_state(), arm11_read_dscr(), arm11_run_instr_data_from_core(), arm11_run_instr_data_to_core(), arm11_run_instr_data_to_core_noack(), arm11_sc7_run(), and arm11_write_dscr().

◆ arm11_write_dscr()

int arm11_write_dscr ( struct arm11_common arm11,
uint32_t  dscr 
)

Write the Debug Status and Control Register (DSCR)

same as CP14 c1

Parameters
arm11Target state variable.
dscrDSCR content
Remarks
This is a stand-alone function that executes the JTAG command queue.

Definition at line 301 of file arm11_dbgtap.c.

References arm11_common::arm, arm11_add_debug_scan_n(), arm11_add_dr_scan_vc(), arm11_add_ir(), ARM11_EXTEST, arm11_setup_field(), ARM11_TAP_DEFAULT, CHECK_RETVAL, arm11_common::dscr, ERROR_OK, JTAG_DEBUG, jtag_execute_queue(), NULL, target::tap, TAP_DRPAUSE, and arm::target.

Referenced by arm11_check_init(), arm11_debug_entry(), and arm11_leave_debug_state().

◆ dpm_to_arm11()

Variable Documentation

◆ arm11_move_drpause_idle_drpause_with_delay

const tap_state_t arm11_move_drpause_idle_drpause_with_delay[]
static
Initial value:
= {
}
@ TAP_DRCAPTURE
Definition: jtag.h:47
@ TAP_DRSELECT
Definition: jtag.h:48
@ TAP_DREXIT2
Definition: jtag.h:41
@ TAP_IDLE
Definition: jtag.h:53
@ TAP_DRSHIFT
Definition: jtag.h:43
@ TAP_DRUPDATE
Definition: jtag.h:46

JTAG path for arm11_run_instr_data_to_core_noack.

The repeated TAP_IDLE's do not cause a repeated execution if passed without leaving the state.

Since this is more than 7 bits (adjustable via adding more TAP_IDLE's) it produces an artificial delay in the lower layer (FT2232) that is long enough to finish execution on the core but still shorter than any manually inducible delays.

To disable this code, try "memwrite burst false"

FIX!!! should we use multiple TAP_IDLE here or not???

https://lists.berlios.de/pipermail/openocd-development/2009-July/009698.html https://lists.berlios.de/pipermail/openocd-development/2009-August/009865.html

Definition at line 545 of file arm11_dbgtap.c.

Referenced by arm11_run_instr_data_to_core_noack_inner().

◆ arm11_move_pd_to_sd_via_cd

const tap_state_t arm11_move_pd_to_sd_via_cd[]
static
Initial value:

Definition at line 49 of file arm11_dbgtap.c.

Referenced by arm11_add_dr_scan_vc().

◆ arm11_move_pi_to_si_via_ci

const tap_state_t arm11_move_pi_to_si_via_ci[]
static
Initial value:
= {
}
@ TAP_IRCAPTURE
Definition: jtag.h:55
@ TAP_IRSELECT
Definition: jtag.h:45
@ TAP_IRUPDATE
Definition: jtag.h:54
@ TAP_IREXIT2
Definition: jtag.h:49
@ TAP_IRSHIFT
Definition: jtag.h:51

Definition at line 34 of file arm11_dbgtap.c.

Referenced by arm11_add_ir_scan_vc().