diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-02 23:15:12 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-06-02 23:15:12 +0000 |
commit | a5467296097cc0a820da3aad65dcd9de196fc1be (patch) | |
tree | 06fe064c886f05e120a43645e0149179bfb91c9f /src/jtag/jtag.h | |
parent | 7dc29156fee5d4ae30f65f4c82e8cefde763fe40 (diff) |
Add header file for JTAG minidriver:
- Wraps all minidriver API functions using API front-ends:
- Outlines jtag_add_dr_out() and jtag_alloc_in_value32().
- Adds interface_ prefix to existing jtag_alloc_invalue_32 routines.
- Re-inline these interface definitions in new header file.
- Re-inline parts of the (mini)driver implementations in minidriver.h.
- Replace INCLUDE_JTAG_MINIDRIVER_H with #include directives.
The next patch will finish removing '#ifdef HAVE_JTAG_MINIDRIVER_H'
from jtag.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2006 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag/jtag.h')
-rw-r--r-- | src/jtag/jtag.h | 78 |
1 files changed, 3 insertions, 75 deletions
diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index f0aaeaab..94928117 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -585,17 +585,7 @@ extern void jtag_add_dr_scan(int num_fields, const scan_field_t* fields, tap_sta * allocation method is used, for the synchronous case the temporary 32 bits come * from the input field itself. */ - -#ifndef HAVE_JTAG_MINIDRIVER_H extern void jtag_alloc_in_value32(scan_field_t *field); -#else -static __inline__ void jtag_alloc_in_value32(scan_field_t *field) -{ - field->in_value=field->intmp; -} -#endif - - /* This version of jtag_add_dr_scan() uses the check_value/mask fields */ extern void jtag_add_dr_scan_check(int num_fields, scan_field_t* fields, tap_state_t endstate); @@ -841,61 +831,6 @@ void jtag_tap_handle_event(jtag_tap_t* tap, enum jtag_tap_event e); #define ERROR_JTAG_NOT_STABLE_STATE (-105) #define ERROR_JTAG_DEVICE_ERROR (-107) -#ifdef INCLUDE_JTAG_MINIDRIVER_H - -extern void interface_jtag_add_scan_check_alloc(scan_field_t *field); - -extern int interface_jtag_add_ir_scan( - int num_fields, const scan_field_t* fields, - tap_state_t endstate); -extern int interface_jtag_add_plain_ir_scan( - int num_fields, const scan_field_t* fields, - tap_state_t endstate); - -extern int interface_jtag_add_dr_scan( - int num_fields, const scan_field_t* fields, - tap_state_t endstate); -extern int interface_jtag_add_plain_dr_scan( - int num_fields, const scan_field_t* fields, - tap_state_t endstate); - -extern int interface_jtag_add_tlr(void); -extern int interface_jtag_add_pathmove(int num_states, const tap_state_t* path); -extern int interface_jtag_add_runtest(int num_cycles, tap_state_t endstate); - -/** - * This drives the actual srst and trst pins. srst will always be 0 - * if jtag_reset_config & RESET_SRST_PULLS_TRST != 0 and ditto for - * trst. - * - * the higher level jtag_add_reset will invoke jtag_add_tlr() if - * approperiate - */ -extern int interface_jtag_add_reset(int trst, int srst); -extern int interface_jtag_add_end_state(tap_state_t endstate); -extern int interface_jtag_add_sleep(u32 us); -extern int interface_jtag_add_clocks(int num_cycles); -extern int interface_jtag_execute_queue(void); - -/** - * Calls the interface callback to execute the queue. This routine - * is used by the JTAG driver layer and should not be called directly. - */ -extern int default_interface_jtag_execute_queue(void); - - -#endif // INCLUDE_JTAG_MINIDRIVER_H - -/* this allows JTAG devices to implement the entire jtag_xxx() layer in hw/sw */ -#ifdef HAVE_JTAG_MINIDRIVER_H -/* Here a #define MINIDRIVER() and an inline version of hw fifo interface_jtag_add_dr_out can be defined */ -#include "jtag_minidriver.h" -#else -extern void interface_jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int* num_bits, const u32* value, - tap_state_t end_state); - -#endif - /* jtag_add_dr_out() is a version of jtag_add_dr_scan() which * only scans data out. It operates on 32 bit integers instead * of 8 bit, which makes it a better impedance match with @@ -921,16 +856,9 @@ extern void interface_jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int * There is no jtag_add_dr_outin() version of this fn that also allows * clocking data back in. Patches gladly accepted! */ -static __inline__ void jtag_add_dr_out(jtag_tap_t* tap, int num_fields, const int* num_bits, const u32* value, - tap_state_t end_state) -{ - if (end_state != TAP_INVALID) - cmd_queue_end_state = end_state; - cmd_queue_cur_state = cmd_queue_end_state; - interface_jtag_add_dr_out(tap, num_fields, num_bits, value, cmd_queue_end_state); -} - - +extern void jtag_add_dr_out(jtag_tap_t* tap, + int num_fields, const int* num_bits, const u32* value, + tap_state_t end_state); /** |