jlink: add detect hw type
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Mon, 7 Mar 2011 14:11:28 +0000 (15:11 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 13 Mar 2011 13:55:03 +0000 (14:55 +0100)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
src/jtag/drivers/jlink.c

index 6507403e34763c61df499c7997c5bfab69609723..174f7b346c517e2da6dcdab5de02877c24f816eb 100644 (file)
@@ -159,6 +159,20 @@ static char *jlink_cap_str[] = {
 /* max speed 12MHz v5.0 jlink */
 #define JLINK_MAX_SPEED 12000
 
+/* J-Link hardware versions */
+#define JLINK_HW_TYPE_JLINK    0
+#define JLINK_HW_TYPE_JTRACE   1
+#define JLINK_HW_TYPE_FLASHER  2
+#define JLINK_HW_TYPE_JLINK_PRO        3
+#define JLINK_HW_TYPE_MAX      4
+
+static char *jlink_hw_type_str[] = {
+       "J-Link",
+       "J-Trace",
+       "Flasher",
+       "J-Link Pro",
+};
+
 /* Queue command functions */
 static void jlink_end_state(tap_state_t state);
 static void jlink_state_move(void);
@@ -206,6 +220,7 @@ static uint16_t vids[] = { VID, 0 };
 static uint16_t pids[] = { PID, 0 };
 
 static uint32_t jlink_caps;
+static uint32_t jlink_hw_type;
 
 /***************************************************************************/
 /* External interface implementation */
@@ -687,10 +702,16 @@ static int jlink_get_version_info(void)
 
                uint32_t jlink_hw_version = buf_get_u32(usb_in_buffer, 0, 32);
                uint32_t major_revision = (jlink_hw_version / 10000) % 100;
+               jlink_hw_type = (jlink_hw_version / 1000000) % 100;
                if (major_revision >= 5)
                        jlink_hw_jtag_version = 3;
 
                LOG_INFO("J-Link hw version %i", (int)jlink_hw_version);
+
+               if (jlink_hw_type >= JLINK_HW_TYPE_MAX)
+                       LOG_INFO("J-Link hw type uknown 0x%x", jlink_hw_type);
+               else
+                       LOG_INFO("J-Link hw type %s", jlink_hw_type_str[jlink_hw_type]);
        }
 
        if (jlink_caps & (1 << EMU_CAP_GET_MAX_BLOCK_SIZE))

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)