ARM: ADIv5, deadcode cleanup

I have no idea what the scan_inout_check() was *expecting* to achieve by
issuing a read of the DP_RDBUFF register.  But in any case, that code was
clearly never being called ("invalue" always NULL) ... so remove it, and
the associated comment.

Also rename it as ap_write_check(), facilitating a cleanup of its single
call site by removing constant parameters.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
This commit is contained in:
David Brownell 2010-02-21 14:54:54 -08:00
parent 39cfe62796
commit ecff73043c
1 changed files with 13 additions and 13 deletions

View File

@ -188,23 +188,24 @@ static int adi_jtag_dp_scan_u32(struct swjdp_common *swjdp,
return retval; return retval;
} }
/* scan_inout_check adds one extra inscan for DPAP_READ commands to read variables */ /**
static int scan_inout_check(struct swjdp_common *swjdp, * Utility to write AP registers.
uint8_t instr, uint8_t reg_addr, uint8_t RnW, */
uint8_t *outvalue, uint8_t *invalue) static int ap_write_check(struct swjdp_common *dap,
uint8_t reg_addr, uint8_t *outvalue)
{ {
adi_jtag_dp_scan(swjdp, instr, reg_addr, RnW, outvalue, NULL, NULL); adi_jtag_dp_scan(dap, JTAG_DP_APACC, reg_addr, DPAP_WRITE,
outvalue, NULL, NULL);
if ((RnW == DPAP_READ) && (invalue != NULL)) /* REVISIT except in dap_setup_accessport() almost all call paths
adi_jtag_dp_scan(swjdp, JTAG_DP_DPACC, * set up COMPOSITE. Probably worth just inlining the scan...
DP_RDBUFF, DPAP_READ, 0, invalue, &swjdp->ack); */
/* In TRANS_MODE_ATOMIC all JTAG_DP_APACC transactions wait for /* In TRANS_MODE_ATOMIC all JTAG_DP_APACC transactions wait for
* ack = OK/FAULT and the check CTRL_STAT * ack = OK/FAULT and the check CTRL_STAT
*/ */
if ((instr == JTAG_DP_APACC) if (dap->trans_mode == TRANS_MODE_ATOMIC)
&& (swjdp->trans_mode == TRANS_MODE_ATOMIC)) return jtagdp_transaction_endcheck(dap);
return jtagdp_transaction_endcheck(swjdp);
return ERROR_OK; return ERROR_OK;
} }
@ -432,8 +433,7 @@ static int dap_ap_write_reg(struct swjdp_common *swjdp,
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
return scan_inout_check(swjdp, JTAG_DP_APACC, reg_addr, return ap_write_check(swjdp, reg_addr, out_value_buf);
DPAP_WRITE, out_value_buf, NULL);
} }
/** /**