Browse Source

jtag_scan: Cleaned up and reworked jtag_dev_shift_dr()

pull/947/head
dragonmux 2 years ago
committed by Piotr Esden-Tempski
parent
commit
a4ee80edfe
  1. 13
      src/target/jtag_scan.c
  2. 2
      src/target/jtag_scan.h

13
src/target/jtag_scan.c

@ -250,15 +250,16 @@ void jtag_dev_write_ir(jtag_proc_t *jp, const uint8_t jd_index, const uint32_t i
jtagtap_return_idle(1);
}
void jtag_dev_shift_dr(jtag_proc_t *jp, uint8_t jd_index, uint8_t *dout, const uint8_t *din, int ticks)
void jtag_dev_shift_dr(
jtag_proc_t *jp, const uint8_t jd_index, uint8_t *dout, const uint8_t *din, const size_t clock_cycles)
{
jtag_dev_t *d = &jtag_devs[jd_index];
jtagtap_shift_dr();
jp->jtagtap_tdi_seq(0, ones, d->dr_prescan);
if(dout)
jp->jtagtap_tdi_tdo_seq((void*)dout, d->dr_postscan?0:1, (void*)din, ticks);
jp->jtagtap_tdi_seq(false, ones, d->dr_prescan);
if (dout)
jp->jtagtap_tdi_tdo_seq((uint8_t *)dout, !d->dr_postscan, (const uint8_t *)din, clock_cycles);
else
jp->jtagtap_tdi_seq(d->dr_postscan?0:1, (void*)din, ticks);
jp->jtagtap_tdi_seq(1, ones, d->dr_postscan);
jp->jtagtap_tdi_seq(!d->dr_postscan, (const uint8_t *)din, clock_cycles);
jp->jtagtap_tdi_seq(true, ones, d->dr_postscan);
jtagtap_return_idle(1);
}

2
src/target/jtag_scan.h

@ -45,7 +45,7 @@ extern struct jtag_dev_s jtag_devs[JTAG_MAX_DEVS + 1];
extern uint32_t jtag_dev_count;
void jtag_dev_write_ir(jtag_proc_t *jp, uint8_t jd_index, uint32_t ir);
void jtag_dev_shift_dr(jtag_proc_t *jp, uint8_t jd_index, uint8_t *dout, const uint8_t *din, int ticks);
void jtag_dev_shift_dr(jtag_proc_t *jp, uint8_t jd_index, uint8_t *dout, const uint8_t *din, size_t ticks);
void jtag_add_device(uint32_t dev_index, const jtag_dev_t *jtag_dev);
#endif /*__JTAG_SCAN_H*/

Loading…
Cancel
Save