OpenOCD
drivers/OpenULINK/include/jtag.h File Reference
Include dependency graph for drivers/OpenULINK/include/jtag.h:

Go to the source code of this file.

Macros

#define NOP   { __asm nop __endasm; }
 

Functions

void jtag_clock_tck (uint16_t count)
 Generate TCK clock cycles. More...
 
void jtag_clock_tms (uint8_t count, uint8_t sequence)
 Perform TAP FSM state transitions at maximum TCK frequency. More...
 
void jtag_configure_tck_delay (uint8_t scan_in, uint8_t scan_out, uint8_t scan_io, uint8_t tck, uint8_t tms)
 Configure TCK delay parameters. More...
 
uint16_t jtag_get_signals (void)
 Get current JTAG signal states. More...
 
void jtag_scan_in (uint8_t out_offset, uint8_t in_offset)
 Perform JTAG SCAN-IN operation at maximum TCK frequency. More...
 
void jtag_scan_io (uint8_t out_offset, uint8_t in_offset)
 Perform bidirectional JTAG SCAN operation at maximum TCK frequency. More...
 
void jtag_scan_out (uint8_t out_offset)
 Perform JTAG SCAN-OUT operation at maximum TCK frequency. More...
 
void jtag_set_signals (uint8_t low, uint8_t high)
 Set state of JTAG output signals. More...
 
void jtag_slow_clock_tck (uint16_t count)
 Generate TCK clock cycles at variable frequency. More...
 
void jtag_slow_clock_tms (uint8_t count, uint8_t sequence)
 Perform TAP-FSM state transitions at less than maximum TCK frequency. More...
 
void jtag_slow_scan_in (uint8_t out_offset, uint8_t in_offset)
 Perform JTAG SCAN-IN operation at variable TCK frequency. More...
 
void jtag_slow_scan_io (uint8_t out_offset, uint8_t in_offset)
 Perform bidirectional JTAG SCAN operation at maximum TCK frequency. More...
 
void jtag_slow_scan_out (uint8_t out_offset)
 Perform JTAG SCAN-OUT operation at maximum TCK frequency. More...
 

Macro Definition Documentation

#define NOP   { __asm nop __endasm; }

Definition at line 24 of file drivers/OpenULINK/include/jtag.h.

Function Documentation

void jtag_clock_tck ( uint16_t  count)

Generate TCK clock cycles.

Maximum achievable TCK frequency is 375 kHz for ULINK clocked at 24 MHz.

Parameters
countnumber of TCK clock cyclces to generate.

Definition at line 567 of file OpenULINK/src/jtag.c.

References count, and PIN_TCK.

Referenced by execute_command().

void jtag_clock_tms ( uint8_t  count,
uint8_t  sequence 
)

Perform TAP FSM state transitions at maximum TCK frequency.

Maximum achievable TCK frequency is 176 kHz for ULINK clocked at 24 MHz.

Parameters
countthe number of state transitions to perform.
sequencethe TMS pin levels for each state transition, starting with the least-significant bit.

Definition at line 610 of file OpenULINK/src/jtag.c.

References count, PIN_TCK, and PIN_TMS.

Referenced by execute_command(), jtag_scan_in(), jtag_scan_io(), and jtag_scan_out().

void jtag_configure_tck_delay ( uint8_t  scan_in,
uint8_t  scan_out,
uint8_t  scan_io,
uint8_t  tck,
uint8_t  tms 
)

Configure TCK delay parameters.

Parameters
scan_innumber of delay cycles in scan_in operations.
scan_outnumber of delay cycles in scan_out operations.
scan_ionumber of delay cycles in scan_io operations.
tcknumber of delay cycles in clock_tck operations.
tmsnumber of delay cycles in clock_tms operations.

Definition at line 713 of file OpenULINK/src/jtag.c.

References delay_scan_in, delay_scan_io, delay_scan_out, delay_tck, and delay_tms.

Referenced by execute_command().

uint16_t jtag_get_signals ( void  )

Get current JTAG signal states.

Returns
a 16-bit integer where the most-significant byte contains the state of the JTAG input signals and the least-significant byte contains the state of the JTAG output signals.

Definition at line 666 of file OpenULINK/src/jtag.c.

References GET_BRKOUT, GET_RTCK, GET_TDO, GET_TRAP, MASK_PORTB_DIRECTION_OUT, SIGNAL_BRKOUT, SIGNAL_RTCK, SIGNAL_TDO, and SIGNAL_TRAP.

Referenced by execute_command().

void jtag_scan_in ( uint8_t  out_offset,
uint8_t  in_offset 
)

Perform JTAG SCAN-IN operation at maximum TCK frequency.

Dummy data is shifted into the JTAG chain via TDI, TDO data is sampled and stored in the EP2 IN buffer.

Maximum achievable TCK frequency is 182 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 52 of file OpenULINK/src/jtag.c.

References GET_TDO, jtag_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().

void jtag_scan_io ( uint8_t  out_offset,
uint8_t  in_offset 
)

Perform bidirectional JTAG SCAN operation at maximum TCK frequency.

Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO data is sampled and stored in the EP2 IN buffer. The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.

Maximum achievable TCK frequency is 100 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 377 of file OpenULINK/src/jtag.c.

References GET_TDO, jtag_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().

void jtag_scan_out ( uint8_t  out_offset)

Perform JTAG SCAN-OUT operation at maximum TCK frequency.

Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO data is not sampled. The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.

Maximum achievable TCK frequency is 142 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 217 of file OpenULINK/src/jtag.c.

References jtag_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().

void jtag_set_signals ( uint8_t  low,
uint8_t  high 
)

Set state of JTAG output signals.

Parameters
lowsignals which should be de-asserted.
highsignals which should be asserted.

Definition at line 698 of file OpenULINK/src/jtag.c.

References MASK_PORTB_DIRECTION_OUT.

Referenced by execute_command().

void jtag_slow_clock_tck ( uint16_t  count)

Generate TCK clock cycles at variable frequency.

Maximum achieveable TCK frequency is 166.6 kHz for ULINK clocked at 24 MHz.

Parameters
countnumber of TCK clock cyclces to generate.

Definition at line 585 of file OpenULINK/src/jtag.c.

References count, delay_tck, and PIN_TCK.

Referenced by execute_command().

void jtag_slow_clock_tms ( uint8_t  count,
uint8_t  sequence 
)

Perform TAP-FSM state transitions at less than maximum TCK frequency.

Maximum achievable TCK frequency is 117 kHz for ULINK clocked at 24 MHz.

Parameters
countthe number of state transitions to perform.
sequencethe TMS pin levels for each state transition, starting with the least-significant bit.

Definition at line 637 of file OpenULINK/src/jtag.c.

References count, delay_tms, PIN_TCK, and PIN_TMS.

Referenced by execute_command(), jtag_slow_scan_in(), jtag_slow_scan_io(), and jtag_slow_scan_out().

void jtag_slow_scan_in ( uint8_t  out_offset,
uint8_t  in_offset 
)

Perform JTAG SCAN-IN operation at variable TCK frequency.

Dummy data is shifted into the JTAG chain via TDI, TDO data is sampled and stored in the EP2 IN buffer.

Maximum achievable TCK frequency is 113 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 129 of file OpenULINK/src/jtag.c.

References delay_scan_in, GET_TDO, jtag_slow_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().

void jtag_slow_scan_io ( uint8_t  out_offset,
uint8_t  in_offset 
)

Perform bidirectional JTAG SCAN operation at maximum TCK frequency.

Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO data is sampled and stored in the EP2 IN buffer. The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.

Maximum achievable TCK frequency is 78 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 469 of file OpenULINK/src/jtag.c.

References delay_scan_io, GET_TDO, jtag_slow_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().

void jtag_slow_scan_out ( uint8_t  out_offset)

Perform JTAG SCAN-OUT operation at maximum TCK frequency.

Data stored in EP2 OUT buffer is shifted into the JTAG chain via TDI, TDO data is not sampled. The TAP-FSM state is alyways left in the PAUSE-DR/PAUSE-IR state.

Maximum achievable TCK frequency is 97 kHz for ULINK clocked at 24 MHz.

Parameters
out_offsetoffset in OUT2BUF where payload data starts

Definition at line 292 of file OpenULINK/src/jtag.c.

References delay_scan_out, jtag_slow_clock_tms(), PIN_TCK, PIN_TDI, and PIN_TMS.

Referenced by execute_command().