/* project specific includes */
#include <jtag/interface.h>
+#include <jtag/transport.h>
#include <helper/time_support.h>
#if IS_CYGWIN == 1
void (*reset)(int trst, int srst);
void (*blink)(void);
int channel;
+ const char **transports;
};
/* init procedures for supported layouts */
static void signalyzer_h_blink(void);
static void ktlink_blink(void);
+/* common transport support options */
+static const char *jtag_only[] = { "jtag", NULL };
+
+
+//static const char *jtag_and_swd[] = { "jtag", "swd", NULL };
+#define jtag_and_swd NULL
+
static const struct ft2232_layout ft2232_layouts[] =
{
{ .name = "usbjtag",
{ .name = "evb_lm3s811",
.init = lm3s811_jtag_init,
.reset = ftx23_reset,
+ .transports = jtag_and_swd,
},
{ .name = "luminary_icdi",
.init = icdi_jtag_init,
.reset = ftx23_reset,
+ .transports = jtag_and_swd,
},
{ .name = "olimex-jtag",
.init = olimex_jtag_init,
/** Updates defaults for DBUS signals: the four JTAG signals
* (TCK, TDI, TDO, TMS) and * the four GPIOL signals.
*/
-static inline void ftx232_init_head(void)
+static inline void ftx232_dbus_init(void)
{
low_output = 0x08;
low_direction = 0x0b;
* the four GPIOL signals. Initialization covers value and direction,
* as customized for each layout.
*/
-static int ftx232_init_tail(void)
+static int ftx232_dbus_write(void)
{
uint8_t buf[3];
uint32_t bytes_written;
* NOTE: This is now _specific_ to the "usbjtag" layout.
* Don't try cram any more layouts into this.
*/
- ftx232_init_head();
+ ftx232_dbus_init();
nTRST = 0x10;
nTRSTnOE = 0x10;
nSRST = 0x40;
nSRSTnOE = 0x40;
- return ftx232_init_tail();
+ return ftx232_dbus_write();
}
static int lm3s811_jtag_init(void)
{
- ftx232_init_head();
+ ftx232_dbus_init();
/* There are multiple revisions of LM3S811 eval boards:
* - Rev B (and older?) boards have no SWO trace support.
low_output = 0x88;
low_direction = 0x8b;
- return ftx232_init_tail();
+ return ftx232_dbus_write();
}
static int icdi_jtag_init(void)
{
- ftx232_init_head();
+ ftx232_dbus_init();
/* Most Luminary eval boards support SWO trace output,
* and should use this "luminary_icdi" layout.
low_output = 0x88;
low_direction = 0xcb;
- return ftx232_init_tail();
+ return ftx232_dbus_write();
}
static int signalyzer_init(void)
{
- ftx232_init_head();
+ ftx232_dbus_init();
nTRST = 0x10;
nTRSTnOE = 0x10;
nSRST = 0x20;
nSRSTnOE = 0x20;
- return ftx232_init_tail();
+ return ftx232_dbus_write();
}
static int axm0432_jtag_init(void)
for (const struct ft2232_layout *l = ft2232_layouts; l->name; l++) {
if (strcmp(l->name, CMD_ARGV[0]) == 0) {
layout = l;
- return ERROR_OK;
+ /* This may also select the transport
+ * if we only suppport one of them.
+ */
+ return allow_transports(CMD_CTX,
+ l->transports ? : jtag_only);
}
}