jlink: add support for Jlink-OB (0x0105) devices 31/2031/3
authorAndrey Yurovsky <yurovsky@gmail.com>
Sat, 8 Mar 2014 01:16:52 +0000 (17:16 -0800)
committerPaul Fertser <fercerpav@gmail.com>
Sat, 29 Mar 2014 07:12:42 +0000 (07:12 +0000)
commitfb897cc805fe193a1ee2f295f284e421660793d5
tree4d592e75336940a424097818a11629b14de5d697
parenta5ef7b83e2a729d9442801f34314b911e3ed1e9f
jlink: add support for Jlink-OB (0x0105) devices

The JLink-OB (onboard) devices work the same way as the normal JLink
except that their PID is 0x0105 (and that's the only one we know of so
far) and their endpoint addresses are different due to there being a
CDC-ACM interface as well.  These JLink-OB devices show up on a lot of
vendors' development kits as an integrated debugger.

This change simply checks whether the adapter we opened has a JLink-OB
PID and, if it does, uses the JLink-OB endpoints rather than the
default.  To do this, we add a new routine, jtag_libusb_get_pid() to the
libusb adapter layer, it in turn just calls
libusb_get_device_descriptor(), which previously had no wrapper.

Also, checkpatch.pl doesn't like the VID/PID macros as defined so I
moved them to the array itself.  This should have no effect on the code.

This change adds the 0102 through 0104 PIDs to openocd.rules as well as this
new 0105 PID.

Tested on an Atmel SAM4S Xplained board which has a JLink-OB, also
regression tested by using a 0x0101 PID normal JLink adapter.

Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com>
Change-Id: I121d30e57729cda3adb66e2a5dc72e1fcb7ef8b1
Reviewed-on: http://openocd.zylin.com/2031
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
contrib/99-openocd.rules
src/jtag/drivers/jlink.c
src/jtag/drivers/libusb0_common.c
src/jtag/drivers/libusb0_common.h
src/jtag/drivers/libusb1_common.c
src/jtag/drivers/libusb1_common.h

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)