vsllink: improve the performance when using swd 02/2302/3
authorSimon Qian <openocd@versaloon.com>
Tue, 16 Sep 2014 13:10:13 +0000 (21:10 +0800)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 29 Sep 2014 20:06:20 +0000 (20:06 +0000)
Versaloon firmware has been updated for reporting
errors if fail on swd transactions.

Change-Id: I49ac0ad034cc9ad83cc4e43953579811d1243063
Signed-off-by: Simon Qian <openocd@versaloon.com>
Reviewed-on: http://openocd.zylin.com/2302
Reviewed-by: Fatih Aşıcı <fatih.asici@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/jtag/drivers/vsllink.c

index fcac28820a436fa261e77a941c259d05ce1a5beb..844f6f2766f07bde5b10344dbc49a8db7b69a4cf 100644 (file)
@@ -97,7 +97,6 @@ static uint8_t *tdi_buffer;
 static uint8_t *tdo_buffer;
 
 static bool swd_mode;
-static int queued_retval;
 
 static struct vsllink *vsllink_handle;
 
@@ -758,7 +757,6 @@ static int_least32_t vsllink_swd_frequency(struct adiv5_dap *dap,
                LOG_DEBUG("SWD delay: %d, retry count: %d", delay, retry_count);
 
                versaloon_interface.adaptors.swd.config(0, 2, retry_count, delay);
-               queued_retval = versaloon_interface.adaptors.peripheral_commit();
        }
 
        return hz;
@@ -788,68 +786,24 @@ static int vsllink_swd_switch_seq(struct adiv5_dap *dap,
                return ERROR_FAIL;
        }
 
-       return versaloon_interface.adaptors.peripheral_commit();
+       return ERROR_OK;
 }
 
 static void vsllink_swd_read_reg(struct adiv5_dap *dap, uint8_t cmd,
                uint32_t *value)
 {
-       if (queued_retval != ERROR_OK)
-               return;
-
-       int retval;
-       uint32_t val = 0;
-       uint8_t ack;
-
-       versaloon_interface.adaptors.swd.transact(0, cmd, &val, &ack);
-       retval = versaloon_interface.adaptors.peripheral_commit();
-
-       if (retval != ERROR_OK) {
-               queued_retval = ERROR_FAIL;
-               return;
-       }
-
-       if (ack != 0x01) {
-               queued_retval = ack;
-               return;
-       }
-
-       if (value)
-               *value = val;
-
-       queued_retval = retval;
+       versaloon_interface.adaptors.swd.transact(0, cmd, value, NULL);
 }
 
 static void vsllink_swd_write_reg(struct adiv5_dap *dap, uint8_t cmd,
                uint32_t value)
 {
-       if (queued_retval != ERROR_OK)
-               return;
-
-       int retval;
-       uint8_t ack;
-
-       versaloon_interface.adaptors.swd.transact(0, cmd, &value, &ack);
-       retval = versaloon_interface.adaptors.peripheral_commit();
-
-       if (retval != ERROR_OK) {
-               queued_retval = ERROR_FAIL;
-               return;
-       }
-
-       if (ack != 0x01) {
-               queued_retval = ack;
-               return;
-       }
-
-       queued_retval = retval;
+       versaloon_interface.adaptors.swd.transact(0, cmd, &value, NULL);
 }
 
 static int vsllink_swd_run_queue(struct adiv5_dap *dap)
 {
-       int retval = queued_retval;
-       queued_retval = ERROR_OK;
-       return retval;
+       return versaloon_interface.adaptors.peripheral_commit();
 }
 
 /****************************************************************************

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)