Finish off the dummy minidriver integration:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 00:42:15 +0000 (00:42 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 8 Jun 2009 00:42:15 +0000 (00:42 +0000)
- 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.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2102 b42882b7-edfa-0310-969c-e2dbd0fdcd60

configure.in
src/jtag/Makefile.am
src/jtag/jtag.c

index 9cb4ef49a5a0608b57df7d40e7d115c9e47299ff..7dbdebc6e78169d111e5a87ccfb11edab71d7ed2 100644 (file)
@@ -13,7 +13,6 @@ AC_CHECK_HEADERS(elf.h)
 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 @@ AC_ARG_ENABLE(ecosboard,
   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 @@ AC_ARG_ENABLE(arm-jtag-ew,
   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 @@ else
   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(DUMMY, test $build_dummy = yes)
 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_MINGW, test $is_mingw = yes)
 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
index fa5861a550d684fd601d69be59ccdd3faa287cae..6be4db044723289bf037ecf578246a0282747054 100644 (file)
@@ -51,14 +51,15 @@ else
 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 @@ libjtag_la_SOURCES = \
        $(PRESTOFILES) \
        $(USBPROGFILES) \
        $(ECOSBOARDFILES) \
-       $(MINIDUMMYFILES) \
        $(JLINKFILES) \
        $(RLINKFILES) \
        $(VSLLINKFILES) \
@@ -153,6 +153,7 @@ noinst_HEADERS = \
        rlink/dtc_cmd.h \
        rlink/ep1_cmd.h \
        rlink/rlink.h \
-       rlink/st7.h
+       rlink/st7.h \
+       minidummy/jtag_minidriver.h
 
 MAINTAINERCLEANFILES = Makefile.in
index 6821445595ae4fac37555e6c76d9a1b62bfb64df..8bc19112ca5ee41e7d11dd8178dd9dfe9ca52404 100644 (file)
@@ -97,11 +97,9 @@ static bool hasKHz = false;
 
 #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 @@ static bool hasKHz = false;
 #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 @@ jtag_interface_t *jtag_interfaces[] = {
 #if BUILD_ARMJTAGEW == 1
        &armjtagew_interface,
 #endif
+#endif // standard drivers
        NULL,
 };
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)