]> git.sur5r.net Git - openocd/log
openocd
14 years agostm32: add error propagation on writes
Øyvind Harboe [Mon, 8 Nov 2010 15:22:22 +0000 (16:22 +0100)]
stm32: add error propagation on writes

catch problems earlier.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agostm32: sharpen error handling for timeouts
Øyvind Harboe [Mon, 8 Nov 2010 15:02:07 +0000 (16:02 +0100)]
stm32: sharpen error handling for timeouts

delete lots of crud by handling this all in one spot.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agolpc3131: target definition
Andrew Leech [Tue, 9 Nov 2010 07:05:02 +0000 (08:05 +0100)]
lpc3131: target definition

14 years agoTCL scripts: add support for ST SPEAr310
Antonio Borneo [Thu, 4 Nov 2010 08:53:28 +0000 (16:53 +0800)]
TCL scripts: add support for ST SPEAr310

Initial support for ST SPEAr310 and for the evaluation
board EVALSPEAr310 Rev. 2.0.
Scripts are split in generic for SPEAr3xx family and
specific for SPEAr310. This should easily allow adding
new members of the family.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agoAdd EfikaMX smarttop board support
Marek Vasut [Fri, 29 Oct 2010 01:06:16 +0000 (03:06 +0200)]
Add EfikaMX smarttop board support

This patch finally adds support for i.MX51 based Genesi USA EfikaMX smarttop
board.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
14 years agoCortexA8: Introduce Freescale i.MX51 variant
Marek Vasut [Fri, 29 Oct 2010 00:57:32 +0000 (02:57 +0200)]
CortexA8: Introduce Freescale i.MX51 variant

This patch introduces support for Cortex A8 based Freescale i.MX51 CPU. This CPU
has the Debug Access Port located at a different address (0x60008000) than TI
OMAP3 series of CPUs.

i.MX51 configuration file based on OMAP3 configuration file and an email from
Alan Carvalho de Assis <acassis@gmail.com>.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
14 years agoCortexA8: Implement debug base autodetection
Marek Vasut [Fri, 29 Oct 2010 00:57:32 +0000 (02:57 +0200)]
CortexA8: Implement debug base autodetection

Implement autodetection of debug base. Also, implement a function solving
various hardware quirks (like iMX51 ROM Table location bug).

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
14 years agoADIv5: Implement function to lookup CoreSight component
Marek Vasut [Sun, 31 Oct 2010 06:11:47 +0000 (07:11 +0100)]
ADIv5: Implement function to lookup CoreSight component

This patch implements "dap_lookup_cs_component()", which allows to lookup CS
component by it's identification.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
14 years agoADIv5: Introduce function to detect ROM Table location
Marek Vasut [Sun, 31 Oct 2010 04:24:36 +0000 (05:24 +0100)]
ADIv5: Introduce function to detect ROM Table location

This patch adds function called "dap_detect_debug_base()", which should be
called to get location of the ROM Table. By walking ROM Table, it's possible to
discover the location of DAP.

Sadly, some CPUs misreport this value, therefore I had to introduce an fixup
table, which will be used in case such CPU is detected.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
14 years agoarm964e: Add support for ARM946E target.
ddraskovic [Thu, 4 Nov 2010 13:33:10 +0000 (14:33 +0100)]
arm964e: Add support for ARM946E target.

So far most of the people have been using existing ARM966E in the
place of ARM946E, because they have practically the same scan chains.

However, ARM946E has caches, which further complicates JATG handling
via scan-chain. this was preventing single-stepping for ARM946E when
SW breakpoints are used.

This patch thus introduces :
1) Correct cache handling on memory write
2) Possibility to flush whole cache and turn it off during debug, or
just to flush affected lines (faster and better)
3) Correct SW breakpoint handling and correct single-stepping
4) Corrects the bug on CP15 read and write, so CP15 values
are now correctly R/W

14 years agobootstrap: add quick start build instructions
Øyvind Harboe [Fri, 29 Oct 2010 13:05:15 +0000 (15:05 +0200)]
bootstrap: add quick start build instructions

leave some bread-crumbs for users to figure out how
to build OpenOCD

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojimtcl: 0.63 release
Øyvind Harboe [Fri, 15 Oct 2010 07:51:08 +0000 (09:51 +0200)]
jimtcl: 0.63 release

as a git module.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojim tests: use installed
Øyvind Harboe [Sun, 10 Oct 2010 17:17:03 +0000 (19:17 +0200)]
jim tests: use installed

Delete obsolete jim that comes with OpenOCD.

14 years agosrc: add loader src description
Spencer Oliver [Thu, 28 Oct 2010 09:08:16 +0000 (10:08 +0100)]
src: add loader src description

 - add comment where to find the various loaders src files.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agocontrib: add ram loader src code
Spencer Oliver [Thu, 28 Oct 2010 08:19:37 +0000 (09:19 +0100)]
contrib: add ram loader src code

Add src code for ram loaders to contrib directory.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoimx31pdk: use rclk w/1MHz fallback
Øyvind Harboe [Thu, 28 Oct 2010 06:34:41 +0000 (08:34 +0200)]
imx31pdk: use rclk w/1MHz fallback

measure_clk indicates ca. 3-4MHz, so 1MHz should be safe.

Added self_test proc used to test that rclk worked.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agohelp: help now works on configuration commands
Øyvind Harboe [Wed, 27 Oct 2010 06:37:54 +0000 (08:37 +0200)]
help: help now works on configuration commands

help would not show help for commands when the command
interpreter was in the wrong mode, which means that
e.g. "help newtap" didn't work, it wouldn't show the
"jtag newtap" help as it was a configuration command.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoMake systesetreq typos read sysresetreq instead
Peter Stuge [Sun, 24 Oct 2010 14:28:48 +0000 (16:28 +0200)]
Make systesetreq typos read sysresetreq instead

Signed-off-by: Peter Stuge <peter@stuge.se>
14 years agoRemove srst_pulls_trst from LPC1768 target
Peter Stuge [Sun, 24 Oct 2010 14:28:47 +0000 (16:28 +0200)]
Remove srst_pulls_trst from LPC1768 target

srst_pulls_trst may be true on some (broken) LPC1768 boards but is
not true in general for the LPC1768.

Signed-off-by: Peter Stuge <peter@stuge.se>
14 years agobuspirate: change handling of communication speed setting + create serial port open...
Michal Demin [Fri, 22 Oct 2010 21:26:43 +0000 (23:26 +0200)]
buspirate: change handling of communication speed setting + create serial port open function

Signed-off-by: Michal Demin <michaldemin@gmail.com>
14 years agobuspirate: Serial port was not correctly closed.
Michal Demin [Fri, 22 Oct 2010 19:06:31 +0000 (21:06 +0200)]
buspirate: Serial port was not correctly closed.

Signed-off-by: Michal Demin <michaldemin@gmail.com>
14 years agoTARGET: review handle_load_image_command()
Antonio Borneo [Tue, 12 Oct 2010 08:47:24 +0000 (16:47 +0800)]
TARGET: review handle_load_image_command()

Collect variable definitions.
Report syntax error to command dispatcher.
Propagate error when unable to open file.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agoTARGET: fix segfault in handle_dump_image_command()
Antonio Borneo [Tue, 12 Oct 2010 08:08:35 +0000 (16:08 +0800)]
TARGET: fix segfault in handle_dump_image_command()

The struct fileio is used after fileio_close().
Move fileio_close() after last usage.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agoswj-dp.tcl (SWD infrastructure #1)
David Brownell [Sun, 10 Oct 2010 21:41:11 +0000 (14:41 -0700)]
swj-dp.tcl (SWD infrastructure #1)

Provide new helper proc that can set up either an SWD or JTAG DAP
based on the transport which is in use -- mostly for SWJ-DP.

 Also update some SWJ-DP based chips/targets to use it.  The goal
is making SWD-vs-JTAG transparent in most places.  SWJ-DP based chips
really need this flexible configuration to cope with debug adapters
that support different transports, without needing new target configs
for each transport or adapter.

For JTAG-DP, callers will use "jtag newtap" directly, as today; only
one chip-level transport option exists.

For SW-DP (e.g. LPC1[13]xx or EFM32, they'll use "swd newdap" directly
(part of an upcoming SWD transport patch).  Again, only one transport
option exists, so hard-wiring is appropriate there.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoadd JLINK protocol doc ref
David Brownell [Sun, 10 Oct 2010 21:27:35 +0000 (14:27 -0700)]
add JLINK protocol doc ref

Provide URL for a recent
version of JLINK protocol.
Signed-Off-By: David Brownell <dbrownell@users.sourceforge.net>
14 years agobuild: remove warn_unused_result errors
Spencer Oliver [Tue, 5 Oct 2010 15:29:37 +0000 (16:29 +0100)]
build: remove warn_unused_result errors

Remove any build errors for strtol when building release
version of openocd.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agogdbderver: fix gdb pipe startup overflow
Spencer Oliver [Tue, 5 Oct 2010 14:00:40 +0000 (15:00 +0100)]
gdbderver: fix gdb pipe startup overflow

When usng gdb pipes we need to keep openocd output at a minimum,
otherwise the gdb stdin will overflow and fail.
Make the calls to gdb_port and log_output synchronous to stop this.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agogdbserver: fix gdb_port memory leak
Spencer Oliver [Mon, 4 Oct 2010 19:35:33 +0000 (20:35 +0100)]
gdbserver: fix gdb_port memory leak

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoserver: fix server pipe windows support
Spencer Oliver [Mon, 4 Oct 2010 19:34:47 +0000 (20:34 +0100)]
server: fix server pipe windows support

commit 50d5441e2a615fb2c44b41a777e4373901f7a2e6 caused
native windows build to fail.

Firstly this patch fixes the build issue, but it also disables support
for named pipes under Windows. Windows does not support posix named
pipes.
A cross-platfom access layer will need creating before support can be
enabled again.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agozy1000: add : port number syntax for tftp filing system
Øyvind Harboe [Sun, 5 Sep 2010 19:20:15 +0000 (21:20 +0200)]
zy1000: add : port number syntax for tftp filing system

Allows using non-standard port number. Default to port 69.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agopipes: add documentation for pipes
Øyvind Harboe [Mon, 27 Sep 2010 20:55:30 +0000 (22:55 +0200)]
pipes: add documentation for pipes

Stick with the name "gdb_port" even if this command
can be used for other things(disable, named pipes,
anonymous stdin/out pipe). "port" is correct for
probably more than 90% of use cases, if not more.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoserver: add support for pipes
Øyvind Harboe [Mon, 27 Sep 2010 06:50:49 +0000 (08:50 +0200)]
server: add support for pipes

-p/--pipe is now deprecated. Use '-c "gdb_port pipe;log_output openocd.log"'
instead. Warning logged.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoserver: specify port as a string
Øyvind Harboe [Mon, 27 Sep 2010 06:48:31 +0000 (08:48 +0200)]
server: specify port as a string

This will allow switching to using named pipes.

Split this out as a seperate commit to make changes
easier to follow.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoserver: read/write now goes through connection fn's
Øyvind Harboe [Mon, 27 Sep 2010 07:24:51 +0000 (09:24 +0200)]
server: read/write now goes through connection fn's

depending on whether the connection is over a socket
or pipe, the read is done differently.

pipes can return -1 when writing 0 bytes, make 0 byte
writes a successful no-op. 0 byte writes falls out
naturally of tcl server code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoserver: split file descriptors in in/out fd's
Øyvind Harboe [Mon, 27 Sep 2010 06:26:31 +0000 (08:26 +0200)]
server: split file descriptors in in/out fd's

pipes have different fd's for in/out. This makes the
code more orthogonal and prepares for adding pipes.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoserver: rely on ctrl-c to stop openocd
Øyvind Harboe [Sun, 26 Sep 2010 17:30:31 +0000 (19:30 +0200)]
server: rely on ctrl-c to stop openocd

there was special support to support pressing 'x' to quit
openocd. ctrl-c is sufficient. The main server loop is already
complicated enough.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agolog: remove hack to redirect logs when pipes are in use
Øyvind Harboe [Sun, 26 Sep 2010 16:24:36 +0000 (18:24 +0200)]
log: remove hack to redirect logs when pipes are in use

There is an explicit command "log_output" that can
be used to redirect log output to a file, no need
for a hack in the first place.

Before enabling pipes, use "log_output foo" to redirect
log output to the "foo" files.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoUpdate ep93xx and at91rm9200 drivers
Luca Bruno [Mon, 27 Sep 2010 14:21:04 +0000 (16:21 +0200)]
Update ep93xx and at91rm9200 drivers

ep93xx and at91rm9200 are conditionally built only on arm and were not
updated to reflect changes in command registration handler.
This patch makes them properly compile again, fixing a build failure
experienced on Debian armel.

Signed-off-by: Luca Bruno <lucab@debian.org>
Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
14 years agofileio: fileio_size() can now fail
Øyvind Harboe [Wed, 29 Sep 2010 07:11:01 +0000 (09:11 +0200)]
fileio: fileio_size() can now fail

Part of making the fileio API more robust.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agofileio: refactor struct fileio to be an opaque structure
Øyvind Harboe [Tue, 28 Sep 2010 13:37:56 +0000 (15:37 +0200)]
fileio: refactor struct fileio to be an opaque structure

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoTCL scripts: fix ocd_mem2array/mem2array
Antonio Borneo [Tue, 28 Sep 2010 08:37:19 +0000 (16:37 +0800)]
TCL scripts: fix ocd_mem2array/mem2array

In previous patch, I have introduced again the symbol
"ocd_mem2array", now replaced by "mem2array".
Fix the error.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agoflash: fix error handling
Øyvind Harboe [Mon, 27 Sep 2010 14:45:25 +0000 (16:45 +0200)]
flash: fix error handling

memory leaks and missing check on memory allocation.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoimage: fix spelling mistake
Øyvind Harboe [Mon, 27 Sep 2010 14:29:08 +0000 (16:29 +0200)]
image: fix spelling mistake

struct imageection => struct imagesection

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoFix omap3_dbginit to write to physical memory.
Zachary T Welch [Fri, 24 Sep 2010 23:13:04 +0000 (16:13 -0700)]
Fix omap3_dbginit to write to physical memory.

Setting the OMAP3530 DBGEN bit must be done in physical memory, so
update omap3_dbginit callback to use the new 'mww phys' command syntax.

14 years agozy1000: fix non-JTAG master build
Øyvind Harboe [Sun, 26 Sep 2010 18:37:53 +0000 (20:37 +0200)]
zy1000: fix non-JTAG master build

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agogdb: fix blank line at top
Øyvind Harboe [Sun, 26 Sep 2010 16:01:54 +0000 (18:01 +0200)]
gdb: fix blank line at top

snuck in at some point...

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojtagdp: remove #if 0'd kludges and explain why the code is correct
Øyvind Harboe [Tue, 21 Sep 2010 20:13:09 +0000 (22:13 +0200)]
jtagdp: remove #if 0'd kludges and explain why the code is correct

short story: if the JTAG clock is too high, then the
behavior will be flaky and kludging the code may
seem to make things beter, but really it's just a red
herring.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoflash: fix error handling
Øyvind Harboe [Mon, 20 Sep 2010 07:22:46 +0000 (09:22 +0200)]
flash: fix error handling

sensible error must be reported at failure site

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoembeddedice: fix error handling
Øyvind Harboe [Mon, 20 Sep 2010 07:40:09 +0000 (09:40 +0200)]
embeddedice: fix error handling

error is now reported at failure site.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoTCL scripts: collect duplicated procedures
Antonio Borneo [Tue, 21 Sep 2010 08:06:37 +0000 (16:06 +0800)]
TCL scripts: collect duplicated procedures

TCL procedures mrw and mmw, originally in DaVinci target code,
are duplicated in other TCL scripts.
Moved in a common helper file, and added help/usage description.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
14 years agostartup: removed capture_catch
Øyvind Harboe [Fri, 10 Sep 2010 09:42:12 +0000 (11:42 +0200)]
startup: removed capture_catch

not used.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agohelper: fix flaky capture command
Øyvind Harboe [Mon, 20 Sep 2010 09:50:32 +0000 (11:50 +0200)]
helper: fix flaky capture command

capture of progress output would get polling
results. This will break in the example below
where polling output would override the tcl
return value.

capture {sleep 10000; set abc def}

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agotcl_server: switch to ctrl-z
Øyvind Harboe [Wed, 8 Sep 2010 18:04:27 +0000 (20:04 +0200)]
tcl_server: switch to ctrl-z

by using ctrl-z instead of line end, multi-line tcl scripts
can be handled.

Testing: send ctrl-z a couple of times to make telnet enter the
mode where it sends ctrl-z unencoded.

Programs that talk to the tcl_server can send ctrl-z to
indicate end of tcl-let to be executed without having
to worry about telnet protocols.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agologging: turn of stdout/stderr buffering
Øyvind Harboe [Fri, 17 Sep 2010 23:37:42 +0000 (01:37 +0200)]
logging: turn of stdout/stderr buffering

with this buffering disabled fancier logging scripts will
be able to process each line as it is output.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: add support for Linux host
Øyvind Harboe [Tue, 7 Sep 2010 18:27:45 +0000 (20:27 +0200)]
zy1000: add support for Linux host

used /dev/mem and mmem() to memory map JTAG registers
into user space and used new configure options to exclude
eCos specific code.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojtag: build jtag first because it generates header files
Øyvind Harboe [Mon, 20 Sep 2010 11:44:03 +0000 (13:44 +0200)]
jtag: build jtag first because it generates header files

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agowarnings: fix alignment warnings
Øyvind Harboe [Fri, 3 Sep 2010 20:49:37 +0000 (22:49 +0200)]
warnings: fix alignment warnings

These warnings are for architectures that do not
support non-aligned word access.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: split out configure option for eCos and JTAG master
Øyvind Harboe [Tue, 7 Sep 2010 18:19:05 +0000 (20:19 +0200)]
zy1000: split out configure option for eCos and JTAG master

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agozy1000: remove obsolete debug code
Øyvind Harboe [Tue, 7 Sep 2010 18:22:38 +0000 (20:22 +0200)]
zy1000: remove obsolete debug code

Obsolete code clutter

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agotcl: remove incomplete unused tcl file
Øyvind Harboe [Mon, 20 Sep 2010 07:23:24 +0000 (09:23 +0200)]
tcl: remove incomplete unused tcl file

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoxscale: some wp detail added to user manual
Mike Dunn [Sun, 19 Sep 2010 22:30:59 +0000 (15:30 -0700)]
xscale: some wp detail added to user manual

Hi everyone (again),

Watchpoints on xscale are quirky, so I thought a little explanation in the
user's manual was warranted.

Comments gratefully received.

Last one, Øyvind :-)

Thanks,
Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
14 years agoxscale: check that wp length does not exceed address
Mike Dunn [Sun, 19 Sep 2010 21:48:51 +0000 (14:48 -0700)]
xscale: check that wp length does not exceed address

Hi everyone,

A while back I sent in a patch that adds support for watchpoint lengths greater
than four on xscale.  It's been working well, until the other day, when it
caused an unexpected debug exception.  Looking into this I realized there is a
case where it breaks: when the length arg is greater than the base address.
This is a consequence of the way the hardware works.  Don't see a work-around,
so I added code to xscale_add_watchpoint() to check for and disallow this
combination.

Some more detail... xscale watchpoint hardware does not support a length
directly.  Instead, a mask value can be specified (not to be confused with the
optional mask arg to the wp command, which xscale does not support).  Any bits
set in the mask are ignored when the watchpoint hardware compares the access
address to the watchpoint address.  So as long as the length is a power of two,
setting the mask to length-1 effectively specifies the length.  Or so I thought,
until I realized that if the length exceeds the base address, *all* bits of the
base address are ignored by the comaparator, and the watchpoint range
effectively becomes 0 .. length.

Questions, comments, criticisms gratefully received.

Thanks,
Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
14 years agoxscale: bp/wp: additional LOG_ERROR on failure
Mike Dunn [Sun, 19 Sep 2010 21:35:46 +0000 (14:35 -0700)]
xscale: bp/wp: additional LOG_ERROR on failure

Hi everyone,

Added more LOG_ERROR messsages to watchpoint and breakpoint code, given that the
infrastructure no longer interprets returned error codes.  Also changed
existing LOG_INFO and LOG_WARNING to LOG_ERROR for cases where an error is
returned.

Note that the check of the target state is superflous, since the infrastruture
code currently checks this before calling target code.  Is this being
reconsidered as well?  Also, should we stop returning anything other than
ERROR_OK and ERROR_FAIL?

Comments gratefully received.

Thanks,
Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
14 years agoAM/DM37x: Unify configuration scripts and add support for TI Beagleboard xM.
Karl Kurbjun [Sat, 18 Sep 2010 15:55:29 +0000 (09:55 -0600)]
AM/DM37x: Unify configuration scripts and add support for TI Beagleboard xM.

14 years agocfi: add sst39vf6401b
Flemming Futtrup [Wed, 15 Sep 2010 09:34:57 +0000 (11:34 +0200)]
cfi: add sst39vf6401b

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agobreakpoints: fix error handling
Øyvind Harboe [Mon, 13 Sep 2010 19:59:39 +0000 (21:59 +0200)]
breakpoints: fix error handling

do not try to interpret "retval" into a string, just
amend a bit about the context of the already reported
error.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoboard scripts: Marvell PXA270M processor has a new TAPID: 0x89265013
Takács Áron [Tue, 14 Sep 2010 09:15:35 +0000 (11:15 +0200)]
board scripts: Marvell PXA270M processor has a new TAPID: 0x89265013

the new Marvell PXA270M processor has a new TAPID: 0x89265013.
Attached you will find a patch for target/pxa270.cfg that will handle this.

I have also attached a board/colibri.cfg file to support the Colibri
PXA270 module by Toradex.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoxscale: fix sw breakpoints for thumb; set bp immediately
Mike Dunn [Mon, 13 Sep 2010 19:45:37 +0000 (12:45 -0700)]
xscale: fix sw breakpoints for thumb; set bp immediately

Hi everyone,

Version 2 of this patch.  Code added to breakpoints.c was removed from previous
patch, and item 3 added, per discussion with Øyvind regarding error reporting.
Item 4 added, which I just noticed.

I tried to use a software breakpoint in thumb code on the xscale for the first
time recently, and was surprised to find that it didn't work.  The result was
this patch, which does four things:

1): fix trivial cut-n-paste error that caused thumb breakpoints to not work
2): call xscale_set_breakpoint() from xscale_add_breakpoint()
3): log error on data abort in xscale_write_memory()
4): fixed incorrect error code returned by xscale_set_breakpoint() when no
    breakpoint register is available; added comment

Item 2 not only makes the xscale breakpoint code consistent with other targets,
but also alerts the user immediately if an error occurs when writing the
breakpoint instruction to target memory (previously, xscale_set_breakpoint() was
not called until execution resumed).  Also, calling xscale_breakpoint_set() as
part of the call chain starting with handle_bp_command() and propagating the
return status back up the chain avoids the situation where OpenOCD "thinks" the
breakpoint is set when in reality an error ocurred.

Item 3 provides a helpful message for a common reason for failure to set sw
breakpoint.

This was thoroughly tested, mindful of the fact that breakpoint management is
somewhat dicey during single-stepping.

Comments and criticisms of course gratefully received.

Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agopropagate return status of set_breakpoint() up call chain
Mike Dunn [Sun, 12 Sep 2010 19:05:07 +0000 (12:05 -0700)]
propagate return status of set_breakpoint() up call chain

Hi everyone,

I figured since I was poking around in the breakpoint code on other arches, I'd
add this change to those arches that don't do it already.  This patch propagates
the return code of <arch>_set_breakpoint() up the call stack.  This ensures that
the higher layer breakpoint infrastructure is aware that an error ocurred, in
which case the breakpoint is not recorded.

Normally I wouldn't touch code that I can't test, but the code is very
uniform across architectures, and the change is rather benign, so I figured
after careful inspection that it is safe.  If the maintainers or others think
this is imprudent, the patch can be dropped.

Also changed the error code to something more appropriate in two cases where
hardware resources are unavailable.

Comments and criticisms of course gratefully received.

Mike

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agohelper: add stacktrace command that returns error stacktrace
Øyvind Harboe [Sun, 12 Sep 2010 17:29:37 +0000 (19:29 +0200)]
helper: add stacktrace command that returns error stacktrace

Ability to access the stacktrace from a script is quite
handy.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojim: fix crash when using Jim_ListInsertElements
Øyvind Harboe [Sun, 12 Sep 2010 18:16:55 +0000 (20:16 +0200)]
jim: fix crash when using Jim_ListInsertElements

Jim_ListInsertElements was simply forgotten from the
fn that registered all the APIs.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoversion command: make it scriptable
Øyvind Harboe [Fri, 10 Sep 2010 11:16:13 +0000 (13:16 +0200)]
version command: make it scriptable

you can now set a variable in a script like set version [version].

Also version takes an optional argument "git" to show git version
of source. If git is not installed during the build, then this
will yield an error that is ignored during the build and "version git"
returns an empty string.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agocommand: capture command now handles both types commands
Øyvind Harboe [Fri, 10 Sep 2010 17:28:11 +0000 (19:28 +0200)]
command: capture command now handles both types commands

Commands that output progress output and no return value
will have the progress output captured.

Commands that do not output progress output(tcl commands)
will return the tcl return value instead.

The advantage here is that it is no longer necessary to
consider which command one is capturing, it works for
either.

Example #1: capture progress output:

set foo [capture help]

Example #2: capture tcl return value

set foo [capture {set abc def}]

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agocfi: random crash in cfi_probe() fixed
Øyvind Harboe [Fri, 10 Sep 2010 08:22:14 +0000 (10:22 +0200)]
cfi: random crash in cfi_probe() fixed

for non_cfi cfi chips free() was invoked on rodata.

The mystery is why this bug has survived for so long.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agocfi: tighten up type usage a bit
Øyvind Harboe [Fri, 10 Sep 2010 08:20:06 +0000 (10:20 +0200)]
cfi: tighten up type usage a bit

sizeof() is a bit less scary than seing assumption
about size of type, no bug as such.

Use NULL instead of 0 for pointers. More obvious that
it is a pointer from code inspection.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoxscale: mark xscale registers invalid on debug entry
Mike Dunn [Thu, 9 Sep 2010 02:13:14 +0000 (19:13 -0700)]
xscale: mark xscale registers invalid on debug entry

Hi everyone,

This simple patch fixes a problem I noticed on the xscale where incorrect values
are sometimes reported by the reg command.  The problem can occur when
requesting the value of registers in the xscale-specific register cache.  With a
couple of exceptions, none of the registers in the xscale register cache are
automatically retrieved on debug entry.  This is probably fine, as they are
unlikely to be needed on a regular basis during a typical debug session, and
they can be retrieved when explicitly requested by name using the reg command.
The problem is that once this is done, the register remains marked as valid for
the remainder of the OpenOCD session, and the reg command will henceforth always
report the same value because it is obtained from the cache and is never again
retrieved from the debug handler on the target.

The fix is to mark all registers in the xscale register cache as invalid on
debug entry (before the two exceptions are retrieved), thus forcing retrieval
(when requested) from the target across resumptions in execution, and avoiding
the reporting of stale values.

Small addition change by Øyvind: change 'i' to unsigned to fix compiler
warning for xscale_debug_entry() fn.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoRemove duplicated initialization
Alexander Stein [Wed, 8 Sep 2010 08:17:54 +0000 (10:17 +0200)]
Remove duplicated initialization

I a mail conversation with Øyvind we stated that speed may not be set at
all on case CLOCK_MODE_KHZ and CLOCK_MODE_RCLK. Also there isn't proper
error propagation adapter_khz_to_speed or jtag_rclk_to_speed.
So jtag_get_speed may need some rewrite for error propagation.

CC: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agowarning: fix silly -O3 warning
Øyvind Harboe [Tue, 7 Sep 2010 16:38:06 +0000 (18:38 +0200)]
warning: fix silly -O3 warning

Some versions of GCC don't pick up that local variables
are set in all code paths.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojtag: fix regression with dummy driver and when starting OpenOCD with target powered...
Øyvind Harboe [Wed, 1 Sep 2010 21:36:31 +0000 (23:36 +0200)]
jtag: fix regression with dummy driver and when starting OpenOCD with target powered down

Do not fail startup if communication with target is
not possible.

OpenOCD supports launching without a target connected
or the target powered down.

The user will typically power up the target and issue
a "reset init" + load his application after OpenOCD
is started then.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoNumonyx M29W160ET patch
Wookey [Tue, 31 Aug 2010 12:53:50 +0000 (13:53 +0100)]
Numonyx M29W160ET patch

Someone called David Carne popped up on IRC and offered a fix (as he's not
on this list so can;t post here). I am just passing it on. (thanx David)

 10:54 < davidc__> Basically; the Numonyx M29W160ET has an incorrect CFI PRI
             block; it describes the erase blocks backwards
 10:54 < davidc__> the linked patch has a fixup for that part [really trivial]:

14 years agocortex m3: add cortex_m3 reset_config cmd
Spencer Oliver [Wed, 25 Aug 2010 19:29:22 +0000 (20:29 +0100)]
cortex m3: add cortex_m3 reset_config cmd

This new cmd adds the ability to choose the Cortex-M3
reset method used.
It defaults to using SRST for reset if available otherwise
it falls back to using NVIC VECTRESET. This is known to work
on all cores.

Move any luminary specific reset handling to the stellaris cfg file.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agoflash: increase stellaris flash loader buffer
Spencer Oliver [Tue, 24 Aug 2010 19:52:04 +0000 (20:52 +0100)]
flash: increase stellaris flash loader buffer

This speeds up programming for targets with more working area,

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agocfg: update Luminary config files
Spencer Oliver [Tue, 24 Aug 2010 19:50:20 +0000 (20:50 +0100)]
cfg: update Luminary config files

 - Update all Luminary config's to use a common target/stellaris.cfg.
 - Add Luminary ek-lm3s6965 config.
 - Increase working area for boards with more ram.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
14 years agobitq: unshadow pause()
David Brownell [Fri, 27 Aug 2010 22:16:39 +0000 (15:16 -0700)]
bitq: unshadow pause()

bitq.c: In function ‘bitq_scan_field’:
bitq.c:224: error: declaration of ‘pause’ shadows a global declaration
/usr/include/unistd.h:429: error: shadowed declaration is here

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoimx35pdk: fix clock and reset delays
Øyvind Harboe [Thu, 19 Aug 2010 14:06:45 +0000 (16:06 +0200)]
imx35pdk: fix clock and reset delays

Use rclk and 100ms delay on ntrst

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agomcb1700: Keil MCB1700 w/1768 config script
Øyvind Harboe [Tue, 17 Aug 2010 19:51:36 +0000 (21:51 +0200)]
mcb1700: Keil MCB1700 w/1768 config script

Ca. 93kBytes/s flashing speed @ 10MHz JTAG clock

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoupdate more Stellaris EK board comments
David Brownell [Mon, 16 Aug 2010 12:25:37 +0000 (08:25 -0400)]
update more Stellaris EK board comments

Using the bundled JTAG/SWD debug support in JTAG mode
is optional on *all* of the EK boards.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agotwo NEWS updates
David Brownell [Mon, 16 Aug 2010 05:11:39 +0000 (01:11 -0400)]
two NEWS updates

Mention AVR32 AP7000 support.
Clarify ARM semihosting update was for V7M (not ARM9 etc).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoUpdate comments for some Stellaris EK boards.
David Brownell [Mon, 16 Aug 2010 04:36:52 +0000 (00:36 -0400)]
Update comments for some Stellaris EK boards.

These  don't need to use the on-board debuggers in JTAG mode.
Off-board is OK, as would be SWD mode.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
14 years agoavr32: basic target script
Oleksandr Tymoshenko [Sun, 15 Aug 2010 19:55:17 +0000 (21:55 +0200)]
avr32: basic target script

14 years agoat32ap7000 config file
David Brownell [Sun, 15 Aug 2010 19:54:01 +0000 (21:54 +0200)]
at32ap7000 config file

nice board to play with.

14 years agoavr32: work-in-progress
Oleksandr Tymoshenko [Sun, 15 Aug 2010 19:51:34 +0000 (21:51 +0200)]
avr32: work-in-progress

committed so as to ease cooperation and to let it be improved
over time.

So far it supports:
- halt/resume
- registers inspection
- memory inspection/modification

I'm still getting up to speed with OpenOCD internals and AVR32 so code is a little
bit messy and I'd appreciate any feedback.

14 years agoFix typo in usb_blaster_vid_pid error message
Catalin Patulea [Fri, 13 Aug 2010 22:41:18 +0000 (18:41 -0400)]
Fix typo in usb_blaster_vid_pid error message

14 years agoFix typo in documentation of usb_blaster_vid_pid command
Catalin Patulea [Fri, 13 Aug 2010 20:57:37 +0000 (16:57 -0400)]
Fix typo in documentation of usb_blaster_vid_pid command

14 years agolpc1768: turn down the jtag clock
Øyvind Harboe [Fri, 13 Aug 2010 10:59:36 +0000 (12:59 +0200)]
lpc1768: turn down the jtag clock

Tests should that it needs to be as low as 100kHz to be
stable.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agoAdded support for the Lisa/L jtag LEDs.
Piotr Esden-Tempski [Wed, 4 Aug 2010 05:04:46 +0000 (22:04 -0700)]
Added support for the Lisa/L jtag LEDs.

14 years agoAdded Lisa/L script as a target board.
Piotr Esden-Tempski [Wed, 4 Aug 2010 04:00:09 +0000 (21:00 -0700)]
Added Lisa/L script as a target board.

14 years agoAdded support for Lisa/L builtin JTAG interface.
Piotr Esden-Tempski [Wed, 4 Aug 2010 03:58:29 +0000 (20:58 -0700)]
Added support for Lisa/L builtin JTAG interface.

14 years agoat91cap7a-stk-sdram.cfg: faster reset
Øyvind Harboe [Thu, 12 Aug 2010 13:01:23 +0000 (15:01 +0200)]
at91cap7a-stk-sdram.cfg: faster reset

crank up JTAG speed as soon as clocks are set up.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
14 years agojtag: fix handling of 'tap enable' error
Thomas Koeller [Tue, 10 Aug 2010 12:56:45 +0000 (14:56 +0200)]
jtag: fix handling of 'tap enable' error

if a tap could not be _enabled_, the error message was
'failed to disable tap'. Fixed that. Also, display the failing
tap's name.

Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>