diff --git a/jtag/ChangeLog b/jtag/ChangeLog index d9a3094c..6ad48c64 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,18 +1,23 @@ +2008-01-19 Kolja Waschk + + * ChangeLog: whitespace cosmetics + * Makefile.am, configure.ac, jim/tap.c, jim/Makefile.am, jim/README.jim, + tap/cable/jim.c, tap/cable.c, tap/Makefile.am: JTAG target sim skeleton + 2008-01-18 Arnim Laeuger - * configure.ac: restructured the test logic for bison error locations and the - the BSDL subsystem - [ 1873515 ] BSDL part doesn't compile under Cygwin + * configure.ac: restructured the test logic for bison error locations and + the BSDL subsystem [ 1873515 ] BSDL part doesn't compile under Cygwin 2008-01-18 Kolja Waschk * Moved the code from libbrux/ subdirectory into appropriate locations in our src/ subdirectory (Enhancement 1873220): - libbrux/cmd/help.c -> src/cmd/help.c - libbrux/cmd/quit.c -> src/cmd/quit.c - libbrux/cmd/cmd.c + src/cmd.c -> src/cmd/cmd.c - libbrux/cmd/cmd_detectflash.c -> src/cmd/detectflash.c + libbrux/cmd/help.c -> src/cmd/help.c + libbrux/cmd/quit.c -> src/cmd/quit.c + libbrux/cmd/cmd.c + src/cmd.c -> src/cmd/cmd.c + libbrux/cmd/cmd_detectflash.c -> src/cmd/detectflash.c libbrux/flash + Makefile.am -> src/flash/ * Merged the header files from openwince "include" package, which were @@ -32,13 +37,16 @@ 2008-01-17 Kolja Waschk - * doc/UrJTAG.txt: Updates regarding Cygwin ioperm package and readline library - * src/jtag.c: Without readline library, informative output often was printed after prompt, not before - * src/bus/s3c4510x.c: Address alignment on A0..Ax lines changes dynamically with bus width + * UrJTAG.txt: Updates regarding Cygwin ioperm package and readline library + * src/jtag.c: Without readline library, informative output often + was printed after prompt, not before + * src/bus/s3c4510x.c: Address alignment on A0..Ax lines changes dynamically + with bus width 2008-01-16 Arnim Laeuger - * src/bus/prototype.c (prototype_bus_new): properly calculate the address shift based on the current bus width + * src/bus/prototype.c (prototype_bus_new): properly calculate the address + shift based on the current bus width 2008-01-15 Arnim Laeuger diff --git a/jtag/configure.ac b/jtag/configure.ac index 7d9ff1f6..aa266409 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -70,6 +70,7 @@ AC_CONFIG_FILES( src/cmd/Makefile src/svf/Makefile src/bsdl/Makefile + src/jim/Makefile po/Makefile.in ) @@ -357,6 +358,22 @@ AS_IF([test "x$bsdl" = xtrue], [ AM_CONDITIONAL(ENABLE_BSDL, false) ]) +dnl Enable JTAG target simulator JIM? +AC_ARG_ENABLE(jim, +[ --enable-jim Enable JTAG target simulator JIM], +[case "${enableval}" in + yes) jim=true ;; + no) jim=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-jim) ;; + esac], +[jim=false]) +AS_IF([test "x$jim" = xtrue], [ + AM_CONDITIONAL(ENABLE_JIM, true) + AC_DEFINE(ENABLE_JIM, 1, [define if JTAG target simulator JIM is enabled]) +],[ + AM_CONDITIONAL(ENABLE_JIM, false) +]) + AC_OUTPUT dnl diff --git a/jtag/src/Makefile.am b/jtag/src/Makefile.am index c2666cc3..5fe41872 100644 --- a/jtag/src/Makefile.am +++ b/jtag/src/Makefile.am @@ -89,5 +89,11 @@ if ENABLE_BSDL jtag_LDADD += -Lbsdl -lbsdl endif +if ENABLE_JIM +SUBDIRS += jim +jtag_LDADD += -Ljim -ljim +jtag_DEPENDENCIES += jim/libjim.a +endif + localedir = $(datadir)/locale INCLUDES = -DLOCALEDIR=\"$(localedir)\" diff --git a/jtag/src/jim/Makefile.am b/jtag/src/jim/Makefile.am new file mode 100644 index 00000000..975904c4 --- /dev/null +++ b/jtag/src/jim/Makefile.am @@ -0,0 +1,29 @@ +# +# $Id: Makefile.am $ +# +# Copyright (C) 2008 Kolja Waschk +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +include $(top_srcdir)/Makefile.rules + +noinst_LIBRARIES = libjim.a + +libjim_a_SOURCES = \ + tap.c diff --git a/jtag/src/jim/README.jim b/jtag/src/jim/README.jim new file mode 100644 index 00000000..5639c1fc --- /dev/null +++ b/jtag/src/jim/README.jim @@ -0,0 +1,6 @@ +This directory contains source code that simulates various aspects of +a target. It is mainly thought to assist in testing and debugging the +rest of UrJTAG. The connection between UrJTAG and the code here is by +means of special bus, cable or parport drivers. + + diff --git a/jtag/src/jim/tap.c b/jtag/src/jim/tap.c new file mode 100644 index 00000000..e69de29b diff --git a/jtag/src/tap/Makefile.am b/jtag/src/tap/Makefile.am index 2610d9cb..d1d1d0f2 100644 --- a/jtag/src/tap/Makefile.am +++ b/jtag/src/tap/Makefile.am @@ -56,6 +56,11 @@ libtap_a_SOURCES += \ cable/xpc.c endif +if ENABLE_JIM +libtap_a_SOURCES += \ + cable/jim.c +endif + if HAVE_LIBFTDI libtap_a_SOURCES += \ parport/ftdi.c diff --git a/jtag/src/tap/cable.c b/jtag/src/tap/cable.c index 09dac851..e0afeee2 100644 --- a/jtag/src/tap/cable.c +++ b/jtag/src/tap/cable.c @@ -50,6 +50,9 @@ extern cable_driver_t keithkoep_cable_driver; extern cable_driver_t lattice_cable_driver; extern cable_driver_t mpcbdm_cable_driver; extern cable_driver_t triton_cable_driver; +#ifdef ENABLE_JIM +extern cable_driver_t jim_cable_driver; +#endif extern cable_driver_t wiggler_cable_driver; extern cable_driver_t wiggler2_cable_driver; extern cable_driver_t wiggler_cable_driver; @@ -77,6 +80,9 @@ cable_driver_t *cable_drivers[] = { &lattice_cable_driver, &mpcbdm_cable_driver, &triton_cable_driver, +#ifdef ENABLE_JIM + &jim_cable_driver, +#endif &wiggler_cable_driver, &wiggler2_cable_driver, #ifdef HAVE_LIBUSB diff --git a/jtag/src/tap/cable/jim.c b/jtag/src/tap/cable/jim.c new file mode 100644 index 00000000..a49a7ff0 --- /dev/null +++ b/jtag/src/tap/cable/jim.c @@ -0,0 +1,124 @@ +/* + * $Id: $ + * + * JTAG target simulator JIM "cable" driver + * + * Copyright (C) 2008 Kolja Waschk + * + * 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. + */ + +#include "sysdep.h" + +#include +#include +#include + +#include "cable.h" +#include "parport.h" +#include "chain.h" + +#include "generic.h" + +#include + +int +jim_cable_connect( char *params[], cable_t *cable ) +{ + if ( cmd_params( params ) < 1 ) { + printf( _("not enough arguments!\n") ); + return 1; + } + + cable->chain = NULL; + + return 0; +} + +void +jim_cable_disconnect( cable_t *cable ) +{ + cable_done( cable ); + chain_disconnect( cable->chain ); +} + +void +jim_cable_free( cable_t *cable ) +{ + free( cable ); +} + +void +jim_cable_done( cable_t *cable ) +{ +} + +static int +jim_cable_init( cable_t *cable ) +{ + printf( _("JTAG target simulator JIM - work in progress!\n")); + return 0; +} + +static void +jim_cable_clock( cable_t *cable, int tms, int tdi, int n ) +{ +} + +static int +jim_cable_get_tdo( cable_t *cable ) +{ + return 0; +} + +static int +jim_cable_get_trst( cable_t *cable ) +{ + return 0; +} + +static int +jim_cable_set_trst( cable_t *cable, int trst ) +{ + return jim_cable_get_trst( cable ); +} + +static void +jim_cable_help( const char *cablename ) +{ + printf( _( + "Usage: cable %s\n" + ), + cablename + ); +} + +cable_driver_t jim_cable_driver = { + "JIM", + N_("JTAG target simulator JIM"), + jim_cable_connect, + jim_cable_disconnect, + jim_cable_free, + jim_cable_init, + jim_cable_done, + jim_cable_clock, + jim_cable_get_tdo, + generic_transfer, + jim_cable_set_trst, + jim_cable_get_trst, + jim_cable_help +}; +