Adjusted epilogue width.

This commit is contained in:
Greg Savin 2019-03-28 09:48:22 -07:00
parent 84870e8ada
commit 2b73796a5c
2 changed files with 46 additions and 36 deletions

View File

@ -504,14 +504,15 @@ static void ftdi_execute_pathmove(struct jtag_command *cmd)
}
#if BUILD_FTDI_BSCAN == 1
static void bscan_single_field_data_scan(const uint8_t *out, unsigned out_offset, uint8_t *in,
static void bscan_shift(bool traverse_to_end_state, const uint8_t *out, unsigned out_offset, uint8_t *in,
unsigned in_offset, unsigned length)
{
if (traverse_to_end_state) {
DO_CLOCK_DATA(mpsse_ctx,
out,
0,
out_offset,
in,
0,
in_offset,
length - 1,
ftdi_jtag_mode);
uint8_t last_bit = 0;
@ -522,7 +523,7 @@ static void bscan_single_field_data_scan(const uint8_t *out, unsigned out_offset
&tms_bits,
0,
in,
length - 1,
in_offset + length - 1,
1,
last_bit,
ftdi_jtag_mode);
@ -531,12 +532,21 @@ static void bscan_single_field_data_scan(const uint8_t *out, unsigned out_offset
&tms_bits,
1,
1,
last_bit,
0,
ftdi_jtag_mode);
tap_set_state(tap_state_transition(tap_get_state(), 0));
if (tap_get_state() != tap_get_end_state())
move_to_state(tap_get_end_state());
} else {
DO_CLOCK_DATA(mpsse_ctx,
out,
out_offset,
in,
in_offset,
length,
ftdi_jtag_mode);
}
}
@ -566,7 +576,7 @@ static void ftdi_execute_scan_via_bscan(struct jtag_command *cmd)
// Do the 6-bit IR scan of 0x23 (USER4)
bscan_single_field_data_scan(&bscan_ir_user, 0, NULL, 0, bscan_ir_user_width);
bscan_shift(true, &bscan_ir_user, 0, NULL, 0, bscan_ir_user_width);
if (tap_get_state() != tap_get_end_state())
move_to_state(tap_get_end_state());
@ -584,7 +594,7 @@ static void ftdi_execute_scan_via_bscan(struct jtag_command *cmd)
// shift in prologue
uint8_t prologue = (scan_size << 1) | (cmd->cmd.scan->ir_scan ? 0 : 1);
static const uint8_t epilogue = 0x1;
static const uint8_t epilogue = 0x0;
DO_CLOCK_DATA(mpsse_ctx,
&prologue,
@ -639,8 +649,8 @@ static void ftdi_execute_scan_via_bscan(struct jtag_command *cmd)
ftdi_jtag_mode);
// shift in epilogue and exit shift state
bscan_single_field_data_scan(&epilogue, 0, NULL, 0, 2);
// shift in epilogue (3 bits of value zero), exiting shift state and traversing to idle state
bscan_shift(true, &epilogue, 0, NULL, 0, 3);
if (tap_get_state() != tap_get_end_state())
move_to_state(tap_get_end_state());

View File

@ -4,9 +4,9 @@
# -c "adapter_khz 5000" -f "interface/ftdi/arty-onboard-ftdi.cfg" -f "board/sifive-e31arty-onboard-ftdi.cfg"
set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 6 -expected-id 0x0362d093
jtag newtap $_CHIPNAME cpu -irlen 6; # -expected-id 0x0362d093
# Arrange for bscan tunneling mode to become active after the JTAG chain is verified
# Arrange for bscan tunneling mode to become active after the JTAG chain is verified (or has been reset but even if the full verification sequence wasn't perfect)
jtag configure $_CHIPNAME.cpu -event setup {
ftdi_bscan_mode on
}