mirror of
https://github.com/linux-msm/openocd.git
synced 2026-02-25 13:15:07 -08:00
jtag: drop useless typedef tap_state_t
No need to use a typedef for an enum. Drop it. Change-Id: I9eb2dc4f926671c5bb44e61453d92880e3036848 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8709 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
This commit is contained in:
@@ -68,7 +68,7 @@ static int str9xpec_erase_area(struct flash_bank *bank, unsigned int first,
|
||||
static int str9xpec_set_address(struct flash_bank *bank, uint8_t sector);
|
||||
static int str9xpec_write_options(struct flash_bank *bank);
|
||||
|
||||
static int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
|
||||
static int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, enum tap_state end_state)
|
||||
{
|
||||
if (!tap)
|
||||
return ERROR_TARGET_INVALID;
|
||||
|
||||
@@ -40,26 +40,26 @@ struct scan_command {
|
||||
/** pointer to an array of data scan fields */
|
||||
struct scan_field *fields;
|
||||
/** state in which JTAG commands should finish */
|
||||
tap_state_t end_state;
|
||||
enum tap_state end_state;
|
||||
};
|
||||
|
||||
struct statemove_command {
|
||||
/** state in which JTAG commands should finish */
|
||||
tap_state_t end_state;
|
||||
enum tap_state end_state;
|
||||
};
|
||||
|
||||
struct pathmove_command {
|
||||
/** number of states in *path */
|
||||
unsigned int num_states;
|
||||
/** states that have to be passed */
|
||||
tap_state_t *path;
|
||||
enum tap_state *path;
|
||||
};
|
||||
|
||||
struct runtest_command {
|
||||
/** number of cycles to spend in Run-Test/Idle state */
|
||||
unsigned int num_cycles;
|
||||
/** state in which JTAG commands should finish */
|
||||
tap_state_t end_state;
|
||||
enum tap_state end_state;
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ struct reset_command {
|
||||
|
||||
struct end_state_command {
|
||||
/** state in which JTAG commands should finish */
|
||||
tap_state_t end_state;
|
||||
enum tap_state end_state;
|
||||
};
|
||||
|
||||
struct sleep_command {
|
||||
|
||||
@@ -48,8 +48,8 @@ static void jtag_add_scan_check(struct jtag_tap *active,
|
||||
void (*jtag_add_scan)(struct jtag_tap *active,
|
||||
int in_num_fields,
|
||||
const struct scan_field *in_fields,
|
||||
tap_state_t state),
|
||||
int in_num_fields, struct scan_field *in_fields, tap_state_t state);
|
||||
enum tap_state state),
|
||||
int in_num_fields, struct scan_field *in_fields, enum tap_state state);
|
||||
|
||||
static int jtag_error_clear(void);
|
||||
|
||||
@@ -87,7 +87,7 @@ static int jtag_srst = -1;
|
||||
static struct jtag_tap *__jtag_all_taps;
|
||||
|
||||
static enum reset_types jtag_reset_config = RESET_NONE;
|
||||
tap_state_t cmd_queue_cur_state = TAP_RESET;
|
||||
enum tap_state cmd_queue_cur_state = TAP_RESET;
|
||||
|
||||
static bool jtag_verify_capture_ir = true;
|
||||
static bool jtag_verify = true;
|
||||
@@ -350,7 +350,7 @@ static void jtag_checks(void)
|
||||
assert(jtag_trst == 0);
|
||||
}
|
||||
|
||||
static void jtag_prelude(tap_state_t state)
|
||||
static void jtag_prelude(enum tap_state state)
|
||||
{
|
||||
jtag_checks();
|
||||
|
||||
@@ -360,7 +360,7 @@ static void jtag_prelude(tap_state_t state)
|
||||
}
|
||||
|
||||
void jtag_add_ir_scan_noverify(struct jtag_tap *active, const struct scan_field *in_fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
jtag_prelude(state);
|
||||
|
||||
@@ -371,13 +371,13 @@ void jtag_add_ir_scan_noverify(struct jtag_tap *active, const struct scan_field
|
||||
static void jtag_add_ir_scan_noverify_callback(struct jtag_tap *active,
|
||||
int dummy,
|
||||
const struct scan_field *in_fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
jtag_add_ir_scan_noverify(active, in_fields, state);
|
||||
}
|
||||
|
||||
/* If fields->in_value is filled out, then the captured IR value will be checked */
|
||||
void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap_state_t state)
|
||||
void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, enum tap_state state)
|
||||
{
|
||||
assert(state != TAP_RESET);
|
||||
|
||||
@@ -396,7 +396,7 @@ void jtag_add_ir_scan(struct jtag_tap *active, struct scan_field *in_fields, tap
|
||||
}
|
||||
|
||||
void jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
assert(out_bits);
|
||||
assert(state != TAP_RESET);
|
||||
@@ -426,8 +426,8 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(
|
||||
struct jtag_tap *active,
|
||||
int in_num_fields,
|
||||
const struct scan_field *in_fields,
|
||||
tap_state_t state),
|
||||
int in_num_fields, struct scan_field *in_fields, tap_state_t state)
|
||||
enum tap_state state),
|
||||
int in_num_fields, struct scan_field *in_fields, enum tap_state state)
|
||||
{
|
||||
jtag_add_scan(active, in_num_fields, in_fields, state);
|
||||
|
||||
@@ -445,7 +445,7 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(
|
||||
void jtag_add_dr_scan_check(struct jtag_tap *active,
|
||||
int in_num_fields,
|
||||
struct scan_field *in_fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
if (jtag_verify)
|
||||
jtag_add_scan_check(active, jtag_add_dr_scan, in_num_fields, in_fields, state);
|
||||
@@ -457,7 +457,7 @@ void jtag_add_dr_scan_check(struct jtag_tap *active,
|
||||
void jtag_add_dr_scan(struct jtag_tap *active,
|
||||
int in_num_fields,
|
||||
const struct scan_field *in_fields,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
assert(state != TAP_RESET);
|
||||
|
||||
@@ -469,7 +469,7 @@ void jtag_add_dr_scan(struct jtag_tap *active,
|
||||
}
|
||||
|
||||
void jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
|
||||
tap_state_t state)
|
||||
enum tap_state state)
|
||||
{
|
||||
assert(out_bits);
|
||||
assert(state != TAP_RESET);
|
||||
@@ -520,9 +520,9 @@ int jtag_add_tms_seq(unsigned int nbits, const uint8_t *seq, enum tap_state stat
|
||||
return retval;
|
||||
}
|
||||
|
||||
void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path)
|
||||
void jtag_add_pathmove(unsigned int num_states, const enum tap_state *path)
|
||||
{
|
||||
tap_state_t cur_state = cmd_queue_cur_state;
|
||||
enum tap_state cur_state = cmd_queue_cur_state;
|
||||
|
||||
/* the last state has to be a stable state */
|
||||
if (!tap_is_state_stable(path[num_states - 1])) {
|
||||
@@ -554,9 +554,9 @@ void jtag_add_pathmove(unsigned int num_states, const tap_state_t *path)
|
||||
cmd_queue_cur_state = path[num_states - 1];
|
||||
}
|
||||
|
||||
int jtag_add_statemove(tap_state_t goal_state)
|
||||
int jtag_add_statemove(enum tap_state goal_state)
|
||||
{
|
||||
tap_state_t cur_state = cmd_queue_cur_state;
|
||||
enum tap_state cur_state = cmd_queue_cur_state;
|
||||
|
||||
if (goal_state != cur_state) {
|
||||
LOG_DEBUG("cur_state=%s goal_state=%s",
|
||||
@@ -575,7 +575,7 @@ int jtag_add_statemove(tap_state_t goal_state)
|
||||
else if (tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state)) {
|
||||
unsigned int tms_bits = tap_get_tms_path(cur_state, goal_state);
|
||||
unsigned int tms_count = tap_get_tms_path_len(cur_state, goal_state);
|
||||
tap_state_t moves[8];
|
||||
enum tap_state moves[8];
|
||||
assert(tms_count < ARRAY_SIZE(moves));
|
||||
|
||||
for (unsigned int i = 0; i < tms_count; i++, tms_bits >>= 1) {
|
||||
@@ -595,7 +595,7 @@ int jtag_add_statemove(tap_state_t goal_state)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
void jtag_add_runtest(unsigned int num_cycles, tap_state_t state)
|
||||
void jtag_add_runtest(unsigned int num_cycles, enum tap_state state)
|
||||
{
|
||||
jtag_prelude(state);
|
||||
jtag_set_error(interface_jtag_add_runtest(num_cycles, state));
|
||||
|
||||
@@ -146,7 +146,7 @@ static int amt_jtagaccel_speed(int speed)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static void amt_jtagaccel_end_state(tap_state_t state)
|
||||
static void amt_jtagaccel_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -179,8 +179,8 @@ static void amt_jtagaccel_state_move(void)
|
||||
uint8_t aw_scan_tms_5;
|
||||
uint8_t tms_scan[2];
|
||||
|
||||
tap_state_t cur_state = tap_get_state();
|
||||
tap_state_t end_state = tap_get_end_state();
|
||||
enum tap_state cur_state = tap_get_state();
|
||||
enum tap_state end_state = tap_get_end_state();
|
||||
|
||||
tms_scan[0] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][0];
|
||||
tms_scan[1] = amt_jtagaccel_tap_move[tap_move_ndx(cur_state)][tap_move_ndx(end_state)][1];
|
||||
@@ -209,7 +209,7 @@ static void amt_jtagaccel_runtest(unsigned int num_cycles)
|
||||
uint8_t aw_scan_tms_5;
|
||||
uint8_t aw_scan_tms_1to4;
|
||||
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -237,7 +237,7 @@ static void amt_jtagaccel_scan(bool ir_scan, enum scan_type type, uint8_t *buffe
|
||||
{
|
||||
int bits_left = scan_size;
|
||||
int bit_count = 0;
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
uint8_t aw_tdi_option;
|
||||
uint8_t dw_tdi_scan;
|
||||
uint8_t dr_tdo;
|
||||
|
||||
@@ -219,7 +219,7 @@ static int angie_append_test_cmd(struct angie *device);
|
||||
static int angie_calculate_delay(enum angie_delay_type type, long f, int *delay);
|
||||
|
||||
/* Interface between ANGIE and OpenOCD */
|
||||
static void angie_set_end_state(tap_state_t endstate);
|
||||
static void angie_set_end_state(enum tap_state endstate);
|
||||
static int angie_queue_statemove(struct angie *device);
|
||||
|
||||
static int angie_queue_scan(struct angie *device, struct jtag_command *cmd);
|
||||
@@ -1519,7 +1519,7 @@ static long angie_calculate_frequency(enum angie_delay_type type, int delay)
|
||||
*
|
||||
* @param endstate the state the end state follower should be set to.
|
||||
*/
|
||||
static void angie_set_end_state(tap_state_t endstate)
|
||||
static void angie_set_end_state(enum tap_state endstate)
|
||||
{
|
||||
if (tap_is_state_stable(endstate))
|
||||
tap_set_end_state(endstate);
|
||||
@@ -1837,7 +1837,7 @@ static int angie_reset(int trst, int srst)
|
||||
static int angie_queue_pathmove(struct angie *device, struct jtag_command *cmd)
|
||||
{
|
||||
int ret, state_count;
|
||||
tap_state_t *path;
|
||||
enum tap_state *path;
|
||||
uint8_t tms_sequence;
|
||||
|
||||
unsigned int num_states = cmd->cmd.pathmove->num_states;
|
||||
|
||||
@@ -42,9 +42,9 @@ static uint8_t usb_in_buffer[ARMJTAGEW_IN_BUFFER_SIZE];
|
||||
static uint8_t usb_out_buffer[ARMJTAGEW_OUT_BUFFER_SIZE];
|
||||
|
||||
/* Queue command functions */
|
||||
static void armjtagew_end_state(tap_state_t state);
|
||||
static void armjtagew_end_state(enum tap_state state);
|
||||
static void armjtagew_state_move(void);
|
||||
static void armjtagew_path_move(unsigned int num_states, tap_state_t *path);
|
||||
static void armjtagew_path_move(unsigned int num_states, enum tap_state *path);
|
||||
static void armjtagew_runtest(unsigned int num_cycles);
|
||||
static void armjtagew_scan(bool ir_scan,
|
||||
enum scan_type type,
|
||||
@@ -253,7 +253,7 @@ static int armjtagew_quit(void)
|
||||
/**************************************************************************
|
||||
* Queue command implementations */
|
||||
|
||||
static void armjtagew_end_state(tap_state_t state)
|
||||
static void armjtagew_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -279,7 +279,7 @@ static void armjtagew_state_move(void)
|
||||
tap_set_state(tap_get_end_state());
|
||||
}
|
||||
|
||||
static void armjtagew_path_move(unsigned int num_states, tap_state_t *path)
|
||||
static void armjtagew_path_move(unsigned int num_states, enum tap_state *path)
|
||||
{
|
||||
for (unsigned int i = 0; i < num_states; i++) {
|
||||
/*
|
||||
@@ -305,7 +305,7 @@ static void armjtagew_path_move(unsigned int num_states, tap_state_t *path)
|
||||
|
||||
static void armjtagew_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -329,7 +329,7 @@ static void armjtagew_scan(bool ir_scan,
|
||||
int scan_size,
|
||||
struct scan_command *command)
|
||||
{
|
||||
tap_state_t saved_end_state;
|
||||
enum tap_state saved_end_state;
|
||||
|
||||
armjtagew_tap_ensure_space(1, scan_size + 8);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ const struct bitbang_interface *bitbang_interface;
|
||||
#define CLOCK_IDLE() 0
|
||||
|
||||
/* The bitbang driver leaves the TCK 0 when in idle */
|
||||
static void bitbang_end_state(tap_state_t state)
|
||||
static void bitbang_end_state(enum tap_state state)
|
||||
{
|
||||
assert(tap_is_state_stable(state));
|
||||
tap_set_end_state(state);
|
||||
@@ -149,7 +149,7 @@ static int bitbang_path_move(struct pathmove_command *cmd)
|
||||
|
||||
static int bitbang_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -195,7 +195,7 @@ static int bitbang_stableclocks(unsigned int num_cycles)
|
||||
static int bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer,
|
||||
unsigned int scan_size)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
unsigned int bit_cnt;
|
||||
|
||||
if (!((!ir_scan &&
|
||||
|
||||
@@ -76,7 +76,7 @@ static void bitq_io(int tms, int tdi, int tdo_req)
|
||||
bitq_in_proc();
|
||||
}
|
||||
|
||||
static void bitq_end_state(tap_state_t state)
|
||||
static void bitq_end_state(enum tap_state state)
|
||||
{
|
||||
if (!tap_is_state_stable(state)) {
|
||||
LOG_ERROR("BUG: %i is not a valid end state", state);
|
||||
@@ -85,7 +85,7 @@ static void bitq_end_state(tap_state_t state)
|
||||
tap_set_end_state(state);
|
||||
}
|
||||
|
||||
static void bitq_state_move(tap_state_t new_state)
|
||||
static void bitq_state_move(enum tap_state new_state)
|
||||
{
|
||||
int i = 0;
|
||||
uint8_t tms_scan;
|
||||
|
||||
@@ -25,9 +25,9 @@ static int buspirate_init(void);
|
||||
static int buspirate_quit(void);
|
||||
static int buspirate_reset(int trst, int srst);
|
||||
|
||||
static void buspirate_end_state(tap_state_t state);
|
||||
static void buspirate_end_state(enum tap_state state);
|
||||
static void buspirate_state_move(void);
|
||||
static void buspirate_path_move(unsigned int num_states, tap_state_t *path);
|
||||
static void buspirate_path_move(unsigned int num_states, enum tap_state *path);
|
||||
static void buspirate_runtest(unsigned int num_cycles);
|
||||
static void buspirate_scan(bool ir_scan, enum scan_type type,
|
||||
uint8_t *buffer, int scan_size, struct scan_command *command);
|
||||
@@ -554,7 +554,7 @@ struct adapter_driver buspirate_adapter_driver = {
|
||||
};
|
||||
|
||||
/*************** jtag execute commands **********************/
|
||||
static void buspirate_end_state(tap_state_t state)
|
||||
static void buspirate_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -580,7 +580,7 @@ static void buspirate_state_move(void)
|
||||
tap_set_state(tap_get_end_state());
|
||||
}
|
||||
|
||||
static void buspirate_path_move(unsigned int num_states, tap_state_t *path)
|
||||
static void buspirate_path_move(unsigned int num_states, enum tap_state *path)
|
||||
{
|
||||
for (unsigned int i = 0; i < num_states; i++) {
|
||||
if (tap_state_transition(tap_get_state(), false) == path[i]) {
|
||||
@@ -604,7 +604,7 @@ static void buspirate_path_move(unsigned int num_states, tap_state_t *path)
|
||||
|
||||
static void buspirate_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -628,7 +628,7 @@ static void buspirate_runtest(unsigned int num_cycles)
|
||||
static void buspirate_scan(bool ir_scan, enum scan_type type,
|
||||
uint8_t *buffer, int scan_size, struct scan_command *command)
|
||||
{
|
||||
tap_state_t saved_end_state;
|
||||
enum tap_state saved_end_state;
|
||||
|
||||
buspirate_tap_make_space(1, scan_size+8);
|
||||
/* is 8 correct ? (2 moves = 16) */
|
||||
|
||||
@@ -1502,7 +1502,7 @@ static int cmsis_dap_execute_tlr_reset(struct jtag_command *cmd)
|
||||
}
|
||||
|
||||
/* Set new end state */
|
||||
static void cmsis_dap_end_state(tap_state_t state)
|
||||
static void cmsis_dap_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -1831,7 +1831,7 @@ static void cmsis_dap_execute_scan(struct jtag_command *cmd)
|
||||
tap_state_name(tap_get_end_state()));
|
||||
}
|
||||
|
||||
static void cmsis_dap_pathmove(int num_states, tap_state_t *path)
|
||||
static void cmsis_dap_pathmove(int num_states, enum tap_state *path)
|
||||
{
|
||||
uint8_t tms0 = 0x00;
|
||||
uint8_t tms1 = 0xff;
|
||||
@@ -1873,7 +1873,7 @@ static void cmsis_dap_stableclocks(unsigned int num_cycles)
|
||||
|
||||
static void cmsis_dap_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* Only do a state_move when we're not already in IDLE. */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
|
||||
@@ -49,7 +49,7 @@ static void jtag_callback_queue_reset(void)
|
||||
*
|
||||
*/
|
||||
int interface_jtag_add_ir_scan(struct jtag_tap *active,
|
||||
const struct scan_field *in_fields, tap_state_t state)
|
||||
const struct scan_field *in_fields, enum tap_state state)
|
||||
{
|
||||
size_t num_taps = jtag_tap_count_enabled();
|
||||
|
||||
@@ -111,7 +111,7 @@ int interface_jtag_add_ir_scan(struct jtag_tap *active,
|
||||
*
|
||||
*/
|
||||
int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields,
|
||||
const struct scan_field *in_fields, tap_state_t state)
|
||||
const struct scan_field *in_fields, enum tap_state state)
|
||||
{
|
||||
/* count devices in bypass */
|
||||
|
||||
@@ -184,7 +184,7 @@ int interface_jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields,
|
||||
}
|
||||
|
||||
static int jtag_add_plain_scan(int num_bits, const uint8_t *out_bits,
|
||||
uint8_t *in_bits, tap_state_t state, bool ir_scan)
|
||||
uint8_t *in_bits, enum tap_state state, bool ir_scan)
|
||||
{
|
||||
struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command));
|
||||
struct scan_command *scan = cmd_queue_alloc(sizeof(struct scan_command));
|
||||
@@ -207,19 +207,19 @@ static int jtag_add_plain_scan(int num_bits, const uint8_t *out_bits,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state)
|
||||
int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, enum tap_state state)
|
||||
{
|
||||
return jtag_add_plain_scan(num_bits, out_bits, in_bits, state, false);
|
||||
}
|
||||
|
||||
int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, tap_state_t state)
|
||||
int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits, uint8_t *in_bits, enum tap_state state)
|
||||
{
|
||||
return jtag_add_plain_scan(num_bits, out_bits, in_bits, state, true);
|
||||
}
|
||||
|
||||
int interface_jtag_add_tlr(void)
|
||||
{
|
||||
tap_state_t state = TAP_RESET;
|
||||
enum tap_state state = TAP_RESET;
|
||||
|
||||
/* allocate memory for a new list member */
|
||||
struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command));
|
||||
@@ -259,7 +259,7 @@ int interface_add_tms_seq(unsigned int num_bits, const uint8_t *seq, enum tap_st
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path)
|
||||
int interface_jtag_add_pathmove(unsigned int num_states, const enum tap_state *path)
|
||||
{
|
||||
/* allocate memory for a new list member */
|
||||
struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command));
|
||||
@@ -270,7 +270,7 @@ int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path
|
||||
|
||||
cmd->cmd.pathmove = cmd_queue_alloc(sizeof(struct pathmove_command));
|
||||
cmd->cmd.pathmove->num_states = num_states;
|
||||
cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(tap_state_t) * num_states);
|
||||
cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(enum tap_state) * num_states);
|
||||
|
||||
for (unsigned int i = 0; i < num_states; i++)
|
||||
cmd->cmd.pathmove->path[i] = path[i];
|
||||
@@ -278,7 +278,7 @@ int interface_jtag_add_pathmove(unsigned int num_states, const tap_state_t *path
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int interface_jtag_add_runtest(unsigned int num_cycles, tap_state_t state)
|
||||
int interface_jtag_add_runtest(unsigned int num_cycles, enum tap_state state)
|
||||
{
|
||||
/* allocate memory for a new list member */
|
||||
struct jtag_command *cmd = cmd_queue_alloc(sizeof(struct jtag_command));
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "hello.h"
|
||||
|
||||
/* my private tap controller state, which tracks state for calling code */
|
||||
static tap_state_t dummy_state = TAP_RESET;
|
||||
static enum tap_state dummy_state = TAP_RESET;
|
||||
|
||||
static int dummy_clock; /* edge detector */
|
||||
|
||||
@@ -34,7 +34,7 @@ static int dummy_write(int tck, int tms, int tdi)
|
||||
/* TAP standard: "state transitions occur on rising edge of clock" */
|
||||
if (tck != dummy_clock) {
|
||||
if (tck) {
|
||||
tap_state_t old_state = dummy_state;
|
||||
enum tap_state old_state = dummy_state;
|
||||
dummy_state = tap_state_transition(old_state, tms);
|
||||
|
||||
if (old_state != dummy_state) {
|
||||
|
||||
@@ -622,7 +622,7 @@ static const struct command_registration ft232r_command_handlers[] = {
|
||||
* Synchronous bitbang protocol implementation.
|
||||
*/
|
||||
|
||||
static void syncbb_end_state(tap_state_t state)
|
||||
static void syncbb_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -705,7 +705,7 @@ static void syncbb_path_move(struct pathmove_command *cmd)
|
||||
static void syncbb_runtest(unsigned int num_cycles)
|
||||
{
|
||||
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -747,7 +747,7 @@ static void syncbb_stableclocks(unsigned int num_cycles)
|
||||
|
||||
static void syncbb_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int scan_size)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
int bit_cnt, bit0_index;
|
||||
|
||||
if (!((!ir_scan && (tap_get_state() == TAP_DRSHIFT)) || (ir_scan && (tap_get_state() == TAP_IRSHIFT)))) {
|
||||
|
||||
@@ -238,9 +238,9 @@ static int ftdi_get_signal(const struct signal *s, uint16_t *value_out)
|
||||
*
|
||||
* @param goal_state is the destination state for the move.
|
||||
*/
|
||||
static void move_to_state(tap_state_t goal_state)
|
||||
static void move_to_state(enum tap_state goal_state)
|
||||
{
|
||||
tap_state_t start_state = tap_get_state();
|
||||
enum tap_state start_state = tap_get_state();
|
||||
|
||||
/* goal_state is 1/2 of a tuple/pair of states which allow convenient
|
||||
lookup of the required TMS pattern to move to this state from the
|
||||
@@ -299,7 +299,7 @@ static int ftdi_khz(int khz, int *jtag_speed)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static void ftdi_end_state(tap_state_t state)
|
||||
static void ftdi_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -370,7 +370,7 @@ static void ftdi_execute_tms(struct jtag_command *cmd)
|
||||
|
||||
static void ftdi_execute_pathmove(struct jtag_command *cmd)
|
||||
{
|
||||
tap_state_t *path = cmd->cmd.pathmove->path;
|
||||
enum tap_state *path = cmd->cmd.pathmove->path;
|
||||
unsigned int num_states = cmd->cmd.pathmove->num_states;
|
||||
|
||||
LOG_DEBUG_IO("pathmove: %u states, current: %s end: %s", num_states,
|
||||
|
||||
@@ -133,7 +133,7 @@ static void gw16012_reset(int trst, int srst)
|
||||
gw16012_control(0x0b);
|
||||
}
|
||||
|
||||
static void gw16012_end_state(tap_state_t state)
|
||||
static void gw16012_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -187,7 +187,7 @@ static void gw16012_path_move(struct pathmove_command *cmd)
|
||||
|
||||
static void gw16012_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -209,7 +209,7 @@ static void gw16012_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int
|
||||
{
|
||||
int bits_left = scan_size;
|
||||
int bit_count = 0;
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
uint8_t scan_out, scan_in;
|
||||
|
||||
/* only if we're not already in the correct Shift state */
|
||||
|
||||
@@ -78,9 +78,9 @@ static struct device_config config;
|
||||
static struct device_config tmp_config;
|
||||
|
||||
/* Queue command functions */
|
||||
static void jlink_end_state(tap_state_t state);
|
||||
static void jlink_end_state(enum tap_state state);
|
||||
static void jlink_state_move(void);
|
||||
static void jlink_path_move(unsigned int num_states, tap_state_t *path);
|
||||
static void jlink_path_move(unsigned int num_states, enum tap_state *path);
|
||||
static void jlink_stableclocks(unsigned int num_cycles);
|
||||
static void jlink_runtest(unsigned int num_cycles);
|
||||
static void jlink_reset(int trst, int srst);
|
||||
@@ -875,7 +875,7 @@ static int jlink_quit(void)
|
||||
/***************************************************************************/
|
||||
/* Queue command implementations */
|
||||
|
||||
static void jlink_end_state(tap_state_t state)
|
||||
static void jlink_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -899,7 +899,7 @@ static void jlink_state_move(void)
|
||||
tap_set_state(tap_get_end_state());
|
||||
}
|
||||
|
||||
static void jlink_path_move(unsigned int num_states, tap_state_t *path)
|
||||
static void jlink_path_move(unsigned int num_states, enum tap_state *path)
|
||||
{
|
||||
uint8_t tms = 0xff;
|
||||
|
||||
@@ -930,7 +930,7 @@ static void jlink_stableclocks(unsigned int num_cycles)
|
||||
|
||||
static void jlink_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* Only do a state_move when we're not already in IDLE. */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
|
||||
@@ -272,7 +272,7 @@ static int jtag_vpi_tms(struct tms_command *cmd)
|
||||
return jtag_vpi_tms_seq(cmd->bits, cmd->num_bits);
|
||||
}
|
||||
|
||||
static int jtag_vpi_state_move(tap_state_t state)
|
||||
static int jtag_vpi_state_move(enum tap_state state)
|
||||
{
|
||||
if (tap_get_state() == state)
|
||||
return ERROR_OK;
|
||||
@@ -440,7 +440,7 @@ static int jtag_vpi_scan(struct scan_command *cmd)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int jtag_vpi_runtest(unsigned int num_cycles, tap_state_t state)
|
||||
static int jtag_vpi_runtest(unsigned int num_cycles, enum tap_state state)
|
||||
{
|
||||
int retval;
|
||||
|
||||
|
||||
@@ -104,9 +104,9 @@ static int opendous_init(void);
|
||||
static int opendous_quit(void);
|
||||
|
||||
/* Queue command functions */
|
||||
static void opendous_end_state(tap_state_t state);
|
||||
static void opendous_end_state(enum tap_state state);
|
||||
static void opendous_state_move(void);
|
||||
static void opendous_path_move(unsigned int num_states, tap_state_t *path);
|
||||
static void opendous_path_move(unsigned int num_states, enum tap_state *path);
|
||||
static void opendous_runtest(unsigned int num_cycles);
|
||||
static void opendous_scan(int ir_scan, enum scan_type type, uint8_t *buffer,
|
||||
int scan_size, struct scan_command *command);
|
||||
@@ -393,7 +393,7 @@ static int opendous_quit(void)
|
||||
/***************************************************************************/
|
||||
/* Queue command implementations */
|
||||
|
||||
void opendous_end_state(tap_state_t state)
|
||||
void opendous_end_state(enum tap_state state)
|
||||
{
|
||||
if (tap_is_state_stable(state))
|
||||
tap_set_end_state(state);
|
||||
@@ -419,7 +419,7 @@ void opendous_state_move(void)
|
||||
tap_set_state(tap_get_end_state());
|
||||
}
|
||||
|
||||
void opendous_path_move(unsigned int num_states, tap_state_t *path)
|
||||
void opendous_path_move(unsigned int num_states, enum tap_state *path)
|
||||
{
|
||||
for (unsigned int i = 0; i < num_states; i++) {
|
||||
if (path[i] == tap_state_transition(tap_get_state(), false))
|
||||
@@ -440,7 +440,7 @@ void opendous_path_move(unsigned int num_states, tap_state_t *path)
|
||||
|
||||
void opendous_runtest(unsigned int num_cycles)
|
||||
{
|
||||
tap_state_t saved_end_state = tap_get_end_state();
|
||||
enum tap_state saved_end_state = tap_get_end_state();
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
if (tap_get_state() != TAP_IDLE) {
|
||||
@@ -460,7 +460,7 @@ void opendous_runtest(unsigned int num_cycles)
|
||||
|
||||
void opendous_scan(int ir_scan, enum scan_type type, uint8_t *buffer, int scan_size, struct scan_command *command)
|
||||
{
|
||||
tap_state_t saved_end_state;
|
||||
enum tap_state saved_end_state;
|
||||
|
||||
opendous_tap_ensure_space(1, scan_size + 8);
|
||||
|
||||
|
||||
@@ -748,7 +748,7 @@ static void openjtag_execute_scan(struct jtag_command *cmd)
|
||||
static void openjtag_execute_runtest(struct jtag_command *cmd)
|
||||
{
|
||||
|
||||
tap_state_t end_state = cmd->cmd.runtest->end_state;
|
||||
enum tap_state end_state = cmd->cmd.runtest->end_state;
|
||||
tap_set_end_state(end_state);
|
||||
|
||||
/* only do a state_move when we're not already in IDLE */
|
||||
|
||||
@@ -380,7 +380,7 @@ static int osbdm_quit(void)
|
||||
|
||||
static int osbdm_add_pathmove(
|
||||
struct queue *queue,
|
||||
tap_state_t *path,
|
||||
enum tap_state *path,
|
||||
unsigned int num_states)
|
||||
{
|
||||
assert(num_states <= 32);
|
||||
@@ -415,7 +415,7 @@ static int osbdm_add_pathmove(
|
||||
|
||||
static int osbdm_add_statemove(
|
||||
struct queue *queue,
|
||||
tap_state_t new_state,
|
||||
enum tap_state new_state,
|
||||
int skip_first)
|
||||
{
|
||||
int len = 0;
|
||||
@@ -490,7 +490,7 @@ static int osbdm_add_scan(
|
||||
struct queue *queue,
|
||||
struct scan_field *fields,
|
||||
unsigned int num_fields,
|
||||
tap_state_t end_state,
|
||||
enum tap_state end_state,
|
||||
bool ir_scan)
|
||||
{
|
||||
/* Move to desired shift state */
|
||||
@@ -537,7 +537,7 @@ static int osbdm_add_scan(
|
||||
static int osbdm_add_runtest(
|
||||
struct queue *queue,
|
||||
unsigned int num_cycles,
|
||||
tap_state_t end_state)
|
||||
enum tap_state end_state)
|
||||
{
|
||||
if (osbdm_add_statemove(queue, TAP_IDLE, 0) != ERROR_OK)
|
||||
return ERROR_FAIL;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user