drivers/vsllink: add help and usage to commands
[openocd.git] / src / jtag / drivers / vsllink.c
index 844f6f2766f07bde5b10344dbc49a8db7b69a4cf..ea9152c090b93b3c53d9bb3d3e7236a798e4e83f 100644 (file)
@@ -12,9 +12,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 /* Versaloon is a programming tool for multiple MCUs.
@@ -72,10 +70,8 @@ static void vsllink_tap_append_scan(int length, uint8_t *buffer,
                struct scan_command *command);
 
 /* VSLLink SWD functions */
-static int_least32_t vsllink_swd_frequency(struct adiv5_dap *dap,
-               int_least32_t hz);
-static int vsllink_swd_switch_seq(struct adiv5_dap *dap,
-               enum swd_special_seq seq);
+static int_least32_t vsllink_swd_frequency(int_least32_t hz);
+static int vsllink_swd_switch_seq(enum swd_special_seq seq);
 
 /* VSLLink lowlevel functions */
 struct vsllink {
@@ -242,8 +238,10 @@ static int vsllink_execute_queue(void)
 
 static int vsllink_speed(int speed)
 {
-       if (swd_mode)
+       if (swd_mode) {
+               vsllink_swd_frequency(speed * 1000);
                return ERROR_OK;
+       }
 
        versaloon_interface.adaptors.jtag_raw.config(0, (uint16_t)speed);
        return versaloon_interface.adaptors.peripheral_commit();
@@ -347,8 +345,8 @@ static int vsllink_init(void)
                versaloon_interface.adaptors.gpio.config(0, GPIO_TRST, 0,
                        GPIO_TRST, GPIO_TRST);
                versaloon_interface.adaptors.swd.init(0);
-               vsllink_swd_frequency(NULL, jtag_get_speed_khz() * 1000);
-               vsllink_swd_switch_seq(NULL, JTAG_TO_SWD);
+               vsllink_swd_frequency(jtag_get_speed_khz() * 1000);
+               vsllink_swd_switch_seq(JTAG_TO_SWD);
 
        } else {
                /* malloc buffer size for tap */
@@ -728,8 +726,7 @@ static int vsllink_swd_init(void)
        return ERROR_OK;
 }
 
-static int_least32_t vsllink_swd_frequency(struct adiv5_dap *dap,
-               int_least32_t hz)
+static int_least32_t vsllink_swd_frequency(int_least32_t hz)
 {
        const int_least32_t delay2hz[] = {
                1850000, 235000, 130000, 102000, 85000, 72000
@@ -762,8 +759,7 @@ static int_least32_t vsllink_swd_frequency(struct adiv5_dap *dap,
        return hz;
 }
 
-static int vsllink_swd_switch_seq(struct adiv5_dap *dap,
-               enum swd_special_seq seq)
+static int vsllink_swd_switch_seq(enum swd_special_seq seq)
 {
        switch (seq) {
        case LINE_RESET:
@@ -789,19 +785,17 @@ static int vsllink_swd_switch_seq(struct adiv5_dap *dap,
        return ERROR_OK;
 }
 
-static void vsllink_swd_read_reg(struct adiv5_dap *dap, uint8_t cmd,
-               uint32_t *value)
+static void vsllink_swd_read_reg(uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk)
 {
        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)
+static void vsllink_swd_write_reg(uint8_t cmd, uint32_t value, uint32_t ap_delay_clk)
 {
        versaloon_interface.adaptors.swd.transact(0, cmd, &value, NULL);
 }
 
-static int vsllink_swd_run_queue(struct adiv5_dap *dap)
+static int vsllink_swd_run_queue(void)
 {
        return versaloon_interface.adaptors.peripheral_commit();
 }
@@ -925,31 +919,43 @@ static const struct command_registration vsllink_command_handlers[] = {
                .name = "vsllink_usb_vid",
                .handler = &vsllink_handle_usb_vid_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set USB VID",
+               .usage = "<vid>",
        },
        {
                .name = "vsllink_usb_pid",
                .handler = &vsllink_handle_usb_pid_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set USB PID",
+               .usage = "<pid>",
        },
        {
                .name = "vsllink_usb_serial",
                .handler = &vsllink_handle_usb_serial_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set or disable check for USB serial",
+               .usage = "[<serial>]",
        },
        {
                .name = "vsllink_usb_bulkin",
                .handler = &vsllink_handle_usb_bulkin_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set USB input endpoint",
+               .usage = "<ep_in>",
        },
        {
                .name = "vsllink_usb_bulkout",
                .handler = &vsllink_handle_usb_bulkout_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set USB output endpoint",
+               .usage = "<ep_out>",
        },
        {
                .name = "vsllink_usb_interface",
                .handler = &vsllink_handle_usb_interface_command,
                .mode = COMMAND_CONFIG,
+               .help = "Set USB output interface",
+               .usage = "<interface>",
        },
        COMMAND_REGISTRATION_DONE
 };

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)