OpenOCD
|
Go to the source code of this file.
Macros | |
#define | CLOCK_IDLE() 0 |
Functions | |
static void | bitbang_end_state (tap_state_t state) |
int | bitbang_execute_queue (void) |
static int | bitbang_execute_tms (struct jtag_command *cmd) |
Clock a bunch of TMS (or SWDIO) transitions, to change the JTAG (or SWD) state machine. More... | |
static int | bitbang_path_move (struct pathmove_command *cmd) |
static int | bitbang_runtest (int num_cycles) |
static int | bitbang_scan (bool ir_scan, enum scan_type type, uint8_t *buffer, unsigned scan_size) |
static int | bitbang_stableclocks (int num_cycles) |
Function bitbang_stableclocks issues a number of clock cycles while staying in a stable state. More... | |
static int | bitbang_state_move (int skip) |
static void | bitbang_swd_exchange (bool rnw, uint8_t buf[], unsigned int offset, unsigned int bit_cnt) |
static int | bitbang_swd_init (void) |
static void | bitbang_swd_read_reg (uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk) |
static int | bitbang_swd_run_queue (void) |
static int | bitbang_swd_switch_seq (enum swd_special_seq seq) |
static void | bitbang_swd_write_reg (uint8_t cmd, uint32_t value, uint32_t ap_delay_clk) |
static void | swd_clear_sticky_errors (void) |
Variables | |
struct bitbang_interface * | bitbang_interface |
const struct swd_driver | bitbang_swd |
static int | queued_retval |
|
static |
Definition at line 57 of file bitbang.c.
References state, tap_is_state_stable(), and tap_set_end_state().
Referenced by bitbang_execute_queue(), bitbang_runtest(), and bitbang_scan().
int bitbang_execute_queue | ( | void | ) |
Definition at line 281 of file bitbang.c.
References bitbang_end_state(), bitbang_execute_tms(), bitbang_path_move(), bitbang_runtest(), bitbang_scan(), bitbang_stableclocks(), bitbang_state_move(), bitbang_interface::blink, buffer, cmd, ERROR_FAIL, ERROR_JTAG_QUEUE_FAILED, ERROR_OK, jtag_build_buffer(), jtag_command_queue, JTAG_PATHMOVE, jtag_read_buffer(), JTAG_RUNTEST, JTAG_SCAN, jtag_scan_type(), JTAG_SLEEP, jtag_sleep(), JTAG_STABLECLOCKS, JTAG_TLR_RESET, JTAG_TMS, LOG_DEBUG_IO, LOG_ERROR, tap_state_name(), and type.
|
static |
Clock a bunch of TMS (or SWDIO) transitions, to change the JTAG (or SWD) state machine.
Definition at line 87 of file bitbang.c.
References bits, CLOCK_IDLE, cmd, ERROR_FAIL, ERROR_OK, LOG_DEBUG_IO, and bitbang_interface::write.
Referenced by bitbang_execute_queue().
|
static |
Definition at line 108 of file bitbang.c.
References CLOCK_IDLE, cmd, ERROR_FAIL, ERROR_OK, LOG_ERROR, tap_get_state(), tap_set_end_state(), tap_set_state, tap_state_name(), tap_state_transition(), and bitbang_interface::write.
Referenced by bitbang_execute_queue().
|
static |
Definition at line 144 of file bitbang.c.
References bitbang_end_state(), bitbang_state_move(), CLOCK_IDLE, ERROR_FAIL, ERROR_OK, tap_get_end_state(), tap_get_state(), TAP_IDLE, and bitbang_interface::write.
Referenced by bitbang_execute_queue().
|
static |
Definition at line 192 of file bitbang.c.
References BB_HIGH, BB_LOW, bitbang_end_state(), bitbang_state_move(), bitbang_interface::buf_size, buffer, ERROR_FAIL, ERROR_OK, bitbang_interface::read, bitbang_interface::read_sample, bitbang_interface::sample, SCAN_IN, SCAN_OUT, TAP_DRSHIFT, tap_get_end_state(), tap_get_state(), TAP_IRSHIFT, type, and bitbang_interface::write.
Referenced by bitbang_execute_queue().
|
static |
Function bitbang_stableclocks issues a number of clock cycles while staying in a stable state.
Because the TMS value required to stay in the RESET state is a 1, whereas the TMS value required to stay in any of the other stable states is a 0, this function checks the current stable state to decide on the value of TMS to use.
Definition at line 176 of file bitbang.c.
References ERROR_FAIL, ERROR_OK, tap_get_state(), TAP_RESET, and bitbang_interface::write.
Referenced by bitbang_execute_queue().
|
static |
Definition at line 63 of file bitbang.c.
References CLOCK_IDLE, ERROR_FAIL, ERROR_OK, tap_get_end_state(), tap_get_state(), tap_get_tms_path(), tap_get_tms_path_len(), tap_set_state, and bitbang_interface::write.
Referenced by bitbang_execute_queue(), bitbang_runtest(), and bitbang_scan().
|
static |
Definition at line 381 of file bitbang.c.
References bitbang_interface::blink, offset, bitbang_interface::swd_write, and bitbang_interface::swdio_read.
Referenced by bitbang_swd_read_reg(), bitbang_swd_switch_seq(), and bitbang_swd_write_reg().
|
static |
|
static |
Definition at line 456 of file bitbang.c.
References bitbang_swd_exchange(), buf_get_u32(), cmd, DIV_ROUND_UP, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_DEBUG_IO, LOG_ERROR, NULL, parity(), parity_u32(), queued_retval, SWD_ACK_FAULT, SWD_ACK_OK, swd_ack_to_error_code(), SWD_ACK_WAIT, swd_clear_sticky_errors(), SWD_CMD_A32, SWD_CMD_APNDP, SWD_CMD_PARK, SWD_CMD_RNW, SWD_CMD_START, and bitbang_interface::swdio_drive.
|
static |
Definition at line 411 of file bitbang.c.
References bitbang_swd_exchange(), DORMANT_TO_JTAG, DORMANT_TO_SWD, ERROR_FAIL, ERROR_OK, JTAG_TO_DORMANT, JTAG_TO_SWD, LINE_RESET, LOG_DEBUG, LOG_DEBUG_IO, LOG_ERROR, swd_seq_dormant_to_jtag, swd_seq_dormant_to_jtag_len, swd_seq_dormant_to_swd, swd_seq_dormant_to_swd_len, swd_seq_jtag_to_dormant, swd_seq_jtag_to_dormant_len, swd_seq_jtag_to_swd, swd_seq_jtag_to_swd_len, swd_seq_line_reset, swd_seq_line_reset_len, swd_seq_swd_to_dormant, swd_seq_swd_to_dormant_len, swd_seq_swd_to_jtag, swd_seq_swd_to_jtag_len, SWD_TO_DORMANT, and SWD_TO_JTAG.
|
static |
Definition at line 506 of file bitbang.c.
References bitbang_swd_exchange(), buf_get_u32(), buf_set_u32(), cmd, DIV_ROUND_UP, ERROR_OK, LOG_DEBUG, LOG_DEBUG_IO, NULL, parity_u32(), queued_retval, SWD_ACK_FAULT, SWD_ACK_OK, swd_ack_to_error_code(), SWD_ACK_WAIT, swd_clear_sticky_errors(), SWD_CMD_A32, SWD_CMD_APNDP, SWD_CMD_PARK, swd_cmd_returns_ack(), SWD_CMD_RNW, SWD_CMD_START, and bitbang_interface::swdio_drive.
Referenced by swd_clear_sticky_errors().
|
static |
Definition at line 450 of file bitbang.c.
References bitbang_swd_write_reg(), DP_ABORT, ORUNERRCLR, STKCMPCLR, STKERRCLR, swd_cmd(), and WDERRCLR.
Referenced by bitbang_swd_read_reg(), and bitbang_swd_write_reg().
struct bitbang_interface* bitbang_interface |
const struct swd_driver bitbang_swd |
|
static |
Definition at line 373 of file bitbang.c.
Referenced by bitbang_swd_read_reg(), and bitbang_swd_write_reg().