jtag_add_dr_scan(ejtag_info->tap, 1, &field, TAP_IDLE);
- if (jtag_execute_queue() != ERROR_OK)
+ int retval;
+ if ((retval = jtag_execute_queue()) != ERROR_OK)
{
LOG_ERROR("register read failed");
+ return retval;
}
-
return ERROR_OK;
}
-int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info, uint32_t *impcode)
+static int mips_ejtag_get_impcode(struct mips_ejtag *ejtag_info, uint32_t *impcode)
{
struct scan_field field;
jtag_add_dr_scan(ejtag_info->tap, 1, &field, TAP_IDLE);
- if (jtag_execute_queue() != ERROR_OK)
+ int retval;
+ if ((retval = jtag_execute_queue()) != ERROR_OK)
{
LOG_ERROR("register read failed");
+ return retval;
}
-
return ERROR_OK;
}
return ERROR_OK;
}
-int mips_ejtag_step_enable(struct mips_ejtag *ejtag_info)
+static int mips_ejtag_step_enable(struct mips_ejtag *ejtag_info)
{
static const uint32_t code[] = {
MIPS32_MTC0(1,31,0), /* move $1 to COP0 DeSave */
return ERROR_OK;
}
-int mips_ejtag_step_disable(struct mips_ejtag *ejtag_info)
+
+static int mips_ejtag_step_disable(struct mips_ejtag *ejtag_info)
{
static const uint32_t code[] = {
MIPS32_MTC0(15,31,0), /* move $15 to COP0 DeSave */
/* set initial state for ejtag control reg */
ejtag_info->ejtag_ctrl = EJTAG_CTRL_ROCC | EJTAG_CTRL_PRACC | EJTAG_CTRL_PROBEN | EJTAG_CTRL_SETDEV;
+ ejtag_info->fast_access_save = -1;
return ERROR_OK;
}
-int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write, uint32_t *data)
+int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write_t, uint32_t *data)
{
struct jtag_tap *tap;
tap = ejtag_info->tap;
fields[1].num_bits = 32;
fields[1].out_value = t;
- if (write)
+ if (write_t)
{
fields[1].in_value = NULL;
buf_set_u32(t, 0, 32, *data);