openocd.git
13 years agotarget: don't swap MMU/no-MMU work areas
David Brownell [Fri, 6 Nov 2009 22:57:21 +0000 (14:57 -0800)]
target: don't swap MMU/no-MMU work areas

Resolve serious bug inserted by the "target: require working
area for physical/virtual addresses to be specified" patch.
It forced use of (invalid) virtual addresses when the MMU
was disabled, and vice versa.

Observed to break at least Cortex-M3, ARM926, ARM7TDMI whenever
work areas are used, such as during bulk writes to flash, DDR2,
SRAM, and so on.

Also, fix overlong lines and whitespace goofs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM: shrink offsets
David Brownell [Fri, 6 Nov 2009 06:04:25 +0000 (22:04 -0800)]
ARM: shrink offsets

Move various embedded target structs to the beginnings of
their containers ... pretty much the way C++ or Obj-C
would for single inheritance.

This shrinks code that accesses those embedded structs by
letting common offsets use smaller instructions.  Sample
before/after sizes (on amd64):

  17181     312       0   17493    4455 arm920t.o
  16810     312       0   17122    42e2 arm920t.o

Where the "after" is the smaller number, with this patch
over the ones leveraging that embedding knowledge.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM: other code uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:04:22 +0000 (22:04 -0800)]
ARM: other code uses the new inheritance/nesting scheme

Remove most remaining uses of target->arch_info from ARM
infrastructure, where it hasn't already been updated.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoCortex-A8: use the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:04:13 +0000 (22:04 -0800)]
Cortex-A8: use the new inheritance/nesting scheme

Use target_to_armv7a() etc, replacing needless pointer traversals.
Stop using X->arch_info scheme in most ARMv7-A and Cortex-A8 code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM7TDMI uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:04:04 +0000 (22:04 -0800)]
ARM7TDMI uses the new inheritance/nesting scheme

Use target_to_arm7_9(), replacing needless pointer traversals.

Also:  remove now-useless contents of arm7tdmi struct; it's
almost ready to be removed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM720 uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:56 +0000 (22:03 -0800)]
ARM720 uses the new inheritance/nesting scheme

Use target_to_arm720(), replacing needless pointer traversals
and simplifying a bunch of nasty code.  Stop setting arch_info
for arm720 type parts, it's not used any longer.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoXScale uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:45 +0000 (22:03 -0800)]
XScale uses the new inheritance/nesting scheme

Use target_to_xscale(), replacing needless pointer traversals
and simplifying a bunch of code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM9TDMI uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:40 +0000 (22:03 -0800)]
ARM9TDMI uses the new inheritance/nesting scheme

Replace needless pointer traversals and simplify.  Also remove most
remaining contents from arm9tdmi struct; it's almost removable.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM966 uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:33 +0000 (22:03 -0800)]
ARM966 uses the new inheritance/nesting scheme

Use target_to_arm966(), replacing needless pointer traversals.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM926 uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:30 +0000 (22:03 -0800)]
ARM926 uses the new inheritance/nesting scheme

Use target_to_arm926(), replacing needless pointer traversals
and simplifying a bunch of code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoFA526 uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:24 +0000 (22:03 -0800)]
FA526 uses the new inheritance/nesting scheme

Replace needless pointer traversals, simplify.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM920 uses the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 06:03:13 +0000 (22:03 -0800)]
ARM920 uses the new inheritance/nesting scheme

Use target_to_arm920(), replacing needless pointer traversals
and simplifying.  Stop setting arm9tdmi->arch_info for arm920
type parts, it's not used any longer.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoCortex-M3: use the new inheritance/nesting scheme
David Brownell [Fri, 6 Nov 2009 05:59:45 +0000 (21:59 -0800)]
Cortex-M3: use the new inheritance/nesting scheme

Use new target_to_cm3() and target_to_armv7m() inlines,
instead of a series of x->arch_info conversions.  Remove
arch_info, since nothing uses it.

Also fix an omission:  the Cortex-M3 commands didn't verify
that they were operating on that kind of target.  Add comment
about the ARMv7M version of that omission.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agotarget: provide container_of()
David Brownell [Fri, 6 Nov 2009 05:59:39 +0000 (21:59 -0800)]
target: provide container_of()

Provide a cleaner way to handle single inheritance of targets
in C, using the same model Linux does:  structs containing other
structs, un-nested via calls to a "container_of()" macro that
are packaged in typesafe inline functions.

Targets already use this containment idiom, but make it much
more complicated because they un-nest using embedded "void *"
pointers ... in chains of up to five per target, which is all
pure needless complication.  (Example: arm92x core, arm9tdmi,
arm7_9, armv4_5 ... on top of the base "target" class.)

Applying this scheme consistently simplifies things, and gets
rid of many error-prone untyped pointers.  It won't change any
part of the type model though -- it just simplifies things.
(And facilitates more cleanup later on.)

Rule of thumb:  where there's an X->arch_info void* pointer,
access to that pointer can and should be removed.  It may be
convenient to set up pointers to some of the embedded structs;
and shrink their current "*_common" names (annoyingly long).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM7TDMI: remove forward decls
David Brownell [Fri, 6 Nov 2009 04:36:42 +0000 (20:36 -0800)]
ARM7TDMI: remove forward decls

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

Also shrink a few overly-long lines with function declarations
or definitions;  get rid of arm7tdmi_register_commands(), it's
not needed (just delegated); minor whitespace declutter.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM720: remove exports and forward decls
David Brownell [Fri, 6 Nov 2009 04:36:27 +0000 (20:36 -0800)]
ARM720: remove exports and forward decls

Unneeded exports cause confusion about the module interfaces.
Make all functions static.  Add a short header comment.

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

Remove unneeded indirection for the write_memory() method.  Make
a table static, remove a can't-happen case with nasty exit().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoFA526: remove exports and forward decls
David Brownell [Fri, 6 Nov 2009 04:36:18 +0000 (20:36 -0800)]
FA526: remove exports and forward decls

Unneeded exports cause confusion about the module interfaces.
Make most functions static.

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM9TDMI: remove forward decls
David Brownell [Fri, 6 Nov 2009 04:36:09 +0000 (20:36 -0800)]
ARM9TDMI: remove forward decls

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

Also shrink a few overly-long lines with function declarations
or definitions.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM966: remove exports and forward decls
David Brownell [Fri, 6 Nov 2009 04:35:53 +0000 (20:35 -0800)]
ARM966: remove exports and forward decls

Unneeded exports cause confusion about the module interfaces.
Make most functions static.

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

Also remove needless arm966e_init_target(), in favor of the
arm9tdmi routine to which it delegates its work.

This saved over 100 bytes of code on x86_32.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM926: more cleanup
David Brownell [Fri, 6 Nov 2009 04:35:47 +0000 (20:35 -0800)]
ARM926: more cleanup

An init_target() wrapper isn't needed, and target_create()
can shrink a bit.  Add a header comment and some doxygen.

Remove arm926ejs_catch_broken_irscan() which has been a NOP
for quite a few months now, and in any case duplicates logic
in the JTAG core to validate IR capture data.  But force the
capture mask to 0x0f, so those tests are most effective.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARM920: remove exports and forward decls
David Brownell [Fri, 6 Nov 2009 04:35:37 +0000 (20:35 -0800)]
ARM920: remove exports and forward decls

Unneeded exports cause confusion about the module interfaces.
Make most functions static.  Add a short header comment.

The forward decls are just code clutter; remove them, by moving
their references after definitions.  This is another file which
never needed even one internal forward declaration.

This saved almost 900 bytes of code on x86_32; it seems the
compiler can leverage its knowledge that these functions are
not called from the outside world...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoImprove str9xpec command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 08:18:25 +0000 (01:18 -0700)]
Improve str9xpec command argument parsing.

13 years agoImprove str9x config command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 08:25:22 +0000 (01:25 -0700)]
Improve str9x config command argument parsing.

13 years agoImprove str7x config command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 08:32:20 +0000 (01:32 -0700)]
Improve str7x config command argument parsing.

13 years agoImprove stm32x.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve stm32x.c command argument parsing.

13 years agoImprove stellaris.c erase argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 08:40:47 +0000 (01:40 -0700)]
Improve stellaris.c erase argument parsing.

13 years agoImprove pic32mx.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve pic32mx.c command argument parsing.

13 years agoImprove mflash.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve mflash.c command argument parsing.

13 years agoImprove lpc3180_nand_controller.c parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve lpc3180_nand_controller.c parsing.

This fixes a memory leak in lpc3180_nand_device_command by
reordering the malloc to occur after all parsing has completed.

13 years agoImprove lpc2900.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve lpc2900.c command argument parsing.

13 years agoImprove lpc288x.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve lpc288x.c command argument parsing.

13 years agoImprove lpc2000.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve lpc2000.c command argument parsing.

13 years agoImprove cfi.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve cfi.c command argument parsing.

13 years agoImprove avrf.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 09:17:17 +0000 (02:17 -0700)]
Improve avrf.c command argument parsing.

13 years agoImprove orion_nand.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve orion_nand.c command argument parsing.

13 years agoImprove davinci_nand.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve davinci_nand.c command argument parsing.

13 years agoImprove at91sam7.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve at91sam7.c command argument parsing.

13 years agoImprove at91sam3.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve at91sam3.c command argument parsing.

13 years agoImprove nand.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve nand.c command argument parsing.

13 years agoImprove flash.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:33:12 +0000 (22:33 -0700)]
Improve flash.c command argument parsing.

13 years agoAdd Flash/NAND bank command argument helpers.
Zachary T Welch [Fri, 23 Oct 2009 08:13:19 +0000 (01:13 -0700)]
Add Flash/NAND bank command argument helpers.

This eliminates redundant code for parsing and retreiving the bank
specified from a script command argument.  This patch was written to
replace existing functionality; however, the parsing logic can be
updated later to allow flash commands to accept bank names as well as
their numbers.

13 years agoImprove ETM tracemode update command.
Zachary T Welch [Thu, 22 Oct 2009 15:11:55 +0000 (08:11 -0700)]
Improve ETM tracemode update command.

13 years agoImprove etm command argument parsing.
Zachary T Welch [Thu, 22 Oct 2009 15:15:37 +0000 (08:15 -0700)]
Improve etm command argument parsing.

13 years agoImprove trace command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)]
Improve trace command argument parsing.

13 years agoImprove arm_adi_v5 command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm_adi_v5 command argument parsing.

13 years agoImprove cortex_m3 command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)]
Improve cortex_m3 command argument parsing.

13 years agoImprove xscale command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)]
Improve xscale command argument parsing.

13 years agoImprove arm11 command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm11 command argument parsing.

13 years agoImprove arm966e command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm966e command argument parsing.

13 years agoImprove arm926ejs command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm926ejs command argument parsing.

13 years agoImprove arm920t command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm920t command argument parsing.

13 years agoImprove arm720t command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve arm720t command argument parsing.

13 years agoImprove arm7_9_common command argument parsing.
Zachary T Welch [Thu, 22 Oct 2009 14:03:20 +0000 (07:03 -0700)]
Improve arm7_9_common command argument parsing.

13 years agoImprove armv7m command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)]
Improve armv7m command argument parsing.

13 years agoImprove armv7a command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)]
Improve armv7a command argument parsing.

13 years agoImprove armv4_5 command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 13:36:05 +0000 (06:36 -0700)]
Improve armv4_5 command argument parsing.

13 years agoImprove xscale command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 12:55:23 +0000 (05:55 -0700)]
Improve xscale command argument parsing.

13 years agoImprove pld command argument parsing.
Zachary T Welch [Sat, 24 Oct 2009 08:22:58 +0000 (01:22 -0700)]
Improve pld command argument parsing.

13 years agoUpdate all server port command to use new helper.
Zachary T Welch [Sat, 24 Oct 2009 08:12:56 +0000 (01:12 -0700)]
Update all server port command to use new helper.

13 years agoAdd server port command helper function.
Zachary T Welch [Sat, 24 Oct 2009 08:11:13 +0000 (01:11 -0700)]
Add server port command helper function.

13 years agoImprove target.c command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 04:04:23 +0000 (21:04 -0700)]
Improve target.c command argument parsing.

Passes cmd_ctx into parse_load_image_command_args for reporting the
parsing errors therein.

13 years agoImprove jtag command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 04:05:50 +0000 (21:05 -0700)]
Improve jtag command argument parsing.

13 years agoImprove debug_level command argument parsing.
Zachary T Welch [Fri, 23 Oct 2009 05:34:19 +0000 (22:34 -0700)]
Improve debug_level command argument parsing.

13 years agoAdd macro for parsing numeric command arguments.
Zachary T Welch [Thu, 22 Oct 2009 14:44:54 +0000 (07:44 -0700)]
Add macro for parsing numeric command arguments.

This helper eliminates significant amount of redundant code in command
handler functions throughout the system.  It wraps the lower-level
parse_* macros to implement a policy for reporting parse errors to the
active command context (cmd_ctx).  If errors do occur, this macro causes
the calling function to abort with the proper return code.

13 years agoAdd stringify macros in src/helper/types.h.
Zachary T Welch [Thu, 22 Oct 2009 14:39:23 +0000 (07:39 -0700)]
Add stringify macros in src/helper/types.h.

13 years agoarm920t: add mrcmcr interface fn's.
Øyvind Harboe [Tue, 3 Nov 2009 11:54:26 +0000 (12:54 +0100)]
arm920t: add mrcmcr interface fn's.

The arm920t has a concept of read modify write cycles
that may have to be represented in the mrcmcr interface
eventually.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoarm11: check if target is halted before executing mrc/mcr commands.
Øyvind Harboe [Tue, 27 Oct 2009 12:43:42 +0000 (13:43 +0100)]
arm11: check if target is halted before executing mrc/mcr commands.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agotarget: fix ordering of arguments to mcr and mrc commands
Øyvind Harboe [Mon, 26 Oct 2009 17:57:52 +0000 (18:57 +0100)]
target: fix ordering of arguments to mcr and mrc commands

Now matches machine code syntax and old arm11 syntax.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agotarget: check args to mrc/mcr.
Øyvind Harboe [Mon, 26 Oct 2009 17:53:19 +0000 (18:53 +0100)]
target: check args to mrc/mcr.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoARM11: added mrc/mcr support to arm11 code.
Øyvind Harboe [Mon, 26 Oct 2009 13:39:32 +0000 (14:39 +0100)]
ARM11: added mrc/mcr support to arm11 code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoTODO: Wrote up list of remaining tasks for target->type->mrc/mcr
Øyvind Harboe [Sat, 24 Oct 2009 12:50:57 +0000 (14:50 +0200)]
TODO: Wrote up list of remaining tasks for target->type->mrc/mcr

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agotarget: Only register mrc mcr commands when one of the targets support them.
Øyvind Harboe [Sat, 24 Oct 2009 11:24:35 +0000 (13:24 +0200)]
target: Only register mrc mcr commands when one of the targets support them.

This avoids polluting help for targets that can never support mrc/mcr

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agocortex_a8: add mrc mcr interface.
Øyvind Harboe [Sat, 24 Oct 2009 11:17:04 +0000 (13:17 +0200)]
cortex_a8: add mrc mcr interface.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoUser's Guide: TAP setup tweakage
David Brownell [Thu, 5 Nov 2009 19:31:32 +0000 (11:31 -0800)]
User's Guide: TAP setup tweakage

Highlight that the "-expected-id" probably comes from vendor
documentation, and that it *should* be used where possible.

Don't use ircapture/irmask in examples, to help discourage
use of those params when they're not required.  Explain a
bit better about why/when those params get used.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agowatchpoint_add() cleanup
David Brownell [Thu, 5 Nov 2009 09:47:44 +0000 (01:47 -0800)]
watchpoint_add() cleanup

Fail watchpoint_add() if it's the same address but the
parameters are different ... don't just assume having
the same address means the same watchpoint!  (Note that
overlapping watchpoints aren't detected...)

Handle unrecognized return codes more sanely; don't exit()!
And describe command params right.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoCortex-M3: expose most DWT registers
David Brownell [Thu, 5 Nov 2009 09:04:08 +0000 (01:04 -0800)]
Cortex-M3: expose most DWT registers

Expose most DWT registers via Tcl; there are a few more, but
those are mostly for profiling along with the ITM.  Having
this set available enables operations which aren't possible
with just the standard watchpoint operations.

The cycle counter may be interesting.  Turn it on after reset
by setting the LSB of the dwt_ctrl register, and it counts
CPU clocks.  You can program the comparator 0 watchpoint to
trigger on a given cycle count, rather than a data address.

Likewise, comparator 1 may be able to match data values given
address matches from one or two other comparators.  (Not all
hardware supports this capability though; try it.  That is
something the standard watchpoint methods should eventually
handle, for the single address case.)

Minor cleanup:  remove needless functional indirection for
exposing the v7m architctural registers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoCortex-M3: minor cleanup
David Brownell [Thu, 5 Nov 2009 09:03:54 +0000 (01:03 -0800)]
Cortex-M3: minor cleanup

There's no reason to read which interrupts are enabled from
the NVIC; that state isn't used.  Plus, it's highly dynamic
since firmware can change it at any time; remove the support
for those state records.

Remove duplicate definition of DWT_CTRL address; shrink a line.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoCortex-M3: DWT cleanup/fixes
David Brownell [Thu, 5 Nov 2009 09:03:17 +0000 (01:03 -0800)]
Cortex-M3: DWT cleanup/fixes

Fix the watchpoint error checks, and do them in add(), not later
in set() when it's mostly too late.  Support the full range of
watchpoint sizes (1 to 32K bytes each), and check alignments.

Minor cleanup of DWT access:  shrink lines, use "+" for address
calculations, comment a few issues.  Add debug message reporting
DWT capabilities, matching the message for FBP, and some minor
code and spec review comments.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoARMv7M: add docs, remove exports
David Brownell [Thu, 5 Nov 2009 09:02:52 +0000 (01:02 -0800)]
ARMv7M: add docs, remove exports

Add Doxygen for the exported ARMv7-M interfaces.

Make the non-exported stuff static.  Remove functions and
data which are now observably unused.

Add comment about a small speedup that the run_algorithm()
logic could use.  Shrink a few too-long lines.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agotarget: add target->type->has_mmu fn.
Øyvind Harboe [Tue, 27 Oct 2009 13:02:16 +0000 (14:02 +0100)]
target: add target->type->has_mmu fn.

improve default target->read/write_phys_memory, produce
more sensible error messages if the mmu interface
functions have not been implemented yet vs. will
not be implemented(e.g. cortex m3).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoMake default implementation of mdw/mmw phys return error 'not implemented'
Øyvind Harboe [Mon, 26 Oct 2009 20:47:41 +0000 (21:47 +0100)]
Make default implementation of mdw/mmw phys return error 'not implemented'

13 years agotarget: remove unused interface fn that clutters code
Øyvind Harboe [Sat, 31 Oct 2009 12:57:18 +0000 (13:57 +0100)]
target: remove unused interface fn that clutters code

The quit entry point was not being invoked. Just a source
of confusion at this point. XScale ran 100x reset upon
quit, but that code made no sense, wasn't commented
and never invoke.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agodebug interface: get rid of unused pre_debug fn
Øyvind Harboe [Fri, 30 Oct 2009 17:29:09 +0000 (18:29 +0100)]
debug interface: get rid of unused pre_debug fn

Removing unused code makes it much less mysterius.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agowarnings: remove
Øyvind Harboe [Thu, 5 Nov 2009 08:02:06 +0000 (09:02 +0100)]
warnings: remove

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoft2232: cleanup
David Brownell [Thu, 5 Nov 2009 05:41:08 +0000 (21:41 -0800)]
ft2232: cleanup

Previous patch somehow made GCC lose some of its cookies;
work around, zero-init that struct.

Clean up code from the previous patch.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoJTAG: support KT-LINK adapter
Krzysztof Kajstura [Thu, 5 Nov 2009 05:20:44 +0000 (21:20 -0800)]
JTAG: support KT-LINK adapter

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoPXA255: support Intel "Lubbock" platform
David Brownell [Thu, 5 Nov 2009 05:11:44 +0000 (21:11 -0800)]
PXA255: support Intel "Lubbock" platform

Config for Intel's "Lubbock" PXA255 development board.  Even more
so than the PXA255 itself, this is obsolete.  AFAIK this was the
first generally available development platform for PXA255.  Intel
stopped providing these after other devel boards became available.

One interesting thing about this board from the OpenOCD perspective
is probably its flash configuration.  Each bank is 32 bits wide,
built from two 16-bit StrataFlash chips wired in parallel.  This
doubles throughput ... it reads/writes 32 bits in the time a single
chip takes to write just 16 bits.

This conf mostly works, given XScale bugfixes, but has some issues
(notably: no access to the on-board SDRAM) flagged by FIXMEs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoVersion 0.4.0-dev
David Brownell [Thu, 5 Nov 2009 03:44:36 +0000 (19:44 -0800)]
Version 0.4.0-dev

Add "-dev" tag.  Update minor version number.
Archive old NEWS file, start a new one.

13 years agoVersion 0.3.0 v0.3.0
David Brownell [Thu, 5 Nov 2009 03:39:59 +0000 (19:39 -0800)]
Version 0.3.0

Remove -dev tag, remove -rc tag.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoRelease docs: fix notes
David Brownell [Thu, 5 Nov 2009 01:49:06 +0000 (17:49 -0800)]
Release docs: fix notes

We currently do something unusual:  version codes in config.in get
updated after the release, which means that "git describe" won't
match up to development version labels.  Comment that trouble spot.

We can fix this by switching away from the major/minor/micro type
release numbering, as various other projects have done.  The major
numbers basically don't tend to change, and doing a good job with
micro versions is so annoying that they rarely change either.

13 years agoDoc: fix broken link
David Brownell [Thu, 5 Nov 2009 01:12:53 +0000 (17:12 -0800)]
Doc: fix broken link

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoNEWS: mention switch to git!
David Brownell [Thu, 5 Nov 2009 01:03:20 +0000 (17:03 -0800)]
NEWS: mention switch to git!

13 years agoOther files: stop referring to ChangeLog too
David Brownell [Thu, 5 Nov 2009 00:46:27 +0000 (16:46 -0800)]
Other files: stop referring to ChangeLog too

The ChangeLog idiom is redundant given any decent SCM.
Time to phase it out here.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoNEWS refs repository history, not ChangeLog
David Brownell [Wed, 4 Nov 2009 23:54:33 +0000 (15:54 -0800)]
NEWS refs repository history, not ChangeLog

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoTweak release docs
David Brownell [Wed, 4 Nov 2009 23:38:06 +0000 (15:38 -0800)]
Tweak release docs

Contrast releases to git snapshot tarballs.  Mention that
releases have some quality-improvement focus, with special
non-"dev" version IDs.  Explain more about version IDs,
using "openocd -v" to see them, etc;

Make release milestone info be less specific about timing,
and presume we have both a merge window and an RC stage.

Rework the release process information to match reality a
bit more closely.  Reference the version.sh script (in one
place the wrong script was referenced).  Bugfix branches
get special treatment, while non-bugfix releases are more
or less what *defines* being the mainline branch.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoRelease scripts: comments, run on Ubuntu
David Brownell [Wed, 4 Nov 2009 23:20:18 +0000 (15:20 -0800)]
Release scripts: comments, run on Ubuntu

The "source" command isn't accepted by ASH; easy to fix.
Failures with "-e" are harder to fix.  Remove the "-e"
(for now) and force bash, for safety.

Un-obfuscate the release steps, by using names instead
of numbers.  Comment the version-number manipulation.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
13 years agoconfigure: fix build problems with eCos
Øyvind Harboe [Wed, 4 Nov 2009 12:16:38 +0000 (13:16 +0100)]
configure: fix build problems with eCos

Various include files require some other include files
to be included first. Copied solution from net/if.h.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agodocs: add reference to git bisect docs on BUGS page
Øyvind Harboe [Wed, 4 Nov 2009 18:25:20 +0000 (19:25 +0100)]
docs: add reference to git bisect docs on BUGS page

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agotarget: 20 second timeout/megabyte for CRC check
Øyvind Harboe [Tue, 3 Nov 2009 14:38:09 +0000 (15:38 +0100)]
target: 20 second timeout/megabyte for CRC check

There was a fixed 20 second timeout which is too little
for large, slow timeout checks.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
13 years agoarm920t: memory writes were broken when MMU was disabled
Øyvind Harboe [Tue, 3 Nov 2009 11:28:00 +0000 (12:28 +0100)]
arm920t: memory writes were broken when MMU was disabled

To support breakpoints, flush data cache line and invalidate
instruction cache when 4 and 2 byte words are written.

The previous code was trying to write directly to the physical
memory, which was buggy and had a number of other situations
that were not handled.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

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)