You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <zw...@ma...> - 2009-06-08 12:54:20
|
Author: zwelch Date: 2009-06-08 12:54:06 +0200 (Mon, 08 Jun 2009) New Revision: 2109 Modified: trunk/src/jtag/jtag.c Log: Simplify logic in handle_jtag_speed_command. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-08 06:18:13 UTC (rev 2108) +++ trunk/src/jtag/jtag.c 2009-06-08 10:54:06 UTC (rev 2109) @@ -2144,8 +2144,10 @@ static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - int retval=ERROR_OK; + int retval = ERROR_OK; + if (argc > 1) + return ERROR_COMMAND_SYNTAX_ERROR; if (argc == 1) { LOG_DEBUG("handle jtag speed"); @@ -2156,14 +2158,7 @@ /* this command can be called during CONFIG, * in which case jtag isn't initialized */ if (jtag) - { - retval=jtag->speed(cur_speed); - } - } else if (argc == 0) - { - } else - { - return ERROR_COMMAND_SYNTAX_ERROR; + retval = jtag->speed(cur_speed); } command_print(cmd_ctx, "jtag_speed: %d", jtag_speed); |
From: oharboe at B. <oh...@ma...> - 2009-06-08 08:18:13
|
Author: oharboe Date: 2009-06-08 08:18:13 +0200 (Mon, 08 Jun 2009) New Revision: 2108 Modified: trunk/src/target/target.c Log: David Brownell <da...@pa...> Bugfix: $target_name cget/configure -work-area-backup commands should return the "is it backed up?" flag, not the work area size. Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-08 06:16:43 UTC (rev 2107) +++ trunk/src/target/target.c 2009-06-08 06:18:13 UTC (rev 2108) @@ -3413,7 +3413,7 @@ goto no_params; } } - Jim_SetResult( interp, Jim_NewIntObj( goi->interp, target->working_area_size ) ); + Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->backup_working_area)); /* loop for more e*/ break; |
From: oharboe at B. <oh...@ma...> - 2009-06-08 08:16:54
|
Author: oharboe Date: 2009-06-08 08:16:43 +0200 (Mon, 08 Jun 2009) New Revision: 2107 Modified: trunk/doc/openocd.texi trunk/src/target/target.c Log: David Brownell <da...@pa...> - Don't let disabled TAPs be set as the current target - Improve "targets" output: * Remove undesirable "chain position" number; we discourage using them * TAP and Target column updates: + make them long enough for current usage + improve labels, removing guesswork + "TapName" label patches scan_chain output * Highlight the "current" target * Display "tap disabled" as a new pseudo-state * Update docs accordingly Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-08 04:35:19 UTC (rev 2106) +++ trunk/doc/openocd.texi 2009-06-08 06:16:43 UTC (rev 2107) @@ -2117,14 +2117,15 @@ This display often has only one CPU; here's what it might look like with more than one: @verbatim - CmdName Type Endian AbsChainPos Name State --- ---------- ---------- ---------- ----------- ------------- ---------- - 0: rm9200.cpu arm920t little 2 rm9200.cpu running - 1: MyTarget cortex_m3 little 0 mychip.cpu halted + TargetName Type Endian TapName State +-- ------------------ ---------- ------ ------------------ ------------ + 0* at91rm9200.cpu arm920t little at91rm9200.cpu running + 1 MyTarget cortex_m3 little mychip.foo tap-disabled @end verbatim One member of that list is the @dfn{current target}, which is implicitly referenced by many commands. +It's the one marked with a @code{*} near the target name. In particular, memory addresses often refer to the address space seen by that current target. Commands like @command{mdw} (memory display words) Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-08 04:35:19 UTC (rev 2106) +++ trunk/src/target/target.c 2009-06-08 06:16:43 UTC (rev 2107) @@ -1467,6 +1467,12 @@ command_print(cmd_ctx,"Target: %s is unknown, try one of:\n", args[0] ); goto DumpTargets; } + if (!target->tap->enabled) { + command_print(cmd_ctx,"Target: TAP %s is disabled, " + "can't be the current target\n", + target->tap->dotted_name); + return ERROR_FAIL; + } cmd_ctx->current_target = target->target_number; return ERROR_OK; @@ -1474,19 +1480,32 @@ DumpTargets: target = all_targets; - command_print(cmd_ctx, " CmdName Type Endian AbsChainPos Name State "); - command_print(cmd_ctx, "-- ---------- ---------- ---------- ----------- ------------- ----------"); + command_print(cmd_ctx, " TargetName Type Endian TapName State "); + command_print(cmd_ctx, "-- ------------------ ---------- ------ ------------------ ------------"); while (target) { - /* XX: abcdefghij abcdefghij abcdefghij abcdefghij */ - command_print(cmd_ctx, "%2d: %-10s %-10s %-10s %10d %14s %s", + const char *state; + char marker = ' '; + + if (target->tap->enabled) + state = Jim_Nvp_value2name_simple(nvp_target_state, + target->state)->name; + else + state = "tap-disabled"; + + if (cmd_ctx->current_target == target->target_number) + marker = '*'; + + /* keep columns lined up to match the headers above */ + command_print(cmd_ctx, "%2d%c %-18s %-10s %-6s %-18s %s", target->target_number, + marker, target->cmd_name, target_get_name(target), - Jim_Nvp_value2name_simple( nvp_target_endian, target->endianness )->name, - target->tap->abs_chain_position, + Jim_Nvp_value2name_simple(nvp_target_endian, + target->endianness)->name, target->tap->dotted_name, - Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name ); + state); target = target->next; } |
From: <zw...@ma...> - 2009-06-08 06:35:25
|
Author: zwelch Date: 2009-06-08 06:35:19 +0200 (Mon, 08 Jun 2009) New Revision: 2106 Modified: trunk/configure.in Log: Adjust whitespace in configure script: use two spaces for indent. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-08 04:35:05 UTC (rev 2105) +++ trunk/configure.in 2009-06-08 04:35:19 UTC (rev 2106) @@ -1,6 +1,6 @@ AC_PREREQ(2.60) AC_INIT([openocd], [0.2.0-in-development], - [OpenOCD Mailing List <ope...@li...>]) + [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) AM_INIT_AUTOMAKE([-Wall -Wno-portability]) @@ -91,14 +91,14 @@ build_release=yes AC_ARG_ENABLE(release, - AS_HELP_STRING([--enable-release], [Enable Release Build, default no]), - [build_release=$enableval], [build_release=no]) + AS_HELP_STRING([--enable-release], [Enable Release Build, default no]), + [build_release=$enableval], [build_release=no]) if test $cross_compiling = no; then - if test $build_release = no; then - # check we can find guess-rev.sh - AC_CHECK_FILE("$srcdir/guess-rev.sh", build_release=no, build_release=yes) - fi + if test $build_release = no; then + # check we can find guess-rev.sh + AC_CHECK_FILE("$srcdir/guess-rev.sh", build_release=no, build_release=yes) + fi fi # We are not *ALWAYS* being installed in the standard place. @@ -128,7 +128,7 @@ LDFLAGS="$LDFLAGS -L$OCDxprefix/lib" # RPATH becomes an issue on Linux only if test $host_os = linux-gnu || test $host_os = linux ; then - LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" + LDFLAGS="$LDFLAGS -Wl,-rpath,$OCDxprefix/lib" fi # The "INCDIR" is also usable CFLAGS="$CFLAGS -I$includedir" @@ -136,7 +136,7 @@ AC_ARG_WITH(ftd2xx, AS_HELP_STRING([--with-ftd2xx=<PATH>],[This option has been removed.]), -[ + [ # Option Given. cat << __EOF__ @@ -148,7 +148,7 @@ Where <path> is the path the the directory where the "tar.gz" file from FTDICHIP.COM was unpacked, for example: - --with-ftd2xx-linux-tardir=/home/duane/libftd2xx-linux-tardir=/home/duane/libftd2xx0.4.16 + --with-ftd2xx-linux-tardir=${HOME}/libftd2xx0.4.16 On Cygwin/MingW32, the new option is: @@ -157,17 +157,12 @@ Where <path> is the path to the directory where the "zip" file from FTDICHIP.COM was unpacked, for example: - --with-ftd2xx-win32-zipdir=/home/duane/ftd2xx.cdm.files + --with-ftd2xx-win32-zipdir=${HOME}/ftd2xx.cdm.files __EOF__ AC_MSG_ERROR([Sorry Cannot continue]) -], -[ -# Option not given -true -] -) + ], [true]) #======================================== # FTD2XXX support comes in 4 forms. @@ -184,17 +179,12 @@ # option present if test -d $with_ftd2xx_win32_zipdir then - with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd` - AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir]) + with_ftd2xx_win32_zipdir=`cd $with_ftd2xx_win32_zipdir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_win32_zipdir]) else - AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir]) + AC_MSG_ERROR([Parameter to --with-ftd2xx-win32-zipdir is not a dir: $with_ftd2xx_win32_zipdir]) fi - ], - [ - # not given - true - ] -) + ], [true]) AC_ARG_WITH(ftd2xx-linux-tardir, AS_HELP_STRING([--with-ftd2xx-linux-tardir], [Where (Linux/Unix) the tar file from ftdichip.com was unpacked <default=search>]), @@ -205,50 +195,44 @@ fi if test -d $with_ftd2xx_linux_tardir then - with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd` - AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir]) + with_ftd2xx_linux_tardir=`cd $with_ftd2xx_linux_tardir && pwd` + AC_MSG_NOTICE([Using: ftdichip.com library: $with_ftd2xx_linux_tardir]) else - AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir]) + AC_MSG_ERROR([Parameter to --with-ftd2xx-linux-tardir is not a dir: $with_ftd2xx_linux_tardir]) fi - ], - [ - # Not given - true - ] -) + ], [true]) AC_ARG_WITH(ftd2xx-lib, - AS_HELP_STRING([--with-ftd2xx-lib], [Use static or shared ftd2xx libs on default static]), -[ -case "$withval" in -static) - with_ftd2xx_lib=$withval - ;; -shared) - with_ftd2xx_lib=$withval - ;; -*) - AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval]) - ;; -esac -], -[ - # Default is static - it is simpler :-( - with_ftd2xx_lib=static -] -) + AS_HELP_STRING([--with-ftd2xx-lib], + [Use static or shared ftd2xx libs on default static]), + [ + case "$withval" in + static) + with_ftd2xx_lib=$withval + ;; + shared) + with_ftd2xx_lib=$withval + ;; + *) + AC_MSG_ERROR([Option: --with-ftd2xx-lib=static or --with-ftd2xx-lib=shared not, $withval]) + ;; + esac + ], [ + # Default is static - it is simpler :-( + with_ftd2xx_lib=static + ]) AC_ARG_ENABLE(gccwarnings, - AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]), - [gcc_warnings=$enableval], [gcc_warnings=yes]) + AS_HELP_STRING([--disable-gccwarnings], [Disable compiler warnings]), + [gcc_warnings=$enableval], [gcc_warnings=yes]) AC_ARG_ENABLE(wextra, - AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]), - [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings]) + AS_HELP_STRING([--disable-wextra], [Disable extra compiler warnings]), + [gcc_wextra=$enableval], [gcc_wextra=$gcc_warnings]) AC_ARG_ENABLE(werror, - AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]), - [gcc_werror=$enableval], [gcc_werror=$gcc_warnings]) + AS_HELP_STRING([--disable-werror], [Do not treat warnings as errors]), + [gcc_werror=$enableval], [gcc_werror=$gcc_warnings]) # set default verbose options, overridden by following options debug_jtag_io=no @@ -256,26 +240,26 @@ debug_usb_comms=no AC_ARG_ENABLE(verbose, - AS_HELP_STRING([--enable-verbose], - [Enable verbose JTAG I/O messages (for debugging).]), - [ - debug_jtag_io=$enableval - debug_usb_io=$enableval - debug_usb_comms=$enableval - ], []) + AS_HELP_STRING([--enable-verbose], + [Enable verbose JTAG I/O messages (for debugging).]), + [ + debug_jtag_io=$enableval + debug_usb_io=$enableval + debug_usb_comms=$enableval + ], []) AC_ARG_ENABLE(verbose_jtag_io, - AS_HELP_STRING([--enable-verbose-jtag-io], - [Enable verbose JTAG I/O messages (for debugging).]), - [debug_jtag_io=$enableval], []) + AS_HELP_STRING([--enable-verbose-jtag-io], + [Enable verbose JTAG I/O messages (for debugging).]), + [debug_jtag_io=$enableval], []) AC_ARG_ENABLE(verbose_usb_io, - AS_HELP_STRING([--enable-verbose-usb-io], - [Enable verbose USB I/O messages (for debugging)]), - [debug_usb_io=$enableval], []) + AS_HELP_STRING([--enable-verbose-usb-io], + [Enable verbose USB I/O messages (for debugging)]), + [debug_usb_io=$enableval], []) AC_ARG_ENABLE(verbose_usb_comms, - AS_HELP_STRING([--enable-verbose-usb-comms], - [Enable verbose USB communication messages (for debugging)]), - [debug_usb_comms=$enableval], []) + AS_HELP_STRING([--enable-verbose-usb-comms], + [Enable verbose USB communication messages (for debugging)]), + [debug_usb_comms=$enableval], []) AC_MSG_CHECKING([whether to enable verbose JTAG I/O messages]); AC_MSG_RESULT($debug_jtag_io) @@ -298,9 +282,9 @@ debug_malloc=no AC_ARG_ENABLE(malloc_logging, - AS_HELP_STRING([--enable-malloc-logging], - [Include free space in logging messages (requires malloc.h).]), - [debug_malloc=$enableval], []) + AS_HELP_STRING([--enable-malloc-logging], + [Include free space in logging messages (requires malloc.h).]), + [debug_malloc=$enableval], []) AC_MSG_CHECKING([whether to enable malloc free space logging]); AC_MSG_RESULT($debug_malloc) @@ -326,7 +310,7 @@ AS_HELP_STRING([--enable-parport-giveio], [Enable use of giveio for parport (for CygWin only)]), [parport_use_giveio=$enableval], [parport_use_giveio=]) - + AC_ARG_ENABLE(ft2232_libftdi, AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no]) @@ -435,7 +419,7 @@ build_minidriver=yes AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, - [Define to 1 if you have the <jtag_minidriver.h> header file.]) + [Define to 1 if you have the <jtag_minidriver.h> header file.]) fi AC_MSG_RESULT($build_minidriver_dummy) @@ -463,19 +447,20 @@ *-cygwin*) is_win32=yes - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no]) - if test $is_mingw = yes; then - AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) - if test x$parport_use_giveio = xno; then - AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) - fi - parport_use_giveio=yes - is_cygwin=no - else - is_cygwin=yes - AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.]) - fi - + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]), + [is_mingw=yes],[is_mingw=no]) + if test $is_mingw = yes; then + AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) + if test x$parport_use_giveio = xno; then + AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) + fi + parport_use_giveio=yes + is_cygwin=no + else + is_cygwin=yes + AC_DEFINE(IS_CYGWIN, 1, [1 if building for Cygwin.]) + fi + AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.]) AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) ;; @@ -664,47 +649,47 @@ if test $is_win32 = yes; then if test "${with_ftd2xx_linux_tardir+set}" = set then - AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) + AC_MSG_ERROR([The option: with_ftd2xx_linux_tardir is for LINUX only.]) fi if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes ; then -AC_MSG_CHECKING([for ftd2xx.lib exists (win32)]) + AC_MSG_CHECKING([for ftd2xx.lib exists (win32)]) - # if we are given a zipdir... - if test "${with_ftd2xx_win32_zipdir+set}" = set - then - # Set the CFLAGS for "ftd2xx.h" - f=$with_ftd2xx_win32_zipdir/ftd2xx.h - if test ! -f $f ; then - AC_MSG_ERROR([File: $f cannot be found]) - fi - CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir" + # if we are given a zipdir... + if test "${with_ftd2xx_win32_zipdir+set}" = set + then + # Set the CFLAGS for "ftd2xx.h" + f=$with_ftd2xx_win32_zipdir/ftd2xx.h + if test ! -f $f ; then + AC_MSG_ERROR([File: $f cannot be found]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_win32_zipdir" - # And calculate the LDFLAGS for the machine - case "$host_cpu" in - i?86|x86_*) - LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/i386" - LIBS="$LIBS -lftd2xx" - f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib - ;; - amd64) - LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/amd64" - LIBS="$LIBS -lftd2xx" - f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib - ;; - *) - AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu]) - ;; - esac - if test ! -f $f ; then - AC_MSG_ERROR([Library: $f not found]) - fi - else + # And calculate the LDFLAGS for the machine + case "$host_cpu" in + i?86|x86_*) + LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/i386" LIBS="$LIBS -lftd2xx" - AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place]) - fi + f=$with_ftd2xx_win32_zipdir/i386/ftd2xx.lib + ;; + amd64) + LDFLAGS="$LDFLAGS -L$with_ftd2xx_win32_zipdir/amd64" + LIBS="$LIBS -lftd2xx" + f=$with_ftd2xx_win32_zipdir/amd64/ftd2xx.lib + ;; + *) + AC_MSG_ERROR([Unknown Win32 host cpu: $host_cpu]) + ;; + esac + if test ! -f $f ; then + AC_MSG_ERROR([Library: $f not found]) + fi + else + LIBS="$LIBS -lftd2xx" + AC_MSG_WARN([ASSUMPTION: The (win32) FTDICHIP.COM files: ftd2xx.h and ftd2xx.lib are in a proper place]) + fi fi -fi +fi # win32 if test $is_darwin = yes ; then if test "${with_ftd2xx_win32_zipdir+set}" = set @@ -728,7 +713,7 @@ LIBS="$LIBS -lftd2xx" AC_MSG_RESULT([-L/usr/local/lib -lftd2xx]) fi -fi +fi # darwin if test $is_win32 = no && test $is_darwin = no ; then @@ -741,62 +726,62 @@ # Must be linux if test $host_os != linux-gnu && test $host_os != linux ; then AC_MSG_ERROR([The (linux) ftd2xx library from FTDICHIP.com is linux only. Try --enable-ft2232-libftdi instead]) - fi - # Are we given a TAR directory? - if test "${with_ftd2xx_linux_tardir+set}" = set - then - AC_MSG_CHECKING([uninstalled ftd2xx distribution]) - # The .H file is simple.. - FTD2XX_H=$with_ftd2xx_linux_tardir/ftd2xx.h - if test ! -f "${FTD2XX_H}"; then - AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: ${FTD2XX_H}]) - fi - CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir" - FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir" - FTD2XX_LIB="-lftd2xx" - if test $with_ftd2xx_lib != shared; then - # Test #1 - Future proof - if/when ftdichip fixes their distro. - # Try it with the simple ".a" suffix. - FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a" - if test -f "${FTD2XX_LIB}"; then - FTD2XX_LDFLAGS="${FTD2XX_LDFLAGS}/static_lib" - else - # Test Number2. - # Grr.. perhaps it exists as a version number? - FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*" - count=`ls ${FTD2XX_LIB} | wc -l` - if test $count -gt 1 ; then - AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet]) - fi - if test $count -ne 1 ; then - AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong]) - fi - # Because the "-l" rules do not understand version numbers... - # we will just stuff the absolute path onto the LIBS variable - FTD2XX_LIB="`ls ${FTD2XX_LIB}` -lpthread" - FTD2XX_LDFLAGS="" - fi + fi + # Are we given a TAR directory? + if test "${with_ftd2xx_linux_tardir+set}" = set + then + AC_MSG_CHECKING([uninstalled ftd2xx distribution]) + # The .H file is simple.. + FTD2XX_H=$with_ftd2xx_linux_tardir/ftd2xx.h + if test ! -f "${FTD2XX_H}"; then + AC_MSG_ERROR([Option: --with-ftd2xx-linux-tardir appears wrong, cannot find: ${FTD2XX_H}]) + fi + CFLAGS="$CFLAGS -I$with_ftd2xx_linux_tardir" + FTD2XX_LDFLAGS="-L$with_ftd2xx_linux_tardir" + FTD2XX_LIB="-lftd2xx" + if test $with_ftd2xx_lib != shared; then + # Test #1 - Future proof - if/when ftdichip fixes their distro. + # Try it with the simple ".a" suffix. + FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a" + if test -f "${FTD2XX_LIB}"; then + FTD2XX_LDFLAGS="${FTD2XX_LDFLAGS}/static_lib" + else + # Test Number2. + # Grr.. perhaps it exists as a version number? + FTD2XX_LIB="$with_ftd2xx_linux_tardir/static_lib/libftd2xx.a.*.*.*" + count=`ls ${FTD2XX_LIB} | wc -l` + if test $count -gt 1 ; then + AC_MSG_ERROR([Multiple libftd2xx.a files found in: $with_ftd2xx_linux_tardir/static_lib sorry cannot handle this yet]) fi - LDFLAGS="${LDFLAGS} ${FTD2XX_LDFLAGS}" - LIBS="${LIBS} ${FTD2XX_LIB}" - AC_MSG_RESULT([${FTD2XX_LDFLAGS} ${FTD2XX_LIB}]) - else - AC_CHECK_HEADER([ftd2xx.h],[],[ - AC_MSG_ERROR([You seem to be missing the FTD2xx driver header file.]) - ]) - AC_SEARCH_LIBS([FT_GetLibraryVersion],[ftd2xx],,[ - AC_MSG_ERROR([You appear to be missing the FTD2xx driver library.]) - ],[]) - fi + if test $count -ne 1 ; then + AC_MSG_ERROR([Not found: $f, option: --with-ftd2xx-linux-tardir appears to be wrong]) + fi + # Because the "-l" rules do not understand version numbers... + # we will just stuff the absolute path onto the LIBS variable + FTD2XX_LIB="`ls ${FTD2XX_LIB}` -lpthread" + FTD2XX_LDFLAGS="" + fi + fi + LDFLAGS="${LDFLAGS} ${FTD2XX_LDFLAGS}" + LIBS="${LIBS} ${FTD2XX_LIB}" + AC_MSG_RESULT([${FTD2XX_LDFLAGS} ${FTD2XX_LIB}]) + else + AC_CHECK_HEADER([ftd2xx.h],[],[ + AC_MSG_ERROR([You seem to be missing the FTD2xx driver header file.]) + ]) + AC_SEARCH_LIBS([FT_GetLibraryVersion],[ftd2xx],,[ + AC_MSG_ERROR([You appear to be missing the FTD2xx driver library.]) + ],[]) + fi fi -fi +fi # linux if test $build_ft2232_ftd2xx = yes -o $build_presto_ftd2xx = yes; then # Before we go any further - make sure we can *BUILD* and *RUN* # a simple app with the "ftd2xx.lib" file - in what ever form we where given # We should be able to compile, link and run this test program now - AC_MSG_CHECKING([whether ftd2xx library works]) +AC_MSG_CHECKING([whether ftd2xx library works]) # # Save the LDFLAGS for later.. @@ -806,8 +791,8 @@ _CFLAGS=`eval echo $CFLAGS` LDFLAGS=$_LDFLAGS CFLAGS=$_CFLAGS - AC_RUN_IFELSE( -[ + +AC_RUN_IFELSE([ #include "confdefs.h" #if IS_WIN32 #include "windows.h" @@ -818,17 +803,21 @@ int main( int argc, char **argv ) { - DWORD x; - FT_GetLibraryVersion( &x ); - return 0; + DWORD x; + FT_GetLibraryVersion( &x ); + return 0; } -], [ AC_MSG_RESULT([Success!])] , [ AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib]) ] ) + ], [ + AC_MSG_RESULT([Success!]) + ], [ + AC_MSG_ERROR([Cannot build & run test program using ftd2xx.lib]) + ] ) AC_MSG_CHECKING([whether to build ftd2xx device support]) AC_MSG_RESULT([$want_ftd2xx_highspeed]) if test $want_ftd2xx_highspeed != no; then -AC_MSG_CHECKING([for ftd2xx highspeed device support]) -AC_COMPILE_IFELSE([ + AC_MSG_CHECKING([for ftd2xx highspeed device support]) + AC_COMPILE_IFELSE([ #include "confdefs.h" #if IS_WIN32 #include "windows.h" @@ -836,17 +825,18 @@ #include <stdio.h> #include <ftd2xx.h> DWORD x = FT_DEVICE_4232H; -], [ - AC_DEFINE(BUILD_FTD2XX_HIGHSPEED, [1], [Support FT2232H/FT4232HS with FTD2XX.]) - build_ftd2xx_highspeed=yes -], [ - build_ftd2xx_highspeed=no -] ) -AC_MSG_RESULT([$build_ftd2xx_highspeed]) + ], [ + AC_DEFINE(BUILD_FTD2XX_HIGHSPEED, [1], + [Support FT2232H/FT4232HS with FTD2XX.]) + build_ftd2xx_highspeed=yes + ], [ + build_ftd2xx_highspeed=no + ]) + AC_MSG_RESULT([$build_ftd2xx_highspeed]) -if test $want_ftd2xx_highspeed = yes -a $build_ftd2xx_highspeed = no; then - AC_MSG_ERROR([You need a newer FTD2XX driver (version 0.4.16 or later).]) - fi + if test $want_ftd2xx_highspeed = yes -a $build_ftd2xx_highspeed = no; then + AC_MSG_ERROR([You need a newer FTD2XX driver (version 0.4.16 or later).]) + fi fi LDFLAGS=$LDFLAGS_SAVE @@ -854,53 +844,52 @@ fi if test $build_ft2232_libftdi = yes ; then - # We assume: the package is preinstalled in the proper place - # these present as 2 libraries.. - LIBS="$LIBS -lftdi -lusb" - # - # Try to build a small program. - AC_MSG_CHECKING([Build & Link with libftdi...]) + # We assume: the package is preinstalled in the proper place + # these present as 2 libraries.. + LIBS="$LIBS -lftdi -lusb" + # + # Try to build a small program. + AC_MSG_CHECKING([Build & Link with libftdi...]) -LDFLAGS_SAVE=$LDFLAGS -CFLAGS_SAVE=$CFLAGS -_LDFLAGS=`eval echo $LDFLAGS` -_CFLAGS=`eval echo $CFLAGS` -LDFLAGS=$_LDFLAGS -CFLAGS=$_CFLAGS + LDFLAGS_SAVE=$LDFLAGS + CFLAGS_SAVE=$CFLAGS + _LDFLAGS=`eval echo $LDFLAGS` + _CFLAGS=`eval echo $CFLAGS` + LDFLAGS=$_LDFLAGS + CFLAGS=$_CFLAGS - AC_RUN_IFELSE( -[ + AC_RUN_IFELSE([ #include <stdio.h> #include <ftdi.h> int main( int argc, char **argv ) { - struct ftdi_context *p; - p = ftdi_new(); - if( p != NULL ){ - return 0; - } else { - fprintf( stderr, "calling ftdi_new() failed\n"); - return 1; + struct ftdi_context *p; + p = ftdi_new(); + if( p != NULL ){ + return 0; + } else { + fprintf( stderr, "calling ftdi_new() failed\n"); + return 1; } } -] -, -[ AC_MSG_RESULT([Success]) ] -, -[ AC_MSG_ERROR([Cannot build & run test program using libftdi]) ] ) -# Restore the 'unexpanded ldflags' -LDFLAGS=$LDFLAGS_SAVE -CFLAGS=$CFLAGS_SAVE + ], [ + AC_MSG_RESULT([Success]) + ], [ + AC_MSG_ERROR([Cannot build & run test program using libftdi]) + ]) + # Restore the 'unexpanded ldflags' + LDFLAGS=$LDFLAGS_SAVE + CFLAGS=$CFLAGS_SAVE fi # check for usb.h when a driver will require it if test $build_jlink = yes -o $build_vsllink = yes -o $build_usbprog = yes -o \ - $build_rlink = yes -o $build_armjtagew = yes + $build_rlink = yes -o $build_armjtagew = yes then AC_CHECK_HEADERS([usb.h],[], - [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) + [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) fi AM_CONDITIONAL(RELEASE, test $build_release = yes) @@ -962,7 +951,7 @@ ]) if test "${has_environ}" != "yes" ; then - AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.]) + AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.]) fi AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).]) @@ -970,28 +959,28 @@ # set default gcc warnings GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security" if test "${gcc_wextra}" = yes; then - GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter" - GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast" - GCC_WARNINGS="${GCC_WARNINGS} -Wcast-align" - GCC_WARNINGS="${GCC_WARNINGS} -Wredundant-decls" + GCC_WARNINGS="${GCC_WARNINGS} -Wextra -Wno-unused-parameter" + GCC_WARNINGS="${GCC_WARNINGS} -Wbad-function-cast" + GCC_WARNINGS="${GCC_WARNINGS} -Wcast-align" + GCC_WARNINGS="${GCC_WARNINGS} -Wredundant-decls" fi if test "${gcc_werror}" = yes; then - GCC_WARNINGS="${GCC_WARNINGS} -Werror" + GCC_WARNINGS="${GCC_WARNINGS} -Werror" fi # overide default gcc cflags if test $gcc_warnings = yes; then - CFLAGS="$CFLAGS $GCC_WARNINGS" + CFLAGS="$CFLAGS $GCC_WARNINGS" fi # Setup for compiling build tools AC_MSG_CHECKING([for a C compiler for build tools]) if test $cross_compiling = yes; then - AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) - CFLAGS_FOR_BUILD="-g -O2 $GCC_WARNINGS" + AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) + CFLAGS_FOR_BUILD="-g -O2 $GCC_WARNINGS" else - CC_FOR_BUILD=$CC - CFLAGS_FOR_BUILD=$CFLAGS + CC_FOR_BUILD=$CC + CFLAGS_FOR_BUILD=$CFLAGS fi AC_MSG_RESULT([$CC_FOR_BUILD]) @@ -1000,29 +989,41 @@ AC_MSG_CHECKING([for suffix of executable build tools]) if test $cross_compiling = yes; then - cat >conftest.c <<\_______EOF + cat >conftest.c <<\_______EOF int main () { - exit (0); + exit (0); } _______EOF -for i in .exe ""; do + for i in .exe ""; do compile="$CC_FOR_BUILD conftest.c -o conftest$i" if AC_TRY_EVAL(compile); then - if (./conftest) 2>&AC_FD_CC; then - EXEEXT_FOR_BUILD=$i - break - fi - fi -done - rm -f conftest* - if test "${EXEEXT_FOR_BUILD+set}" != set; then - AC_MSG_ERROR([Cannot determine suffix of executable build tools]) - fi + if (./conftest) 2>&AC_FD_CC; then + EXEEXT_FOR_BUILD=$i + break + fi + fi + done + rm -f conftest* + if test "${EXEEXT_FOR_BUILD+set}" != set; then + AC_MSG_ERROR([Cannot determine suffix of executable build tools]) + fi else - EXEEXT_FOR_BUILD=$EXEEXT + EXEEXT_FOR_BUILD=$EXEEXT fi AC_MSG_RESULT([$EXEEXT_FOR_BUILD]) AC_SUBST(EXEEXT_FOR_BUILD) -AC_OUTPUT(Makefile src/Makefile src/helper/Makefile src/jtag/Makefile src/xsvf/Makefile src/svf/Makefile src/target/Makefile src/server/Makefile src/flash/Makefile src/pld/Makefile doc/Makefile) +AC_OUTPUT([ + Makefile + src/Makefile + src/helper/Makefile + src/jtag/Makefile + src/xsvf/Makefile + src/svf/Makefile + src/target/Makefile + src/server/Makefile + src/flash/Makefile + src/pld/Makefile + doc/Makefile + ]) |
From: <zw...@ma...> - 2009-06-08 06:35:16
|
Author: zwelch Date: 2009-06-08 06:35:05 +0200 (Mon, 08 Jun 2009) New Revision: 2105 Modified: trunk/configure.in Log: Reorder configure script macros: - Check for a compiler before looking for libraries or header files. - Initialize automake before calling other AM_ macros. - Disable libtool shared libraries by default. - Remove checks for unused C++, Fortran, and Java compilers. - Remove redundant AC_CANONICAL_HOST; called by AC_PROG_LIBTOOL. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-08 04:34:45 UTC (rev 2104) +++ trunk/configure.in 2009-06-08 04:35:05 UTC (rev 2105) @@ -3,8 +3,34 @@ [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) -AC_CANONICAL_HOST +AM_INIT_AUTOMAKE([-Wall -Wno-portability]) +AM_MAINTAINER_MODE +AM_CONFIG_HEADER(config.h) +AH_BOTTOM([ +#include "system.h" +#include "replacements.h" +]) + +AC_LANG_C +AC_PROG_CC +AC_PROG_CC_C99 +AM_PROG_CC_C_O +AC_PROG_RANLIB + +dnl disable checks for C++, Fortran and GNU Java Compiler +m4_defun([_LT_AC_LANG_CXX_CONFIG], [:]) +m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) +m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:]) +AC_DISABLE_SHARED +AC_PROG_LIBTOOL + + +dnl configure checks required for Jim files (these are obsolete w/ C99) +AC_C_CONST +AC_TYPE_LONG_LONG_INT + + AC_SEARCH_LIBS([ioperm], [ioperm]) AC_SEARCH_LIBS([dlopen], [dl]) @@ -877,15 +903,6 @@ [AC_MSG_ERROR([usb.h is required to build some OpenOCD driver(s)])]) fi -AM_CONFIG_HEADER(config.h) -AH_BOTTOM([ -#include "system.h" -#include "replacements.h" -]) - -AM_INIT_AUTOMAKE([-Wall -Wno-portability]) -AM_MAINTAINER_MODE - AM_CONDITIONAL(RELEASE, test $build_release = yes) AM_CONDITIONAL(PARPORT, test $build_parport = yes) AM_CONDITIONAL(DUMMY, test $build_dummy = yes) @@ -917,18 +934,6 @@ AM_CONDITIONAL(MINIDRIVER, test $build_minidriver = yes) AM_CONDITIONAL(MINIDRIVER_DUMMY, test $build_minidriver_dummy = yes) -AC_LANG_C -AC_PROG_CC -AC_PROG_CC_C99 -AM_PROG_CC_C_O -AC_PROG_RANLIB -AC_PROG_LIBTOOL -AC_PROG_INSTALL - -dnl configure checks required for Jim files (these are obsolete w/ C99) -AC_C_CONST -AC_TYPE_LONG_LONG_INT - # Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h? AC_MSG_CHECKING([for environ in unistd.h and stdlib.h]) AC_COMPILE_IFELSE([ |
From: <zw...@ma...> - 2009-06-08 06:35:02
|
Author: zwelch Date: 2009-06-08 06:34:45 +0200 (Mon, 08 Jun 2009) New Revision: 2104 Modified: trunk/configure.in Log: Rework parallel port configure script option handling: - Move AC_ARG_ENABLE for secondary parallel port options: - These macros cause their configure options to appear unconditionally, so they should not be placed inside conditional logic. - Groups them with primary parallel port driver option. - Update these options to show '-' instead of '_'; both still work. - Update command help text to show host architecture/OS requirements. - Display a warning when these options have been provided and the configure script will ignore the setting that the user specified. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-08 01:14:04 UTC (rev 2103) +++ trunk/configure.in 2009-06-08 04:34:45 UTC (rev 2104) @@ -283,25 +283,24 @@ fi +AC_ARG_ENABLE(dummy, + AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]), + [build_dummy=$enableval], [build_dummy=no]) + AC_ARG_ENABLE(parport, AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]), [build_parport=$enableval], [build_parport=no]) -AC_ARG_ENABLE(dummy, - AS_HELP_STRING([--enable-dummy], [Enable building the dummy port driver]), - [build_dummy=$enableval], [build_dummy=no]) - -case "${host_cpu}" in - i?86|x86*) - AC_ARG_ENABLE(parport_ppdev, - AS_HELP_STRING([--enable-parport_ppdev], [Enable use of ppdev (/dev/parportN) for parport]), - [parport_use_ppdev=$enableval], [parport_use_ppdev=no]) - ;; - *) - parport_use_ppdev=yes - ;; -esac +AC_ARG_ENABLE(parport_ppdev, + AS_HELP_STRING([--disable-parport-ppdev], + [Disable use of ppdev (/dev/parportN) for parport (for x86 only)]), + [parport_use_ppdev=$enableval], [parport_use_ppdev=]) +AC_ARG_ENABLE(parport_giveio, + AS_HELP_STRING([--enable-parport-giveio], + [Enable use of giveio for parport (for CygWin only)]), + [parport_use_giveio=$enableval], [parport_use_giveio=]) + AC_ARG_ENABLE(ft2232_libftdi, AS_HELP_STRING([--enable-ft2232_libftdi], [Enable building support for FT2232 based devices using the libftdi driver, opensource alternate of FTD2XX]), [build_ft2232_libftdi=$enableval], [build_ft2232_libftdi=no]) @@ -423,18 +422,27 @@ AC_MSG_RESULT([yes]) fi +case "${host_cpu}" in + i?86|x86*) + ;; + *) + if test x$parport_use_ppdev = xno; then + AC_MSG_WARN([--disable-parport-ppdev is not supported by the host CPU]) + fi + parport_use_ppdev=yes + ;; +esac case $host in *-cygwin*) is_win32=yes - AC_ARG_ENABLE(parport_giveio, - AS_HELP_STRING([--enable-parport_giveio], [Enable use of giveio for parport instead of ioperm]), - [parport_use_giveio=$enableval], [parport_use_giveio=no]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[return __MINGW32__;]),[is_mingw=yes],[is_mingw=no]) if test $is_mingw = yes; then AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) + if test x$parport_use_giveio = xno; then + AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) + fi parport_use_giveio=yes is_cygwin=no else @@ -449,6 +457,9 @@ is_mingw=yes is_win32=yes + if test x$parport_use_giveio = xno; then + AC_MSG_WARN([--disable-parport-giveio is not supported by MinGW32 hosts]) + fi parport_use_giveio=yes AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.]) @@ -458,6 +469,9 @@ *darwin*) is_darwin=yes + if test x$parport_use_giveio = xyes; then + AC_MSG_WARN([--enable-parport-giveio cannot be used by Darwin hosts]) + fi parport_use_giveio=no AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) @@ -465,7 +479,10 @@ AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.]) ;; *) - parport_use_giveio=no + if test x$parport_use_giveio = xyes; then + AC_MSG_WARN([--enable-parport-giveio cannot be used by ]$host[ hosts]) + fi + parport_use_giveio=no AC_DEFINE(IS_CYGWIN, 0, [0 if not building for Cygwin.]) AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.]) AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.]) @@ -518,13 +535,13 @@ AC_DEFINE(BUILD_AT91RM9200, 0, [0 if you don't want at91rm9200.]) fi -if test $parport_use_ppdev = yes; then +if test x$parport_use_ppdev = xyes; then AC_DEFINE(PARPORT_USE_PPDEV, 1, [1 if you want parport to use ppdev.]) else AC_DEFINE(PARPORT_USE_PPDEV, 0, [0 if you don't want parport to use ppdev.]) fi -if test $parport_use_giveio = yes; then +if test x$parport_use_giveio = xyes; then AC_DEFINE(PARPORT_USE_GIVEIO, 1, [1 if you want parport to use giveio.]) else AC_DEFINE(PARPORT_USE_GIVEIO, 0, [0 if you don't want parport to use giveio.]) @@ -872,7 +889,7 @@ AM_CONDITIONAL(RELEASE, test $build_release = yes) AM_CONDITIONAL(PARPORT, test $build_parport = yes) AM_CONDITIONAL(DUMMY, test $build_dummy = yes) -AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) +AM_CONDITIONAL(GIVEIO, test x$parport_use_giveio = xyes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) |
From: <zw...@ma...> - 2009-06-08 03:14:14
|
Author: zwelch Date: 2009-06-08 03:14:04 +0200 (Mon, 08 Jun 2009) New Revision: 2103 Added: trunk/src/jtag/minidummy/minidummy.c Removed: trunk/src/jtag/minidummy.c Modified: trunk/src/jtag/Makefile.am Log: Move minidummy source file, as was supposed to happen in last commit. Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-08 00:42:15 UTC (rev 2102) +++ trunk/src/jtag/Makefile.am 2009-06-08 01:14:04 UTC (rev 2103) @@ -52,7 +52,7 @@ endif if MINIDRIVER_DUMMY -MINIDUMMYFILES = minidummy.c commands.c +MINIDUMMYFILES = minidummy/minidummy.c commands.c AM_CPPFLAGS += -I$(srcdir)/minidummy else MINIDUMMYFILES = Copied: trunk/src/jtag/minidummy/minidummy.c (from rev 2101, trunk/src/jtag/minidummy.c) Deleted: trunk/src/jtag/minidummy.c =================================================================== --- trunk/src/jtag/minidummy.c 2009-06-08 00:42:15 UTC (rev 2102) +++ trunk/src/jtag/minidummy.c 2009-06-08 01:14:04 UTC (rev 2103) @@ -1,190 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2008 by vind Harboe * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "embeddedice.h" -#include "minidriver.h" -#include "interface.h" - - - - -jtag_interface_t minidummy_interface = -{ - .name = "minidummy", - .execute_queue = NULL, - .speed = NULL, - .register_commands = NULL, - .init = NULL, - .quit = NULL, - .khz = NULL, - .speed_div = NULL, - .power_dropout = NULL, - .srst_asserted = NULL, -}; - - - - - - -int interface_jtag_execute_queue(void) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - - - -extern int jtag_check_value(u8 *captured, void *priv); - -int interface_jtag_set_end_state(tap_state_t state) -{ - return ERROR_OK; -} - - -int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; - -} - - - - - -int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -/*extern jtag_command_t **jtag_get_last_command_p(void);*/ - -int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - -int interface_jtag_add_tlr() -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - -int interface_jtag_add_reset(int req_trst, int req_srst) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - -int interface_jtag_add_runtest(int num_cycles, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_clocks(int num_cycles) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_sleep(u32 us) -{ - jtag_sleep(us); - return ERROR_OK; -} - -int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) -{ - int state_count; - int tms = 0; - - state_count = 0; - - tap_state_t cur_state=cmd_queue_cur_state; - - while (num_states) - { - if (tap_state_transition(cur_state, false) == path[state_count]) - { - tms = 0; - } - else if (tap_state_transition(cur_state, true) == path[state_count]) - { - tms = 1; - } - else - { - LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count])); - exit(-1); - } - - /* synchronously do the operation here */ - - cur_state = path[state_count]; - state_count++; - num_states--; - } - - - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - -void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count) -{ - int i; - for (i = 0; i < count; i++) - { - embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little)); - buffer += 4; - } -} - |
From: <zw...@ma...> - 2009-06-08 02:43:20
|
Author: zwelch Date: 2009-06-08 02:42:15 +0200 (Mon, 08 Jun 2009) New Revision: 2102 Modified: trunk/configure.in trunk/src/jtag/Makefile.am trunk/src/jtag/jtag.c Log: Finish off the dummy minidriver integration: - Try to disambiguates minidriver options from "standard" driver options. - Make minidummy symbols more explict about being a minidriver. - Move minidummy.c into minidummy directory to put it with its header. In configure.in: - Improve configuration option to allow new minidriver implementations: - Change option from --enable-minidummy to --enable-minidriver-dummy. - Move it to the end of the list of options. - Provides a clear pattern for future minidrivers. - Update handling of HAVE_JTAG_MINIDRIVER_H: - Check for external jtag_minidriver.h only with --enable-ecosboard. - Otherwise, define it when --enable-minidriver-dummy is provided. - Add check to ensure only one minidriver is enabled. - When a minidriver is enabled, warn user that standard drivers are not built. - Use proper AC_DEFINE semantics with MINIDRIVER_DUMMY. In src/jtag/Makefile.am: - Restructure handling of minidummy source files. - Include minidummy driver header in the distribution. In src/jtag/jtag.c: - Restructure preprocessor logic to include: - only one minidriver, or - all configured standard drivers. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-07 23:49:14 UTC (rev 2101) +++ trunk/configure.in 2009-06-08 00:42:15 UTC (rev 2102) @@ -13,7 +13,6 @@ AC_CHECK_HEADERS(dirent.h) AC_CHECK_HEADERS(fcntl.h) AC_CHECK_HEADERS(ifaddrs.h) -AC_CHECK_HEADERS(jtag_minidriver.h,[build_minidriver=yes],[build_minidriver=no]) AC_CHECK_HEADERS(malloc.h) AC_CHECK_HEADERS(netdb.h) AC_CHECK_HEADERS(netinet/in.h) @@ -323,10 +322,6 @@ AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]), [build_ecosboard=$enableval], [build_ecosboard=no]) -AC_ARG_ENABLE(minidummy, - AS_HELP_STRING([--enable-minidummy], [Enable building support for minidummy driver]), - [build_minidummy=$enableval], [build_minidummy=no]) - AC_ARG_ENABLE(ioutil, AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]), [build_ioutil=$enableval], [build_ioutil=no]) @@ -388,6 +383,47 @@ AS_HELP_STRING([--enable-arm-jtag-ew], [Enable building support for the Olimex ARM-JTAG-EW Programmer]), [build_armjtagew=$enableval], [build_armjtagew=no]) +AC_ARG_ENABLE(minidriver_dummy, + AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]), + [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no]) + + +build_minidriver=no +AC_MSG_CHECKING([whether to enable ZY1000 minidriver]) +if test $build_ecosboard = yes; then + # check for that project's header file in the current header search path + AC_CHECK_HEADERS(jtag_minidriver.h, [build_minidriver=yes], + AC_MSG_WARN([The --enable-ecosboard option needs the out-of-tree 'jtag_minidriver.h']) + AC_MSG_ERROR([The out-of-tree jtag_minidriver.h cannot be found.]) + ) + build_minidriver=yes + AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) +fi +AC_MSG_RESULT($build_ecosboard) + + +AC_MSG_CHECKING([whether to enable dummy minidriver]) +if test $build_minidriver_dummy = yes; then + if test $build_minidriver = yes; then + AC_MSG_ERROR([Multiple minidriver options have been enabled.]) + fi + build_minidriver=yes + AC_DEFINE(BUILD_MINIDRIVER_DUMMY, 1, [Use the dummy minidriver.]) + AC_DEFINE(HAVE_JTAG_MINIDRIVER_H, 1, + [Define to 1 if you have the <jtag_minidriver.h> header file.]) +fi +AC_MSG_RESULT($build_minidriver_dummy) + +AC_MSG_CHECKING([whether standard drivers can be built]) +if test "$build_minidriver" = yes; then + AC_MSG_RESULT([no]) + AC_MSG_WARN([Using the minidriver disables all other drivers.]) + sleep 2 +else + AC_MSG_RESULT([yes]) +fi + + case $host in *-cygwin*) is_win32=yes @@ -463,12 +499,6 @@ AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.]) fi -if test $build_minidummy = yes; then - AC_DEFINE(BUILD_MINIDUMMY, 1, [1 if you want minidummy.]) -else - AC_DEFINE(BUILD_MINIDUMMY, 0, [0 if you don't want minidummy.]) -fi - if test $build_ioutil = yes; then AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) else @@ -845,7 +875,6 @@ AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) -AM_CONDITIONAL(MINIDUMMY, test $build_minidummy = yes) AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) AM_CONDITIONAL(HTTPD, test $build_httpd = yes) AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes) @@ -867,7 +896,9 @@ AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes) AM_CONDITIONAL(IS_DARWIN, test $is_darwin = yes) AM_CONDITIONAL(BITQ, test $build_bitq = yes) + AM_CONDITIONAL(MINIDRIVER, test $build_minidriver = yes) +AM_CONDITIONAL(MINIDRIVER_DUMMY, test $build_minidriver_dummy = yes) AC_LANG_C AC_PROG_CC Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-07 23:49:14 UTC (rev 2101) +++ trunk/src/jtag/Makefile.am 2009-06-08 00:42:15 UTC (rev 2102) @@ -51,14 +51,15 @@ ECOSBOARDFILES = endif -if MINIDUMMY -MINIDUMMYFILES = minidummy.c +if MINIDRIVER_DUMMY +MINIDUMMYFILES = minidummy.c commands.c +AM_CPPFLAGS += -I$(srcdir)/minidummy else MINIDUMMYFILES = endif if MINIDRIVER -DRIVERFILES = +DRIVERFILES = $(MINIDUMMYFILES) else DRIVERFILES = jtag_driver.c commands.c endif @@ -137,7 +138,6 @@ $(PRESTOFILES) \ $(USBPROGFILES) \ $(ECOSBOARDFILES) \ - $(MINIDUMMYFILES) \ $(JLINKFILES) \ $(RLINKFILES) \ $(VSLLINKFILES) \ @@ -153,6 +153,7 @@ rlink/dtc_cmd.h \ rlink/ep1_cmd.h \ rlink/rlink.h \ - rlink/st7.h + rlink/st7.h \ + minidummy/jtag_minidriver.h MAINTAINERCLEANFILES = Makefile.in Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 23:49:14 UTC (rev 2101) +++ trunk/src/jtag/jtag.c 2009-06-08 00:42:15 UTC (rev 2102) @@ -97,11 +97,9 @@ #if BUILD_ECOSBOARD == 1 extern jtag_interface_t zy1000_interface; -#endif - -#if BUILD_MINIDUMMY == 1 +#elif defined(BUILD_MINIDRIVER_DUMMY) extern jtag_interface_t minidummy_interface; -#endif +#else // standard drivers #if BUILD_PARPORT == 1 extern jtag_interface_t parport_interface; #endif @@ -157,14 +155,21 @@ #if BUILD_ARMJTAGEW == 1 extern jtag_interface_t armjtagew_interface; #endif +#endif // standard drivers +/** + * The list of built-in JTAG interfaces, containing entries for those + * drivers that were enabled by the @c configure script. + * + * The list should be defined to contain either one minidriver interface + * or some number of standard driver interfaces, never both. + */ jtag_interface_t *jtag_interfaces[] = { #if BUILD_ECOSBOARD == 1 &zy1000_interface, -#endif -#if BUILD_MINIDUMMY == 1 +#elif defined(BUILD_MINIDRIVER_DUMMY) &minidummy_interface, -#endif +#else // standard drivers #if BUILD_PARPORT == 1 &parport_interface, #endif @@ -207,6 +212,7 @@ #if BUILD_ARMJTAGEW == 1 &armjtagew_interface, #endif +#endif // standard drivers NULL, }; |
From: <zw...@ma...> - 2009-06-08 01:49:19
|
Author: zwelch Date: 2009-06-08 01:49:14 +0200 (Mon, 08 Jun 2009) New Revision: 2101 Modified: trunk/doc/manual/primer/jtag.txt Log: Fix reference warning in JTAG primer, add another external reference. Modified: trunk/doc/manual/primer/jtag.txt =================================================================== --- trunk/doc/manual/primer/jtag.txt 2009-06-07 23:35:29 UTC (rev 2100) +++ trunk/doc/manual/primer/jtag.txt 2009-06-07 23:49:14 UTC (rev 2101) @@ -105,6 +105,12 @@ registers do, so you can actually do something useful. That's where it gets interesting. But in and of itself, JTAG is actually very simple. +@section primerjtag More Reading + +The following link goes to an HTML (or PDF) introduction to JTAG, +written by one of the original members of the JTAG committee: @par +http://www.asset-intertech.com/products/boundscan.htm + A separate primer contains information about @subpage primerjtagbs for developers that want to extend OpenOCD for such purposes. @@ -164,5 +170,5 @@ */ /** @file -This file contains the @ref primerjtag and @ref bsdl page. +This file contains the @ref primerjtag and @ref primerjtagbs page. */ |
From: <zw...@ma...> - 2009-06-08 01:35:34
|
Author: zwelch Date: 2009-06-08 01:35:29 +0200 (Mon, 08 Jun 2009) New Revision: 2100 Modified: trunk/src/helper/startup.tcl trunk/src/target/target.c Log: David Brownell <da...@pa...>: Let disabled targets be ignored during normal operation: - In target_examine(), ignore disabled TAPs - Reset handling must not poke at them either: * fail $target_name arp_* operations on disabled TAPs * in startup.tcl, don't even issue the arp_* wait ops ZW: removed superfluous braces from the patch to target.c. Modified: trunk/src/helper/startup.tcl =================================================================== --- trunk/src/helper/startup.tcl 2009-06-07 23:21:41 UTC (rev 2099) +++ trunk/src/helper/startup.tcl 2009-06-07 23:35:29 UTC (rev 2100) @@ -164,6 +164,11 @@ return -error "Invalid mode: $MODE, must be one of: halt, init, or run"; } + # Target event handlers *might* change which TAPs are enabled + # or disabled, so we fire all of them. But don't issue any + # of the "arp_*" commands, which may issue JTAG transactions, + # unless we know the underlying TAP is active. + foreach t [ target names ] { # New event script. $t invoke-event reset-start @@ -172,16 +177,20 @@ # Init the tap controller. jtag arp_init-reset - # Examine all targets. + # Examine all targets on enabled taps. foreach t [ target names ] { - $t arp_examine + if {[jtag tapisenabled [$t cget -chain-position]]} { + $t arp_examine + } } # Let the C code know we are asserting reset. foreach t [ target names ] { $t invoke-event reset-assert-pre # C code needs to know if we expect to 'halt' - $t arp_reset assert $halt + if {[jtag tapisenabled [$t cget -chain-position]]} { + $t arp_reset assert $halt + } $t invoke-event reset-assert-post } @@ -189,14 +198,19 @@ foreach t [ target names ] { $t invoke-event reset-deassert-pre # Again, de-assert code needs to know.. - $t arp_reset deassert $halt + if {[jtag tapisenabled [$t cget -chain-position]]} { + $t arp_reset deassert $halt + } $t invoke-event reset-deassert-post } # Pass 1 - Now try to halt. if { $halt } { foreach t [target names] { - + if {[jtag tapisenabled [$t cget -chain-position]] == 0} { + continue + } + # Wait upto 1 second for target to halt. Why 1sec? Cause # the JTAG tap reset signal might be hooked to a slow # resistor/capacitor circuit - and it might take a while @@ -217,6 +231,10 @@ #Pass 2 - if needed "init" if { 0 == [string compare init $MODE] } { foreach t [target names] { + if {[jtag tapisenabled [$t cget -chain-position]] == 0} { + continue + } + set err [catch "$t arp_waitstate halted 5000"] # Did it halt? if { $err == 0 } { Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-07 23:21:41 UTC (rev 2099) +++ trunk/src/target/target.c 2009-06-07 23:35:29 UTC (rev 2100) @@ -479,12 +479,14 @@ int target_examine(void) { int retval = ERROR_OK; - target_t *target = all_targets; - while (target) + target_t *target; + + for (target = all_targets; target; target = target->next) { + if (!target->tap->enabled) + continue; if ((retval = target_examine_one(target)) != ERROR_OK) return retval; - target = target->next; } return retval; } @@ -3734,6 +3736,8 @@ Jim_WrongNumArgs( goi.interp, 2, argv, "[no parameters]"); return JIM_ERR; } + if (!target->tap->enabled) + goto err_tap_disabled; e = target->type->examine( target ); if( e != ERROR_OK ){ Jim_SetResult_sprintf( interp, "examine-fails: %d", e ); @@ -3745,6 +3749,8 @@ Jim_WrongNumArgs( goi.interp, 2, argv, "[no parameters]"); return JIM_ERR; } + if (!target->tap->enabled) + goto err_tap_disabled; if( !(target_was_examined(target)) ){ e = ERROR_TARGET_NOT_EXAMINED; } else { @@ -3772,6 +3778,8 @@ if( e != JIM_OK ){ return e; } + if (!target->tap->enabled) + goto err_tap_disabled; /* determine if we should halt or not. */ target->reset_halt = !!a; /* When this happens - all workareas are invalid. */ @@ -3789,6 +3797,8 @@ Jim_WrongNumArgs( goi.interp, 0, argv, "halt [no parameters]"); return JIM_ERR; } + if (!target->tap->enabled) + goto err_tap_disabled; target->type->halt( target ); return JIM_OK; case TS_CMD_WAITSTATE: @@ -3806,6 +3816,8 @@ if( e != JIM_OK ){ return e; } + if (!target->tap->enabled) + goto err_tap_disabled; e = target_wait_state( target, n->value, a ); if( e != ERROR_OK ){ Jim_SetResult_sprintf( goi.interp, @@ -3861,6 +3873,10 @@ return JIM_OK; } return JIM_ERR; + +err_tap_disabled: + Jim_SetResult_sprintf(interp, "[TAP is disabled]"); + return JIM_ERR; } static int target_create( Jim_GetOptInfo *goi ) |
From: <zw...@ma...> - 2009-06-08 01:21:45
|
Author: zwelch Date: 2009-06-08 01:21:41 +0200 (Mon, 08 Jun 2009) New Revision: 2099 Modified: trunk/doc/openocd.texi Log: David Brownell <da...@pa...>: Clarify docs for the evb_lm3s811 layout: works in two modes, not just one. Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-07 23:20:30 UTC (rev 2098) +++ trunk/doc/openocd.texi 2009-06-07 23:21:41 UTC (rev 2099) @@ -1414,8 +1414,9 @@ @item @b{axm0432_jtag} Axiom AXM-0432 @item @b{comstick} Hitex STR9 comstick @item @b{cortino} Hitex Cortino JTAG interface -@item @b{evb_lm3s811} Luminary Micro EVB_LM3S811 as a JTAG interface -(bypassing onboard processor), no TRST or SRST signals on external connector +@item @b{evb_lm3s811} Luminary Micro EVB_LM3S811 as a JTAG interface, +either for the local Cortex-M3 (SRST only) +or in a passthrough mode (neither SRST nor TRST) @item @b{flyswatter} Tin Can Tools Flyswatter @item @b{icebear} ICEbear JTAG adapter from Section 5 @item @b{jtagkey} Amontec JTAGkey and JTAGkey-Tiny (and compatibles) |
From: <zw...@ma...> - 2009-06-08 01:20:37
|
Author: zwelch Date: 2009-06-08 01:20:30 +0200 (Mon, 08 Jun 2009) New Revision: 2098 Modified: trunk/src/target/target.c Log: Fix regression in mdw output; identified by Magnus Lundin. Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-07 23:14:58 UTC (rev 2097) +++ trunk/src/target/target.c 2009-06-07 23:20:30 UTC (rev 2098) @@ -1943,9 +1943,9 @@ const char *value_fmt; switch (size) { - case 4: value_fmt = "%8.8x"; break; - case 2: value_fmt = "%4.2x"; break; - case 1: value_fmt = "%2.2x"; break; + case 4: value_fmt = "%8.8x "; break; + case 2: value_fmt = "%4.2x "; break; + case 1: value_fmt = "%2.2x "; break; default: LOG_ERROR("invalid memory read size: %u", size); exit(-1); |
From: <zw...@ma...> - 2009-06-08 01:15:09
|
Author: zwelch Date: 2009-06-08 01:14:58 +0200 (Mon, 08 Jun 2009) New Revision: 2097 Modified: trunk/doc/openocd.texi Log: David Brownell <da...@pa...>: Rework chapter 12 (CPU configuration) to use @deffn, match the code more closely, and present things more clearly. Includes the *current* list of targets. Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-07 23:10:50 UTC (rev 2096) +++ trunk/doc/openocd.texi 2009-06-07 23:14:58 UTC (rev 2097) @@ -1262,7 +1262,7 @@ @cindex GDB configuration You can reconfigure some GDB behaviors if needed. The ones listed here are static and global. -@xref{Target Create}, about declaring individual targets. +@xref{Target Configuration}, about configuring individual targets. @xref{Target Events}, about configuring target-specific event handling. @anchor{gdb_breakpoint_override} @@ -2096,191 +2096,469 @@ @chapter CPU Configuration @cindex GDB target -This chapter discusses how to create a GDB debug target for a CPU. +This chapter discusses how to set up GDB debug targets for CPUs. You can also access these targets without GDB -(@pxref{Architecture and Core Commands}) and, where relevant, +(@pxref{Architecture and Core Commands}, +and @ref{Target State handling}) and through various kinds of NAND and NOR flash commands. -Also, if you have multiple CPUs you can have multiple such targets. +If you have multiple CPUs you can have multiple such targets. +We'll start by looking at how to examine the targets you have, +then look at how to add one more target and how to configure it. + +@section Target List + +All targets that have been set up are part of a list, +where each member has a name. +That name should normally be the same as the TAP name. +You can display the list with the @command{targets} +(plural!) command. +This display often has only one CPU; here's what it might +look like with more than one: +@verbatim + CmdName Type Endian AbsChainPos Name State +-- ---------- ---------- ---------- ----------- ------------- ---------- + 0: rm9200.cpu arm920t little 2 rm9200.cpu running + 1: MyTarget cortex_m3 little 0 mychip.cpu halted +@end verbatim + +One member of that list is the @dfn{current target}, which +is implicitly referenced by many commands. +In particular, memory addresses often refer to the address +space seen by that current target. +Commands like @command{mdw} (memory display words) +and @command{flash erase_address} (erase NOR flash blocks) +are examples; and there are many more. + +Several commands let you examine the list of targets: + +@deffn Command {target count} +Returns the number of targets, @math{N}. +The highest numbered target is @math{N - 1}. +@example +set c [target count] +for @{ set x 0 @} @{ $x < $c @} @{ incr x @} @{ + # Assuming you have created this function + print_target_details $x +@} +@end example +@end deffn + +@deffn Command {target current} +Returns the name of the current target. +@end deffn + +@deffn Command {target names} +Lists the names of all current targets in the list. +@example +foreach t [target names] @{ + puts [format "Target: %s\n" $t] +@} +@end example +@end deffn + +@deffn Command {target number} number +The list of targets is numbered starting at zero. +This command returns the name of the target at index @var{number}. +@example +set thename [target number $x] +puts [format "Target %d is: %s\n" $x $thename] +@end example +@end deffn + +@c yep, "target list" would have been better. +@c plus maybe "target setdefault". + +@deffn Command targets [name] +@emph{Note: the name of this command is plural. Other target +command names are singular.} + +With no parameter, this command displays a table of all known +targets in a user friendly form. + +With a parameter, this command sets the current target to +the given target with the given @var{name}; this is +only relevant on boards which have more than one target. +@end deffn + +@section Target CPU Types and Variants + +Each target has a @dfn{CPU type}, as shown in the output of +the @command{targets} command. You need to specify that type +when calling @command{target create}. +The CPU type indicates more than just the instruction set. +It also indicates how that instruction set is implemented, +what kind of debug support it integrates, +whether it has an MMU (and if so, what kind), +what core-specific commands may be available +(@pxref{Architecture and Core Commands}), +and more. + +For some CPU types, OpenOCD also defines @dfn{variants} which +indicate differences that affect their handling. +For example, a particular implementation bug might need to be +worked around in some chip versions. + +It's easy to see what target types are supported, +since there's a command to list them. +However, there is currently no way to list what target variants +are supported (other than by reading the OpenOCD source code). + +@anchor{target types} +@deffn Command {target types} +Lists all supported target types. +At this writing, the supported CPU types and variants are: + +@itemize @bullet +@item @code{arm11} -- this is a generation of ARMv6 cores +@item @code{arm720t} -- this is an ARMv4 core +@item @code{arm7tdmi} -- this is an ARMv4 core +@item @code{arm920t} -- this is an ARMv5 core +@item @code{arm926ejs} -- this is an ARMv5 core +@item @code{arm966e} -- this is an ARMv5 core +@item @code{arm9tdmi} -- this is an ARMv4 core +@item @code{avr} -- implements Atmel's 8-bit AVR instruction set. +(Support for this is preliminary and incomplete.) +@item @code{cortex_a8} -- this is an ARMv7 core +@item @code{cortex_m3} -- this is an ARMv7 core, supporting only the +compact Thumb2 instruction set. It supports one variant: +@itemize @minus +@item @code{lm3s} ... Use this when debugging older Stellaris LM3S targets. +This will cause OpenOCD to use a software reset rather than asserting +SRST, to avoid a issue with clearing the debug registers. +This is fixed in Fury Rev B, DustDevil Rev B, Tempest; these revisions will +be detected and the normal reset behaviour used. +@end itemize +@item @code{feroceon} -- resembles arm926 +@item @code{mips_m4k} -- a MIPS core. This supports one variant: +@itemize @minus +@item @code{ejtag_srst} ... Use this when debugging targets that do not +provide a functional SRST line on the EJTAG connector. This causes +OpenOCD to instead use an EJTAG software reset command to reset the +processor. +You still need to enable @option{srst} on the @command{reset_config} +command to enable OpenOCD hardware reset functionality. +@end itemize +@item @code{xscale} -- this is actually an architecture, +not a CPU type. It is based on the ARMv5 architecture. +There are several variants defined: +@itemize @minus +@item @code{ixp42x}, @code{ixp45x}, @code{ixp46x}, +@code{pxa27x} ... instruction register length is 7 bits +@item @code{pxa250}, @code{pxa255}, +@code{pxa26x} ... instruction register length is 5 bits +@end itemize +@end itemize +@end deffn + +To avoid being confused by the variety of ARM based cores, remember +this key point: @emph{ARM is a technology licencing company}. +(See: @url{http://www.arm.com}.) +The CPU name used by OpenOCD will reflect the CPU design that was +licenced, not a vendor brand which incorporates that design. +Name prefixes like arm7, arm9, arm11, and cortex +reflect design generations; +while names like ARMv4, ARMv5, ARMv6, and ARMv7 +reflect an architecture version implemented by a CPU design. + +@anchor{Target Configuration} +@section Target Configuration + Before creating a ``target'', you must have added its TAP to the scan chain. When you've added that TAP, you will have a @code{dotted.name} which is used to set up the CPU support. The chip-specific configuration file will normally configure its CPU(s) right after it adds all of the chip's TAPs to the scan chain. -@section targets [NAME] -@b{Note:} This command name is PLURAL - not singular. +Although you can set up a target in one step, it's often clearer if you +use shorter commands and do it in two steps: create it, then configure +optional parts. +All operations on the target after it's created will use a new +command, created as part of target creation. -With NO parameter, this plural @b{targets} command lists all known -targets in a human friendly form. +The two main things to configure after target creation are +a work area, which usually has target-specific defaults even +if the board setup code overrides them later; +and event handlers (@pxref{Target Events}), which tend +to be much more board-specific. +The key steps you use might look something like this -With a parameter, this plural @b{targets} command sets the current -target to the given name. (i.e.: If there are multiple debug targets) +@example +target create MyTarget cortex_m3 -chain-position mychip.cpu +$MyTarget configure -work-area-phys 0x08000 -work-area-size 8096 +$MyTarget configure -event reset-deassert-pre @{ jtag_rclk 5 @} +$MyTarget configure -event reset-init @{ myboard_reinit @} +@end example -Example: -@verbatim -(gdb) mon targets - CmdName Type Endian ChainPos State --- ---------- ---------- ---------- -------- ---------- - 0: target0 arm7tdmi little 0 halted -@end verbatim +You should specify a working area if you can; typically it uses some +on-chip SRAM. +Such a working area can speed up many things, including bulk +writes to target memory; +flash operations like checking to see if memory needs to be erased; +GDB memory checksumming; +and more. -@section target COMMANDS -@b{Note:} This command name is SINGULAR - not plural. It is used to -manipulate specific targets, to create targets and other things. +@quotation Warning +On more complex chips, the work area can become +inaccessible when application code +(such as an operating system) +enables or disables the MMU. +For example, the particular MMU context used to acess the virtual +address will probably matter ... and that context might not have +easy access to other addresses needed. +At this writing, OpenOCD doesn't have much MMU intelligence. +@end quotation -Once a target is created, a TARGETNAME (object) command is created; -see below for details. +It's often very useful to define a @code{reset-init} event handler. +For systems that are normally used with a boot loader, +common tasks include updating clocks and initializing memory +controllers. +That may be needed to let you write the boot loader into flash, +in order to ``de-brick'' your board; or to load programs into +external DDR memory without having run the boot loader. -The TARGET command accepts these sub-commands: +@deffn Command {target create} target_name type configparams... +This command creates a GDB debug target that refers to a specific JTAG tap. +It enters that target into a list, and creates a new +command (@command{@var{target_name}}) which is used for various +purposes including additional configuration. + @itemize @bullet -@item @b{create} .. parameters .. -@* creates a new target, see below for details. -@item @b{types} -@* Lists all supported target types (perhaps some are not yet in this document). -@item @b{names} -@* Lists all current debug target names, for example: 'str912.cpu' or 'pxa27.cpu' example usage: -@verbatim - foreach t [target names] { - puts [format "Target: %s\n" $t] - } -@end verbatim -@item @b{current} -@* Returns the current target. OpenOCD always has, or refers to the ``current target'' in some way. -By default, commands like: ``mww'' (used to write memory) operate on the current target. -@item @b{number} @b{NUMBER} -@* Internally OpenOCD maintains a list of targets - in numerical index -(0..N-1) this command returns the name of the target at index N. -Example usage: -@verbatim - set thename [target number $x] - puts [format "Target %d is: %s\n" $x $thename] -@end verbatim -@item @b{count} -@* Returns the number of targets known to OpenOCD (see number above) -Example: -@verbatim - set c [target count] - for { set x 0 } { $x < $c } { incr x } { - # Assuming you have created this function - print_target_details $x - } -@end verbatim +@item @var{target_name} ... is the name of the debug target. +By convention this should be the same as the @emph{dotted.name} +of the TAP associated with this target, which must be specified here +using the @code{-chain-position @var{dotted.name}} configparam. +This name is also used to create the target object command, +referred to here as @command{$target_name}, +and in other places the target needs to be identified. +@item @var{type} ... specifies the target type. @xref{target types}. +@item @var{configparams} ... all parameters accepted by +@command{$target_name configure} are permitted. +If the target is big-endian, set it here with @code{-endian big}. +If the variant matters, set it here with @code{-variant}. + +You @emph{must} set the @code{-chain-position @var{dotted.name}} here. @end itemize +@end deffn -@section TARGETNAME (object) commands -@b{Use:} Once a target is created, an ``object name'' that represents the -target is created. By convention, the target name is identical to the -tap name. In a multiple target system, one can precede many common -commands with a specific target name and effect only that target. -@example - str912.cpu mww 0x1234 0x42 - omap3530.cpu mww 0x5555 123 -@end example +@deffn Command {$target_name configure} configparams... +The options accepted by this command may also be +specified as parameters to @command{target create}. +Their values can later be queried one at a time by +using the @command{$target_name cget} command. -@b{Model:} The Tcl/Tk language has the concept of object commands. A -good example is a on screen button, once a button is created a button -has a name (a path in Tk terms) and that name is useable as a 1st +@emph{Warning:} changing some of these after setup is dangerous. +For example, moving a target from one TAP to another; +and changing its endianness or variant. + +@itemize @bullet + +@item @code{-chain-position} @var{dotted.name} -- names the TAP +used to access this target. + +@item @code{-endian} (@option{big}|@option{little}) -- specifies +whether the CPU uses big or little endian conventions + +@item @code{-event} @var{event_name} @var{event_body} -- +@xref{Target Events}. +Note that this updates a list of named event handlers. +Calling this twice with two different event names assigns +two different handlers, but calling it twice with the +same event name assigns only one handler. + +@item @code{-variant} @var{name} -- specifies a variant of the target, +which OpenOCD needs to know about. + +@item @code{-work-area-backup} (@option{0}|@option{1}) -- says +whether the work area gets backed up; by default, it doesn't. +When possible, use a working_area that doesn't need to be backed up, +since performing a backup slows down operations. + +@item @code{-work-area-size} @var{size} -- specify/set the work area + +@item @code{-work-area-phys} @var{address} -- set the work area +base @var{address} to be used when no MMU is active. + +@item @code{-work-area-virt} @var{address} -- set the work area +base @var{address} to be used when an MMU is active. + +@end itemize +@end deffn + +@section Other $target_name Commands +@cindex object command + +The Tcl/Tk language has the concept of object commands, +and OpenOCD adopts that same model for targets. + +A good Tk example is a on screen button. +Once a button is created a button +has a name (a path in Tk terms) and that name is useable as a first class command. For example in Tk, one can create a button and later configure it like this: @example - # Create - button .foobar -background red -command @{ foo @} - # Modify - .foobar configure -foreground blue - # Query - set x [.foobar cget -background] - # Report - puts [format "The button is %s" $x] +# Create +button .foobar -background red -command @{ foo @} +# Modify +.foobar configure -foreground blue +# Query +set x [.foobar cget -background] +# Report +puts [format "The button is %s" $x] @end example In OpenOCD's terms, the ``target'' is an object just like a Tcl/Tk -button. Commands available as a ``target object'' are: +button, and its object commands are invoked the same way. -@comment START targetobj commands. -@itemize @bullet -@item @b{configure} - configure the target; see Target Config/Cget Options below -@item @b{cget} - query the target configuration; see Target Config/Cget Options below -@item @b{curstate} - current target state (running, halt, etc. -@item @b{eventlist} -@* Intended for a human to see/read the currently configure target events. -@item @b{Various Memory Commands} See the ``mww'' command elsewhere. -@comment start memory -@itemize @bullet -@item @b{mww} ... -@item @b{mwh} ... -@item @b{mwb} ... -@item @b{mdw} ... -@item @b{mdh} ... -@item @b{mdb} ... -@comment end memory +@example +str912.cpu mww 0x1234 0x42 +omap3530.cpu mww 0x5555 123 +@end example + +The commands supported by OpenOCD target objects are: + +@deffn Command {$target_name arp_examine} +@deffnx Command {$target_name arp_halt} +@deffnx Command {$target_name arp_poll} +@deffnx Command {$target_name arp_reset} +@deffnx Command {$target_name arp_waitstate} +Internal OpenOCD scripts (most notably @file{startup.tcl}) +use these to deal with specific reset cases. +They are not otherwise documented here. +@end deffn + +@deffn Command {$target_name array2mem} arrayname width address count +@deffnx Command {$target_name mem2array} arrayname width address count +These provide an efficient script-oriented interface to memory. +The @code{array2mem} primitive writes bytes, halfwords, or words; +while @code{mem2array} reads them. +In both cases, the TCL side uses an array, and +the target side uses raw memory. + +The efficiency comes from enabling the use of +bulk JTAG data transfer operations. +The script orientation comes from working with data +values that are packaged for use by TCL scripts; +@command{mdw} type primitives only print data they retrieve, +and neither store nor return those values. + +@itemize +@item @var{arrayname} ... is the name of an array variable +@item @var{width} ... is 8/16/32 - indicating the memory access size +@item @var{address} ... is the target memory address +@item @var{count} ... is the number of elements to process @end itemize -@item @b{Memory To Array, Array To Memory} -@* These are aimed at a machine interface to memory +@end deffn + +@deffn Command {$target_name cget} queryparm +Each configuration parameter accepted by +@command{$target_name configure} +can be individually queried, to return its current value. +The @var{queryparm} is a parameter name +accepted by that command, such as @code{-work-area-phys}. +There are a few special cases: + @itemize @bullet -@item @b{mem2array ARRAYNAME WIDTH ADDRESS COUNT} -@item @b{array2mem ARRAYNAME WIDTH ADDRESS COUNT} -@* Where: -@* @b{ARRAYNAME} is the name of an array variable -@* @b{WIDTH} is 8/16/32 - indicating the memory access size -@* @b{ADDRESS} is the target memory address -@* @b{COUNT} is the number of elements to process +@item @code{-event} @var{event_name} -- returns the handler for the +event named @var{event_name}. +This is a special case because setting a handler requires +two parameters. +@item @code{-type} -- returns the target type. +This is a special case because this is set using +@command{target create} and can't be changed +using @command{$target_name configure}. @end itemize -@item @b{Used during ``reset''} -@* These commands are used internally by the OpenOCD scripts to deal -with odd reset situations and are not documented here. -@itemize @bullet -@item @b{arp_examine} -@item @b{arp_poll} -@item @b{arp_reset} -@item @b{arp_halt} -@item @b{arp_waitstate} -@end itemize -@item @b{invoke-event} @b{EVENT-NAME} -@* Invokes the specific event manually for the target -@end itemize +For example, if you wanted to summarize information about +all the targets you might use something like this: + +@example +for @{ set x 0 @} @{ $x < [target count] @} @{ incr x @} @{ + set name [target number $x] + set y [$name cget -endian] + set z [$name cget -type] + puts [format "Chip %d is %s, Endian: %s, type: %s" \ + $x $name $y $z] +@} +@end example +@end deffn + +@deffn Command {$target_name curstate} +Displays the current target state: +@code{debug-running}, +@code{halted}, +@code{reset}, +@code{running}, or @code{unknown}. +@end deffn + +@deffn Command {$target_name eventlist} +Displays a table listing all event handlers +currently associated with this target. +@xref{Target Events}. +@end deffn + +@deffn Command {$target_name invoke-event} event_name +Invokes the handler for the event named @var{event_name}. +(This is primarily intended for use by OpenOCD framework +code, for example by the reset code in @file{startup.tcl}.) +@end deffn + +@deffn Command {$target_name mdw} addr [count] +@deffnx Command {$target_name mdh} addr [count] +@deffnx Command {$target_name mdb} addr [count] +Display contents of address @var{addr}, as +32-bit words (@command{mdw}), 16-bit halfwords (@command{mdh}), +or 8-bit bytes (@command{mdb}). +If @var{count} is specified, displays that many units. +(If you want to manipulate the data instead of displaying it, +see the @code{mem2array} primitives.) +@end deffn + +@deffn Command {$target_name mww} addr word +@deffnx Command {$target_name mwh} addr halfword +@deffnx Command {$target_name mwb} addr byte +Writes the specified @var{word} (32 bits), +@var{halfword} (16 bits), or @var{byte} (8-bit) pattern, +at the specified address @var{addr}. +@end deffn + @anchor{Target Events} @section Target Events @cindex events At various times, certain things can happen, or you want them to happen. - -Examples: +For example: @itemize @bullet @item What should happen when GDB connects? Should your target reset? @item When GDB tries to flash the target, do you need to enable the flash via a special command? -@item During reset, do you need to write to certain memory location to reconfigure the SDRAM? +@item During reset, do you need to write to certain memory locations +to set up system clocks or +to reconfigure the SDRAM? @end itemize -All of the above items are handled by target events. +All of the above items can be addressed by target event handlers. +These are set up by @command{$target_name configure -event} or +@command{target create ... -event}. -To specify an event action, either during target creation, or later -via ``$_TARGETNAME configure'' see this example. +The programmer's model matches the @code{-command} option used in Tcl/Tk +buttons and events. The two examples below act the same, but one creates +and invokes a small procedure while the other inlines it. -Syntactially, the option is: ``-event NAME BODY'' where NAME is a -target event name, and BODY is a Tcl procedure or string of commands -to execute. - -The programmers model is the ``-command'' option used in Tcl/Tk -buttons and events. Below are two identical examples, the first -creates and invokes small procedure. The second inlines the procedure. - @example - proc my_attach_proc @{ @} @{ - puts "RESET...." - reset halt - @} - mychip.cpu configure -event gdb-attach my_attach_proc - mychip.cpu configure -event gdb-attach @{ - puts "Reset..." - reset halt - @} +proc my_attach_proc @{ @} @{ + echo "Reset..." + reset halt +@} +mychip.cpu configure -event gdb-attach my_attach_proc +mychip.cpu configure -event gdb-attach @{ + echo "Reset..." + reset halt +@} @end example -@section Current Events -The following events are available: +The following target events are defined: + @itemize @bullet @item @b{debug-halted} @* The target has halted for debug reasons (i.e.: breakpoint) @@ -2324,6 +2602,10 @@ @item @b{reset-deassert-pre} @* Issued as part of @command{reset} processing when reset is about to be released on the tap. + +For some chips, this may be a good place to make sure +the JTAG clock is slow enough to work before the PLL +has been set up to allow faster JTAG speeds. @item @b{reset-deassert-post} @* Issued as part of @command{reset} processing when reset has been released on the tap. @@ -2336,6 +2618,7 @@ @item @b{reset-init} @* Used by @b{reset init} command for board-specific initialization. This event fires after @emph{reset-deassert-post}. + This is where you would configure PLLs and clocking, set up DRAM so you can download programs that don't fit in on-chip SRAM, set up pin multiplexing, and so on. @@ -2356,110 +2639,7 @@ @* Target has resumed @end itemize -@anchor{Target Create} -@section Target Create -@cindex target -@cindex target creation -@example -@b{target} @b{create} <@var{NAME}> <@var{TYPE}> <@var{PARAMS ...}> -@end example -@*This command creates a GDB debug target that refers to a specific JTAG tap. -@comment START params -@itemize @bullet -@item @b{NAME} -@* Is the name of the debug target. By convention it should be the tap -DOTTED.NAME. This name is also used to create the target object -command, and in other places the target needs to be identified. -@item @b{TYPE} -@* Specifies the target type, i.e.: ARM7TDMI, or Cortex-M3. Currently supported targets are: -@comment START types -@itemize @minus -@item @b{arm7tdmi} -@item @b{arm720t} -@item @b{arm9tdmi} -@item @b{arm920t} -@item @b{arm922t} -@item @b{arm926ejs} -@item @b{arm966e} -@item @b{cortex_m3} -@item @b{feroceon} -@item @b{xscale} -@item @b{arm11} -@item @b{mips_m4k} -@comment end TYPES -@end itemize -@item @b{PARAMS} -@*PARAMs are various target configuration parameters. The following ones are mandatory: -@comment START mandatory -@itemize @bullet -@item @b{-endian big|little} -@item @b{-chain-position DOTTED.NAME} -@comment end MANDATORY -@end itemize -@comment END params -@end itemize - -@section Target Config/Cget Options -These options can be specified when the target is created, or later -via the configure option or to query the target via cget. - -You should specify a working area if you can; typically it uses some -on-chip SRAM. Such a working area can speed up many things, including bulk -writes to target memory; flash operations like checking to see if memory needs -to be erased; GDB memory checksumming; and may help perform otherwise -unavailable operations (like some coprocessor operations on ARM7/9 systems). -@itemize @bullet -@item @b{-type} - returns the target type -@item @b{-event NAME BODY} see Target events -@item @b{-work-area-virt [ADDRESS]} specify/set the work area base address -which will be used when an MMU is active. -@item @b{-work-area-phys [ADDRESS]} specify/set the work area base address -which will be used when an MMU is inactive. -@item @b{-work-area-size [ADDRESS]} specify/set the work area -@item @b{-work-area-backup [0|1]} does the work area get backed up; -by default, it doesn't. When possible, use a working_area that doesn't -need to be backed up, since performing a backup slows down operations. -@item @b{-endian [big|little]} -@item @b{-variant [NAME]} some chips have variants OpenOCD needs to know about -@item @b{-chain-position DOTTED.NAME} the tap name this target refers to. -@end itemize -Example: -@example - for @{ set x 0 @} @{ $x < [target count] @} @{ incr x @} @{ - set name [target number $x] - set y [$name cget -endian] - set z [$name cget -type] - puts [format "Chip %d is %s, Endian: %s, type: %s" $x $y $z] - @} -@end example - -@b{PROBLEM:} On more complex chips, the work area can become -inaccessible when application code enables or disables the MMU. -For example, the MMU context used to acess the virtual address -will probably matter. - -@section Target Variants -@itemize @bullet -@item @b{cortex_m3} -@* Use variant @option{lm3s} when debugging older Stellaris LM3S targets. -This will cause OpenOCD to use a software reset rather than asserting -SRST, to avoid a issue with clearing the debug registers. -This is fixed in Fury Rev B, DustDevil Rev B, Tempest; these revisions will -be detected and the normal reset behaviour used. -@item @b{xscale} -@*Supported variants are -@option{ixp42x}, @option{ixp45x}, @option{ixp46x}, -@option{pxa250}, @option{pxa255}, @option{pxa26x}. -@item @b{mips_m4k} -@* Use variant @option{ejtag_srst} when debugging targets that do not -provide a functional SRST line on the EJTAG connector. This causes -OpenOCD to instead use an EJTAG software reset command to reset the -processor. You still need to enable @option{srst} on the reset -configuration command to enable OpenOCD hardware reset functionality. -@comment END variants -@end itemize - @node Flash Commands @chapter Flash Commands @@ -3542,6 +3722,7 @@ the initial log output channel is stderr. @end deffn +@anchor{Target State handling} @section Target State handling @cindex reset @cindex halt @@ -3688,6 +3869,8 @@ 32-bit words (@command{mdw}), 16-bit halfwords (@command{mdh}), or 8-bit bytes (@command{mdb}). If @var{count} is specified, displays that many units. +(If you want to manipulate the data instead of displaying it, +see the @code{mem2array} primitives.) @end deffn @deffn Command mww addr word @@ -4184,6 +4367,9 @@ They are available in addition to the ARMv4/5, ARM7/ARM9, and ARM9TDMI commands. +The Feroceon cores also support these commands, although +they are not built from ARM926ej-s designs. + @deffn Command {arm926ejs cache_info} Print information about the caches found. @end deffn |
From: <zw...@ma...> - 2009-06-08 01:10:55
|
Author: zwelch Date: 2009-06-08 01:10:50 +0200 (Mon, 08 Jun 2009) New Revision: 2096 Modified: trunk/doc/openocd.texi Log: David Brownell <da...@pa...>: Various minor tweaks for the User's guide. - Fix various minor (but repeated) typographic goofs; - Talk about TAP "declaration" not "creation" (they exist even if OpenOCD never learns about their board); - Encourage board.cfg for reset config, not target.cfg - Fill in some missing information (e.g. x16_as_x8) - Add a cross reference to the FAQ on TAP ordering; - Unclutter the concept index a bit (re core-specific commands) - Provide a bit more info about TAP states Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-07 19:10:51 UTC (rev 2095) +++ trunk/doc/openocd.texi 2009-06-07 23:10:50 UTC (rev 2096) @@ -69,7 +69,7 @@ * Daemon Configuration:: Daemon Configuration * Interface - Dongle Configuration:: Interface - Dongle Configuration * Reset Configuration:: Reset Configuration -* TAP Creation:: TAP Creation +* TAP Declaration:: TAP Declaration * CPU Configuration:: CPU Configuration * Flash Commands:: Flash Commands * NAND Flash Commands:: NAND Flash Commands @@ -890,6 +890,7 @@ @item SDRAM configuration (size, speed, etc. @item Board specific IO configuration (i.e.: GPIO pins might disable a 2nd flash) @item Multiple TARGET source statements +@item Reset configuration @item All things that are not ``inside a chip'' @item Things inside a chip go in a 'target' file @end enumerate @@ -910,7 +911,6 @@ @item Set defaults @item Add TAPs to the scan chain @item Add CPU targets -@item Reset configuration @item CPU/Chip/CPU-Core specific features @item On-Chip flash @end enumerate @@ -1038,7 +1038,7 @@ @subsection Adding TAPs to the Scan Chain After the ``defaults'' are set up, add the TAPs on each chip to the JTAG scan chain. -@xref{TAP Creation}, and the naming convention +@xref{TAP Declaration}, and the naming convention for taps. In the simplest case the chip has only one TAP, @@ -1053,7 +1053,7 @@ A board with two such at91sam7 chips would be able to source such a config file twice, with different -values for @code{CHIPNAME} and @code{CPUTAPID}, so +values for @code{CHIPNAME}, so it adds a different TAP each time. There are more complex examples too, with chips that have @@ -1075,6 +1075,7 @@ For the at91sam7 example above, the command can look like this: @example +set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME arm7tdmi -chain-position $_TARGETNAME @end example @@ -1087,14 +1088,18 @@ @example $_TARGETNAME configure -work-area-phys 0x00200000 \ - -work-area-size 0x4000 -work-area-backup 0 + -work-area-size 0x4000 -work-area-backup 0 @end example @subsection Reset Configuration +As a rule, you should put the @command{reset_config} command +into the board file. Most things you think you know about a +chip can be tweaked by the board. + Some chips have specific ways the TRST and SRST signals are -managed. If these are @b{CHIP SPECIFIC} they go here, if they are -@b{BOARD SPECIFIC} they go in the board file. +managed. In the unusual case that these are @emph{chip specific} +and can never be changed by board wiring, they could go here. @subsection ARM Core Specific Hacks @@ -1261,43 +1266,40 @@ @xref{Target Events}, about configuring target-specific event handling. @anchor{gdb_breakpoint_override} -@deffn {Command} gdb_breakpoint_override <hard|soft|disable> +@deffn {Command} gdb_breakpoint_override [@option{hard}|@option{soft}|@option{disable}] Force breakpoint type for gdb @command{break} commands. -The raison d'etre for this option is to support GDB GUI's which don't +This option supports GDB GUIs which don't distinguish hard versus soft breakpoints, if the default OpenOCD and GDB behaviour is not sufficient. GDB normally uses hardware breakpoints if the memory map has been set up for flash regions. - -This option replaces older arm7_9 target commands that addressed -the same issue. @end deffn -@deffn {Config command} gdb_detach <resume|reset|halt|nothing> +@deffn {Config command} gdb_detach (@option{resume}|@option{reset}|@option{halt}|@option{nothing}) Configures what OpenOCD will do when GDB detaches from the daemon. -Default behaviour is @var{resume}. +Default behaviour is @option{resume}. @end deffn @anchor{gdb_flash_program} -@deffn {Config command} gdb_flash_program <enable|disable> -Set to @var{enable} to cause OpenOCD to program the flash memory when a +@deffn {Config command} gdb_flash_program (@option{enable}|@option{disable}) +Set to @option{enable} to cause OpenOCD to program the flash memory when a vFlash packet is received. -The default behaviour is @var{enable}. +The default behaviour is @option{enable}. @end deffn -@deffn {Config command} gdb_memory_map <enable|disable> -Set to @var{enable} to cause OpenOCD to send the memory configuration to GDB when +@deffn {Config command} gdb_memory_map (@option{enable}|@option{disable}) +Set to @option{enable} to cause OpenOCD to send the memory configuration to GDB when requested. GDB will then know when to set hardware breakpoints, and program flash using the GDB load command. @command{gdb_flash_program enable} must also be enabled for flash programming to work. -Default behaviour is @var{enable}. +Default behaviour is @option{enable}. @xref{gdb_flash_program}. @end deffn -@deffn {Config command} gdb_report_data_abort <enable|disable> +@deffn {Config command} gdb_report_data_abort (@option{enable}|@option{disable}) Specifies whether data aborts cause an error to be reported by GDB memory read packets. -The default behaviour is @var{disable}; -use @var{enable} see these errors reported. +The default behaviour is @option{disable}; +use @option{enable} see these errors reported. @end deffn @node Interface - Dongle Configuration @@ -1839,9 +1841,9 @@ @end deffn -@node TAP Creation -@chapter TAP Creation -@cindex TAP creation +@node TAP Declaration +@chapter TAP Declaration +@cindex TAP declaration @cindex TAP configuration @emph{Test Access Ports} (TAPs) are the core of JTAG. @@ -1882,7 +1884,7 @@ The configuration mechanism currently supported by OpenOCD requires explicit configuration of all TAP devices using @command{jtag newtap} commands. -One like this would create a tap named @code{chip1.cpu}: +One like this would declare a tap and name it @code{chip1.cpu}: @example jtag newtap chip1 cpu -irlen 7 -ircapture 0x01 -irmask 0x55 @@ -1892,16 +1894,16 @@ by a given chip. Board configuration files combine all the targets on a board, and so forth. -Note that @emph{the order in which TAPs are created is very important.} +Note that @emph{the order in which TAPs are declared is very important.} It must match the order in the JTAG scan chain, both inside a single chip and between them. +@xref{FAQ TAP Order}. For example, the ST Microsystems STR912 chip has three separate TAPs@footnote{See the ST document titled: @emph{STR91xFAxxx, Section 3.15 Jtag Interface, Page: 28/102, Figure 3: JTAG chaining inside the STR91xFA}. -@url{http://eu.st.com/stonline/products/literature/ds/13495.pdf} -Checked: 28-Nov-2008}. +@url{http://eu.st.com/stonline/products/literature/ds/13495.pdf}}. To configure those taps, @file{target/str912.cfg} includes commands something like this: @@ -1917,7 +1919,7 @@ @section TAP Names -When a TAP objects is created with @command{jtag newtap}, +When TAP objects are declared with @command{jtag newtap}, a @dfn{dotted.name} is created for the TAP, combining the name of a module (usually a chip) and a label for the TAP. For example: @code{xilinx.tap}, @code{str912.flash}, @@ -1940,13 +1942,12 @@ reusing on boards with multiple targets. @end quotation -@anchor{TAP Creation Commands} -@section TAP Creation Commands +@section TAP Declaration Commands @c shouldn't this be(come) a {Config Command}? @anchor{jtag newtap} @deffn Command {jtag newtap} chipname tapname configparams... -Creates a new TAP with the dotted name @var{chipname}.@var{tapname}, +Declares a new TAP with the dotted name @var{chipname}.@var{tapname}, and configured according to the various @var{configparams}. The @var{chipname} is a symbolic name for the chip. @@ -2705,7 +2706,7 @@ @itemize @item @var{jedec_probe} ... is used to detect certain non-CFI flash ROMs, like AM29LV010 and similar types. -@item @var{x16_as_x8} ... +@item @var{x16_as_x8} ... when a 16-bit flash is hooked up to an 8-bit bus. @end itemize To configure two adjacent banks of 16 MBytes each, both sixteen bits (two bytes) @@ -3372,7 +3373,7 @@ status for each block. @end deffn -@deffn Command {nand raw_access} num <enable|disable> +@deffn Command {nand raw_access} num (@option{enable}|@option{disable}) Sets or clears an flag affecting how page I/O is done. The @var{num} parameter is the value shown by @command{nand list}. @@ -3509,7 +3510,7 @@ and level 3 adds debugging messages. @end deffn -@deffn Command fast [enable|disable] +@deffn Command fast (@option{enable}|@option{disable}) Default disabled. Set default behaviour of OpenOCD to be "fast and dangerous". @@ -3971,15 +3972,15 @@ @section ARMv4 and ARMv5 Architecture -@cindex ARMv4 specific commands -@cindex ARMv5 specific commands +@cindex ARMv4 +@cindex ARMv5 These commands are specific to ARM architecture v4 and v5, including all ARM7 or ARM9 systems and Intel XScale. They are available in addition to other core-specific commands that may be available. -@deffn Command {armv4_5 core_state} [arm|thumb] +@deffn Command {armv4_5 core_state} [@option{arm}|@option{thumb}] Displays the core_state, optionally changing it to process either @option{arm} or @option{thumb} instructions. The target may later be resumed in the currently set core_state. @@ -3997,27 +3998,27 @@ @end deffn @deffn Command {armv4_5 reg} -Display a list of all banked core registers, fetching the current value from every +Display a table of all banked core registers, fetching the current value from every core mode if necessary. OpenOCD versions before rev. 60 didn't fetch the current register value. @end deffn @subsection ARM7 and ARM9 specific commands -@cindex ARM7 specific commands -@cindex ARM9 specific commands +@cindex ARM7 +@cindex ARM9 These commands are specific to ARM7 and ARM9 cores, like ARM7TDMI, ARM720T, ARM9TDMI, ARM920T or ARM926EJ-S. They are available in addition to the ARMv4/5 commands, and any other core-specific commands that may be available. -@deffn Command {arm7_9 dbgrq} (enable|disable) +@deffn Command {arm7_9 dbgrq} (@option{enable}|@option{disable}) Control use of the EmbeddedIce DBGRQ signal to force entry into debug mode, instead of breakpoints. This should be safe for all but ARM7TDMI--S cores (like Philips LPC). @end deffn -@deffn Command {arm7_9 dcc_downloads} (enable|disable) +@deffn Command {arm7_9 dcc_downloads} (@option{enable}|@option{disable}) @cindex DCC Control the use of the debug communications channel (DCC) to write larger (>128 byte) amounts of memory. DCC downloads offer a huge speed increase, but might be @@ -4026,7 +4027,7 @@ @end deffn @anchor{arm7_9 fast_memory_access} -@deffn Command {arm7_9 fast_memory_access} (enable|disable) +@deffn Command {arm7_9 fast_memory_access} (@option{enable}|@option{disable}) Enable or disable memory writes and reads that don't check completion of the operation. This provides a huge speed increase, especially with USB JTAG cables (FT2232), but might be unsafe if used with targets running at very low @@ -4048,7 +4049,7 @@ The write goes directly to the CPU, bypassing the register cache. @end deffn -@deffn {Debug Command} {arm7_9 write_xpsr} word (0|1) +@deffn {Debug Command} {arm7_9 write_xpsr} word (@option{0}|@option{1}) @emph{This is intended for use while debugging OpenOCD; you probably shouldn't use it.} @@ -4058,7 +4059,7 @@ In both cases, this bypasses the register cache. @end deffn -@deffn {Debug Command} {arm7_9 write_xpsr_im8} byte rotate (0|1) +@deffn {Debug Command} {arm7_9 write_xpsr_im8} byte rotate (@option{0}|@option{1}) @emph{This is intended for use while debugging OpenOCD; you probably shouldn't use it.} @@ -4070,7 +4071,7 @@ @end deffn @subsection ARM720T specific commands -@cindex ARM720T specific commands +@cindex ARM720T These commands are available to ARM720T based CPUs, which are implementations of the ARMv4T architecture @@ -4105,13 +4106,13 @@ @end deffn @subsection ARM9TDMI specific commands -@cindex ARM9TDMI specific commands +@cindex ARM9TDMI Many ARM9-family CPUs are built around ARM9TDMI integer cores, or processors resembling ARM9TDMI, and can use these commands. Such cores include the ARM920T, ARM926EJ-S, and ARM966. -@deffn Command {arm9tdmi vector_catch} (all|none|list) +@deffn Command {arm9tdmi vector_catch} (@option{all}|@option{none}|list) Catch arm9 interrupt vectors, can be @option{all}, @option{none}, or a list with one or more of the following: @option{reset} @option{undef} @option{swi} @option{pabt} @option{dabt} @option{reserved} @@ -4119,7 +4120,7 @@ @end deffn @subsection ARM920T specific commands -@cindex ARM920T specific commands +@cindex ARM920T These commands are available to ARM920T based CPUs, which are implementations of the ARMv4T architecture @@ -4169,15 +4170,15 @@ Dump the content of the ITLB and DTLB to a file named @file{filename}. @end deffn -@deffn Command {arm920t virt2phys} @var{va} +@deffn Command {arm920t virt2phys} va Translate a virtual address @var{va} to a physical address and display the result. @end deffn -@subsection ARM926EJ-S specific commands -@cindex ARM926EJ-S specific commands +@subsection ARM926ej-s specific commands +@cindex ARM926ej-s -These commands are available to ARM926EJ-S based CPUs, +These commands are available to ARM926ej-s based CPUs, which are implementations of the ARMv5TEJ architecture based on the ARM9EJ-S integer core. They are available in addition to the ARMv4/5, ARM7/ARM9, @@ -4211,13 +4212,13 @@ at the specified physical address @var{addr}. @end deffn -@deffn Command {arm926ejs virt2phys} @var{va} +@deffn Command {arm926ejs virt2phys} va Translate a virtual address @var{va} to a physical address and display the result. @end deffn @subsection ARM966E specific commands -@cindex ARM966E specific commands +@cindex ARM966E These commands are available to ARM966 based CPUs, which are implementations of the ARMv5TE architecture. @@ -4230,7 +4231,7 @@ @end deffn @subsection XScale specific commands -@cindex XScale specific commands +@cindex XScale These commands are available to XScale based CPUs, which are implementations of the ARMv5TE architecture. @@ -4256,7 +4257,7 @@ Changes the address used for the specified target's debug handler. @end deffn -@deffn Command {xscale dcache} (enable|disable) +@deffn Command {xscale dcache} (@option{enable}|@option{disable}) Enables or disable the CPU's data cache. @end deffn @@ -4264,15 +4265,15 @@ Dumps the raw contents of the trace buffer to @file{filename}. @end deffn -@deffn Command {xscale icache} (enable|disable) +@deffn Command {xscale icache} (@option{enable}|@option{disable}) Enables or disable the CPU's instruction cache. @end deffn -@deffn Command {xscale mmu} (enable|disable) +@deffn Command {xscale mmu} (@option{enable}|@option{disable}) Enables or disable the CPU's memory management unit. @end deffn -@deffn Command {xscale trace_buffer} (enable|disable) [fill [n] | wrap] +@deffn Command {xscale trace_buffer} (@option{enable}|@option{disable}) [@option{fill} [n] | @option{wrap}] Enables or disables the trace buffer, and controls how it is emptied. @end deffn @@ -4291,9 +4292,10 @@ @end deffn @section ARMv6 Architecture +@cindex ARMv6 @subsection ARM11 specific commands -@cindex ARM11 specific commands +@cindex ARM11 @deffn Command {arm11 mcr} p1 p2 p3 p4 p5 Read coprocessor register @@ -4330,38 +4332,42 @@ @end deffn @section ARMv7 Architecture +@cindex ARMv7 @subsection ARMv7 Debug Access Port (DAP) specific commands -@cindex ARMv7 Debug Access Port (DAP) specific commands +@cindex Debug Access Port +@cindex DAP These commands are specific to ARM architecture v7 Debug Access Port (DAP), included on cortex-m3 and cortex-a8 systems. They are available in addition to other core-specific commands that may be available. @deffn Command {dap info} [num] -Displays dap info for ap [num], default currently selected AP. +Displays dap info for ap @var{num}, defaulting to the currently selected AP. @end deffn @deffn Command {dap apsel} [num] -Select a different AP [num] (default 0). +Select AP @var{num}, defaulting to 0. @end deffn @deffn Command {dap apid} [num] -Displays id reg from AP [num], default currently selected AP. +Displays id register from AP @var{num}, +defaulting to the currently selected AP. @end deffn @deffn Command {dap baseaddr} [num] -Displays debug base address from AP [num], default currently selected AP. +Displays debug base address from AP @var{num}, +defaulting to the currently selected AP. @end deffn @deffn Command {dap memaccess} [value] Displays the number of extra tck for mem-ap memory bus access [0-255]. -If value is defined, first assigns that. +If @var{value} is defined, first assigns that. @end deffn @subsection Cortex-M3 specific commands -@cindex Cortex-M3 specific commands +@cindex Cortex-M3 -@deffn Command {cortex_m3 maskisr} (on|off) +@deffn Command {cortex_m3 maskisr} (@option{on}|@option{off}) Control masking (disabling) interrupts during target step/resume. @end deffn @@ -4379,7 +4385,7 @@ depends on CONFIG_DEBUG_LL) which uses this mechanism to deliver messages before a serial console can be activated. -@deffn Command {target_request debugmsgs} [enable|disable|charmsg] +@deffn Command {target_request debugmsgs} [@option{enable}|@option{disable}|@option{charmsg}] Displays current handling of target DCC message requests. These messages may be sent to the debugger while the target is running. The optional @option{enable} and @option{charmsg} parameters @@ -4393,7 +4399,7 @@ @chapter JTAG Commands @cindex JTAG Commands Most general purpose JTAG commands have been presented earlier. -(@xref{JTAG Speed}, @ref{Reset Configuration}, and @ref{TAP Creation}.) +(@xref{JTAG Speed}, @ref{Reset Configuration}, and @ref{TAP Declaration}.) Lower level JTAG commands, as presented here, may be needed to work with targets which require special attention during operations such as reset or initialization. @@ -4547,26 +4553,27 @@ and @command{irscan} commands are: @itemize @bullet -@item @b{RESET} -@item @b{RUN/IDLE} +@item @b{RESET} ... should act as if TRST were active +@item @b{RUN/IDLE} ... don't assume this always means IDLE @item @b{DRSELECT} @item @b{DRCAPTURE} -@item @b{DRSHIFT} +@item @b{DRSHIFT} ... TDI/TDO shifting through the data register @item @b{DREXIT1} -@item @b{DRPAUSE} +@item @b{DRPAUSE} ... data register ready for update or more shifting @item @b{DREXIT2} @item @b{DRUPDATE} @item @b{IRSELECT} @item @b{IRCAPTURE} -@item @b{IRSHIFT} +@item @b{IRSHIFT} ... TDI/TDO shifting through the instruction register @item @b{IREXIT1} -@item @b{IRPAUSE} +@item @b{IRPAUSE} ... instruction register ready for update or more shifting @item @b{IREXIT2} @item @b{IRUPDATE} @end itemize Note that only six of those states are fully ``stable'' in the -face of TMS fixed and a free-running JTAG clock; for all the +face of TMS fixed (usually low) +and a free-running JTAG clock. For all the others, the next TCK transition changes to a new state. @itemize @bullet @@ -4576,7 +4583,10 @@ may not be as expected. @item @sc{run/idle}, @sc{drpause}, and @sc{irpause} are reasonable choices after @command{drscan} or @command{irscan} commands, -since they are free of side effects. +since they are free of JTAG side effects. +However, @sc{run/idle} may have side effects that appear at other +levels, such as advancing the ARM9E-S instruction pipeline. +Consult the documentation for the TAP(s) you are working with. @end itemize @node TFTP @@ -5118,17 +5128,22 @@ else that needs to write to controller registers, perhaps for setting up DRAM and loading it with code. -@item @b{JTAG Tap Order} JTAG tap order - command order +@anchor{FAQ TAP Order} +@item @b{JTAG TAP Order} Do I have to declare the TAPS in some +particular order? -Many newer devices have multiple JTAG taps. For example: ST -Microsystems STM32 chips have two taps, a ``boundary scan tap'' and -``Cortex-M3'' tap. Example: The STM32 reference manual, Document ID: +Yes; whenever you have more than one, you must declare them in +the same order used by the hardware. + +Many newer devices have multiple JTAG TAPs. For example: ST +Microsystems STM32 chips have two TAPs, a ``boundary scan TAP'' and +``Cortex-M3'' TAP. Example: The STM32 reference manual, Document ID: RM0008, Section 26.5, Figure 259, page 651/681, the ``TDI'' pin is -connected to the boundary scan tap, which then connects to the -Cortex-M3 tap, which then connects to the TDO pin. +connected to the boundary scan TAP, which then connects to the +Cortex-M3 TAP, which then connects to the TDO pin. Thus, the proper order for the STM32 chip is: (1) The Cortex-M3, then -(2) The boundary scan tap. If your board includes an additional JTAG +(2) The boundary scan TAP. If your board includes an additional JTAG chip in the scan chain (for example a Xilinx CPLD or FPGA) you could place it before or after the STM32 chip in the chain. For example: |
From: <oh...@ma...> - 2009-06-07 21:10:53
|
Author: oharboe Date: 2009-06-07 21:10:51 +0200 (Sun, 07 Jun 2009) New Revision: 2095 Modified: trunk/doc/openocd.texi trunk/src/jtag/jtag.c Log: retire endstate command Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-07 18:39:11 UTC (rev 2094) +++ trunk/doc/openocd.texi 2009-06-07 19:10:51 UTC (rev 2095) @@ -4474,14 +4474,6 @@ instead of batching them into larger operations. @end deffn -@deffn Command {endstate} tap_state -Flush any pending JTAG operations, -and return with all TAPs in @var{tap_state}. -This state should be a stable state such as @sc{reset}, -@sc{run/idle}, -@sc{drpause}, or @sc{irpause}. -@end deffn - @deffn Command {irscan} [tap instruction]+ [@option{-endstate} tap_state] For each @var{tap} listed, loads the instruction register with its associated numeric @var{instruction}. @@ -4552,7 +4544,7 @@ @cindex TAP state names The @var{tap_state} names used by OpenOCD in the @command{drscan}, -@command{endstate}, and @command{irscan} commands are: +and @command{irscan} commands are: @itemize @bullet @item @b{RESET} @@ -4578,9 +4570,6 @@ others, the next TCK transition changes to a new state. @itemize @bullet -@item @sc{reset} is probably most useful with @command{endstate}, -but entering it frequently has side effects. -(This is the only stable state with TMS high.) @item From @sc{drshift} and @sc{irshift}, clock transitions will produce side effects by changing register contents. The values to be latched in upcoming @sc{drupdate} or @sc{irupdate} states @@ -4838,6 +4827,9 @@ @item @b{arm7_9 fast_writes} @cindex arm7_9 fast_writes @*Use @command{arm7_9 fast_memory_access} instead. +@item @b{endstate} +@cindex endstate +@*An buggy old command that would not really work since background polling would wipe out the global endstate @xref{arm7_9 fast_memory_access}. @item @b{arm7_9 force_hw_bkpts} @*Use @command{gdb_breakpoint_override} instead. Note that GDB will use hardware breakpoints Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 18:39:11 UTC (rev 2094) +++ trunk/src/jtag/jtag.c 2009-06-07 19:10:51 UTC (rev 2095) @@ -227,7 +227,6 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); -static int handle_endstate_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_jtag_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_runtest_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -1659,8 +1658,6 @@ register_command(cmd_ctx, NULL, "scan_chain", handle_scan_chain_command, COMMAND_EXEC, "print current scan chain configuration"); - register_command(cmd_ctx, NULL, "endstate", handle_endstate_command, - COMMAND_EXEC, "finish JTAG operations in <tap_state>"); register_command(cmd_ctx, NULL, "jtag_reset", handle_jtag_reset_command, COMMAND_EXEC, "toggle reset lines <trst> <srst>"); register_command(cmd_ctx, NULL, "runtest", handle_runtest_command, @@ -2215,26 +2212,6 @@ } -static int handle_endstate_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) -{ - if (argc < 1) - return ERROR_COMMAND_SYNTAX_ERROR; - - tap_state_t state = tap_state_by_name(args[0]); - if (state < 0) - { - command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); - return ERROR_COMMAND_SYNTAX_ERROR; - } - jtag_set_end_state(state); - jtag_execute_queue(); - - command_print(cmd_ctx, "current endstate: %s", - tap_state_name(cmd_queue_end_state)); - - return ERROR_OK; -} - static int handle_jtag_reset_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { int trst = -1; |
From: <zw...@ma...> - 2009-06-07 20:39:19
|
Author: zwelch Date: 2009-06-07 20:39:11 +0200 (Sun, 07 Jun 2009) New Revision: 2094 Modified: trunk/src/jtag/minidummy.c trunk/src/jtag/minidummy/jtag_minidriver.h Log: Set svn:eol-style properties on new minidummy driver files. Modified: trunk/src/jtag/minidummy/jtag_minidriver.h =================================================================== --- trunk/src/jtag/minidummy/jtag_minidriver.h 2009-06-07 18:38:13 UTC (rev 2093) +++ trunk/src/jtag/minidummy/jtag_minidriver.h 2009-06-07 18:39:11 UTC (rev 2094) @@ -1,43 +1,43 @@ -/*************************************************************************** - * Copyright (C) 2007-2008 by vind Harboe * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - - - -static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap, - int num_fields, - const int *num_bits, - const u32 *value, - enum tap_state end_state) -{ - /* synchronously do the operation here */ -} - -static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap, - int num_fields, - const int *num_bits, - const u32 *value, - enum tap_state end_state) -{ - /* synchronously do the operation here */ -} - -#define interface_jtag_add_callback(callback, in) callback(in) - -#define interface_jtag_add_callback4(callback, in, data1, data2, data3) jtag_set_error(callback(in, data1, data2, data3)) +/*************************************************************************** + * Copyright (C) 2007-2008 by vind Harboe * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + + + +static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap, + int num_fields, + const int *num_bits, + const u32 *value, + enum tap_state end_state) +{ + /* synchronously do the operation here */ +} + +static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap, + int num_fields, + const int *num_bits, + const u32 *value, + enum tap_state end_state) +{ + /* synchronously do the operation here */ +} + +#define interface_jtag_add_callback(callback, in) callback(in) + +#define interface_jtag_add_callback4(callback, in, data1, data2, data3) jtag_set_error(callback(in, data1, data2, data3)) Property changes on: trunk/src/jtag/minidummy/jtag_minidriver.h ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/src/jtag/minidummy.c =================================================================== --- trunk/src/jtag/minidummy.c 2009-06-07 18:38:13 UTC (rev 2093) +++ trunk/src/jtag/minidummy.c 2009-06-07 18:39:11 UTC (rev 2094) @@ -1,190 +1,190 @@ -/*************************************************************************** - * Copyright (C) 2007-2008 by vind Harboe * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "embeddedice.h" -#include "minidriver.h" -#include "interface.h" - - - - -jtag_interface_t minidummy_interface = -{ - .name = "minidummy", - .execute_queue = NULL, - .speed = NULL, - .register_commands = NULL, - .init = NULL, - .quit = NULL, - .khz = NULL, - .speed_div = NULL, - .power_dropout = NULL, - .srst_asserted = NULL, -}; - - - - - - -int interface_jtag_execute_queue(void) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - - - -extern int jtag_check_value(u8 *captured, void *priv); - -int interface_jtag_set_end_state(tap_state_t state) -{ - return ERROR_OK; -} - - -int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; - -} - - - - - -int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -/*extern jtag_command_t **jtag_get_last_command_p(void);*/ - -int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - -int interface_jtag_add_tlr() -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - -int interface_jtag_add_reset(int req_trst, int req_srst) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - - -int interface_jtag_add_runtest(int num_cycles, tap_state_t state) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_clocks(int num_cycles) -{ - /* synchronously do the operation here */ - - return ERROR_OK; -} - -int interface_jtag_add_sleep(u32 us) -{ - jtag_sleep(us); - return ERROR_OK; -} - -int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) -{ - int state_count; - int tms = 0; - - state_count = 0; - - tap_state_t cur_state=cmd_queue_cur_state; - - while (num_states) - { - if (tap_state_transition(cur_state, false) == path[state_count]) - { - tms = 0; - } - else if (tap_state_transition(cur_state, true) == path[state_count]) - { - tms = 1; - } - else - { - LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count])); - exit(-1); - } - - /* synchronously do the operation here */ - - cur_state = path[state_count]; - state_count++; - num_states--; - } - - - /* synchronously do the operation here */ - - return ERROR_OK; -} - - - -void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count) -{ - int i; - for (i = 0; i < count; i++) - { - embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little)); - buffer += 4; - } -} - +/*************************************************************************** + * Copyright (C) 2007-2008 by vind Harboe * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "embeddedice.h" +#include "minidriver.h" +#include "interface.h" + + + + +jtag_interface_t minidummy_interface = +{ + .name = "minidummy", + .execute_queue = NULL, + .speed = NULL, + .register_commands = NULL, + .init = NULL, + .quit = NULL, + .khz = NULL, + .speed_div = NULL, + .power_dropout = NULL, + .srst_asserted = NULL, +}; + + + + + + +int interface_jtag_execute_queue(void) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + + + +extern int jtag_check_value(u8 *captured, void *priv); + +int interface_jtag_set_end_state(tap_state_t state) +{ + return ERROR_OK; +} + + +int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; + +} + + + + + +int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +/*extern jtag_command_t **jtag_get_last_command_p(void);*/ + +int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + +int interface_jtag_add_tlr() +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + +int interface_jtag_add_reset(int req_trst, int req_srst) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + +int interface_jtag_add_runtest(int num_cycles, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_clocks(int num_cycles) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_sleep(u32 us) +{ + jtag_sleep(us); + return ERROR_OK; +} + +int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) +{ + int state_count; + int tms = 0; + + state_count = 0; + + tap_state_t cur_state=cmd_queue_cur_state; + + while (num_states) + { + if (tap_state_transition(cur_state, false) == path[state_count]) + { + tms = 0; + } + else if (tap_state_transition(cur_state, true) == path[state_count]) + { + tms = 1; + } + else + { + LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count])); + exit(-1); + } + + /* synchronously do the operation here */ + + cur_state = path[state_count]; + state_count++; + num_states--; + } + + + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + +void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count) +{ + int i; + for (i = 0; i < count; i++) + { + embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little)); + buffer += 4; + } +} + Property changes on: trunk/src/jtag/minidummy.c ___________________________________________________________________ Name: svn:eol-style + native |
From: <zw...@ma...> - 2009-06-07 20:38:17
|
Author: zwelch Date: 2009-06-07 20:38:13 +0200 (Sun, 07 Jun 2009) New Revision: 2093 Modified: trunk/src/jtag/jtag.c Log: Fix regressions in previous series of cleanp, caused by r2092. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 13:55:29 UTC (rev 2092) +++ trunk/src/jtag/jtag.c 2009-06-07 18:38:13 UTC (rev 2093) @@ -246,7 +246,7 @@ int jtag_tap_count(void) { return jtag_num_taps; - } +} unsigned jtag_tap_count_enabled(void) { @@ -1064,12 +1064,12 @@ tap->dotted_name, tap->expected_ids[ii]); } return false; - } +} /* Try to examine chain layout according to IEEE 1149.1 §12 */ static int jtag_examine_chain(void) - { +{ u8 idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4]; unsigned device_count = 0; @@ -1093,7 +1093,7 @@ { /* LSB must not be 0, this indicates a device in bypass */ LOG_WARNING("Tap/Device does not have IDCODE"); - idcode=0; + idcode = 0; bit_count += 1; } @@ -1103,9 +1103,9 @@ * End of chain (invalid manufacturer ID) some devices, such * as AVR will output all 1's instead of TDI input value at * end of chain. - */ + */ if (jtag_idcode_is_final(idcode)) - { + { jtag_examine_chain_end(idcode_buffer, bit_count + 32, JTAG_MAX_CHAIN_SIZE * 32); break; @@ -1121,7 +1121,7 @@ if (!tap) continue; - tap->idcode = idcode; + tap->idcode = idcode; // ensure the TAP ID does matches what was expected if (!jtag_examine_chain_match_tap(tap)) @@ -1484,12 +1484,12 @@ return ERROR_OK; } - Jim_SetResult_sprintf( goi->interp, - "newtap: %s missing required parameters", - pTap->dotted_name); + Jim_SetResult_sprintf(goi->interp, + "newtap: %s missing required parameters", + pTap->dotted_name); jtag_tap_free(pTap); - return JIM_ERR; - } + return JIM_ERR; +} static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv ) { @@ -2223,11 +2223,11 @@ tap_state_t state = tap_state_by_name(args[0]); if (state < 0) { - command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); - return ERROR_COMMAND_SYNTAX_ERROR; - } - jtag_set_end_state(state); - jtag_execute_queue(); + command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); + return ERROR_COMMAND_SYNTAX_ERROR; + } + jtag_set_end_state(state); + jtag_execute_queue(); command_print(cmd_ctx, "current endstate: %s", tap_state_name(cmd_queue_end_state)); @@ -2576,7 +2576,7 @@ jtag_set_verify(false); else return ERROR_COMMAND_SYNTAX_ERROR; - } + } const char *status = jtag_will_verify() ? "enabled": "disabled"; command_print(cmd_ctx, "verify jtag capture is %s", status); |
From: <oh...@ma...> - 2009-06-07 15:55:32
|
Author: oharboe Date: 2009-06-07 15:55:29 +0200 (Sun, 07 Jun 2009) New Revision: 2092 Added: trunk/src/jtag/minidummy.c trunk/src/jtag/minidummy/ trunk/src/jtag/minidummy/jtag_minidriver.h Modified: trunk/configure.in trunk/src/jtag/Makefile.am trunk/src/jtag/jtag.c Log: minidriver build test driver "minidriver" Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-06-07 05:24:27 UTC (rev 2091) +++ trunk/configure.in 2009-06-07 13:55:29 UTC (rev 2092) @@ -323,6 +323,10 @@ AS_HELP_STRING([--enable-ecosboard], [Enable building support for eCosBoard based JTAG debugger]), [build_ecosboard=$enableval], [build_ecosboard=no]) +AC_ARG_ENABLE(minidummy, + AS_HELP_STRING([--enable-minidummy], [Enable building support for minidummy driver]), + [build_minidummy=$enableval], [build_minidummy=no]) + AC_ARG_ENABLE(ioutil, AS_HELP_STRING([--enable-ioutil], [Enable ioutil functions - useful for standalone OpenOCD implementations]), [build_ioutil=$enableval], [build_ioutil=no]) @@ -459,6 +463,12 @@ AC_DEFINE(BUILD_ECOSBOARD, 0, [0 if you don't want eCosBoard.]) fi +if test $build_minidummy = yes; then + AC_DEFINE(BUILD_MINIDUMMY, 1, [1 if you want minidummy.]) +else + AC_DEFINE(BUILD_MINIDUMMY, 0, [0 if you don't want minidummy.]) +fi + if test $build_ioutil = yes; then AC_DEFINE(BUILD_IOUTIL, 1, [1 if you want ioutils.]) else @@ -835,6 +845,7 @@ AM_CONDITIONAL(GIVEIO, test $parport_use_giveio = yes) AM_CONDITIONAL(EP93XX, test $build_ep93xx = yes) AM_CONDITIONAL(ECOSBOARD, test $build_ecosboard = yes) +AM_CONDITIONAL(MINIDUMMY, test $build_minidummy = yes) AM_CONDITIONAL(IOUTIL, test $build_ioutil = yes) AM_CONDITIONAL(HTTPD, test $build_httpd = yes) AM_CONDITIONAL(AT91RM9200, test $build_at91rm9200 = yes) Modified: trunk/src/jtag/Makefile.am =================================================================== --- trunk/src/jtag/Makefile.am 2009-06-07 05:24:27 UTC (rev 2091) +++ trunk/src/jtag/Makefile.am 2009-06-07 13:55:29 UTC (rev 2092) @@ -51,6 +51,12 @@ ECOSBOARDFILES = endif +if MINIDUMMY +MINIDUMMYFILES = minidummy.c +else +MINIDUMMYFILES = +endif + if MINIDRIVER DRIVERFILES = else @@ -131,6 +137,7 @@ $(PRESTOFILES) \ $(USBPROGFILES) \ $(ECOSBOARDFILES) \ + $(MINIDUMMYFILES) \ $(JLINKFILES) \ $(RLINKFILES) \ $(VSLLINKFILES) \ Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:24:27 UTC (rev 2091) +++ trunk/src/jtag/jtag.c 2009-06-07 13:55:29 UTC (rev 2092) @@ -99,6 +99,9 @@ extern jtag_interface_t zy1000_interface; #endif +#if BUILD_MINIDUMMY == 1 + extern jtag_interface_t minidummy_interface; +#endif #if BUILD_PARPORT == 1 extern jtag_interface_t parport_interface; #endif @@ -159,6 +162,9 @@ #if BUILD_ECOSBOARD == 1 &zy1000_interface, #endif +#if BUILD_MINIDUMMY == 1 + &minidummy_interface, +#endif #if BUILD_PARPORT == 1 &parport_interface, #endif @@ -240,7 +246,7 @@ int jtag_tap_count(void) { return jtag_num_taps; -} + } unsigned jtag_tap_count_enabled(void) { @@ -1058,12 +1064,12 @@ tap->dotted_name, tap->expected_ids[ii]); } return false; -} + } /* Try to examine chain layout according to IEEE 1149.1 §12 */ static int jtag_examine_chain(void) -{ + { u8 idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4]; unsigned device_count = 0; @@ -1087,7 +1093,7 @@ { /* LSB must not be 0, this indicates a device in bypass */ LOG_WARNING("Tap/Device does not have IDCODE"); - idcode = 0; + idcode=0; bit_count += 1; } @@ -1097,9 +1103,9 @@ * End of chain (invalid manufacturer ID) some devices, such * as AVR will output all 1's instead of TDI input value at * end of chain. - */ + */ if (jtag_idcode_is_final(idcode)) - { + { jtag_examine_chain_end(idcode_buffer, bit_count + 32, JTAG_MAX_CHAIN_SIZE * 32); break; @@ -1115,7 +1121,7 @@ if (!tap) continue; - tap->idcode = idcode; + tap->idcode = idcode; // ensure the TAP ID does matches what was expected if (!jtag_examine_chain_match_tap(tap)) @@ -1478,12 +1484,12 @@ return ERROR_OK; } - Jim_SetResult_sprintf(goi->interp, - "newtap: %s missing required parameters", - pTap->dotted_name); + Jim_SetResult_sprintf( goi->interp, + "newtap: %s missing required parameters", + pTap->dotted_name); jtag_tap_free(pTap); - return JIM_ERR; -} + return JIM_ERR; + } static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv ) { @@ -2133,7 +2139,6 @@ return ERROR_OK; } - static int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { int retval=ERROR_OK; @@ -2218,11 +2223,11 @@ tap_state_t state = tap_state_by_name(args[0]); if (state < 0) { - command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); - return ERROR_COMMAND_SYNTAX_ERROR; - } - jtag_set_end_state(state); - jtag_execute_queue(); + command_print( cmd_ctx, "Invalid state name: %s\n", args[0] ); + return ERROR_COMMAND_SYNTAX_ERROR; + } + jtag_set_end_state(state); + jtag_execute_queue(); command_print(cmd_ctx, "current endstate: %s", tap_state_name(cmd_queue_end_state)); @@ -2571,7 +2576,7 @@ jtag_set_verify(false); else return ERROR_COMMAND_SYNTAX_ERROR; - } + } const char *status = jtag_will_verify() ? "enabled": "disabled"; command_print(cmd_ctx, "verify jtag capture is %s", status); Added: trunk/src/jtag/minidummy/jtag_minidriver.h =================================================================== --- trunk/src/jtag/minidummy/jtag_minidriver.h 2009-06-07 05:24:27 UTC (rev 2091) +++ trunk/src/jtag/minidummy/jtag_minidriver.h 2009-06-07 13:55:29 UTC (rev 2092) @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2007-2008 by vind Harboe * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + + + +static __inline__ void interface_jtag_add_dr_out_core(jtag_tap_t *target_tap, + int num_fields, + const int *num_bits, + const u32 *value, + enum tap_state end_state) +{ + /* synchronously do the operation here */ +} + +static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap, + int num_fields, + const int *num_bits, + const u32 *value, + enum tap_state end_state) +{ + /* synchronously do the operation here */ +} + +#define interface_jtag_add_callback(callback, in) callback(in) + +#define interface_jtag_add_callback4(callback, in, data1, data2, data3) jtag_set_error(callback(in, data1, data2, data3)) Added: trunk/src/jtag/minidummy.c =================================================================== --- trunk/src/jtag/minidummy.c 2009-06-07 05:24:27 UTC (rev 2091) +++ trunk/src/jtag/minidummy.c 2009-06-07 13:55:29 UTC (rev 2092) @@ -0,0 +1,190 @@ +/*************************************************************************** + * Copyright (C) 2007-2008 by vind Harboe * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "embeddedice.h" +#include "minidriver.h" +#include "interface.h" + + + + +jtag_interface_t minidummy_interface = +{ + .name = "minidummy", + .execute_queue = NULL, + .speed = NULL, + .register_commands = NULL, + .init = NULL, + .quit = NULL, + .khz = NULL, + .speed_div = NULL, + .power_dropout = NULL, + .srst_asserted = NULL, +}; + + + + + + +int interface_jtag_execute_queue(void) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + + + +extern int jtag_check_value(u8 *captured, void *priv); + +int interface_jtag_set_end_state(tap_state_t state) +{ + return ERROR_OK; +} + + +int interface_jtag_add_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; + +} + + + + + +int interface_jtag_add_plain_ir_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +/*extern jtag_command_t **jtag_get_last_command_p(void);*/ + +int interface_jtag_add_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_plain_dr_scan(int num_fields, const scan_field_t *fields, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + +int interface_jtag_add_tlr() +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + +int interface_jtag_add_reset(int req_trst, int req_srst) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + + +int interface_jtag_add_runtest(int num_cycles, tap_state_t state) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_clocks(int num_cycles) +{ + /* synchronously do the operation here */ + + return ERROR_OK; +} + +int interface_jtag_add_sleep(u32 us) +{ + jtag_sleep(us); + return ERROR_OK; +} + +int interface_jtag_add_pathmove(int num_states, const tap_state_t *path) +{ + int state_count; + int tms = 0; + + state_count = 0; + + tap_state_t cur_state=cmd_queue_cur_state; + + while (num_states) + { + if (tap_state_transition(cur_state, false) == path[state_count]) + { + tms = 0; + } + else if (tap_state_transition(cur_state, true) == path[state_count]) + { + tms = 1; + } + else + { + LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(cur_state), tap_state_name(path[state_count])); + exit(-1); + } + + /* synchronously do the operation here */ + + cur_state = path[state_count]; + state_count++; + num_states--; + } + + + /* synchronously do the operation here */ + + return ERROR_OK; +} + + + +void embeddedice_write_dcc(jtag_tap_t *tap, int reg_addr, u8 *buffer, int little, int count) +{ + int i; + for (i = 0; i < count; i++) + { + embeddedice_write_reg_inner(tap, reg_addr, fast_target_buffer_get_u32(buffer, little)); + buffer += 4; + } +} + |
From: <zw...@ma...> - 2009-06-07 07:24:34
|
Author: zwelch Date: 2009-06-07 07:24:27 +0200 (Sun, 07 Jun 2009) New Revision: 2091 Modified: trunk/src/jtag/jtag.c trunk/src/jtag/jtag.h Log: Factoring of jtag_examine_chain for maintainability: - Improve variable type: change device_count to unsigned. - Improves jtag_tap_count_enabled() API too (now returns unsigned). Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:24:20 UTC (rev 2090) +++ trunk/src/jtag/jtag.c 2009-06-07 05:24:27 UTC (rev 2091) @@ -242,10 +242,10 @@ return jtag_num_taps; } -int jtag_tap_count_enabled(void) +unsigned jtag_tap_count_enabled(void) { jtag_tap_t *t; - int n; + unsigned n; n = 0; t = jtag_all_taps(); @@ -1065,7 +1065,7 @@ static int jtag_examine_chain(void) { u8 idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4]; - int device_count = 0; + unsigned device_count = 0; jtag_examine_chain_execute(idcode_buffer, JTAG_MAX_CHAIN_SIZE); Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-07 05:24:20 UTC (rev 2090) +++ trunk/src/jtag/jtag.h 2009-06-07 05:24:27 UTC (rev 2091) @@ -181,7 +181,7 @@ extern jtag_tap_t* jtag_tap_by_string(const char* dotted_name); extern jtag_tap_t* jtag_tap_by_jim_obj(Jim_Interp* interp, Jim_Obj* obj); extern jtag_tap_t* jtag_tap_by_abs_position(int abs_position); -extern int jtag_tap_count_enabled(void); +extern unsigned jtag_tap_count_enabled(void); extern int jtag_tap_count(void); static __inline__ jtag_tap_t* jtag_tap_next_enabled(jtag_tap_t* p) |
From: <zw...@ma...> - 2009-06-07 07:24:24
|
Author: zwelch Date: 2009-06-07 07:24:20 +0200 (Sun, 07 Jun 2009) New Revision: 2090 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Limit scope: move tap and bit_count variables to point of first use. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:24:12 UTC (rev 2089) +++ trunk/src/jtag/jtag.c 2009-06-07 05:24:20 UTC (rev 2090) @@ -1064,9 +1064,7 @@ */ static int jtag_examine_chain(void) { - jtag_tap_t *tap; u8 idcode_buffer[JTAG_MAX_CHAIN_SIZE * 4]; - int bit_count; int device_count = 0; jtag_examine_chain_execute(idcode_buffer, JTAG_MAX_CHAIN_SIZE); @@ -1075,14 +1073,14 @@ return ERROR_JTAG_INIT_FAILED; /* point at the 1st tap */ - tap = jtag_tap_next_enabled(NULL); + jtag_tap_t *tap = jtag_tap_next_enabled(NULL); if (tap == NULL) { LOG_ERROR("JTAG: No taps enabled?"); return ERROR_JTAG_INIT_FAILED; } - for (bit_count = 0; bit_count < (JTAG_MAX_CHAIN_SIZE * 32) - 31;) + for (unsigned bit_count = 0; bit_count < (JTAG_MAX_CHAIN_SIZE * 32) - 31;) { u32 idcode = buf_get_u32(idcode_buffer, bit_count, 32); if ((idcode & 1) == 0) |
From: <zw...@ma...> - 2009-06-07 07:24:16
|
Author: zwelch Date: 2009-06-07 07:24:12 +0200 (Sun, 07 Jun 2009) New Revision: 2089 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Factor TAP ID matching into new helper function. - Simplifies the main jtag_examine_chain loop logic considerably. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:24:03 UTC (rev 2088) +++ trunk/src/jtag/jtag.c 2009-06-07 05:24:12 UTC (rev 2089) @@ -1021,6 +1021,45 @@ } } +static bool jtag_examine_chain_match_tap(const struct jtag_tap_s *tap) +{ + if (0 == tap->expected_ids_cnt) + { + /// @todo Enable LOG_INFO to ask for reports about unknown TAP IDs. +#if 0 + LOG_INFO("Uknown JTAG TAP ID: 0x%08x", tap->idcode) + LOG_INFO("Please report the chip name and reported ID code to the openocd project"); +#endif + return true; + } + + /* Loop over the expected identification codes and test for a match */ + u8 ii; + for (ii = 0; ii < tap->expected_ids_cnt; ii++) + { + if (tap->idcode == tap->expected_ids[ii]) + break; + } + + /* If none of the expected ids matched, log an error */ + if (ii != tap->expected_ids_cnt) + { + LOG_INFO("JTAG Tap/device matched"); + return true; + } + jtag_examine_chain_display(LOG_LVL_ERROR, "got", + tap->dotted_name, tap->idcode); + for (ii = 0; ii < tap->expected_ids_cnt; ii++) + { + char msg[32]; + snprintf(msg, sizeof(msg), "expected %hhu of %hhu", + ii + 1, tap->expected_ids_cnt); + jtag_examine_chain_display(LOG_LVL_ERROR, msg, + tap->dotted_name, tap->expected_ids[ii]); + } + return false; +} + /* Try to examine chain layout according to IEEE 1149.1 §12 */ static int jtag_examine_chain(void) @@ -1080,42 +1119,11 @@ tap->idcode = idcode; - if (0 == tap->expected_ids_cnt) - { - /// @todo Enable LOG_INFO to ask for reports about unknown TAP IDs. -#if 0 - LOG_INFO("Uknown JTAG TAP ID: 0x%08x", tap->idcode) - LOG_INFO("Please report the chip name and reported ID code to the openocd project"); -#endif - tap = jtag_tap_next_enabled(tap); - continue; - } - /* Loop over the expected identification codes and test for a match */ - u8 ii; - for (ii = 0; ii < tap->expected_ids_cnt; ii++) - { - if (tap->idcode == tap->expected_ids[ii]) - break; - } + // ensure the TAP ID does matches what was expected + if (!jtag_examine_chain_match_tap(tap)) + return ERROR_JTAG_INIT_FAILED; - /* If none of the expected ids matched, log an error */ - if (ii != tap->expected_ids_cnt) - { - LOG_INFO("JTAG Tap/device matched"); - tap = jtag_tap_next_enabled(tap); - continue; - } - jtag_examine_chain_display(LOG_LVL_ERROR, "got", - tap->dotted_name, tap->idcode); - for (ii = 0; ii < tap->expected_ids_cnt; ii++) - { - char msg[20]; - snprintf(msg, 20, "expected %hhu of %hhu", - ii + 1, tap->expected_ids_cnt); - jtag_examine_chain_display(LOG_LVL_ERROR, msg, - tap->dotted_name, tap->expected_ids[ii]); - } - return ERROR_JTAG_INIT_FAILED; + tap = jtag_tap_next_enabled(tap); } /* see if number of discovered devices matches configuration */ |
From: <zw...@ma...> - 2009-06-07 07:24:08
|
Author: zwelch Date: 2009-06-07 07:24:03 +0200 (Sun, 07 Jun 2009) New Revision: 2088 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Minor whitespace and style cleanups in body of jtag_examine_chain. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:23:50 UTC (rev 2087) +++ trunk/src/jtag/jtag.c 2009-06-07 05:24:03 UTC (rev 2088) @@ -1037,7 +1037,8 @@ /* point at the 1st tap */ tap = jtag_tap_next_enabled(NULL); - if( tap == NULL ){ + if (tap == NULL) + { LOG_ERROR("JTAG: No taps enabled?"); return ERROR_JTAG_INIT_FAILED; } @@ -1049,7 +1050,7 @@ { /* LSB must not be 0, this indicates a device in bypass */ LOG_WARNING("Tap/Device does not have IDCODE"); - idcode=0; + idcode = 0; bit_count += 1; } @@ -1081,7 +1082,7 @@ if (0 == tap->expected_ids_cnt) { - // @todo Enable LOG_INFO to ask for reports about unknown TAP IDs. + /// @todo Enable LOG_INFO to ask for reports about unknown TAP IDs. #if 0 LOG_INFO("Uknown JTAG TAP ID: 0x%08x", tap->idcode) LOG_INFO("Please report the chip name and reported ID code to the openocd project"); @@ -1089,12 +1090,12 @@ tap = jtag_tap_next_enabled(tap); continue; } - /* Loop over the expected identification codes and test for a match */ + /* Loop over the expected identification codes and test for a match */ u8 ii; - for (ii = 0; ii < tap->expected_ids_cnt; ii++) { - if (tap->idcode == tap->expected_ids[ii]) { + for (ii = 0; ii < tap->expected_ids_cnt; ii++) + { + if (tap->idcode == tap->expected_ids[ii]) break; - } } /* If none of the expected ids matched, log an error */ @@ -1106,7 +1107,8 @@ } jtag_examine_chain_display(LOG_LVL_ERROR, "got", tap->dotted_name, tap->idcode); - for (ii = 0; ii < tap->expected_ids_cnt; ii++) { + for (ii = 0; ii < tap->expected_ids_cnt; ii++) + { char msg[20]; snprintf(msg, 20, "expected %hhu of %hhu", ii + 1, tap->expected_ids_cnt); @@ -1119,9 +1121,11 @@ /* see if number of discovered devices matches configuration */ if (device_count != jtag_tap_count_enabled()) { - LOG_ERROR("number of discovered devices in JTAG chain (%i) doesn't match (enabled) configuration (%i), total taps: %d", - device_count, jtag_tap_count_enabled(), jtag_tap_count()); - LOG_ERROR("check the config file and ensure proper JTAG communication (connections, speed, ...)"); + LOG_ERROR("number of discovered devices in JTAG chain (%i) " + "does not match (enabled) configuration (%i), total taps: %d", + device_count, jtag_tap_count_enabled(), jtag_tap_count()); + LOG_ERROR("check the config file and ensure proper JTAG communication" + " (connections, speed, ...)"); return ERROR_JTAG_INIT_FAILED; } |
From: <zw...@ma...> - 2009-06-07 07:24:00
|
Author: zwelch Date: 2009-06-07 07:23:50 +0200 (Sun, 07 Jun 2009) New Revision: 2087 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Add helper to check for the terminating ID during jtag_examine_chain. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:23:40 UTC (rev 2086) +++ trunk/src/jtag/jtag.c 2009-06-07 05:23:50 UTC (rev 2087) @@ -995,6 +995,11 @@ EXTRACT_MFG(idcode), EXTRACT_PART(idcode), EXTRACT_VER(idcode) ); } +static bool jtag_idcode_is_final(u32 idcode) +{ + return idcode == 0x000000FF || idcode == 0xFFFFFFFF; +} + /** * This helper checks that remaining bits in the examined chain data are * all as expected, but a single JTAG device requires only 64 bits to be @@ -1008,7 +1013,7 @@ { u32 idcode = buf_get_u32(idcodes, count, 32); // do not trigger the warning if the data looks good - if (!triggered && (idcode == 0x000000FF || idcode == 0xFFFFFFFF)) + if (!triggered && jtag_idcode_is_final(idcode)) continue; LOG_WARNING("Unexpected idcode after end of chain: %d 0x%08x", count, idcode); @@ -1055,7 +1060,7 @@ * as AVR will output all 1's instead of TDI input value at * end of chain. */ - if ((idcode == 0x000000FF)||(idcode == 0xFFFFFFFF)) + if (jtag_idcode_is_final(idcode)) { jtag_examine_chain_end(idcode_buffer, bit_count + 32, JTAG_MAX_CHAIN_SIZE * 32); |
From: <zw...@ma...> - 2009-06-07 07:23:45
|
Author: zwelch Date: 2009-06-07 07:23:40 +0200 (Sun, 07 Jun 2009) New Revision: 2086 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Factor end-of-chain verfication into new helper routine. - Change 'unexpected' local variable name to 'triggered' and type to bool. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:23:30 UTC (rev 2085) +++ trunk/src/jtag/jtag.c 2009-06-07 05:23:40 UTC (rev 2086) @@ -995,6 +995,27 @@ EXTRACT_MFG(idcode), EXTRACT_PART(idcode), EXTRACT_VER(idcode) ); } +/** + * This helper checks that remaining bits in the examined chain data are + * all as expected, but a single JTAG device requires only 64 bits to be + * read back correctly. This can help identify and diagnose problems + * with the JTAG chain earlier, gives more helpful/explicit error messages. + */ +static void jtag_examine_chain_end(u8 *idcodes, unsigned count, unsigned max) +{ + bool triggered = false; + for ( ; count < max - 31; count += 32) + { + u32 idcode = buf_get_u32(idcodes, count, 32); + // do not trigger the warning if the data looks good + if (!triggered && (idcode == 0x000000FF || idcode == 0xFFFFFFFF)) + continue; + LOG_WARNING("Unexpected idcode after end of chain: %d 0x%08x", + count, idcode); + triggered = true; + } +} + /* Try to examine chain layout according to IEEE 1149.1 §12 */ static int jtag_examine_chain(void) @@ -1029,32 +1050,15 @@ } else { - /* some devices, such as AVR will output all 1's instead of TDI - input value at end of chain. */ + /* + * End of chain (invalid manufacturer ID) some devices, such + * as AVR will output all 1's instead of TDI input value at + * end of chain. + */ if ((idcode == 0x000000FF)||(idcode == 0xFFFFFFFF)) { - int unexpected=0; - /* End of chain (invalid manufacturer ID) - * - * The JTAG examine is the very first thing that happens - * - * A single JTAG device requires only 64 bits to be read back correctly. - * - * The code below adds a check that the rest of the data scanned (640 bits) - * are all as expected. This helps diagnose/catch problems with the JTAG chain - * - * earlier and gives more helpful/explicit error messages. - */ - for (bit_count += 32; bit_count < (JTAG_MAX_CHAIN_SIZE * 32) - 31;bit_count += 32) - { - idcode = buf_get_u32(idcode_buffer, bit_count, 32); - if (unexpected||((idcode != 0x000000FF)&&(idcode != 0xFFFFFFFF))) - { - LOG_WARNING("Unexpected idcode after end of chain! %d 0x%08x", bit_count, idcode); - unexpected = 1; - } - } - + jtag_examine_chain_end(idcode_buffer, + bit_count + 32, JTAG_MAX_CHAIN_SIZE * 32); break; } |
From: <zw...@ma...> - 2009-06-07 07:23:35
|
Author: zwelch Date: 2009-06-07 07:23:30 +0200 (Sun, 07 Jun 2009) New Revision: 2085 Modified: trunk/src/jtag/jtag.c Log: Factoring of jtag_examine_chain for maintainability: - Factor output of accepted/incorrect/expected TAP IDs into static helper. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-07 05:23:13 UTC (rev 2084) +++ trunk/src/jtag/jtag.c 2009-06-07 05:23:30 UTC (rev 2085) @@ -985,6 +985,16 @@ return true; } +static void jtag_examine_chain_display(enum log_levels level, const char *msg, + const char *name, u32 idcode) +{ + log_printf_lf(level, __FILE__, __LINE__, __FUNCTION__, + "JTAG tap: %s %16.16s: 0x%08x " + "(mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)", + name, msg, idcode, + EXTRACT_MFG(idcode), EXTRACT_PART(idcode), EXTRACT_VER(idcode) ); +} + /* Try to examine chain layout according to IEEE 1149.1 §12 */ static int jtag_examine_chain(void) @@ -1019,10 +1029,6 @@ } else { - u32 manufacturer; - u32 part; - u32 version; - /* some devices, such as AVR will output all 1's instead of TDI input value at end of chain. */ if ((idcode == 0x000000FF)||(idcode == 0xFFFFFFFF)) @@ -1052,14 +1058,10 @@ break; } - manufacturer = EXTRACT_MFG(idcode); - part = EXTRACT_PART(idcode); - version = EXTRACT_VER(idcode); + jtag_examine_chain_display(LOG_LVL_INFO, "tap/device found", + tap ? tap->dotted_name : "(not-named)", + idcode); - LOG_INFO("JTAG tap: %s tap/device found: 0x%8.8x (Manufacturer: 0x%3.3x, Part: 0x%4.4x, Version: 0x%1.1x)", - ((tap != NULL) ? (tap->dotted_name) : "(not-named)"), - idcode, manufacturer, part, version); - bit_count += 32; } device_count++; @@ -1093,21 +1095,14 @@ tap = jtag_tap_next_enabled(tap); continue; } - LOG_ERROR("JTAG tap: %s got: 0x%08x (mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)", - tap->dotted_name, - idcode, - EXTRACT_MFG( tap->idcode ), - EXTRACT_PART( tap->idcode ), - EXTRACT_VER( tap->idcode ) ); + jtag_examine_chain_display(LOG_LVL_ERROR, "got", + tap->dotted_name, tap->idcode); for (ii = 0; ii < tap->expected_ids_cnt; ii++) { - LOG_ERROR("JTAG tap: %s expected %hhu of %hhu: 0x%08x (mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)", - tap->dotted_name, - ii + 1, - tap->expected_ids_cnt, - tap->expected_ids[ii], - EXTRACT_MFG( tap->expected_ids[ii] ), - EXTRACT_PART( tap->expected_ids[ii] ), - EXTRACT_VER( tap->expected_ids[ii] ) ); + char msg[20]; + snprintf(msg, 20, "expected %hhu of %hhu", + ii + 1, tap->expected_ids_cnt); + jtag_examine_chain_display(LOG_LVL_ERROR, msg, + tap->dotted_name, tap->expected_ids[ii]); } return ERROR_JTAG_INIT_FAILED; } |