ftdi: fix adapter_init rclk fallback
authorSpencer Oliver <spen@spen-soft.co.uk>
Mon, 24 Sep 2012 11:29:47 +0000 (12:29 +0100)
committerFreddie Chopin <freddie.chopin@gmail.com>
Tue, 2 Oct 2012 11:22:27 +0000 (11:22 +0000)
adapter_init expects jtag_get_speed (via ftdi_khz) to return a valid
fallback speed if the adapter does not support rclk. The call was failing
and so was the rest of the adapter init.

The makes the new ftdi driver emulate the old ftdi driver.

Change-Id: Ic7fac7d201241eb181e98f1ba7111f159731f6e0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/839
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/jtag/drivers/ftdi.c

index 46797d7dfe3952d0e3ca221849e0d4fb0c8dfef9..a8d396c0825e46aa80032a0dedea817ae009ff30 100644 (file)
@@ -247,6 +247,11 @@ static int ftdi_speed_div(int speed, int *khz)
 
 static int ftdi_khz(int khz, int *jtag_speed)
 {
+       if (khz == 0 && !mpsse_is_high_speed(mpsse_ctx)) {
+               LOG_DEBUG("RCLK not supported");
+               return ERROR_FAIL;
+       }
+
        *jtag_speed = khz * 1000;
        return ERROR_OK;
 }

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)