jtag/drivers/jlink.c: fix for LPC Link-2 running JLink firmware on Linux
[openocd.git] / src / jtag / drivers / jlink.c
index 55b1e45f9fb54b13cb2f1492710fb620aa0b5bde..2177b08e04b04628a617f3c17c7d8b466d8cd53a 100644 (file)
@@ -1713,7 +1713,15 @@ static struct jlink *jlink_usb_open()
         * committing them!
         */
 
-#if IS_WIN32 == 0
+/* This entire block can probably be removed. It was a workaround for
+ * libusb0.1 and old JLink firmware. It has already be removed for
+ * windows and causing problems (LPC Link-2 with JLink firmware) on
+ * Linux with libusb1.0.
+ *
+ * However, for now the behavior will be left unchanged for non-windows
+ * platforms using libusb0.1 due to lack of testing.
+ */
+#if IS_WIN32 == 0 && HAVE_LIBUSB1 == 0
 
        jtag_libusb_reset_device(devh);
 
@@ -1735,19 +1743,13 @@ static struct jlink *jlink_usb_open()
 
 #endif
 
-       /* usb_set_configuration required under win32 */
+       /* usb_set_configuration is only required under win32
+        * with libusb 0.1 and libusb0.sys. For libusb 1.0 it is a no-op
+        * since the configuration is already set. */
        struct jtag_libusb_device *udev = jtag_libusb_get_device(devh);
        jtag_libusb_set_configuration(devh, 0);
        jtag_libusb_claim_interface(devh, 0);
 
-#if 0
-       /*
-        * This makes problems under Mac OS X. And is not needed
-        * under Windows. Hopefully this will not break a linux build
-        */
-       usb_set_altinterface(result->usb_handle, 0);
-#endif
-
        /* Use the OB endpoints if the JLink we matched is a Jlink-OB adapter */
        uint16_t matched_pid;
        if (jtag_libusb_get_pid(udev, &matched_pid) == 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)