Line 25... |
Line 25... |
|
|
#include "cable_common.h"
|
#include "cable_common.h"
|
#include "cable_parallel.h"
|
#include "cable_parallel.h"
|
#include "cable_sim.h"
|
#include "cable_sim.h"
|
#include "cable_usbblaster.h"
|
#include "cable_usbblaster.h"
|
|
#include "cable_ft2232.h"
|
#include "cable_xpc_dlc9.h"
|
#include "cable_xpc_dlc9.h"
|
#include "errcodes.h"
|
#include "errcodes.h"
|
|
|
#define debug(...) //fprintf(stderr, __VA_ARGS__ )
|
#define debug(...) //fprintf(stderr, __VA_ARGS__ )
|
|
|
Line 41... |
Line 42... |
int (*opt_func)(int, char *);
|
int (*opt_func)(int, char *);
|
int (*bit_out_func)(uint8_t);
|
int (*bit_out_func)(uint8_t);
|
int (*bit_inout_func)(uint8_t, uint8_t *);
|
int (*bit_inout_func)(uint8_t, uint8_t *);
|
int (*stream_out_func)(uint32_t *, int, int);
|
int (*stream_out_func)(uint32_t *, int, int);
|
int (*stream_inout_func)(uint32_t *, uint32_t *, int, int);
|
int (*stream_inout_func)(uint32_t *, uint32_t *, int, int);
|
|
int (*flush_func)();
|
const char *opts;
|
const char *opts;
|
const char *help;
|
const char *help;
|
} jtag_cables[] = {
|
} jtag_cables[] = {
|
{ "rtl_sim",
|
{ "rtl_sim",
|
cable_rtl_sim_inout,
|
cable_rtl_sim_inout,
|
Line 54... |
Line 56... |
cable_rtl_sim_opt,
|
cable_rtl_sim_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_common_read_write_bit,
|
cable_common_read_write_bit,
|
cable_common_write_stream,
|
cable_common_write_stream,
|
cable_common_read_stream,
|
cable_common_read_stream,
|
|
NULL,
|
"d:",
|
"d:",
|
"-d [directory] Directory in which gdb_in.dat/gdb_out.dat may be found\n" },
|
"-d [directory] Directory in which gdb_in.dat/gdb_out.dat may be found\n" },
|
{ "vpi",
|
{ "vpi",
|
cable_vpi_inout,
|
cable_vpi_inout,
|
cable_vpi_out,
|
cable_vpi_out,
|
Line 66... |
Line 69... |
cable_vpi_opt,
|
cable_vpi_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_common_read_write_bit,
|
cable_common_read_write_bit,
|
cable_common_write_stream,
|
cable_common_write_stream,
|
cable_common_read_stream,
|
cable_common_read_stream,
|
|
NULL,
|
"s:p:",
|
"s:p:",
|
"-p [port] Port number that the VPI module is listening on\n\t-s [server] Server that the VPI module is running on\n" },
|
"-p [port] Port number that the VPI module is listening on\n\t-s [server] Server that the VPI module is running on\n" },
|
{ "xpc3",
|
{ "xpc3",
|
cable_xpc3_inout,
|
cable_xpc3_inout,
|
cable_xpc3_out,
|
cable_xpc3_out,
|
Line 78... |
Line 82... |
cable_parallel_opt,
|
cable_parallel_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_common_read_write_bit,
|
cable_common_read_write_bit,
|
cable_common_write_stream,
|
cable_common_write_stream,
|
cable_common_read_stream,
|
cable_common_read_stream,
|
|
NULL,
|
"p:",
|
"p:",
|
"-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" },
|
"-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" },
|
{ "xess",
|
{ "xess",
|
cable_xess_inout,
|
cable_xess_inout,
|
cable_xess_out,
|
cable_xess_out,
|
Line 90... |
Line 95... |
cable_parallel_opt,
|
cable_parallel_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_common_read_write_bit,
|
cable_common_read_write_bit,
|
cable_common_write_stream,
|
cable_common_write_stream,
|
cable_common_read_stream,
|
cable_common_read_stream,
|
|
NULL,
|
"p:",
|
"p:",
|
"-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" },
|
"-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" },
|
|
#ifdef __SUPPORT_USB_CABLES__
|
{ "usbblaster",
|
{ "usbblaster",
|
cable_usbblaster_inout,
|
cable_usbblaster_inout,
|
cable_usbblaster_out,
|
cable_usbblaster_out,
|
cable_usbblaster_init,
|
cable_usbblaster_init,
|
NULL,
|
NULL,
|
cable_usbblaster_opt,
|
cable_usbblaster_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_common_read_write_bit,
|
cable_common_read_write_bit,
|
cable_usbblaster_write_stream,
|
cable_usbblaster_write_stream,
|
cable_usbblaster_read_stream,
|
cable_usbblaster_read_stream,
|
|
NULL,
|
"",
|
"",
|
"no options\n" },
|
"no options\n" },
|
{ "xpc_usb",
|
{ "xpc_usb",
|
cable_xpcusb_inout,
|
cable_xpcusb_inout,
|
cable_xpcusb_out,
|
cable_xpcusb_out,
|
Line 114... |
Line 122... |
cable_xpcusb_opt,
|
cable_xpcusb_opt,
|
cable_common_write_bit,
|
cable_common_write_bit,
|
cable_xpcusb_read_write_bit,
|
cable_xpcusb_read_write_bit,
|
cable_common_write_stream,
|
cable_common_write_stream,
|
cable_common_read_stream,
|
cable_common_read_stream,
|
|
NULL,
|
|
"",
|
|
"no options\n" },
|
|
#ifdef __SUPPORT_FTDI_CABLES__
|
|
{ "ft2232",
|
|
NULL,
|
|
NULL,
|
|
cable_ftdi_init,
|
|
NULL,
|
|
cable_ftdi_opt,
|
|
cable_ftdi_write_bit,
|
|
cable_ftdi_read_write_bit,
|
|
cable_ftdi_write_stream,
|
|
cable_ftdi_read_stream,
|
|
cable_ftdi_flush,
|
"",
|
"",
|
"no options\n" },
|
"no options\n" },
|
{ NULL, NULL, NULL, NULL } };
|
#endif // __SUPPORT_FTDI_CABLES__
|
|
#endif // __SUPPORT_USB_CABLES__
|
|
{ NULL, NULL, NULL, NULL,
|
|
NULL, NULL, NULL, NULL,
|
|
NULL, NULL, NULL, NULL, NULL } };
|
|
|
static struct jtag_cable *jtag_cable_in_use = NULL; /* The currently selected cable */
|
static struct jtag_cable *jtag_cable_in_use = NULL; /* The currently selected cable */
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
Line 201... |
Line 228... |
|
|
int cable_read_write_bit(uint8_t packet_out, uint8_t *bit_in) {
|
int cable_read_write_bit(uint8_t packet_out, uint8_t *bit_in) {
|
return jtag_cable_in_use->bit_inout_func(packet_out, bit_in);
|
return jtag_cable_in_use->bit_inout_func(packet_out, bit_in);
|
}
|
}
|
|
|
|
int cable_flush(void) {
|
|
if(jtag_cable_in_use->flush_func != NULL)
|
|
return jtag_cable_in_use->flush_func();
|
|
return APP_ERR_NONE;
|
|
}
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
// Common functions which may or may not be used by individual drivers
|
// Common functions which may or may not be used by individual drivers
|
|
|
|
|