arm_jtag_scann error propagation fixes
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
parent
a9761c9093
commit
e0525cd182
|
@ -120,7 +120,9 @@ static __inline int arm7tdmi_clock_out(struct arm_jtag *jtag_info,
|
||||||
uint32_t out, uint32_t *deprecated, int breakpoint)
|
uint32_t out, uint32_t *deprecated, int breakpoint)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
|
retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -93,7 +93,9 @@ static int arm920t_read_cp15_physical(struct target *target,
|
||||||
|
|
||||||
jtag_info = &arm920t->arm7_9_common.jtag_info;
|
jtag_info = &arm920t->arm7_9_common.jtag_info;
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -146,7 +148,9 @@ static int arm920t_write_cp15_physical(struct target *target,
|
||||||
|
|
||||||
buf_set_u32(value_buf, 0, 32, value);
|
buf_set_u32(value_buf, 0, 32, value);
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -197,7 +201,9 @@ static int arm920t_execute_cp15(struct target *target, uint32_t cp15_opcode,
|
||||||
|
|
||||||
jtag_info = &arm920t->arm7_9_common.jtag_info;
|
jtag_info = &arm920t->arm7_9_common.jtag_info;
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0xf, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -346,7 +346,9 @@ int embeddedice_read_reg_w_check(struct reg *reg,
|
||||||
uint8_t field2_out[1];
|
uint8_t field2_out[1];
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
|
retval = arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
retval = arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
|
@ -410,7 +412,9 @@ int embeddedice_receive(struct arm_jtag *jtag_info, uint32_t *data, uint32_t siz
|
||||||
uint8_t field2_out[1];
|
uint8_t field2_out[1];
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -497,7 +501,7 @@ void embeddedice_write_reg(struct reg *reg, uint32_t value)
|
||||||
|
|
||||||
LOG_DEBUG("%i: 0x%8.8" PRIx32 "", ice_reg->addr, value);
|
LOG_DEBUG("%i: 0x%8.8" PRIx32 "", ice_reg->addr, value);
|
||||||
|
|
||||||
arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
|
retval = arm_jtag_scann(ice_reg->jtag_info, 0x2, TAP_IDLE);
|
||||||
|
|
||||||
retval = arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(ice_reg->jtag_info, ice_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
|
|
||||||
|
@ -530,7 +534,9 @@ int embeddedice_send(struct arm_jtag *jtag_info, uint32_t *data, uint32_t size)
|
||||||
uint8_t field2_out[1];
|
uint8_t field2_out[1];
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -584,7 +590,9 @@ int embeddedice_handshake(struct arm_jtag *jtag_info, int hsbit, uint32_t timeou
|
||||||
else
|
else
|
||||||
return ERROR_INVALID_ARGUMENTS;
|
return ERROR_INVALID_ARGUMENTS;
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
retval = arm_jtag_scann(jtag_info, 0x2, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -505,7 +505,9 @@ static int etm_read_reg_w_check(struct reg *reg,
|
||||||
|
|
||||||
LOG_DEBUG("%s (%u)", r->name, reg_addr);
|
LOG_DEBUG("%s (%u)", r->name, reg_addr);
|
||||||
|
|
||||||
arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
|
retval = arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -589,7 +591,9 @@ static int etm_write_reg(struct reg *reg, uint32_t value)
|
||||||
|
|
||||||
LOG_DEBUG("%s (%u): 0x%8.8" PRIx32 "", r->name, reg_addr, value);
|
LOG_DEBUG("%s (%u): 0x%8.8" PRIx32 "", r->name, reg_addr, value);
|
||||||
|
|
||||||
arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
|
retval = arm_jtag_scann(etm_reg->jtag_info, 0x6, TAP_IDLE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
retval = arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
retval = arm_jtag_set_instr(etm_reg->jtag_info, etm_reg->jtag_info->intest_instr, NULL, TAP_IDLE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
@ -85,7 +85,9 @@ static int feroceon_dummy_clock_out(struct arm_jtag *jtag_info, uint32_t instr)
|
||||||
|
|
||||||
buf_set_u32(instr_buf, 0, 32, flip_u32(instr, 32));
|
buf_set_u32(instr_buf, 0, 32, flip_u32(instr, 32));
|
||||||
|
|
||||||
arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
|
retval = arm_jtag_scann(jtag_info, 0x1, TAP_DRPAUSE);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
|
retval = arm_jtag_set_instr(jtag_info, jtag_info->intest_instr, NULL, TAP_DRPAUSE);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
|
|
Loading…
Reference in New Issue