])
])
-AC_ARG_ENABLE([minidriver_dummy],
- AS_HELP_STRING([--enable-minidriver-dummy], [Enable the dummy minidriver.]),
- [build_minidriver_dummy=$enableval], [build_minidriver_dummy=no])
-
AC_ARG_ENABLE([internal-jimtcl],
AS_HELP_STRING([--disable-internal-jimtcl], [Disable building internal jimtcl]),
[use_internal_jimtcl=$enableval], [use_internal_jimtcl=yes])
[Disable building internal libjaylink]),
[use_internal_libjaylink=$enableval], [use_internal_libjaylink=yes])
-build_minidriver=no
-
AC_ARG_ENABLE([remote-bitbang],
AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang jtag driver]),
[build_remote_bitbang=$enableval], [build_remote_bitbang=no])
-AC_MSG_CHECKING([whether to enable dummy minidriver])
-AS_IF([test "x$build_minidriver_dummy" = "xyes"], [
- AS_IF([test "x$build_minidriver" = "xyes"], [
- AC_MSG_ERROR([Multiple minidriver options have been enabled.])
- ])
- 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.])
-])
-AC_MSG_RESULT([$build_minidriver_dummy])
-
-AC_MSG_CHECKING([whether standard drivers can be built])
-AS_IF([test "x$build_minidriver" = "xyes"], [
- AC_MSG_RESULT([no])
- AC_MSG_WARN([Using the minidriver disables all other drivers.])
- sleep 2
-], [
- AC_MSG_RESULT([yes])
-])
-
AS_CASE(["${host_cpu}"],
[i?86|x86*], [],
[
AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"])
AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
-AM_CONDITIONAL([MINIDRIVER], [test "x$build_minidriver" = "xyes"])
-AM_CONDITIONAL([MINIDRIVER_DUMMY], [test "x$build_minidriver_dummy" = "xyes"])
-
AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
JTAG_SRCS = %D%/commands.c
%C%_libjtag_la_LIBADD =
-BUILT_SOURCES += %D%/minidriver_imp.h
-CLEANFILES += %D%/minidriver_imp.h
-
-if MINIDRIVER
-
-if MINIDRIVER_DUMMY
-JTAG_SRCS += %D%/minidummy/minidummy.c
-JTAG_MINIDRIVER_DIR = %D%/minidummy
-endif
-
-MINIDRIVER_IMP_DIR = %D%/minidriver
-
-%D%/jtag_minidriver.h: $(JTAG_MINIDRIVER_DIR)/jtag_minidriver.h
- cp $< $@
-
-BUILT_SOURCES += %D%/jtag_minidriver.h
-
-CLEANFILES += %D%/jtag_minidriver.h
-
-else
-
-MINIDRIVER_IMP_DIR = %D%/drivers
-
if HLADAPTER
include %D%/hla/Makefile.am
%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/hla/libocdhla.la
include %D%/drivers/Makefile.am
%C%_libjtag_la_LIBADD += $(top_builddir)/%D%/drivers/libocdjtagdrivers.la
-endif
-# endif // MINIDRIVER
-
-%D%/minidriver_imp.h: $(MINIDRIVER_IMP_DIR)/minidriver_imp.h
- cp $< $@
-
-
%C%_libjtag_la_SOURCES = \
%D%/adapter.c \
%D%/core.c \
%D%/interfaces.h \
%D%/minidriver.h \
%D%/jtag.h \
- %D%/minidriver/minidriver_imp.h \
- %D%/minidummy/jtag_minidriver.h \
%D%/swd.h \
%D%/swim.h \
%D%/tcl.h \
(srst == VALUE_DEASSERT) ? SRST_DEASSERT : SRST_ASSERT);
}
-#ifndef HAVE_JTAG_MINIDRIVER_H
#ifdef HAVE_LIBUSB_GET_PORT_NUMBERS
COMMAND_HANDLER(handle_usb_location_command)
{
#endif /* HAVE_LIBUSB_GET_PORT_NUMBERS */
COMMAND_REGISTRATION_DONE
};
-#endif /* MINIDRIVER */
static const struct command_registration adapter_srst_command_handlers[] = {
{
.help = "Declare transports the adapter supports.",
.usage = "transport ... ",
},
-#ifndef HAVE_JTAG_MINIDRIVER_H
{
.name = "usb",
.mode = COMMAND_ANY,
.usage = "",
.chain = adapter_usb_command_handlers,
},
-#endif /* MINIDRIVER */
{
.name = "assert",
.handler = handle_adapter_reset_de_assert,
for (int i = 0; i < in_num_fields; i++) {
if ((in_fields[i].check_value != NULL) && (in_fields[i].in_value != NULL)) {
- /* this is synchronous for a minidriver */
jtag_add_callback4(jtag_check_value_mask_callback,
(jtag_callback_data_t)in_fields[i].in_value,
(jtag_callback_data_t)in_fields[i].check_value,
int result = jtag->jtag_ops->execute_queue();
-#if !HAVE_JTAG_MINIDRIVER_H
- /* Only build this if we use a regular driver with a command queue.
- * Otherwise jtag_command_queue won't be found at compile/link time. Its
- * definition is in jtag/commands.c, which is only built/linked by
- * jtag/Makefile.am if MINIDRIVER_DUMMY || !MINIDRIVER, but those variables
- * aren't accessible here. Use HAVE_JTAG_MINIDRIVER_H */
struct jtag_command *cmd = jtag_command_queue;
while (debug_level >= LOG_LVL_DEBUG_IO && cmd) {
switch (cmd->type) {
}
cmd = cmd->next;
}
-#endif
return result;
}
* that contain an adapter_driver structure that can added to this list.
*/
-#if defined(BUILD_MINIDRIVER_DUMMY)
-extern struct adapter_driver minidummy_adapter_driver;
-#else /* standard drivers */
#if BUILD_PARPORT == 1
extern struct adapter_driver parport_adapter_driver;
#endif
#if BUILD_RSHIM == 1
extern struct adapter_driver rshim_dap_adapter_driver;
#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.
*/
struct adapter_driver *adapter_drivers[] = {
-#if defined(BUILD_MINIDRIVER_DUMMY)
- &minidummy_adapter_driver,
-#else /* standard drivers */
#if BUILD_PARPORT == 1
&parport_adapter_driver,
#endif
#if BUILD_RSHIM == 1
&rshim_dap_adapter_driver,
#endif
-#endif /* standard drivers */
NULL,
};
*/
void jtag_poll_set_enabled(bool value);
-
-/* The minidriver may have inline versions of some of the low
- * level APIs that are used in inner loops. */
#include <jtag/minidriver.h>
int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
/* this header will be provided by the minidriver implementation, */
/* and it may provide additional declarations that must be defined. */
-#include <jtag/minidriver_imp.h>
+#include <jtag/drivers/minidriver_imp.h>
int interface_jtag_add_ir_scan(struct jtag_tap *active,
const struct scan_field *fields,
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2005 by Dominic Rath <Dominic.Rath@gmx.de> *
- * Copyright (C) 2007,2008 Øyvind Harboe <oyvind.harboe@zylin.com> *
- * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
- * *
- * 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, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifndef OPENOCD_JTAG_MINIDRIVER_MINIDRIVER_IMP_H
-#define OPENOCD_JTAG_MINIDRIVER_MINIDRIVER_IMP_H
-
-#include <jtag/jtag_minidriver.h>
-
-#define jtag_add_callback(callback, in) interface_jtag_add_callback(callback, in)
-
-#define jtag_add_callback4(callback, in, data1, data2, data3) \
- interface_jtag_add_callback4(callback, in, data1, data2, data3)
-
-#endif /* OPENOCD_JTAG_MINIDRIVER_MINIDRIVER_IMP_H */
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2007-2008 by Øyvind 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, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#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))
+++ /dev/null
-/***************************************************************************
- * Copyright (C) 2007-2008 by Øyvind 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, see <http://www.gnu.org/licenses/>. *
- ***************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <jtag/jtag.h>
-#include <target/embeddedice.h>
-#include <jtag/minidriver.h>
-#include <jtag/interface.h>
-
-static struct jtag_interface minidummy_interface = {
- .execute_queue = NULL,
-};
-
-struct adapter_driver minidummy_adapter_driver = {
- .name = "minidummy",
- .transports = jtag_only,
- .commands = NULL,
-
- .init = NULL,
- .quit = NULL,
- .speed = NULL,
- .khz = NULL,
- .speed_div = NULL,
- .power_dropout = NULL,
- .srst_asserted = NULL,
-
- .jtag_ops = &minidummy_interface,
-};
-
-int interface_jtag_execute_queue(void)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-int interface_jtag_add_ir_scan(struct jtag_tap *active, const struct scan_field *fields,
- tap_state_t state)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-int interface_jtag_add_plain_ir_scan(int num_bits, const uint8_t *out_bits,
- uint8_t *in_bits, tap_state_t state)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-int interface_jtag_add_dr_scan(struct jtag_tap *active, int num_fields,
- const struct scan_field *fields, tap_state_t state)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-int interface_jtag_add_plain_dr_scan(int num_bits, const uint8_t *out_bits,
- uint8_t *in_bits, tap_state_t state)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-int interface_jtag_add_tlr(void)
-{
- /* 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(uint32_t 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;
-}
-
-int interface_add_tms_seq(unsigned num_bits, const uint8_t *seq, enum tap_state state)
-{
- /* synchronously do the operation here */
-
- return ERROR_OK;
-}
-
-void embeddedice_write_dcc(struct jtag_tap *tap, int reg_addr, const uint8_t *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;
- }
-}
-
-int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap, uint32_t opcode,
- uint32_t *data, size_t count)
-{
- int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap,
- uint32_t opcode, uint32_t *data, size_t count);
- return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
-}
TAP_DRSHIFT
};
-/* This inner loop can be implemented by the minidriver, oftentimes in hardware... The
- * minidriver can call the default implementation as a fallback or implement it
- * from scratch.
- */
-int arm11_run_instr_data_to_core_noack_inner_default(struct jtag_tap *tap,
+static int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
uint32_t opcode,
uint32_t *data,
size_t count)
return retval;
}
-int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
- uint32_t opcode,
- uint32_t *data,
- size_t count);
-
-#ifndef HAVE_JTAG_MINIDRIVER_H
-int arm11_run_instr_data_to_core_noack_inner(struct jtag_tap *tap,
- uint32_t opcode,
- uint32_t *data,
- size_t count)
-{
- return arm11_run_instr_data_to_core_noack_inner_default(tap, opcode, data, count);
-}
-#endif
-
/** Execute one instruction via ITR repeatedly while
* passing data to the core via DTR on each execution.
*
return ERROR_TARGET_TIMEOUT;
}
-#ifndef HAVE_JTAG_MINIDRIVER_H
/**
* This is an inner loop of the open loop DCC write of data to target
*/
buffer += 4;
}
}
-#else
-/* provided by minidriver */
-#endif
bool transport_is_dapdirect_swd(void);
bool transport_is_swim(void);
-#if BUILD_HLADAPTER && !HAVE_JTAG_MINIDRIVER_H
+#if BUILD_HLADAPTER
bool transport_is_hla(void);
#else
static inline bool transport_is_hla(void)