From 626ddc8ffc5f00ffd92697f041e211608549c145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Tue, 1 Apr 2008 21:51:50 +0000 Subject: [PATCH] [ 1887221 ] Add configure switch to disable all cable&parport drivers: bus, cable and parport drivers are enabled and disabled via separate parameters to configure git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1143 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 19 ++++ jtag/configure.ac | 233 ++++++++++++++++++++++++++++++--------- jtag/doc/UrJTAG.txt | 16 ++- jtag/src/Makefile.am | 2 +- jtag/src/bus/Makefile.am | 150 ++++++++++++++++++++----- jtag/src/bus/buses.c | 74 +++++++++++-- jtag/src/bus/buses.h | 14 +-- jtag/src/tap/Makefile.am | 114 ++++++++++++++----- jtag/src/tap/cable.c | 48 ++++++-- jtag/src/tap/parport.c | 34 +++--- 10 files changed, 544 insertions(+), 160 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 34ba3c79..42bbd577 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,22 @@ +2008-04-01 Arnim Laeuger + + [ 1887221 ] Add configure switch to disable all cable&parport drivers: + * doc/UrJTAG.txt: updates for new options and summary reporting + * src/tap/parport.c: reworked driver referencing based on + ENABLE_PARPORT_* macros + * src/tap/cable.c: reworked driver referencing based on + ENABLE_CABLE_* macros + * src/tap/Makefile.am (libtap_a_SOURCES): include sources based on + ENABLE_CABLE_* and ENABLE_PARPORT_* macros + * src/bus/buses.c: reference bus drivers based on ENABLE_BUS_* macros + * src/bus/buses.h: sorted sequence of extern declarations + * src/bus/Makefile.am (libbus_a_SOURCES): include sources based on + ENABLE_BUS_* macros + * src/Makefile.am (jtag_LDADD): moved -lcmd to top of list to prevent + linker error for --enable-cable=jim + * configure.ac: added switches --enable-bus, --enable-cable and enable-parport + removed (superseeded) --enable-jim and --enable-ep9307 + 2008-03-26 Kolja Waschk * src/flash/amd.c: Fix address shift (Jeff Wittrock) diff --git a/jtag/configure.ac b/jtag/configure.ac index 6affade1..a2736de4 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -91,11 +91,13 @@ AC_PROG_YACC AC_SEARCH_LIBS([ioperm], [ioperm]) if test "$ac_cv_search_ioperm" != "no"; then AC_DEFINE(HAVE_IOPERM, 1, [Define to 1 if you have the ioperm() function]) + HAVE_IOPERM="yes" else AC_SEARCH_LIBS([i386_set_ioperm], [i386]) if test "$ac_cv_search_i386_set_ioperm" != "no"; then AC_DEFINE(HAVE_I386_SET_IOPERM, 1, [Define to 1 if you have the i386_set_ioperm() function]) + HAVE_I386_SET_IOPERM="yes" fi fi @@ -104,8 +106,8 @@ AC_CHECK_FUNCS(swprintf) AC_CHECK_FUNC(clock_gettime, [], [ AC_CHECK_LIB(rt, clock_gettime) ]) -AC_CHECK_HEADERS(linux/ppdev.h) -AC_CHECK_HEADERS(dev/ppbus/ppi.h) +AC_CHECK_HEADERS([linux/ppdev.h], [HAVE_LINUX_PPDEV_H="yes"]) +AC_CHECK_HEADERS([dev/ppbus/ppi.h], [HAVE_DEV_PPBUS_PPI_H="yes"]) AC_CHECK_HEADERS(stropts.h) AC_CHECK_HEADERS(wchar.h) @@ -231,22 +233,6 @@ AS_IF([test "x$HAVELIBFTD2XX" == xyes], [ AC_SUBST(FTD2XXLIB) -dnl Enable cable driver for Vision EP9307? -AC_ARG_ENABLE(ep9307, -[AS_HELP_STRING([--enable-ep9307], [Enable cable driver for EP9307])], -[case "${enableval}" in - yes) ep9307=true ;; - no) ep9307=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-ep9307) ;; - esac], -[ep9307=false]) -AS_IF([test "x$ep9307" = xtrue], [ - AM_CONDITIONAL(ENABLE_EP9307, true) - AC_DEFINE(ENABLE_EP9307, 1, [define if cable driver for ep9307 is enabled]) -],[ - AM_CONDITIONAL(ENABLE_EP9307, false) -]) - CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/include" @@ -380,22 +366,6 @@ AS_IF([test "x$bsdl" = xtrue], [ AM_CONDITIONAL(ENABLE_BSDL, false) ]) -dnl Enable JTAG target simulator JIM? -AC_ARG_ENABLE(jim, -[AS_HELP_STRING([--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) -]) - dnl Enable experimental brute-force JEDEC flash autodetection? AC_ARG_ENABLE(jedec-exp, [AS_HELP_STRING([--enable-jedec-exp], [Enable experimental JEDEC flash detection])], @@ -412,44 +382,199 @@ AS_IF([test "x$jedecexp" = xtrue], [ AM_CONDITIONAL(JEDEC_EXP, false) ]) + +# Macro for driver include check +AC_DEFUN([CHECK_DRIVER], [ + AS_IF([echo "$1" | $GREP -q $3], [ + AC_DEFINE([$4], 1, [define if $3 is enabled]) + AM_CONDITIONAL([$4], true) + $2="${$2}$3 " + ], [ + AM_CONDITIONAL([$4], false) + ]) +]) + + +# Enable bus drivers +AC_DEFUN([DEF_ENABLE_BUSDRIVERS], [\ +au1500 bcm1250 bf533_stamp bf533_ezkit bf537_stamp bf537_ezkit bf548_ezkit bf561_ezkit ejtag \ +fjmem ixp425 jopcyc h7202 lh7a400 mpc5200 mpc824x ppc405ep ppc440gx_ebc8 prototype pxa2x0 pxa27x \ +s3c4510 sa1110 sh7727 sh7750r sh7751r sharc_21065L slsup3 tx4925 zefant_xs3]) +AC_ARG_ENABLE(bus, +[AS_HELP_STRING([--enable-bus], [Enable default set or specific bus drivers:])] +[AS_HELP_STRING([], ['default' enables:])] +[AS_HELP_STRING([],DEF_ENABLE_BUSDRIVERS)] +, +[AS_CASE([${enableval}], + [yes], [busdrivers=default], + [no], [busdrivers=none], + [none], [busdrivers=none], + [busdrivers=`echo ${enableval} | $SED -e 's/,/ /g'`])], +[busdrivers=default]) +# expand 'default' to default enabled busdrivers +busdrivers=`echo ${busdrivers} | $SED -e "s/default/DEF_ENABLE_BUSDRIVERS/"` +# +enabled_bus_drivers='' +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [au1500], [ENABLE_BUS_AU1500]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bcm1250], [ENABLE_BUS_BCM1250]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf533_stamp], [ENABLE_BUS_BF533_STAMP]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf533_ezkit], [ENABLE_BUS_BF533_EZKIT]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf537_stamp], [ENABLE_BUS_BF537_STAMP]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf537_ezkit], [ENABLE_BUS_BF537_EZKIT]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf548_ezkit], [ENABLE_BUS_BF548_EZKIT]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [bf561_ezkit], [ENABLE_BUS_BF561_EZKIT]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ejtag], [ENABLE_BUS_EJTAG]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [fjmem], [ENABLE_BUS_FJMEM]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ixp425], [ENABLE_BUS_IXP425]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [jopcyc], [ENABLE_BUS_JOPCYC]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [h7202], [ENABLE_BUS_H7202]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [lh7a400], [ENABLE_BUS_LH7A400]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [mpc5200], [ENABLE_BUS_MPC5200]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [mpc824x], [ENABLE_BUS_MPC824X]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ppc405ep], [ENABLE_BUS_PPC405EP]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [ppc440gx_ebc8], [ENABLE_BUS_PPC440GX_EBC8]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [prototype], [ENABLE_BUS_PROTOTYPE]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [pxa2x0], [ENABLE_BUS_PXA2X0]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [pxa27x], [ENABLE_BUS_PXA27X]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [s3c4510], [ENABLE_BUS_S3C4510]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [sa1110], [ENABLE_BUS_SA1110]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [sh7727], [ENABLE_BUS_SH7727]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [sh7750r], [ENABLE_BUS_SH7750R]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [sh7751r], [ENABLE_BUS_SH7751R]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [sharc_21065L], [ENABLE_BUS_SHARC_21065L]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [slsup3], [ENABLE_BUS_SLSUP3]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [tx4925], [ENABLE_BUS_TX4925]) +CHECK_DRIVER([$busdrivers], [enabled_bus_drivers], [zefant_xs3], [ENABLE_BUS_ZEFANT_XS3]) + +# Enable cable drivers +AC_DEFUN([DEF_ENABLE_CABLEDRIVERS], [\ +arcom byteblaster dlc5 ea253 ei012 ft2232 igloo jlink keithkoep lattice mpcbdm triton usbblaster wiggler xpc]) +AC_DEFUN([DEF_DISABLE_CABLEDRIVERS], [ep9307 jim]) +AC_ARG_ENABLE(cable, +[AS_HELP_STRING([--enable-cable], [Enable default set or specific cable drivers.])] +[AS_HELP_STRING([], ['default' enables:])] +[AS_HELP_STRING([],DEF_ENABLE_CABLEDRIVERS)] +[AS_HELP_STRING([], [Disabled by default are:])] +[AS_HELP_STRING([],DEF_DISABLE_CABLEDRIVERS)] +, +[AS_CASE([${enableval}], + [yes], [cabledrivers=default], + [no], [cabledrivers=none], + [none], [cabledrivers=none], + [cabledrivers=`echo ${enableval} | $SED -e 's/,/ /g'`])], +[cabledrivers=default]) +# expand 'default' to default enabled cabledrivers +cabledrivers=`echo ${cabledrivers} | $SED -e "s/default/DEF_ENABLE_CABLEDRIVERS/"` +# automatically disable cable drivers when a required feature is not available +AS_IF([test "x$HAVELIBFTDI" != "xyes" -a "x$HAVELIBFTD2XX" != "xyes"], [ + cabledrivers=`echo ${cabledrivers} | $SED -e "s/ft2232//" -e "s/usbblaster//"` +]) +AS_IF([test "x$HAVELIBUSB" != "xyes"], [ + cabledrivers=`echo ${cabledrivers} | $SED -e "s/jlink//" -e "s/xpc//"` +]) +# +enabled_cable_drivers='' +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [arcom], [ENABLE_CABLE_ARCOM]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [byteblaster], [ENABLE_CABLE_BYTEBLASTER]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [dlc5], [ENABLE_CABLE_DLC5]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [ea253], [ENABLE_CABLE_EA253]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [ei012], [ENABLE_CABLE_EI012]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [ep9307], [ENABLE_CABLE_EP9307]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [ft2232], [ENABLE_CABLE_FT2232]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [igloo], [ENABLE_CABLE_IGLOO]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [jim], [ENABLE_JIM]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [jlink], [ENABLE_CABLE_JLINK]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [keithkoep], [ENABLE_CABLE_KEITHKOEP]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [lattice], [ENABLE_CABLE_LATTICE]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [mpcbdm], [ENABLE_CABLE_MPCBDM]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [triton], [ENABLE_CABLE_TRITON]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [usbblaster], [ENABLE_CABLE_USBBLASTER]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [wiggler], [ENABLE_CABLE_WIGGLER]) +CHECK_DRIVER([$cabledrivers], [enabled_cable_drivers], [xpc], [ENABLE_CABLE_XPC]) + + +# Enable parport drivers +AC_DEFUN([DEF_ENABLE_PARPORTDRIVERS], [\ +direct ftdi ftd2xx ppdev ppi]) +AC_ARG_ENABLE(parport, +[AS_HELP_STRING([--enable-parport], [Enable default set or specific parport drivers:])] +[AS_HELP_STRING([], ['default' enables:])] +[AS_HELP_STRING([],DEF_ENABLE_PARPORTDRIVERS)] +, +[AS_CASE([${enableval}], + [yes], [parportdrivers=default], + [no], [parportdrivers=none], + [none], [parportdrivers=none], + [parportdrivers=`echo ${enableval} | $SED -e 's/,/ /g'`])], +[parportdrivers=default]) +# expand 'default' to default enabled parportdrivers +parportdrivers=`echo ${parportdrivers} | $SED -e "s/default/DEF_ENABLE_PARPORTDRIVERS/"` +# automatically disable parport drivers when a required feature is not available +AS_IF([test "x$HAVELIBFTDI" != "xyes"], [ + parportdrivers=`echo ${parportdrivers} | $SED -e "s/ftdi//"` +]) +AS_IF([test "x$HAVELIBFTD2XX" != "xyes"], [ + parportdrivers=`echo ${parportdrivers} | $SED -e "s/ftd2xx//"` +]) +AS_IF([test "x$HAVE_LINUX_PPDEV_H" != "xyes"], [ + parportdrivers=`echo ${parportdrivers} | $SED -e "s/ppdev//"` +]) +AS_IF([test "x$HAVE_DEV_PPBUS_PPI_H" != "xyes"], [ + parportdrivers=`echo ${parportdrivers} | $SED -e "s/ppi//"` +]) +AS_IF([test "x$HAVE_IOPERM" != "xyes" -a "x$HAVE_I386_SET_IOPERM" != "xyes"], [ + parportdrivers=`echo ${parportdrivers} | $SED -e "s/direct//"` +]) +# +enabled_parport_drivers='' +CHECK_DRIVER([$parportdrivers], [enabled_parport_drivers], [direct], [ENABLE_PARPORT_DIRECT]) +CHECK_DRIVER([$parportdrivers], [enabled_parport_drivers], [ftd2xx], [ENABLE_PARPORT_FTD2XX]) +CHECK_DRIVER([$parportdrivers], [enabled_parport_drivers], [ftdi], [ENABLE_PARPORT_FTDI]) +CHECK_DRIVER([$parportdrivers], [enabled_parport_drivers], [ppdev], [ENABLE_PARPORT_PPDEV]) +CHECK_DRIVER([$parportdrivers], [enabled_parport_drivers], [ppi], [ENABLE_PARPORT_PPI]) + + AC_OUTPUT dnl dnl Configuration summary dnl -if test ${HAVELIBFTDI:-no} != no ; then +AS_IF([test ${HAVELIBFTDI:-no} != no], [ FLAG_HAVELIBFTDI=yes -else +], [ FLAG_HAVELIBFTDI=no -fi -if test ${HAVELIBUSB:-no} != no ; then +]) +AS_IF([test ${HAVELIBUSB:-no} != no], [ FLAG_HAVELIBUSB=yes -else +], [ FLAG_HAVELIBUSB=no -fi -if test ${HAVELIBFTD2XX:-no} != no ; then +]) +AS_IF([test ${HAVELIBFTD2XX:-no} != no], [ FLAG_HAVELIBFTD2XX=yes -else +], [ FLAG_HAVELIBFTD2XX=no -fi -if test ${svf:-false} != false ; then +]) +AS_IF([test ${svf:-false} != false], [ FLAG_SVF=yes -else +], [ FLAG_SVF=no -fi -if test ${bsdl:-false} != false ; then +]) +AS_IF([test ${bsdl:-false} != false], [ FLAG_BSDL=yes -else +], [ FLAG_BSDL=no -fi -AC_MSG_RESULT([ +]) +AC_MSG_NOTICE([ + jtag is now configured for - USB cable support : $FLAG_HAVELIBUSB - FTDI cable support - via libftdi : $FLAG_HAVELIBFTDI - via libftd2xx : $FLAG_HAVELIBFTD2XX + Detected libusb : $FLAG_HAVELIBUSB + Detected libftdi : $FLAG_HAVELIBFTDI + Detected libftd2xx : $FLAG_HAVELIBFTD2XX SVF error locations : $bison_locations Build SVF player : $FLAG_SVF Build BSDL subsystem : $FLAG_BSDL + Bus drivers : $enabled_bus_drivers + Cable drivers : $enabled_cable_drivers + Parport drivers : $enabled_parport_drivers ]) diff --git a/jtag/doc/UrJTAG.txt b/jtag/doc/UrJTAG.txt index cba63b09..6acce2ff 100644 --- a/jtag/doc/UrJTAG.txt +++ b/jtag/doc/UrJTAG.txt @@ -365,9 +365,9 @@ without spaces in the name is better) and afterwards run configure with the Configure should now report - FTDI cable support + jtag is now configured for ... - via libftd2xx : yes + Detected libftd2xx : yes ==== Using LibUSB-Win32 in Cygwin environment ==== @@ -382,6 +382,18 @@ might give problems if the path contains spaces, as "Program Files" does!): ./configure --with-libusb="/cygdrive/c/Programme/LibUSB-Win32/" +==== Driver tailoring ==== + +The configure script enables all default bus, cable and parport drivers. You +can include and exclude specific drivers if required. For a list of parameters +run + + ./configure --help + +to figure out the appropriate --enable-bus, --enable-cable and --enable-parport +options. + + ==== Building the BSDL subsystem ==== As mentioned above, building the BSDL lexer requires Flex 2.5.33 or newer. If diff --git a/jtag/src/Makefile.am b/jtag/src/Makefile.am index 79c14f0b..85995529 100644 --- a/jtag/src/Makefile.am +++ b/jtag/src/Makefile.am @@ -66,11 +66,11 @@ jtag_DEPENDENCIES += bsdl/libbsdl.a endif jtag_LDADD = \ + -Lcmd -lcmd \ -Ltap -ltap \ -Lpart -lpart \ -Llib -ljtaglib \ -Lflash -lflash \ - -Lcmd -lcmd \ -Ltap -ltap \ -Lflash -lflash \ -Lbus -lbus \ diff --git a/jtag/src/bus/Makefile.am b/jtag/src/bus/Makefile.am index 710f201a..3019daed 100644 --- a/jtag/src/bus/Makefile.am +++ b/jtag/src/bus/Makefile.am @@ -28,34 +28,126 @@ noinst_LIBRARIES = libbus.a libbus_a_SOURCES = \ buses.c \ buses.h \ - au1500.c \ - bcm1250.c \ - ejtag.c \ - bf533_stamp.c \ - bf533_ezkit.c \ - bf537_stamp.c \ - bf548_ezkit.c \ - bf561_ezkit.c \ - ixp425.c \ - fjmem.c \ - lh7a400.c \ - mpc824x.c \ - mpc5200.c \ - ppc440gx_ebc8.c \ - ppc405ep.c \ - prototype.c \ - pxa2x0.c \ pxa2x0_mc.h \ readmem.c \ - sa1110.c \ - s3c4510x.c \ - sh7727.c \ - sh7750r.c \ - sh7751r.c \ - h7202.c \ - slsup3.c \ - tx4925.c \ - jopcyc.c \ - sharc21065l.c \ - writemem.c \ - zefant-xs3.c + writemem.c + +if ENABLE_BUS_AU1500 +libbus_a_SOURCES += au1500.c +endif + +if ENABLE_BUS_BCM1250 +libbus_a_SOURCES += bcm1250.c +endif + +if ENABLE_BUS_BF533_STAMP +libbus_a_SOURCES += bf533_stamp.c +endif + +if ENABLE_BUS_BF533_EZKIT +libbus_a_SOURCES += bf533_ezkit.c +endif + +if ENABLE_BUS_BF537_STAMP +libbus_a_SOURCES += bf537_stamp.c +else +if ENABLE_BUS_BF537_EZKIT +libbus_a_SOURCES += bf537_stamp.c +endif +endif + +if ENABLE_BUS_BF548_EZKIT +libbus_a_SOURCES += bf548_ezkit.c +endif + +if ENABLE_BUS_BF561_EZKIT +libbus_a_SOURCES += bf561_ezkit.c +endif + +if ENABLE_BUS_EJTAG +libbus_a_SOURCES += ejtag.c +endif + +if ENABLE_BUS_FJMEM +libbus_a_SOURCES += fjmem.c +endif + +if ENABLE_BUS_H7202 +libbus_a_SOURCES += h7202.c +endif + +if ENABLE_BUS_IXP425 +libbus_a_SOURCES += ixp425.c +endif + +if ENABLE_BUS_JOPCYC +libbus_a_SOURCES += jopcyc.c +endif + +if ENABLE_BUS_LH7A400 +libbus_a_SOURCES += lh7a400.c +endif + +if ENABLE_BUS_MPC5200 +libbus_a_SOURCES += mpc5200.c +endif + +if ENABLE_BUS_MPC824X +libbus_a_SOURCES += mpc824x.c +endif + +if ENABLE_BUS_PPC405EP +libbus_a_SOURCES += ppc405ep.c +endif + +if ENABLE_BUS_PPC440GX_EBC8 +libbus_a_SOURCES += ppc440gx_ebc8.c +endif + +if ENABLE_BUS_PROTOTYPE +libbus_a_SOURCES += prototype.c +endif + +if ENABLE_BUS_PXA2X0 +libbus_a_SOURCES += pxa2x0.c +else +if ENABLE_BUS_PXA27X +libbus_a_SOURCES += pxa2x0.c +endif +endif + +if ENABLE_BUS_S3C4510 +libbus_a_SOURCES += s3c4510x.c +endif + +if ENABLE_BUS_SA1110 +libbus_a_SOURCES += sa1110.c +endif + +if ENABLE_BUS_SH7727 +libbus_a_SOURCES += sh7727.c +endif + +if ENABLE_BUS_SH7750R +libbus_a_SOURCES += sh7750r.c +endif + +if ENABLE_BUS_SH7751R +libbus_a_SOURCES += sh7751r.c +endif + +if ENABLE_BUS_SHARC_21065L +libbus_a_SOURCES += sharc21065l.c +endif + +if ENABLE_BUS_SLSUP3 +libbus_a_SOURCES += slsup3.c +endif + +if ENABLE_BUS_TX4925 +libbus_a_SOURCES += tx4925.c +endif + +if ENABLE_BUS_ZEFANT_XS3 +libbus_a_SOURCES += zefant-xs3.c +endif diff --git a/jtag/src/bus/buses.c b/jtag/src/bus/buses.c index 7a14550f..d0a17638 100644 --- a/jtag/src/bus/buses.c +++ b/jtag/src/bus/buses.c @@ -30,36 +30,96 @@ #include "buses.h" const bus_driver_t *bus_drivers[] = { +#ifdef ENABLE_BUS_AU1500 &au1500_bus, +#endif +#ifdef ENABLE_BUS_BCM1250 &bcm1250_bus, - &ejtag_bus, +#endif +#ifdef ENABLE_BUS_BF533_STAMP &bf533_stamp_bus, +#endif +#ifdef ENABLE_BUS_BF533_EZKIT &bf533_ezkit_bus, +#endif +#ifdef ENABLE_BUS_BF537_STAMP &bf537_stamp_bus, +#endif +#ifdef ENABLE_BUS_BF537_EZKIT &bf537_ezkit_bus, +#endif +#ifdef ENABLE_BUS_BF548_EZKIT &bf548_ezkit_bus, +#endif +#ifdef ENABLE_BUS_BF561_EZKIT &bf561_ezkit_bus, - &ixp425_bus, +#endif +#ifdef ENABLE_BUS_EJTAG + &ejtag_bus, +#endif +#ifdef ENABLE_BUS_FJMEM &fjmem_bus, +#endif +#ifdef ENABLE_BUS_IXP425 + &ixp425_bus, +#endif +#ifdef ENABLE_BUS_JOPCYC + &jopcyc_bus, +#endif +#ifdef ENABLE_BUS_H7202 + &h7202_bus, +#endif +#ifdef ENABLE_BUS_LH7A400 &lh7a400_bus, - &mpc824x_bus, +#endif +#ifdef ENABLE_BUS_MPC5200 &mpc5200_bus, - &ppc440gx_ebc8_bus, +#endif +#ifdef ENABLE_BUS_MPC824X + &mpc824x_bus, +#endif +#ifdef ENABLE_BUS_PPC405EP &ppc405ep_bus, +#endif +#ifdef ENABLE_BUS_PPC440GX_EBC8 + &ppc440gx_ebc8_bus, +#endif +#ifdef ENABLE_BUS_PROTOTYPE &prototype_bus, +#endif +#ifdef ENABLE_BUS_PXA2X0 &pxa2x0_bus, +#endif +#ifdef ENABLE_BUS_PXA27X &pxa27x_bus, +#endif +#ifdef ENABLE_BUS_S3C4510 &s3c4510_bus, +#endif +#ifdef ENABLE_BUS_SA1110 &sa1110_bus, +#endif +#ifdef ENABLE_BUS_SH7727 &sh7727_bus, +#endif +#ifdef ENABLE_BUS_SH7750R &sh7750r_bus, +#endif +#ifdef ENABLE_BUS_SH7751R &sh7751r_bus, - &h7202_bus, +#endif +#ifdef ENABLE_BUS_SHARC_21065L + &sharc_21065L_bus, +#endif +#ifdef ENABLE_BUS_SLSUP3 &slsup3_bus, +#endif +#ifdef ENABLE_BUS_TX4925 &tx4925_bus, - &jopcyc_bus, - &sharc_21065L_bus, +#endif +#ifdef ENABLE_BUS_ZEFANT_XS3 &zefant_xs3_bus, +#endif NULL /* last must be NULL */ }; diff --git a/jtag/src/bus/buses.h b/jtag/src/bus/buses.h index ed2045ee..7924c9cf 100644 --- a/jtag/src/bus/buses.h +++ b/jtag/src/bus/buses.h @@ -27,20 +27,22 @@ extern const bus_driver_t au1500_bus; extern const bus_driver_t bcm1250_bus; -extern const bus_driver_t ejtag_bus; extern const bus_driver_t bf533_stamp_bus; extern const bus_driver_t bf533_ezkit_bus; extern const bus_driver_t bf537_stamp_bus; extern const bus_driver_t bf537_ezkit_bus; extern const bus_driver_t bf548_ezkit_bus; extern const bus_driver_t bf561_ezkit_bus; -extern const bus_driver_t ixp425_bus; +extern const bus_driver_t ejtag_bus; extern const bus_driver_t fjmem_bus; +extern const bus_driver_t h7202_bus; +extern const bus_driver_t ixp425_bus; +extern const bus_driver_t jopcyc_bus; extern const bus_driver_t lh7a400_bus; -extern const bus_driver_t mpc824x_bus; extern const bus_driver_t mpc5200_bus; -extern const bus_driver_t ppc440gx_ebc8_bus; +extern const bus_driver_t mpc824x_bus; extern const bus_driver_t ppc405ep_bus; +extern const bus_driver_t ppc440gx_ebc8_bus; extern const bus_driver_t prototype_bus; extern const bus_driver_t pxa2x0_bus; extern const bus_driver_t pxa27x_bus; @@ -49,11 +51,9 @@ extern const bus_driver_t sa1110_bus; extern const bus_driver_t sh7727_bus; extern const bus_driver_t sh7750r_bus; extern const bus_driver_t sh7751r_bus; -extern const bus_driver_t h7202_bus; +extern const bus_driver_t sharc_21065L_bus; extern const bus_driver_t slsup3_bus; extern const bus_driver_t tx4925_bus; -extern const bus_driver_t jopcyc_bus; -extern const bus_driver_t sharc_21065L_bus; extern const bus_driver_t zefant_xs3_bus; #endif /* BUSES_H */ diff --git a/jtag/src/tap/Makefile.am b/jtag/src/tap/Makefile.am index ed5e2077..fc4a2436 100644 --- a/jtag/src/tap/Makefile.am +++ b/jtag/src/tap/Makefile.am @@ -33,9 +33,6 @@ libtap_a_SOURCES = \ detect.c \ discovery.c \ parport.c \ - parport/direct.c \ - parport/ppdev.c \ - parport/ppi.c \ usbconn.c \ cable.c \ cable/generic.h \ @@ -43,56 +40,117 @@ libtap_a_SOURCES = \ cable/generic_usbconn.h \ cable/generic_usbconn.c \ cable/generic_parport.h \ - cable/generic_parport.c \ - cable/arcom.c \ - cable/byteblaster.c \ - cable/dlc5.c \ - cable/ea253.c \ - cable/ei012.c \ - cable/keithkoep.c \ - cable/lattice.c \ - cable/mpcbdm.c \ - cable/triton.c \ + cable/generic_parport.c + +if ENABLE_CABLE_ARCOM +libtap_a_SOURCES += \ + cable/arcom.c +endif + +if ENABLE_CABLE_BYTEBLASTER +libtap_a_SOURCES += \ + cable/byteblaster.c +endif + +if ENABLE_CABLE_DLC5 +libtap_a_SOURCES += \ + cable/dlc5.c +endif + +if ENABLE_CABLE_EA253 +libtap_a_SOURCES += \ + cable/ea253.c +endif + +if ENABLE_CABLE_EI012 +libtap_a_SOURCES += \ + cable/ei012.c +endif + +if ENABLE_CABLE_KEITHKOEP +libtap_a_SOURCES += \ + cable/keithkoep.c +endif + +if ENABLE_CABLE_LATTICE +libtap_a_SOURCES += \ + cable/lattice.c +endif + +if ENABLE_CABLE_MPCBDM +libtap_a_SOURCES += \ + cable/mpcbdm.c +endif + +if ENABLE_CABLE_TRITON +libtap_a_SOURCES += \ + cable/triton.c +endif + +if ENABLE_CABLE_WIGGLER +libtap_a_SOURCES += \ cable/wiggler.c \ cable/wiggler2.c +endif + +if ENABLE_CABLE_JLINK +libtap_a_SOURCES += \ + cable/jlink.c +endif + +if ENABLE_CABLE_XPC +libtap_a_SOURCES += \ + cable/xpc.c +endif + +if ENABLE_CABLE_USBBLASTER +libtap_a_SOURCES += \ + cable/usbblaster.c +endif + +if ENABLE_CABLE_FT2232 +libtap_a_SOURCES += \ + cable/ft2232.c +endif + if HAVE_LIBUSB libtap_a_SOURCES += \ - cable/xpc.c \ - cable/jlink.c \ usbconn/libusb.c endif + if ENABLE_JIM libtap_a_SOURCES += \ cable/jim.c endif -if HAVE_LIBFTDI +if ENABLE_PARPORT_FTDI libtap_a_SOURCES += \ parport/ftdi.c endif -if HAVE_LIBFTD2XX +if ENABLE_PARPORT_FTD2XX libtap_a_SOURCES += \ parport/ftd2xx.c endif -FTDIDEPENDENT= \ - cable/usbblaster.c \ - cable/ft2232.c +if ENABLE_PARPORT_DIRECT +libtap_a_SOURCES += \ + parport/direct.c +endif -if HAVE_LIBFTDI -libtap_a_SOURCES += $(FTDIDEPENDENT) -else -if HAVE_LIBFTD2XX -libtap_a_SOURCES += $(FTDIDEPENDENT) +if ENABLE_PARPORT_PPDEV +libtap_a_SOURCES += \ + parport/ppdev.c endif + +if ENABLE_PARPORT_PPI +libtap_a_SOURCES += \ + parport/ppi.c endif -if ENABLE_EP9307 +if ENABLE_CABLE_EP9307 libtap_a_SOURCES += \ cable/vision_ep9307.c endif - - diff --git a/jtag/src/tap/cable.c b/jtag/src/tap/cable.c index 6f08dac4..366b22ac 100644 --- a/jtag/src/tap/cable.c +++ b/jtag/src/tap/cable.c @@ -41,7 +41,6 @@ extern cable_driver_t arcom_cable_driver; extern cable_driver_t byteblaster_cable_driver; -#if defined(HAVE_LIBFTDI) || defined(HAVE_LIBFTD2XX) extern cable_driver_t usbblaster_cable_driver; extern cable_driver_t ft2232_cable_driver; extern cable_driver_t ft2232_jtagkey_cable_driver; @@ -50,7 +49,6 @@ extern cable_driver_t ft2232_oocdlinks_cable_driver; extern cable_driver_t ft2232_signalyzer_cable_driver; extern cable_driver_t ft2232_turtelizer2_cable_driver; extern cable_driver_t ft2232_usbtojtagif_cable_driver; -#endif extern cable_driver_t dlc5_cable_driver; extern cable_driver_t ea253_cable_driver; extern cable_driver_t ei012_cable_driver; @@ -59,26 +57,28 @@ 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; -#ifdef HAVE_LIBUSB extern cable_driver_t xpc_int_cable_driver; extern cable_driver_t xpc_ext_cable_driver; extern cable_driver_t jlink_cable_driver; -#endif -#ifdef ENABLE_EP9307 extern cable_driver_t ep9307_cable_driver; -#endif cable_driver_t *cable_drivers[] = { +#ifdef ENABLE_CABLE_ARCOM &arcom_cable_driver, +#endif +#ifdef ENABLE_CABLE_BYTEBLASTER &byteblaster_cable_driver, -#if defined(HAVE_LIBFTDI) || defined(HAVE_LIBFTD2XX) +#endif + +#ifdef ENABLE_CABLE_USBBLASTER &usbblaster_cable_driver, +#endif + +#ifdef ENABLE_CABLE_FT2232 &ft2232_cable_driver, &ft2232_jtagkey_cable_driver, &ft2232_armusbocd_cable_driver, @@ -87,25 +87,49 @@ cable_driver_t *cable_drivers[] = { &ft2232_turtelizer2_cable_driver, &ft2232_usbtojtagif_cable_driver, #endif + +#ifdef ENABLE_CABLE_DLC5 &dlc5_cable_driver, +#endif +#ifdef ENABLE_CABLE_EA253 &ea253_cable_driver, +#endif +#ifdef ENABLE_CABLE_EI012 &ei012_cable_driver, +#endif +#ifdef ENABLE_CABLE_IGLOO &igloo_cable_driver, +#endif +#ifdef ENABLE_CABLE_KEITHKOEP &keithkoep_cable_driver, +#endif +#ifdef ENABLE_CABLE_LATTICE &lattice_cable_driver, +#endif +#ifdef ENABLE_CABLE_MPCBDM &mpcbdm_cable_driver, +#endif +#ifdef ENABLE_CABLE_TRITON &triton_cable_driver, +#endif #ifdef ENABLE_JIM &jim_cable_driver, #endif +#ifdef ENABLE_CABLE_WIGGLER &wiggler_cable_driver, - &wiggler2_cable_driver, -#ifdef HAVE_LIBUSB + &wiggler2_cable_driver, +#endif + +#ifdef ENABLE_CABLE_XPC &xpc_int_cable_driver, &xpc_ext_cable_driver, +#endif + +#ifdef ENABLE_CABLE_JLINK &jlink_cable_driver, #endif -#ifdef ENABLE_EP9307 + +#ifdef ENABLE_CABLE_EP9307 &ep9307_cable_driver, #endif NULL /* last must be NULL */ diff --git a/jtag/src/tap/parport.c b/jtag/src/tap/parport.c index ecb6f016..36b34112 100644 --- a/jtag/src/tap/parport.c +++ b/jtag/src/tap/parport.c @@ -26,42 +26,36 @@ #include "parport.h" -#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) extern parport_driver_t direct_parport_driver; -#endif /* defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) */ -#ifdef HAVE_LINUX_PPDEV_H extern parport_driver_t ppdev_parport_driver; -#endif /* HAVE_LINUX_PPDEV_H */ -#ifdef HAVE_LIBFTD2XX extern parport_driver_t ftd2xx_parport_driver; extern parport_driver_t ftd2xx_mpsse_parport_driver; -#endif /* HAVE_LIBFTD2xx */ -#ifdef HAVE_LIBFTDI extern parport_driver_t ftdi_parport_driver; extern parport_driver_t ftdi_mpsse_parport_driver; -#endif /* HAVE_LIBFTDI */ -#ifdef HAVE_DEV_PPBUS_PPI_H extern parport_driver_t ppi_parport_driver; -#endif /* HAVE_DEV_PPBUS_PPI_H */ parport_driver_t *parport_drivers[] = { -#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) +#ifdef ENABLE_PARPORT_DIRECT &direct_parport_driver, -#endif /* defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) */ -#ifdef HAVE_LINUX_PPDEV_H +#endif /* ENABLE_PARPORT_DIRECT */ + +#ifdef ENABLE_PARPORT_PPDEV &ppdev_parport_driver, -#endif /* HAVE_LINUX_PPDEV_H */ -#ifdef HAVE_LIBFTD2XX +#endif /* ENABLE_PARPORT_PPDEV */ + +#ifdef ENABLE_PARPORT_FTD2XX &ftd2xx_parport_driver, &ftd2xx_mpsse_parport_driver, -#endif /* HAVE_LIBFTD2XX */ -#ifdef HAVE_LIBFTDI +#endif /* ENABLE_PARPORT_FTD2XX */ + +#ifdef ENABLE_PARPORT_FTDI &ftdi_parport_driver, &ftdi_mpsse_parport_driver, -#endif /* HAVE_LIBFTDI */ -#ifdef HAVE_DEV_PPBUS_PPI_H +#endif /* ENABLE_PARPORT_FTDI */ + +#ifdef ENABLE_PARPORT_PPI &ppi_parport_driver, -#endif /* HAVE_DEV_PPBUS_PPI_H */ +#endif /* ENABLE_PARPORT_PPI */ NULL /* last must be NULL */ };