From d66f48d1f6923e46b81b790d6e02396b4f0f519f Mon Sep 17 00:00:00 2001 From: Nemui Trinomius Date: Sat, 13 Sep 2014 07:44:55 +0900 Subject: [PATCH] jlink: Added hardware version number for JLink firmware on LPC-Link2 JLink firmware on LPC-Link2 has unique hardware version number(0x12). Change-Id: I76b6e27c47d236da75c61dd6b83d6a823615968d Signed-off-by: Nemui Trinomius Reviewed-on: http://openocd.zylin.com/2298 Tested-by: jenkins Reviewed-by: Anders Oleson Reviewed-by: Xiaofan Reviewed-by: Paul Fertser --- src/jtag/drivers/jlink.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index ca57ae848..63580f7f6 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -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)) {