]> git.sur5r.net Git - openocd/log
openocd
14 years agoARM7/9 minor cleanups
David Brownell [Thu, 14 Jan 2010 11:16:07 +0000 (03:16 -0800)]
ARM7/9 minor cleanups

Shrink some overlong lines.  Add my 2009 copyright.
Move a declaration to the beginning of its block.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoGDB: change gdb_breakpoint_override to COMMAND_ANY
Spencer Oliver [Thu, 14 Jan 2010 00:58:07 +0000 (00:58 +0000)]
GDB: change gdb_breakpoint_override to COMMAND_ANY

 - enable gdb_breakpoint_override to be used within config script.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoUser's Guide updates
David Brownell [Thu, 14 Jan 2010 07:33:53 +0000 (23:33 -0800)]
User's Guide updates

Capture various bits of useful information that have come up on the
list but haven't yet gotten into the documentation:

 - Watchdog timers firing during JTAG debug need attention;

 - Some chips have special registers to help JTAG debug;

 - Cortex-M3 stepping example with IRQs and maskisr;

 - Clarifications re adaptive clocking:  not all ARMs do it, and
   explain it a bit better.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoNOR: add optional "flash erase_address" sector padding
David Brownell [Thu, 14 Jan 2010 07:33:25 +0000 (23:33 -0800)]
NOR: add optional "flash erase_address" sector padding

Add a NOR flash mechanism where erase_address ranges can be padded
out to sector boundaries, triggering a diagnostic:

  > flash erase_address 0x0001f980 16
  address range 0x0001f980 .. 0x0001f98f is not sector-aligned
  Command handler execution failed
  in procedure 'flash' called at file "command.c", line 647
  called at file "command.c", line 361
  >

  > flash erase_address pad 0x0001f980 16
  Adding extra erase range, 0x0001f800 to 0x0001f97f
  Adding extra erase range, 0x0001f990 to 0x0001fbff
  erased address 0x0001f980 (length 16) in 0.095975s (0.163 kb/s)
  >

This addresses what would otherwise be something of a functional
regression.  An earlier version of the interface had a dangerous
problem:  it would silently erase data outside the range it was
told to erase.  Fixing that bug turned up some folk who relied on
that unsafe behavior.  (The classic problem with interface bugs!)
Now they can get that behavior again.  If they really need it,
just specify "pad".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoCortex-M3: improved core exception handling
David Brownell [Wed, 13 Jan 2010 11:16:37 +0000 (03:16 -0800)]
Cortex-M3: improved core exception handling

This updates three aspects of debugger/exception interactions:

 - Save the user's "vector_catch" setting, and restore it after reset.
   Previously, it was obliterated (rather annoyingly) each time.

 - Don't catch BusFault and HardFault exceptions unless the user says
   to do so.  Target firmware may need to handle them.

 - Don't modify SHCSR to prevent escalating BusFault to HardFault.
   Target firmware may expect to handle it as a HardFault.

Those simplifications fix several bugs.  In one annoying case, OpenOCD
would cause the target to lock up on ome faults which triggered after
the debugger disconnected.

NOTE:  a known remaining issue is that OpenOCD can still leave DEMCR
set after an otherwise-clean OpenOCD shutdown.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoarm7/9: enable check that DCC downloads have been enabled
Øyvind Harboe [Mon, 11 Jan 2010 14:30:22 +0000 (15:30 +0100)]
arm7/9: enable check that DCC downloads have been enabled

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoarm7/9: add fn to check if dcc downloads have been enabled
Øyvind Harboe [Mon, 11 Jan 2010 14:29:09 +0000 (15:29 +0100)]
arm7/9: add fn to check if dcc downloads have been enabled

DCC downloads should be enabled for any self repecting
openocd config file for arm7/9. Print out note about
it otherwise.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agotarget: add check_reset hook
Øyvind Harboe [Mon, 11 Jan 2010 14:28:18 +0000 (15:28 +0100)]
target: add check_reset hook

Allow targets to run checks post reset. Used to check
that e.g. DCC downloads have been enabled.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agogdbserver: fix typo that broke read/write watchpoint
Øyvind Harboe [Mon, 11 Jan 2010 08:22:08 +0000 (09:22 +0100)]
gdbserver: fix typo that broke read/write watchpoint

It looks like a bugfix from normal breakpoints was not
copied over.

Do not use clever mathematics and assumptions to convert from
GDB enum for break/watchpoints to OpenOCD enum.

Drop connection upon unknown breakpoint type, this code path
was not really considered by the previous code I think.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agodebug: make logging of commands terser
Øyvind Harboe [Mon, 11 Jan 2010 14:54:52 +0000 (15:54 +0100)]
debug: make logging of commands terser

one line / command instead of one line per argument.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoARM: bugfix for "movt" disassembly
David Brownell [Tue, 12 Jan 2010 20:40:39 +0000 (12:40 -0800)]
ARM: bugfix for "movt" disassembly

Use the correct bitfield to specify the register whose
top halfword gets replaced.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoAdded Openmoko USB JTAG interface config file.
Vladimir Zapolskiy [Mon, 11 Jan 2010 14:49:37 +0000 (17:49 +0300)]
Added Openmoko USB JTAG interface config file.

Added interface config file for JTAG/RS232 debug board originally
integrated to Neo 1973 and Neo FreeRunner phones.
Adapter was tested with i.MX31, S3C2410 and AT91SAM9260 processors.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
14 years agotarget: return JIM_OK instead of ERROR_OK
Øyvind Harboe [Mon, 11 Jan 2010 13:59:14 +0000 (14:59 +0100)]
target: return JIM_OK instead of ERROR_OK

No change in actual binary as JIM_OK == ERROR_OK,
but JIM_OK is correct here.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoreset: better error messages
Øyvind Harboe [Mon, 11 Jan 2010 11:54:49 +0000 (12:54 +0100)]
reset: better error messages

Use correct tcl syntax to throw exception.

the syntax is "return -code error" not "return -error"

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agocommands: make error messages a bit more terse
Øyvind Harboe [Mon, 11 Jan 2010 11:53:55 +0000 (12:53 +0100)]
commands: make error messages a bit more terse

we don't need to know the build path of command.c when
reading normal user level error messages.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: reset bugfix
Øyvind Harboe [Mon, 11 Jan 2010 09:21:56 +0000 (10:21 +0100)]
zy1000: reset bugfix

flush JTAG FIFO before reset. Fixes RCLK problems observed
w/lpc2148, but really fixes a wider range of problems.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoDoxygen file comments
David Brownell [Mon, 11 Jan 2010 08:14:01 +0000 (00:14 -0800)]
Doxygen file comments

Add file comments to a few files.  Make the GDB server use
more conventional (pointer-free) hex digit conversion.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoshutdown: more graceful shutdown
Øyvind Harboe [Fri, 8 Jan 2010 14:30:10 +0000 (15:30 +0100)]
shutdown: more graceful shutdown

Shutdown is not an error condition, do not return error
from main.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agobuild: doxygen build
Spencer Oliver [Sun, 10 Jan 2010 14:30:06 +0000 (14:30 +0000)]
build: doxygen build

 - Fix for building doxygen out of tree

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoFreeBSD build fixes
David Brownell [Sun, 10 Jan 2010 18:06:58 +0000 (10:06 -0800)]
FreeBSD build fixes

Based on notes from Tomek Cedro <tomek.cedro@gmail.com> and
Steve Franks <bahamasfranks@gmail.com>.

In the User's Guide, sort the list of operating systems reported
through Tcl with $ocd_HOSTOS ... and include FreeBSD.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoPresto: doxygen fix
David Brownell [Sun, 10 Jan 2010 06:24:43 +0000 (22:24 -0800)]
Presto: doxygen fix

Newline needed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agojtag/tcl help/usage fixups
David Brownell [Sun, 10 Jan 2010 06:15:57 +0000 (22:15 -0800)]
jtag/tcl help/usage fixups

The usual: expand several helptexts to be more correct and to use
full sentences; make the usage messages use the same EBNF as the
User's Guide; use function names for their addresses.

Also add a comment about that odd jtag_command_handlers_to_move[] thing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoZY1000 help/usage fixups
David Brownell [Sun, 10 Jan 2010 06:14:08 +0000 (22:14 -0800)]
ZY1000 help/usage fixups

The usual:  same EBNF as in the User's Guide, full sentence helptext,
function names *are* their addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agojtag: presto, parport help/usage updates
David Brownell [Sun, 10 Jan 2010 06:09:08 +0000 (22:09 -0800)]
jtag: presto, parport help/usage updates

Presto: add doxygen file comment.

Parport: note a couple gaps in layout config.

Both: use the uniform EBNF for usage, bugfix helptexts, use function
name as its address not "&name".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agojtag/gw16012 usage/help updates
David Brownell [Sun, 10 Jan 2010 06:05:55 +0000 (22:05 -0800)]
jtag/gw16012 usage/help updates

Use standard BNF.  Improve/correct helptext for its "parport_port"
command.  Function address is just its name.

14 years agoparport (mostly) doc fixes
David Brownell [Sun, 10 Jan 2010 05:56:11 +0000 (21:56 -0800)]
parport (mostly) doc fixes

The "parport_port" commands generally don't *require* a port_number;
they're of the "apply any parameter, then print result" variety.  Update
the User's Guide accordingly.

Some of those commands are intended to be write-once: parport_port,
and parport_cable.  Say so.

Use proper EBNF for the parport_write_on_exit parameter.

Parport address 0xc8b8 is evidently mutant.  Say so in the "parport.cfg"
file, to avoid breaking anyone with that mutant config.  But update the
User's Guide to include a sane example for the LP2 port.

Finally document the "presto_serial" command.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agosrc/helper: usage/help updates
David Brownell [Sat, 9 Jan 2010 21:32:08 +0000 (13:32 -0800)]
src/helper: usage/help updates

Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets.  Improve and correct various helptexts.

Don't use "&function"; a function's name is its address.
Fix some whitespace glitches, shrink a few overlong lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agosrc/flash/nor: usage/help/doc updates
David Brownell [Sat, 9 Jan 2010 16:58:38 +0000 (08:58 -0800)]
src/flash/nor: usage/help/doc updates

Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets.  Improve and correct various helptexts.

Don't use "&function"; a function's name is its address.
Remove a couple instances of pointless whitespace; shrink a
few overlong lines; fix some bad indents.

Add TODO list entry re full support for NAND/NOR bank names.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoMIPS: update arch_info access to match other targets
Spencer Oliver [Fri, 8 Jan 2010 22:35:08 +0000 (22:35 +0000)]
MIPS: update arch_info access to match other targets

 - add target_to_mips32 and target_to_m4k to match test of codebase.
 - mips32_arch_state now shows if processer is running mips16e isa.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agosrc/server: usage/help/doc updates
David Brownell [Sat, 9 Jan 2010 08:55:41 +0000 (00:55 -0800)]
src/server: usage/help/doc updates

Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets.  Improve and correct various helptexts.

Specifically for the port commands, clarify that the number
is optional, and omitting it causes the current number to be
displayed.

Don't use "&function"; a function's name is its address.
Remove a couple instances of pointless whitespace; shrink a
few overlong lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agobuildfix on MacOS
Masaki Muranaka [Sat, 9 Jan 2010 06:41:31 +0000 (15:41 +0900)]
buildfix on MacOS

Recent Apple gcc versions use __APPLE__ instead of __DARWIN__; accept
that too.

Also use #warning, not #warn; neither is standard, but most CPP versions
require it to be spelled out.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoPLD: usage/help updates
David Brownell [Sat, 9 Jan 2010 07:23:55 +0000 (23:23 -0800)]
PLD: usage/help updates

Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets.  Improve and correct various helptexts.

Don't use "&function"; a function's name is its address.
Remove a couple instances of pointless whitespace, shrink
a few overlong lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoNAND: help/usage/doc updates
David Brownell [Sat, 9 Jan 2010 07:18:46 +0000 (23:18 -0800)]
NAND: help/usage/doc updates

Usage messages should use the same EBNF as the User's Guide;
no angle brackets.  Be more complete too ... some params were
missing.  Improve and correct various helptexts.

Make user's guide refer to the NAND "driver" name, not the
controller name; that's a bit more precise.

Don't use "&function"; its name is its address.  Line up struct
initializers properly.  Remove some blank lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoDoc/examples: clarify usage messages
David Brownell [Sat, 9 Jan 2010 07:13:39 +0000 (23:13 -0800)]
Doc/examples: clarify usage messages

Update/bugfix the "hello" example; emphasize using EBNF syntax,
matching the User's Guide.  Correct the Texinfo style guide to
say EBNF, not BNF.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years ago*SVF: help/usage updates
David Brownell [Sat, 9 Jan 2010 04:16:05 +0000 (20:16 -0800)]
*SVF: help/usage updates

Usage messages should use the same EBNF as the User's Guide;
no angle brackets.  Be more complete too ... some params were
missing.

Don't use "&function"; its name is its address.

Unrelated: fix typo in one "target.c" usage message.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoMFLASH: help/usage updates
David Brownell [Sat, 9 Jan 2010 04:12:18 +0000 (20:12 -0800)]
MFLASH: help/usage updates

Make "usage" messages use the same EBNF as the User's Guide;
no angle brackets.  Improve and correct various helptexts.

Don't use "&function"; a function's name is its address.
Remove a couple instances of pointless whitespace.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoCoexist with quilt: rename PATCHES --> PATCHES.txt
David Brownell [Sat, 9 Jan 2010 01:20:47 +0000 (17:20 -0800)]
Coexist with quilt: rename PATCHES --> PATCHES.txt

The issues is on Win32, which ignores case in filesystem
and thus doesn't tolerate the quilt "patches" directory.

Rename, and add "patches" to .gitignore so that developers
can choose to use quilt for local patch management.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoNOR: add FIXMEs for writing ones
David Brownell [Sat, 9 Jan 2010 00:47:58 +0000 (16:47 -0800)]
NOR: add FIXMEs for writing ones

It can invalidate ECC codes, and in general is not guaranteed
to work.  (However on some chips it _appears_ to behave.)  Just
don't do it; don't write in those cases.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agomisc ARM help/usage updates
David Brownell [Fri, 8 Jan 2010 00:41:42 +0000 (16:41 -0800)]
misc ARM help/usage updates

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Uupdate some helptext to be more accurate.

Don't use "&function"; functions are like arrays, their address
is their name.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM966: help/usage updates
David Brownell [Fri, 8 Jan 2010 00:39:32 +0000 (16:39 -0800)]
ARM966: help/usage updates

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Fix the User's Guide to say where the magic CP15 bits are defined;
and add comments in case someone provides mcr/mrc methods.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoXscale: User's Guide updates
David Brownell [Fri, 8 Jan 2010 00:34:44 +0000 (16:34 -0800)]
Xscale: User's Guide updates

Fix some EBNF goofs ... these commands have *optional* params, etc

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM720: help/usage updates
David Brownell [Fri, 8 Jan 2010 00:30:09 +0000 (16:30 -0800)]
ARM720: help/usage updates

Deprecate the "pass an instruction opcode" flavor of cp15
access in favor of the "arm mcr ..." and "arm mrc ..."
commands, which offer fewer ways to break things.

Use the same EBNF syntax in the code as for the user's guide.

Update User's Guide to say where to find those magic values
(which table in the ARM920 TRM).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM720: help/usage updates
David Brownell [Fri, 8 Jan 2010 00:25:03 +0000 (16:25 -0800)]
ARM720: help/usage updates

Deprecate the "pass an instruction opcode" flavor of cp15 access
in favor of the "arm mcr ..." and "arm mrc ..." commands, which
offer fewer ways to break things.

Use the same EBNF syntax in the code as for the user's guide.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM11: help/usage updates
David Brownell [Fri, 8 Jan 2010 00:21:10 +0000 (16:21 -0800)]
ARM11: help/usage updates

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Uupdate some helptext to be more accurate.

Fix the User's Guide in a few places to be more consistent (mostly
to use brackets not parentheses) and to recognize that parameter may
be entirely optional (in which case the command just displays output,
and changes nothing).  Also reference NXP, not Philips, for LPC chips.

Don't use "&function"; functions are like arrays, their address
is their name.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM7/ARM9: help/usage updates
David Brownell [Fri, 8 Jan 2010 00:20:14 +0000 (16:20 -0800)]
ARM7/ARM9: help/usage updates

Provide helptext which was sometimes missing; update some of it
to be more accurate.

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Fix the User's Guide in a few places to be more consistent (mostly
to use brackets not parentheses) and to recognize that parameter may
be entirely optional (in which case the command just displays output,
and changes nothing).  Also reference NXP, not Philips, for LPC chips.

Don't use "&function"; functions are like arrays, their address
is their name.  Shrink some overlong lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARMv7: help/usage updates
David Brownell [Thu, 7 Jan 2010 23:52:38 +0000 (15:52 -0800)]
ARMv7: help/usage updates

Provide helptext which was sometimes missing; update some of it
to be more accurate.

Usage syntax messages have the same EBNF as the User's Guide;
there should be no angle brackets in either place.

Don't use "&function"; functions are like arrays, their address
is their name.  Shrink some overlong lines, remove some empties.

Add a couple comments about things that should change:  those
extra TCK cycles for MEM-AP reads are in the wrong place (that
might explain some problems we've seen); the DAP command tables
should be shared, not copied.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM ETM/ETB/trace: help/usage updates
David Brownell [Thu, 7 Jan 2010 23:22:41 +0000 (15:22 -0800)]
ARM ETM/ETB/trace: help/usage updates

Provide helptext which was sometimes missing; update some of it
to be more accurate.

Usage syntax messages have the same EBNF as the User's Guide;
no angle brackets in either place.

Don't use "&function"; functions are like arrays, their address
is their name.  Shrink some overlong lines, remove some empties.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agotarget misc: help/usage updates
David Brownell [Thu, 7 Jan 2010 23:05:26 +0000 (15:05 -0800)]
target misc: help/usage updates

Provide helptext which was sometimes missing; update some of it
to be more accurate.

Usage syntax messages have the same EBNF as the User's Guide.

Don't use "&function"; functions are like arrays, their address
is their name.  Shrink some overlong lines; remove some empties.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoXScale: help/usage updates
David Brownell [Thu, 7 Jan 2010 22:51:59 +0000 (14:51 -0800)]
XScale: help/usage updates

Provide helptext which was sometimes missing; update some of it
to be more accurate (mostly they display something w/no args).

Usage syntax messages have the same EBNF as the User's Guide.
In some cases, *exactly* what the user's guide shows... e.g.
talking about "offset" not "address" for trace_image.

Don't use "&function"; functions are like arrays, their name
is their address.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoMIPS: change bulk_write_memory fallback msg to LOG_DEBUG
Spencer Oliver [Thu, 7 Jan 2010 22:39:35 +0000 (22:39 +0000)]
MIPS: change bulk_write_memory fallback msg to LOG_DEBUG

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoMIPS: whitespace cleanup
Spencer Oliver [Thu, 7 Jan 2010 20:56:07 +0000 (20:56 +0000)]
MIPS: whitespace cleanup

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoMIPS: fastdata bulk write fallback
Spencer Oliver [Wed, 6 Jan 2010 20:24:31 +0000 (20:24 +0000)]
MIPS: fastdata bulk write fallback

If fastdata access fails, then fallback to default mips_m4k_write_memory
Remove unnecessary fastdata loader verify check

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agobuildfix with -DNDEBUG
David Brownell [Tue, 5 Jan 2010 22:11:03 +0000 (14:11 -0800)]
buildfix with -DNDEBUG

Don't save that state unless its only user, an assertion,
is compiled.  Saving it broke a cygwin build.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agodon't require 'openocd.cfg' to start
David Brownell [Tue, 5 Jan 2010 21:32:39 +0000 (13:32 -0800)]
don't require 'openocd.cfg' to start

Starting the daemon with with just a bare "openocd" I saw:

Can't find openocd.cfg

That's not an error; don't treat it as if it were.  There may
be an error later -- like, "no interface set up" -- but let
messages only report real errors, not fake ones.

14 years agoARM: add #defines for JTAG ack codes
David Brownell [Tue, 5 Jan 2010 21:03:27 +0000 (13:03 -0800)]
ARM: add #defines for JTAG ack codes

JTAG has only two possible JTAG ack codes for APACC and DPACC
register reads/writes.  Define them, and remove empty "else"
clause in the code which now uses those codes.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM: add comments re DAP assumptions
David Brownell [Tue, 5 Jan 2010 20:55:46 +0000 (12:55 -0800)]
ARM: add comments re DAP assumptions

I think some of these assumptions are not well-founded.
Related, that swjdp_transaction_endcheck() is a bit iffy.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoMIPS: pracc access tweaks
Spencer Oliver [Tue, 5 Jan 2010 17:43:29 +0000 (17:43 +0000)]
MIPS: pracc access tweaks

reorder the pracc access so we can save a few access cycles

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoPIC32: enable ram execution
Spencer Oliver [Mon, 21 Dec 2009 17:23:09 +0000 (17:23 +0000)]
PIC32: enable ram execution

add reset-init script to allow ram execution from reset, this is required for ejtag fastdata access.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoMIPS: optimize pracc access
Spencer Oliver [Mon, 21 Dec 2009 16:33:03 +0000 (16:33 +0000)]
MIPS: optimize pracc access

remove unnecessary nops when accessing ejtag pracc
general fastdata patch cleanup

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoparport: output port as hex rather than dec
Spencer Oliver [Thu, 17 Dec 2009 11:53:39 +0000 (11:53 +0000)]
parport: output port as hex rather than dec

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoMIPS: merge mips fast_data patch from David N. Claffey
David Claffey [Wed, 16 Dec 2009 11:23:52 +0000 (11:23 +0000)]
MIPS: merge mips fast_data patch from David N. Claffey

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agogdb: fix regression in gdb_port command
Øyvind Harboe [Tue, 5 Jan 2010 13:57:45 +0000 (14:57 +0100)]
gdb: fix regression in gdb_port command

The gdb_port command can be invoked during normal execution
to report the port used for gdb, whereas it was listed as
CONFIG stage only, which caused an error when excuting
it to return the reported error.

Also in line with the grander goal of making more commands
available during all "modes" (perhaps retiring config mode),
there is no particular reason to limit gdb_port to the
config stage.

Regression was introduced in:

b3bf1d12b2fdfba1c1cbee3e1afbfbb27cbd1a26 aka
v0.4.0-rc1-32-gb3bf1d1

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoupdate udev rules for new udev version
Johannes Stezenbach [Mon, 4 Jan 2010 15:08:10 +0000 (16:08 +0100)]
update udev rules for new udev version

New versions of udev (148+) emit the following warnings:

udevd[425]: BUS= will be removed in a future udev version,
  please use SUBSYSTEM= to match the event device, or
  SUBSYSTEMS= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:1
udevd[425]: SYSFS{}= will be removed in a future udev version,
  please use ATTR{}= to match the event device, or
  ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:4
udevd[425]: SYSFS{}= will be removed in a future udev version,
  please use ATTR{}= to match the event device, or
  ATTRS{}= to match a parent device, in /lib/udev/rules.d/60-openocd.rules:7
...

See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560141

[dbrownell@users.sourceforge.net: add IDs for Stellaris ICDI, Olimex Tiny-H]

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARMv7-M: use AP_REG_* symbol
David Brownell [Tue, 5 Jan 2010 06:11:34 +0000 (22:11 -0800)]
ARMv7-M:  use AP_REG_* symbol

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoFT2232: fix doc typo
David Brownell [Sun, 3 Jan 2010 23:02:51 +0000 (15:02 -0800)]
FT2232: fix doc typo

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoJTAG/drivers: ft2232 docs
David Brownell [Sun, 3 Jan 2010 22:54:52 +0000 (14:54 -0800)]
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>
14 years agoJTAG/Drivers: Amontec JTAG accelerator fixes
David Brownell [Sun, 3 Jan 2010 22:51:01 +0000 (14:51 -0800)]
JTAG/Drivers: Amontec JTAG accelerator fixes

Remove superfluous #include.

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

Add doxygen -- file-level description and a @todo for doing
RTCK correctly.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoJTAG: Amontec JTAG accelerater "rtck" is back
David Brownell [Sun, 3 Jan 2010 21:30:06 +0000 (13:30 -0800)]
JTAG: Amontec JTAG accelerater "rtck" is back

The command processing conversion a while back lost the
"rtck" enable/disable command; restore it.

NOTE that having such a command is wrong; there's a standard
way to enable adaptive clocking ("speed 0").

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoJTAG/drivers: cleanup jtag_interface structs
David Brownell [Sun, 3 Jan 2010 21:07:18 +0000 (13:07 -0800)]
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>
14 years agoJTAG/drivers: amt_jtagaccel fixes + cleanup
David Brownell [Sun, 3 Jan 2010 20:59:51 +0000 (12:59 -0800)]
JTAG/drivers: amt_jtagaccel fixes + cleanup

Build fixes:  it failed abysmally with PPDEV enabled.  Swapped
a build-time error with a FIXME comment in the affected macros.

Cleanup: remove "&" before function pointers, and excess indent,
for the interface struct declaration.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM: ADIv5 JTAG symbol cleanup
David Brownell [Sat, 2 Jan 2010 23:53:33 +0000 (15:53 -0800)]
ARM: ADIv5 JTAG symbol cleanup

Rename DAP_IR_* as JTAG_DP_* since those symbols are specifically
for JTAG-DP (or SWJ-DP in JTAG mode), and won't work with SWD.
Define the JTAG ABORT and IDCODE instructions for completeness;
add a comment about where to (someday) use ABORT.

Fix messaging which assumes everything is an SWJ-DP; say "JTAG-DP"
instead, it's at least more appropriate for all JTAG transports.

Shrink the affected lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM: dap info fix + tweaks
David Brownell [Sat, 2 Jan 2010 23:53:18 +0000 (15:53 -0800)]
ARM: dap info fix + tweaks

Fix: don't print the BASE address except if it's a MEM-AP;
that's an unlikely error, but there's no point getting it wrong.
Tweaks: comments, capitalization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM: ADIv5 export cleanup
David Brownell [Sat, 2 Jan 2010 23:53:06 +0000 (15:53 -0800)]
ARM: ADIv5 export cleanup

Make some private functions "static".  Remove their public declarations,
and what is now an obviously unused function.  Shrinks this object's size
(about 5% on x86_64) while making the code's scope easier to understand.
Shrink the affected lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM: ADIv5 symbol and comment cleanup
David Brownell [Sat, 2 Jan 2010 23:53:03 +0000 (15:53 -0800)]
ARM: ADIv5 symbol and comment cleanup

Instead of magic numbers, use their AP_REG_* constants.  Rename
the ROM address symbol as BASE to match ARM's documentation.

Comment various other symbols in the header; add some missing ones.
Remove an unused struct.  Add some doxygen for stuff including the
DAP structure and initialization.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoCortex-M3: minor breakpoint cleanup
David Brownell [Sat, 2 Jan 2010 23:52:52 +0000 (15:52 -0800)]
Cortex-M3: minor breakpoint cleanup

Shrink some lines, add some comments, simplify some tests.
During debug startup, log the core revision level too.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agostreamline and document helptext mode displays
David Brownell [Sat, 2 Jan 2010 23:52:35 +0000 (15:52 -0800)]
streamline and document helptext mode displays

Most commands are usable only at runtime; so don't bother saying
that, it's noise.  Moreover, tokens like EXEC are cryptic.  Be
more clear: highlight only the commands which may (also) be used
during the config stage, thus matching the docs more closely.
There are

 - Configuration commands (per documentation)
 - And also some commands that valid at *any* time.

Update the docs to note that "help" now shows this mode info.

This also highlighted a few mistakes in command configuration,
mostly commands listed as "valid at any time" which shouldn't
have been.  This just fixes ones I noted when sanity testing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoFix usage/help search for subcommands.
Dean Glazeski [Thu, 31 Dec 2009 22:01:32 +0000 (16:01 -0600)]
Fix usage/help search for subcommands.

This makes it so that the usage/help command properly uses the whole command,
including subcommand, in the search for help information.  This previously
caused erroneous output from the usage command handler.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoAdd the current command to the command information
Dean Glazeski [Sat, 2 Jan 2010 01:58:38 +0000 (19:58 -0600)]
Add the current command to the command information

I wanted to make it so I can be ignorant of a commands invocation string, so
I tried to use CMD_CURRENT (aka cmd->current) which is supposed to house a
pointer to the current command.  It turns out that this wasn't being set.

This patch adds the current command structure to the command invocation
structure before sending it along to the command handler.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoAdded ST FlashLINK interface config file.
Antonio Borneo [Thu, 31 Dec 2009 12:19:26 +0000 (20:19 +0800)]
Added ST FlashLINK interface config file.

The relevant cable config is already in OpenOCD, but not a config for
the JTAG adapter.  I have tested with FlashLINK on ARM926.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoUser's Guide: warn about the forum
David Brownell [Thu, 31 Dec 2009 11:09:03 +0000 (03:09 -0800)]
User's Guide: warn about the forum

Namely, that developers don't hang out; it's a users-only club.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoRemove some more Eclipse stuff from Git's eyes.
Dean Glazeski [Thu, 31 Dec 2009 05:21:33 +0000 (23:21 -0600)]
Remove some more Eclipse stuff from Git's eyes.

This adds the .settings folder and the .cproject file put down
by Eclipse from the eyes of Git.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM7_9: Fix segfaults
Antonio Borneo [Wed, 30 Dec 2009 23:13:16 +0000 (07:13 +0800)]
ARM7_9: Fix segfaults

Handlers for commands
 - arm7_9 semihosting <enable | disable>
 - $_TARGETNAME arp_reset assert 1
didn't check if target has already been examined, and could
segfault when using the NULL pointer "arm7_9->eice_cache".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agowhitespace cleanup, mostly for docs
Antonio Borneo [Tue, 29 Dec 2009 23:48:49 +0000 (07:48 +0800)]
whitespace cleanup, mostly for docs

Remove useless space/tab at end of lines.
Remove spaces in indentation and replace with tab.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoARM9TDMI: Fix segfault.
Antonio Borneo [Wed, 30 Dec 2009 18:43:56 +0000 (02:43 +0800)]
ARM9TDMI: Fix segfault.

The handler for "arm9tdmi vector_catch ..." did not check
if target has already been examined.  Without this fix it
segfaults when using NULL pointer "arm7_9->eice_cache".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoFix parport_dcl5 config file.
Antonio Borneo [Wed, 30 Dec 2009 14:34:48 +0000 (22:34 +0800)]
Fix parport_dcl5 config file.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agozy1000: add zy1000_ prefix to uart command
Øyvind Harboe [Wed, 30 Dec 2009 12:13:31 +0000 (13:13 +0100)]
zy1000: add zy1000_ prefix to uart command

less polution of the general namespace(preventive action,
no problems reported).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: unlock flash upon startup for revc
Øyvind Harboe [Wed, 30 Dec 2009 11:36:22 +0000 (12:36 +0100)]
zy1000: unlock flash upon startup for revc

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: reconfigure FPGA upon reset instead of just the CPU
Øyvind Harboe [Tue, 29 Dec 2009 11:30:02 +0000 (12:30 +0100)]
zy1000: reconfigure FPGA upon reset instead of just the CPU

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: firmware upgrade fixes for revc
Øyvind Harboe [Fri, 25 Dec 2009 20:50:41 +0000 (21:50 +0100)]
zy1000: firmware upgrade fixes for revc

Use ecos firmwareutil upgrade utilities

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: less warnings
Øyvind Harboe [Fri, 25 Dec 2009 22:05:50 +0000 (23:05 +0100)]
zy1000: less warnings

use inline for static functions in header files to
avoid warnings about fn not being used.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoAdded Open-BLDC board config file.
Piotr Esden-Tempski [Mon, 28 Dec 2009 16:30:32 +0000 (17:30 +0100)]
Added Open-BLDC board config file.

14 years agoAdded floss-jtag interface config file.
Piotr Esden-Tempski [Mon, 28 Dec 2009 16:15:21 +0000 (17:15 +0100)]
Added floss-jtag interface config file.

14 years agoMinGW build fixes
Freddie Chopin [Mon, 28 Dec 2009 20:08:48 +0000 (21:08 +0100)]
MinGW build fixes

Print "ssize_t" as "%ld" (+ cast to long) not as "%zu".
Official MinGW (gcc 3.4.5) doesn't understand "z" flag.

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agostm32x commands get "usage"
Freddie Chopin [Mon, 28 Dec 2009 20:40:39 +0000 (21:40 +0100)]
stm32x commands get "usage"

Add .usage fields to stm32x command_registration,
so that "help stm32x" shows required parameters.

Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoFix Luminary FT2232 layout docs/configs
David Brownell [Mon, 28 Dec 2009 20:59:47 +0000 (12:59 -0800)]
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>
14 years agoNOR: last_addr also needs correction when checking alignment
Piotr Esden-Tempski [Mon, 28 Dec 2009 15:43:51 +0000 (16:43 +0100)]
NOR: last_addr also needs correction when checking alignment

Otherwise the new alignment checking algorithm thinks that the
address is not aligned, because it is way beyond the last sector.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agocreate tcl/board/dm365evm.cfg
David Brownell [Sun, 27 Dec 2009 20:16:55 +0000 (12:16 -0800)]
create tcl/board/dm365evm.cfg

This config is only lightly tested, and doesn't work well yet;
but it's a start.

 * Notably missing is PLL configuration, since each DaVinci
   does that just a bit differently; and thus DDR2 setup.

 * The SRST workaround needed for the goof in the CPLD's VHDL
   depends on at least the not-yet-merged patch letting ARM9
   (and ARM7) chips perform resets that don't use SRST.

So this isn't yet suitable for debugging U-Boot.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoNOR: make flash_write_unlock() pad to sector end
David Brownell [Sun, 27 Dec 2009 19:34:31 +0000 (11:34 -0800)]
NOR: make flash_write_unlock() pad to sector end

Resolve a regression when using newish automagic "write_image"
modes, by always padding to the end of affected sectors.

Also document some issues associated with those automagic options,
in the User's Guide and also some related code comments.

We might need similar padding at the *beginning* of some sectors,
but this is a minimalist fix for the problems which have currently
been reported (plus doc updates).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoDriver for USB-JTAG, Altera USB-Blaster and compatibles
Catalin Patulea [Sat, 26 Dec 2009 23:05:06 +0000 (15:05 -0800)]
Driver for USB-JTAG, Altera USB-Blaster and compatibles

The 10-pin JTAG layout used with these adapters is used by
a variety of platforms including AVR.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoOlimex SAM9-L9260 board configuration update.
Dean Glazeski [Wed, 9 Dec 2009 18:51:52 +0000 (12:51 -0600)]
Olimex SAM9-L9260 board configuration update.

This updates the board configuration for the SAM9-L9260 board with the
configuration for the on-board NAND and dataflash.  Included are commands
for configuring the AT91SAM9 NAND flash driver.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>