]> git.sur5r.net Git - openocd/commitdiff
jlink: Added hardware version number for JLink firmware on LPC-Link2
authorNemui Trinomius <nemuisan_kawausogasuki@live.jp>
Fri, 12 Sep 2014 22:44:55 +0000 (07:44 +0900)
committerPaul Fertser <fercerpav@gmail.com>
Wed, 11 Feb 2015 15:10:53 +0000 (15:10 +0000)
JLink firmware on LPC-Link2 has unique hardware version number(0x12).

Change-Id: I76b6e27c47d236da75c61dd6b83d6a823615968d
Signed-off-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-on: http://openocd.zylin.com/2298
Tested-by: jenkins
Reviewed-by: Anders Oleson <anders@openpuma.org>
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
src/jtag/drivers/jlink.c

index ca57ae848ca23c64f23f25442408f2424626a955..63580f7f6eca2d92b6352b47b22b61c720a867a1 100644 (file)
@@ -195,17 +195,9 @@ static const char * const jlink_cap_str[] = {
 #define JLINK_HW_TYPE_FLASHER                  2
 #define JLINK_HW_TYPE_JLINK_PRO                        3
 #define JLINK_HW_TYPE_JLINK_LITE_ADI   5
-#define JLINK_HW_TYPE_MAX                              6
-
-static const char * const jlink_hw_type_str[] = {
-       "J-Link",
-       "J-Trace",
-       "Flasher",
-       "J-Link Pro",
-       "Unknown",
-       "J-Link Lite-ADI",
-};
+#define JLINK_HW_TYPE_LPCLINK2                 18
 
+/* Interface selection */
 #define JLINK_TIF_JTAG         0
 #define JLINK_TIF_SWD          1
 #define JLINK_SWD_DIR_IN       0
@@ -964,10 +956,29 @@ static int jlink_get_version_info(void)
 
                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 unknown 0x%" PRIx32, jlink_hw_type);
-               else
-                       LOG_INFO("J-Link hw type %s", jlink_hw_type_str[jlink_hw_type]);
+               switch (jlink_hw_type) {
+                       case JLINK_HW_TYPE_JLINK:
+                               LOG_INFO("J-Link hw type J-Link");
+                               break;
+                       case JLINK_HW_TYPE_JTRACE:
+                               LOG_INFO("J-Link hw type J-Trace");
+                               break;
+                       case JLINK_HW_TYPE_FLASHER:
+                               LOG_INFO("J-Link hw type Flasher");
+                               break;
+                       case JLINK_HW_TYPE_JLINK_PRO:
+                               LOG_INFO("J-Link hw type J-Link Pro");
+                               break;
+                       case JLINK_HW_TYPE_JLINK_LITE_ADI:
+                               LOG_INFO("J-Link hw type J-Link Lite-ADI");
+                               break;
+                       case JLINK_HW_TYPE_LPCLINK2:
+                               LOG_INFO("J-Link hw type J-Link on LPC-Link2");
+                               break;
+                       default:
+                               LOG_INFO("J-Link hw type unknown 0x%" PRIx32, jlink_hw_type);
+                               break;
+               }
        }
 
        if (jlink_caps & (1 << EMU_CAP_GET_MAX_BLOCK_SIZE)) {