icdi: add TI icdi interface

This is the new proprietary interface replacing the older FTDI based adapters.
It is currently fitted to the ek-lm4f232 and Stellaris LaunchPad.

Change-Id: I794ad79e31ff61ec8e9f49530aca9308025c0b60
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/922
Tested-by: jenkins
This commit is contained in:
Spencer Oliver
2012-11-12 15:06:37 +00:00
parent c7a6f065d2
commit adb8ec32dc
13 changed files with 858 additions and 13 deletions

2
README
View File

@@ -275,6 +275,8 @@ options may be available there:
--enable-stlink Enable building support for the ST-Link JTAG
Programmer
--enable-ti-icdi Enable building support for the TI/Stellaris ICDI
JTAG Programmer
--enable-osbdm Enable building support for the OSBDM (JTAG only)
Programmer

View File

@@ -477,7 +477,11 @@ AC_ARG_ENABLE([buspirate],
AC_ARG_ENABLE([stlink],
AS_HELP_STRING([--enable-stlink], [Enable building support for the ST-Link JTAG Programmer]),
[build_hladapter=$enableval], [build_hladapter=no])
[build_hladapter_stlink=$enableval], [build_hladapter_stlink=no])
AC_ARG_ENABLE([ti-icdi],
AS_HELP_STRING([--enable-ti-icdi], [Enable building support for the TI ICDI JTAG Programmer]),
[build_hladapter_icdi=$enableval], [build_hladapter_icdi=no])
AC_ARG_ENABLE([osbdm],
AS_HELP_STRING([--enable-osbdm], [Enable building support for the OSBDM (JTAG only) Programmer]),
@@ -790,10 +794,10 @@ else
AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
fi
if test $build_hladapter = yes; then
AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the ST-Link JTAG driver.])
if test $build_hladapter_stlink = yes -o $build_hladapter_icdi = yes; then
AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
else
AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you don't want the ST-Link JTAG driver.])
AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you don't want the High Level JTAG driver.])
fi
if test $build_osbdm = yes; then
@@ -1142,8 +1146,8 @@ fi
# Check for libusb1 ported drivers.
build_usb_ng=no
if test $build_jlink = yes -o $build_hladapter = yes -o $build_osbdm = yes -o \
$build_opendous = yes -o $build_ftdi = yes
if test $build_jlink = yes -o $build_hladapter_stlink = yes -o $build_osbdm = yes -o \
$build_opendous = yes -o $build_ftdi = yes -o $build_hladapter_icdi = yes
then
build_usb_ng=yes
fi
@@ -1192,7 +1196,7 @@ AM_CONDITIONAL([ULINK], [test $build_ulink = yes])
AM_CONDITIONAL([ARMJTAGEW], [test $build_armjtagew = yes])
AM_CONDITIONAL([REMOTE_BITBANG], [test $build_remote_bitbang = yes])
AM_CONDITIONAL([BUSPIRATE], [test $build_buspirate = yes])
AM_CONDITIONAL([HLADAPTER], [test $build_hladapter = yes])
AM_CONDITIONAL([HLADAPTER], [test $build_hladapter_stlink = yes -o $build_hladapter_icdi = yes])
AM_CONDITIONAL([OSBDM], [test $build_osbdm = yes])
AM_CONDITIONAL([OPENDOUS], [test $build_opendous = yes])
AM_CONDITIONAL([SYSFSGPIO], [test $build_sysfsgpio = yes])

View File

@@ -49,12 +49,15 @@ ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="664", GROUP="plugdev"
# Hitex STM32-PerformanceStick
ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="664", GROUP="plugdev"
# TI/Luminary Stellaris Evaluation Board (several)
# TI/Luminary Stellaris Evaluation Board FTDI (several)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="664", GROUP="plugdev"
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="664", GROUP="plugdev"
# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="664", GROUP="plugdev"
# Xverve Signalyzer Tool (DT-USB-ST)
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="664", GROUP="plugdev"

View File

@@ -370,3 +370,30 @@ void bit_copy_discard(struct bit_copy_queue *q)
free(qe);
}
}
int unhexify(char *bin, const char *hex, int count)
{
int i, tmp;
for (i = 0; i < count; i++) {
if (sscanf(hex + (2 * i), "%02x", &tmp) != 1)
return i;
bin[i] = tmp;
}
return i;
}
int hexify(char *hex, const char *bin, int count, int out_maxlen)
{
int i, cmd_len = 0;
/* May use a length, or a null-terminated string as input. */
if (count == 0)
count = strlen(bin);
for (i = 0; i < count; i++)
cmd_len += snprintf(hex + cmd_len, out_maxlen - cmd_len, "%02x", bin[i]);
return cmd_len;
}

View File

@@ -156,4 +156,9 @@ int bit_copy_queued(struct bit_copy_queue *q, uint8_t *dst, unsigned dst_offset,
void bit_copy_execute(struct bit_copy_queue *q);
void bit_copy_discard(struct bit_copy_queue *q);
/* functions to convert to/from hex encoded buffer
* used in ti-icdi driver and gdb server */
int unhexify(char *bin, const char *hex, int count);
int hexify(char *hex, const char *bin, int count, int out_maxlen);
#endif /* BINARYBUFFER_H */

View File

@@ -100,6 +100,7 @@ DRIVERFILES += remote_bitbang.c
endif
if HLADAPTER
DRIVERFILES += stlink_usb.c
DRIVERFILES += ti_icdi_usb.c
endif
if OSBDM
DRIVERFILES += osbdm.c

File diff suppressed because it is too large Load Diff

View File

@@ -71,6 +71,12 @@ static const struct hl_layout hl_layouts[] = {
.close = hl_layout_close,
.api = &stlink_usb_layout_api,
},
{
.name = "ti-icdi",
.open = hl_layout_open,
.close = hl_layout_close,
.api = &icdi_usb_layout_api,
},
{.name = NULL, /* END OF TABLE */ },
};

View File

@@ -30,6 +30,7 @@ struct hl_interface_param_s;
/** */
extern struct hl_layout_api_s stlink_usb_layout_api;
extern struct hl_layout_api_s icdi_usb_layout_api;
/** */
struct hl_layout_api_s {

View File

@@ -0,0 +1,15 @@
#
# TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits
#
# http://www.ti.com/tool/ek-lm4f120xl
#
#
# NOTE: using the bundled ICDI interface is optional!
# This interface is not ftdi based as previous boards were
#
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x8000
set CHIPNAME lm4f120h5qr
source [find target/stellaris_icdi.cfg]

View File

@@ -4,10 +4,12 @@
# http://www.ti.com/tool/ek-lm4f232
#
# NOTE: using the bundled FT2232 JTAG/SWD/SWO interface is optional!
# so is using in JTAG mode, as done here.
source [find interface/luminary-icdi.cfg]
#
# NOTE: using the bundled ICDI interface is optional!
# This interface is not ftdi based as previous boards were
#
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x8000
set CHIPNAME lm4f23x
source [find target/stellaris.cfg]
source [find target/stellaris_icdi.cfg]

15
tcl/interface/ti-icdi.cfg Normal file
View File

@@ -0,0 +1,15 @@
#
# TI Stellaris In-Circuit Debug Interface (ICDI) Board
#
# This is the propriety ICDI interface used on newer boards such as
# LM4F232 Evaluation Kit - http://www.ti.com/tool/ek-lm4f232
# Stellaris Launchpad - http://www.ti.com/stellaris-launchpad
# http://www.ti.com/tool/ek-lm4f232
#
interface hla
hla_layout ti-icdi
hla_vid_pid 0x1cbe 0x00fd
# unused but set to disable warnings
adapter_khz 1000

View File

@@ -0,0 +1,34 @@
#
# lm3s icdi pseudo target
#
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME lm3s
}
# Work-area is a space in RAM used for flash programming
# By default use 16kB
if { [info exists WORKAREASIZE] } {
set _WORKAREASIZE $WORKAREASIZE
} else {
set _WORKAREASIZE 0x4000
}
#
# possible value are hla_jtag
# currently swd is not supported
#
transport select hla_jtag
# do not check id as icdi currently does not support it
hla newtap $_CHIPNAME cpu -expected-id 0
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME hla_target -chain-position $_TARGETNAME
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
# flash configuration ... autodetects sizes, autoprobed
flash bank $_CHIPNAME.flash stellaris 0 0 0 0 $_TARGETNAME