Added minimodule (ftdi) interface
authorRodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Fri, 10 Jun 2011 19:19:32 +0000 (12:19 -0700)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 12 Jun 2011 09:18:27 +0000 (11:18 +0200)
src/jtag/drivers/ft2232.c

index 8c2382a15ebb3b5251a1710ea52f31ca811242ae..7c283278fdd063a9ef6a7006823ae98a8438d5eb 100644 (file)
@@ -177,6 +177,7 @@ static int lm3s811_jtag_init(void);
 static int icdi_jtag_init(void);
 static int olimex_jtag_init(void);
 static int flyswatter_init(void);
+static int minimodule_init(void);
 static int turtle_init(void);
 static int comstick_init(void);
 static int stm32stick_init(void);
@@ -197,6 +198,7 @@ static void ftx23_reset(int trst, int srst);
 static void jtagkey_reset(int trst, int srst);
 static void olimex_jtag_reset(int trst, int srst);
 static void flyswatter_reset(int trst, int srst);
+static void minimodule_reset(int trst, int srst);
 static void turtle_reset(int trst, int srst);
 static void comstick_reset(int trst, int srst);
 static void stm32stick_reset(int trst, int srst);
@@ -261,6 +263,10 @@ static const struct ft2232_layout  ft2232_layouts[] =
                .reset = flyswatter_reset,
                .blink = flyswatter_jtag_blink
        },
+       { .name = "minimodule",
+               .init = minimodule_init,
+               .reset = minimodule_reset,
+       },
        { .name = "turtelizer2",
                .init = turtle_init,
                .reset = turtle_reset,
@@ -1565,6 +1571,24 @@ static void flyswatter_reset(int trst, int srst)
        LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction);
 }
 
+static void minimodule_reset(int trst, int srst)
+{
+       if (srst == 1)
+       {
+               low_output &= ~nSRST;
+       }
+       else if (srst == 0)
+       {
+               low_output |= nSRST;
+       }
+
+       /* command "set data bits low byte" */
+       buffer_write(0x80);
+       buffer_write(low_output);
+       buffer_write(low_direction);
+       LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction);
+}
+
 static void turtle_reset(int trst, int srst)
 {
        trst = trst;
@@ -2900,6 +2924,37 @@ static int flyswatter_init(void)
        return ERROR_OK;
 }
 
+static int minimodule_init(void)
+{
+       low_output    = 0x18;//check if srst should be 1 or 0 initially. (0x08) (flyswatter was 0x18)
+       low_direction = 0xfb;//0xfb;
+
+       /* 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 'minimodule' layout");
+               return ERROR_JTAG_INIT_FAILED;
+       }
+       
+
+       nSRST    = 0x20;
+
+       high_output    = 0x00;
+       high_direction = 0x05;
+
+       /* turn red LED3 on, LED2 off */
+       //high_output |= 0x08;
+
+       /* 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 'minimodule' layout");
+               return ERROR_JTAG_INIT_FAILED;
+       }
+
+       return ERROR_OK;
+}
+
 static int turtle_init(void)
 {
        low_output    = 0x08;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)