+ high_output = 0x0;
+ high_direction = 0x0f;
+
+ /* nTRST is always push-pull */
+ high_output &= ~nTRSTnOE;
+ high_output |= nTRST;
+
+ /* nSRST is always open-drain */
+ high_output |= nSRSTnOE;
+ high_output &= ~nSRST;
+
+ /* initialize high byte for jtag */
+ if (ft2232_set_data_bits_high_byte(high_output, high_direction) != ERROR_OK) {
+ LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout");
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
+ return ERROR_OK;
+}
+
+static int cortino_jtag_init(void)
+{
+ low_output = 0x08;
+ low_direction = 0x1b;
+
+ /* initialize low byte for jtag */
+ if (ft2232_set_data_bits_low_byte(low_output, low_direction) != ERROR_OK) {
+ LOG_ERROR("couldn't initialize FT2232 with 'cortino' layout");
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
+ nTRST = 0x01;
+ nTRSTnOE = 0x00; /* no output enable for nTRST */
+ nSRST = 0x02;
+ nSRSTnOE = 0x00; /* no output enable for nSRST */
+
+ high_output = 0x03;
+ high_direction = 0x03;
+
+ /* initialize high byte for jtag */
+ if (ft2232_set_data_bits_high_byte(high_output, high_direction) != ERROR_OK) {
+ LOG_ERROR("couldn't initialize FT2232 with 'cortino' layout");
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
+ return ERROR_OK;
+}
+
+static int lisa_l_init(void)
+{
+ ftx232_dbus_init();
+
+ nTRST = 0x10;
+ nTRSTnOE = 0x10;
+ nSRST = 0x40;
+ nSRSTnOE = 0x40;
+
+ high_output = 0x00;
+ high_direction = 0x18;
+
+ /* initialize high byte for jtag */
+ if (ft2232_set_data_bits_high_byte(high_output, high_direction) != ERROR_OK) {
+ LOG_ERROR("couldn't initialize FT2232 with 'lisa_l' layout");
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
+ return ftx232_dbus_write();
+}