Commit Graph

42 Commits

Author SHA1 Message Date
Jonas Hörberg
e3f3f60a02 adapter speed: require init script setting and centralize activation from drivers to core.c
Signed-off-by: Jonas Hörberg <jhorberg@sauer-danfoss.com>
2011-05-01 00:38:04 +02:00
Mathias K
0123985abc ft2232: fix log message and change log output to debug 2011-03-03 23:03:34 +01:00
Mathias K
6ddcee7d20 ft2232: fix possible read buffer overflow
This patch fix a possible read buffer overflow in ft2232_execute_queue.
Also the correct read queue size for libftdi and libftd2xx was added and
and tested.
In function ft2232_write a uninitialized value was initialized because we
don't know if this value was set in the ftdi api call.
2011-02-24 23:20:03 +01:00
Mathias K
422e9f9b41 ft2232: add functions for ft2232 set data bits high/low byte command
reduce duplication. No change in behavior.
2011-02-14 15:32:12 +01:00
Mathias K
9629adcbde add basic TI xds100v2 support
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2011-01-26 12:30:35 +00:00
Eric Wetzel
0535531d27 nit: more LOG_* \n fixes
Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages

Remove LOG_INFO_N
LOG_INFO_N was only used once and had a \n at the end

Change LOG_USER_N calls that end with \n to LOG_USER
2011-01-09 21:35:23 +01:00
Eric Wetzel
a665ef716a nit: do not add \n at end of LOG_ERROR
Fixed in many other places, and submitted in response to Øyvind's invitation.
2011-01-05 21:46:12 +01:00
Spencer Oliver
fa46805481 build: fix build from previous commit
commit 740b9e25b4 broke the drivers
for ftdi and parport due to retval already being defined.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-12-08 19:54:10 +00:00
Øyvind Harboe
740b9e25b4 jtag: getting the JTAG speed can fail
If the JTAG speed has not been set, then it has no defined
value, add code to propagate the error.

No change to actual behavior as no new failure paths have
been introduced. This is a no-op patch to make subsequent patches
smaller.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-12-08 08:43:52 +01:00
Piotr Esden-Tempski
6356604382 Some cosmetic fixes to the Lisa/L layout support functions. 2010-11-30 08:15:19 +01:00
Piotr Esden-Tempski
94e1445a86 Added support for the blinking leds on Floss-JTAG v0.3 and newer. 2010-11-30 08:15:19 +01:00
Piotr Esden-Tempski
dce422516a Added support for the Lisa/L jtag LEDs. 2010-08-13 09:52:35 +02:00
Piotr Esden-Tempski
c3ee26d272 Added support for Lisa/L builtin JTAG interface. 2010-08-13 09:52:27 +02:00
David Brownell
612184176f more careful luminary init
Set up more of the Luminary-specific signals, and stop cloning
a few of the JTAG defaults.  More comments too.

Still leaves the "dap info 0" bugs unresolved (presumably coupled
to this particular adapter family) where TPIU, ITM, DWT, and other
debug modules wrongly display as extra NVICs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-07-19 16:08:09 -04:00
David Brownell
d10f0def80 comments for Luminary ICDI layout
Provide $defines for more of the signals involved in the
Luminary ICDI hardware, and comment some of what's going on.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-07-18 17:29:25 -04:00
David Brownell
e8445c9c9f transport selection tweaks
* Bugfix and simplify legacy jtag-only defaulting
* Make "dummy" declare its jtag-only nature
* likewise update ft2232
* warn if selection is _required_ (multi-transport adapters),

fixes the "only ft2232 works" bug for at least dummy, with
other drivers going the "legacy" path (submit patches).

Signed-off-by: David Brownell <db@helium.(none)>
2010-07-09 18:34:31 -04:00
Spencer Oliver
ac5ad4ad8d transport: fix bug/typo in transport_register cmd
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-09 22:02:52 +01:00
David Brownell
93f2afa45f initial "transport" framework
This adds the guts of a transport framework with initialization,
which should work with current JTAG-only configurations (tested
with FT2232).

Each debug adapter can declare the transports it supports, and
exactly one transport is initialized.  (with its commands) in
any given OpenOCD session.

  * Define a new "struct transport with init hooks and a few
 "transport"  subcommands to support it:

     "list" ... list the transports configured (just "jtag" for now)
     "select" ... makes the debug session use that transport
     "init" ... initializes the selected transport (internal)

  * "interface_transports" ... declares transports the current interface
    can support.  (Some will do this from C code instead, when there are
    no hardware versioning (or other) issues to prevent it.

Plus some FT2232 tweaks, including a few to streamline upcoming
support for an SWD transport (initially for Luminary adapters).

Eventually src/jtag should probably become src/transport, moving
jtag-specific stuff  to transport/jtag.

Signed-off-by: David Brownell <db@helium.(none)>
2010-07-02 16:45:28 -04:00
Spencer Oliver
deb176d335 ft2232: revert ft2232_read_scan changes
Revert change made in commit dd88b461da.
Caused segfaults when using ftdi driver under win32.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-02 17:00:57 +01:00
Spencer Oliver
f97b6b59ab ft2232: bugfix from previous commit
fix build error with commit dd88b461da

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-07-01 19:43:58 +01:00
Marc Pignat
dd88b461da ft2232: simplify ft2232_read_scan 2010-07-01 09:32:56 +02:00
Marc Pignat
cd7f443103 ft2232: cleanup ft2232_write
* Include the size check into ft2232_write, so calling it is simpler.
* Use sizeof(buffer) when possible
2010-07-01 09:32:48 +02:00
Øyvind Harboe
00635e28ba jtag: rename JTAG_MOVESTATE to JTAG_TLR_RESET
JTAG_MOVESTATE is misleading, this cmd is only used
for reset.

JTAG_PATHMOVE should be used otherwise.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-07 15:08:30 +02:00
David Brownell
d7dba8d346 FT2232 Messaaging fix
The init cleanup patch overlooked a message which was
wrongly specific to the "usbjtag" layout.  Fix.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-24 16:04:26 -07:00
David Brownell
c2f714bd44 ft2232 init mess cleanup
In the ft2232 driver, initialization for many layouts punts to a routine
called usbjtag_init(), instead of a routine specific to each layout.

That routine is  a mess  built around a "what type layout am I" core.
That's a bad design ... in this case, especially so, since it bypasses
the layout-specific dispatch which was just done, and obfuscates the
initialization which is at least somewhat generic, instead of being
specific to the "usbjtag" layout.

Split and document out the generic parts of usbjtag_init(), and make
the rest of those layouts have layout-specific init methods.  Also,
rename usbjtag_reset() ... that also was not specific to the "usbjtag"
layout, and thus contributed to the previous code structure confusion.

(Eventually, all layout-specific code (and method tables) should probably
live in files specific to each layout.  These changes will facilitate
those and other cleanups to this driver.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-21 22:49:23 -07:00
David Brownell
3b310dbac5 FT2232 comment tweaks
Note that the FT4232 chips have four channels not two, and
Elaborate on uses of the additional channels.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-19 10:31:44 -07:00
Spencer Oliver
4b964a81ca FT2232: bulidfix
Fix build issue with commit c23d4596d2

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-03-15 10:06:47 +00:00
David Brownell
c23d4596d2 FT2232: lookup and save layout just once
Streamline use of the layout:  have the "ft2232_layout" command
look it up and save the result, instead of having a few different
chunks of code looking it up later, and saving just its name (which
is already part of the layout).  This

   - is cleaner
   - reports errors sooner
   - facilitates earlier adapter-specific setup
   - removes unused "default to "usbjtag" logic

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-03-14 13:10:26 -07:00
Spencer Oliver
73c1cff7c2 FT2232: add missing enum when using ftd2xx library
Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-02-28 22:48:51 +00:00
Mariano Alvira
0324eb2496 Add board/redbee-usb.cfg
The Redbee USB is a small form-factor usb stick from Redwire, LLC
(www.redwirellc.com/store), built around a Freescale MC13224V
ARM7TDMI + 802.15.4 radio (plus antenna).

It includes an FT2232H for debugging, with Channel B connected to the
mc13224v's JTAG interface (unusual) and Channel A connected to UART1.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-28 10:33:46 -08:00
Mariano Alvira
63763345d9 add board/redbee-econotag.cfg and JTAG support
The Redbee Econotag is an open hardware development kit from
Redwire, LLC (www.redwirellc.com/store), for the Freescale
MC13224V ARM7TDMI + 802.15.4 radio.

It includes both an MC13224V and an FT2232H (for JTAG and UART
support).  It has flexible power supply options.

Additional features are:

  - inverted-F pcb antenna
  - 36 GPIO brought out to 0.1" pin header
    (includes all peripheral pins)
  - Reset button
  - Two push buttons (on kbi1-5 and kbi0-4)
  - USB-A connector, powered from USB
  - up to 16V external input
  - pads for optional buck inductor
  - pads for optional 32.768kHz crystal
  - 2x LEDS on TX_ON and RX_ON

[ dbrownell@users.sourceforge.net: shrink lines; texi ]

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-27 22:52:34 -08:00
David Brownell
8c9b52e8b6 ft2232: implement TMS sequence command
Implement the new TMS_SEQ command on FT2232 hardware.
Also, swap a bogus exit() call with a clean failure return.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-27 00:12:38 -08:00
Mariano Alvira
4a64820f23 ft2232: add a mechanism to specify channel in layout structs
FT2232-family chips have two or more MPSSE modules.   FTDI documentation
calls these channels.  JTAG adapter drivers thus need to be able to choose
which channel to use.  (For example, one channel may connect to a board's
microcontroller, while another connects to a CPLD.)

Since each channel has its own USB interface, libftdi (somewhat confusingly)
identifies channels using INTERFACE_* symbols.  Most boards use INTERFACE_A
for JTAG, which is the default in OpenOCD.  But some wire up a different one.

Note that there are two facets of what makes a wiring "layout":

 - The mapping between debug signals map and channel signals ... embedded
   in C functions.

 - Label used in Tcl configuration scripts ... part of the "layout" structure.

By letting the channel be part of the layout struct, we permit sharing the C
functions between Tcl-visible layouts, when those signal mappings are reused.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-25 00:01:55 -08:00
David Brownell
c21c740a89 ft2232 table init cleanup
Use labeled initializers in the table of layouts instead of
positional ones.  This ls cleaner and less error prone, plus
it simplifies patches which add members to these structure.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-02-21 17:19:08 -08:00
David Brownell
237a707f96 FT2232: fix doc typo
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-03 15:02:51 -08:00
David Brownell
e1258c703b JTAG/drivers: ft2232 docs
Add doxyegen description for this driver.

Correct the helptext (configures *or* displays based on #params),
and usage (use the same BNF as the User's Guide).

Remove superfluous #include

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-03 14:54:52 -08:00
David Brownell
e0338293b8 JTAG/drivers: cleanup jtag_interface structs
Get rid of excess indents.
Ditto superfluous "&" before function pointers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2010-01-03 13:07:18 -08:00
David Brownell
ec297e4bf1 Fix Luminary FT2232 layout docs/configs
Most of this patch updates documentation and comments for various
Luminary boards, supporting two bug fixes by helping to make sense
of the current mess:

 - Recent rev C lm3s811 eval boards didn't work.  They must use
   the ICDI layout, which sets up some signals that the older
   boards didn't need.  This is actually safe and appropriate
   for *all* recent boards ... so just make "luminary.cfg" use
   the ICDI layout.

 - "luminary-lm3s811.cfg", was previously unusable!  No VID/PID;
   and the wrong vendor string.  Make it work, but reserve it
   for older boards where the ICDI layout is wrong.

 - Default the LM3748 eval board to "luminary.cfg", like the
   other boards.  If someone uses an external JTAG adapter, all
   boards will use the same workaround (override that default).

The difference between the two FT2232 layouts is that eventually
the EVB layout will fail cleanly when asked to enable SWO trace,
but the ICDI layout will as cleanly be able to enable it.  Folk
using "luminary.cfg" with Rev B boards won't see anything going
wrong until SWO support is (someday) added.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-28 12:59:47 -08:00
Zachary T Welch
165fb9309d change #include "interface.h" to <jtag/interface.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "interface.h"

the following form should be used.

	#include <jtag/interface.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch
c9e448222c change #include "commands.h" to <jtag/commands.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "commands.h"

the following form should be used.

	#include <jtag/commands.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch
6512e5e36b change #include "time_support.h" to <helper/time_support.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "time_support.h"

the following form should be used.

	#include <helper/time_support.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch
865efd828a move jtag drivers to src/jtag/drivers
Moves JTAG interface drivers to src/jtag/drivers/,
Adds src/jtag/drivers/Makefile.am.
Builds libocdjtagdrivers.la.

Flattens the rlink driver files into the drivers/ directory, adding
the 'rlink_' prefix or '.rlink' suffix as appropriate.
2009-12-02 23:27:09 -08:00