openocd.git
8 years agotarget: fix missing semihosting return path
Spencer Oliver [Mon, 9 Jan 2012 21:35:19 +0000 (21:35 +0000)]
target: fix missing semihosting return path

bug nicely caught by clang.

Change-Id: I7abf0fdd76666fb3eb1c83e3edfd01e0da485ffe
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/359
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoflash: support stm32f4x flash
Spencer Oliver [Wed, 4 Jan 2012 22:55:49 +0000 (22:55 +0000)]
flash: support stm32f4x flash

This uses the same controller as the stm32f2x family.

Change-Id: I931a9ceb0cd1219514d14b8b59475179e543dd0f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/338
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agoflash: use stm32f2x flash size register
Spencer Oliver [Wed, 4 Jan 2012 22:43:59 +0000 (22:43 +0000)]
flash: use stm32f2x flash size register

Use the flash size register to calculate flash info.

Change-Id: Ia230db8a08d440710c030a9e5001f20561c9f420
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/337
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agodocs: add initial st-link info
Spencer Oliver [Thu, 5 Jan 2012 10:31:03 +0000 (10:31 +0000)]
docs: add initial st-link info

Change-Id: I213bf26dec582fd8e273e604d43a6e849599dd50
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/340
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agocontrib: add stlink udev rules
Spencer Oliver [Wed, 4 Jan 2012 14:50:57 +0000 (14:50 +0000)]
contrib: add stlink udev rules

Change-Id: I3f11de8abfaf8821311a7aa0fd237006de3c2792
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/333
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agocfg: add stlink pseudo stm32 targets
Spencer Oliver [Wed, 4 Jan 2012 21:48:21 +0000 (21:48 +0000)]
cfg: add stlink pseudo stm32 targets

Change-Id: I71253c2090162b1214bbbb37396735bb9128f920
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/334
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
8 years agocfg: use consistent chipname
Spencer Oliver [Tue, 3 Jan 2012 21:42:49 +0000 (21:42 +0000)]
cfg: use consistent chipname

Change-Id: I41e0788f830d5ece13e6231a99d5b4013c9c678f
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/331
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
8 years agodocs: fix doxygen build
Spencer Oliver [Fri, 6 Jan 2012 17:15:38 +0000 (17:15 +0000)]
docs: fix doxygen build

This fixes issues with newer versions of doxygen

Change-Id: Id5d3287857cb154e26064b4ce37f6b72117d5254
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/350
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agortos: fix bug in error handling
Øyvind Harboe [Sat, 7 Jan 2012 08:55:54 +0000 (09:55 +0100)]
rtos: fix bug in error handling

checking for != ERROR_FAIL is broken.

Change-Id: Id7085afac653bb9c38d08928227a9ea402d8e6e9
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/351
Tested-by: jenkins
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodocs: whitespace fixes
Spencer Oliver [Thu, 5 Jan 2012 10:30:39 +0000 (10:30 +0000)]
docs: whitespace fixes

Change-Id: I9c6c7017ce3077bb131a05ea9b53a115506c94d9
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/339
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoChange return value on error.
Mathias K [Fri, 16 Dec 2011 06:48:39 +0000 (07:48 +0100)]
Change return value on error.

On wrong parameters a error is signalized to the calling function.

Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960
Signed-off-by: Mathias K <kesmtp@freenet.de>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/282
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agostlink: update to use ERROR_COMMAND_SYNTAX_ERROR
Spencer Oliver [Wed, 4 Jan 2012 17:36:56 +0000 (17:36 +0000)]
stlink: update to use ERROR_COMMAND_SYNTAX_ERROR

Change-Id: I21b669b09df65b56659d2f057cf389ba7b1cecfa
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/335
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoflash: introduce .usage field for nand and nor flash driver structure
Øyvind Harboe [Wed, 28 Dec 2011 12:10:52 +0000 (13:10 +0100)]
flash: introduce .usage field for nand and nor flash driver structure

Change-Id: I47e7ec8fa8c70d2addc3aa52d7c97e9e1e7bb662
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/301
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoretire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR
Øyvind Harboe [Wed, 28 Dec 2011 11:56:08 +0000 (12:56 +0100)]
retire ERROR_INVALID_ARGUMENTS and replace with ERROR_COMMAND_SYNTAX_ERROR

Change-Id: I6dee51e1fab1944085391f274a343cdb9014c7a4
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/300
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agocommand: print BUG warning when usage is missing
Mathias K [Sat, 24 Dec 2011 14:26:12 +0000 (15:26 +0100)]
command: print BUG warning when usage is missing

These error messages will prompt patches to be submitted for missing
.usage or empty fields. All of the below must be resolved before next
release.

The Jim defined commands are excluded from this checklist because the
help text can be set later than during command registration.

strlen(.usage) == 0 means that the command expects no arguments.

Updates to this patch in Gerrit to fix problems below are most
welcome. Anyone can push updated versions of a patch to Gerrit. If
there are no further updates to this patch within a week, it will be
pushed to the master branch to prompt more fixes.

These were caught by launching OpenOCD.

Error: BUG: command 'command' does not have the '.usage' field filled out
Error: BUG: command 'script' does not have the '.usage' field filled out
Error: BUG: command 'power_restore' does not have the '.usage' field filled out
Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out
Error: BUG: command 'measure_clk' does not have the '.usage' field filled out
Error: BUG: command 'exit' does not have the '.usage' field filled out
Error: BUG: command 'shutdown' does not have the '.usage' field filled out
Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out
Error: BUG: command 'interface_list' does not have the '.usage' field filled out
Error: BUG: command 'target' does not have the '.usage' field filled out
Error: BUG: command 'target init' does not have the '.usage' field filled out
Error: BUG: command 'flash' does not have the '.usage' field filled out
Error: BUG: command 'flash init' does not have the '.usage' field filled out
Error: BUG: command 'flash banks' does not have the '.usage' field filled out
Error: BUG: command 'nand' does not have the '.usage' field filled out
Error: BUG: command 'nand drivers' does not have the '.usage' field filled out
Error: BUG: command 'nand init' does not have the '.usage' field filled out
Error: BUG: command 'pld' does not have the '.usage' field filled out
Error: BUG: command 'pld init' does not have the '.usage' field filled out
Error: BUG: command 'mflash' does not have the '.usage' field filled out
Error: BUG: command 'mflash init' does not have the '.usage' field filled out
Error: BUG: command 'dummy' does not have the '.usage' field filled out
Error: BUG: command 'dummy foo' does not have the '.usage' field filled out
Error: BUG: command 'scan_chain' does not have the '.usage' field filled out
Error: BUG: command 'jtag' does not have the '.usage' field filled out
Error: BUG: command 'jtag init' does not have the '.usage' field filled out
Error: BUG: command 'arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'etm' does not have the '.usage' field filled out
Error: BUG: command 'arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'target_request' does not have the '.usage' field filled out
^C
oyvind@fierce:~/openocd$ openocd -c "interface dummy" -f board/at91eb40a.cfg 2>&1 | grep -w BUG
Error: BUG: command 'command' does not have the '.usage' field filled out
Error: BUG: command 'script' does not have the '.usage' field filled out
Error: BUG: command 'power_restore' does not have the '.usage' field filled out
Error: BUG: command 'srst_deasserted' does not have the '.usage' field filled out
Error: BUG: command 'measure_clk' does not have the '.usage' field filled out
Error: BUG: command 'exit' does not have the '.usage' field filled out
Error: BUG: command 'shutdown' does not have the '.usage' field filled out
Error: BUG: command 'gdb_sync' does not have the '.usage' field filled out
Error: BUG: command 'interface_list' does not have the '.usage' field filled out
Error: BUG: command 'target' does not have the '.usage' field filled out
Error: BUG: command 'target init' does not have the '.usage' field filled out
Error: BUG: command 'flash' does not have the '.usage' field filled out
Error: BUG: command 'flash init' does not have the '.usage' field filled out
Error: BUG: command 'flash banks' does not have the '.usage' field filled out
Error: BUG: command 'nand' does not have the '.usage' field filled out
Error: BUG: command 'nand drivers' does not have the '.usage' field filled out
Error: BUG: command 'nand init' does not have the '.usage' field filled out
Error: BUG: command 'pld' does not have the '.usage' field filled out
Error: BUG: command 'pld init' does not have the '.usage' field filled out
Error: BUG: command 'mflash' does not have the '.usage' field filled out
Error: BUG: command 'mflash init' does not have the '.usage' field filled out
Error: BUG: command 'dummy' does not have the '.usage' field filled out
Error: BUG: command 'dummy foo' does not have the '.usage' field filled out
Error: BUG: command 'scan_chain' does not have the '.usage' field filled out
Error: BUG: command 'jtag' does not have the '.usage' field filled out
Error: BUG: command 'jtag init' does not have the '.usage' field filled out
Error: BUG: command 'arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'etm' does not have the '.usage' field filled out
Error: BUG: command 'arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm' does not have the '.usage' field filled out
Error: BUG: command 'arm reg' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu etm' does not have the '.usage' field filled out
Error: BUG: command 'at91eb40a.cpu arm7_9' does not have the '.usage' field filled out
Error: BUG: command 'target_request' does not have the '.usage' field filled out

Change-Id: I2c3e529530a15d2295a1950ffc59e8f2fc661012
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/299
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agobuild: fix make dist
Spencer Oliver [Tue, 3 Jan 2012 22:53:47 +0000 (22:53 +0000)]
build: fix make dist

add missing files to distribution after previous commit.

Change-Id: I0e4b278c090c71d15dd059b6755c9821427cc8ab
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/332
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agoAdd STM32F2X/STLINK target config file.
Mathias K [Sat, 17 Dec 2011 09:18:07 +0000 (10:18 +0100)]
Add STM32F2X/STLINK target config file.

Change-Id: I02161fa05da993b5b966c31a706667d1bd91935d
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/287
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoAdd STLINK/V2 interface config file.
Mathias K [Sat, 17 Dec 2011 09:17:40 +0000 (10:17 +0100)]
Add STLINK/V2 interface config file.

Change-Id: I6df27ce619a5938ef854ff89bf76c6de4e122204
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/286
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoSTM32 ST-LINK target initial release
Mathias K [Sat, 17 Dec 2011 08:51:09 +0000 (09:51 +0100)]
STM32 ST-LINK target initial release

STM32 ST-LINK target  added.

Change-Id: Ibe2b7a3c0d5a8cf73d8680d6019adbdb62d68fa2
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/279
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoST-LINK USB initial release
Mathias K [Wed, 21 Dec 2011 16:03:11 +0000 (17:03 +0100)]
ST-LINK USB initial release

ST-Link USB support added.

Change-Id: I2812646f2895b1529ff3f911edbdce7fa0051c8f
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/261
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoMake jim functions public accessible.
Mathias K [Thu, 15 Dec 2011 10:36:33 +0000 (11:36 +0100)]
Make jim functions public accessible.

Change this 2 functions to make it accessible for other tcl interfaces.

Change-Id: Idee07fcc779941b037a05a40c021e3fb0b1a4a7a
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/277
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoMake cortex_m3 functions public accessible.
Mathias K [Thu, 15 Dec 2011 10:38:35 +0000 (11:38 +0100)]
Make cortex_m3 functions public accessible.

Change this functions to make it accessible for other
target implementations.

Change-Id: Ib41fc793cfb4de5439af026c2e8b52e7a9507c85
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/278
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoadd private data pointer to the tap interface
Mathias K [Thu, 1 Dec 2011 11:16:54 +0000 (12:16 +0100)]
add private data pointer to the tap interface

This will give us the ability to add special data structures and new
interfaces without rewriting the complete jtag engine.

Change-Id: I21a6e1daa96c5f4d111bbb734c7c1fbc2eaee227
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/244
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agohelper: fix arm11 help text
Spencer Oliver [Tue, 20 Dec 2011 16:15:52 +0000 (16:15 +0000)]
helper: fix arm11 help text

This fixes a long standing bug: see Trac #4
Increased help text recursion limit and added LOG_DEBUG so we can
catch future errors like this.

Change-Id: I5fac95c4486eaddaf1e88a27ecb1835168f87711
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/291
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agobuild: fix mingw build issues
Spencer Oliver [Fri, 23 Dec 2011 11:59:15 +0000 (11:59 +0000)]
build: fix mingw build issues

8901fca0270fec41b12c30c7dbd806d460548c5b broke the build under mingw, this
fixes that.

Change-Id: I22b91e220dac3b68cc576b65a9f1b8711e64263a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/298
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoRenamed mx2.{c,h} to mxc.{c,h} and added copyright notice
Erik Ahlén [Wed, 14 Dec 2011 09:32:53 +0000 (10:32 +0100)]
Renamed mx2.{c,h} to mxc.{c,h} and added copyright notice

Change-Id: I07a280acdce58b8af4a145cd6beafccbb59f20d7
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/272
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoDocumentation for mxc NAND flash controller
Erik Ahlén [Wed, 14 Dec 2011 12:05:06 +0000 (13:05 +0100)]
Documentation for mxc NAND flash controller

Change-Id: I9e552491e8b4737c01e4f8ae2b9a582b6ff2bc5d
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/273
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoAdded support for i.MX35 NAND Flash Controller (v2)
Erik Ahlén [Wed, 14 Dec 2011 09:10:29 +0000 (10:10 +0100)]
Added support for i.MX35 NAND Flash Controller (v2)

Change-Id: I7237ec29792b6a7ee690751fa7e6cba0846d5aa8
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/271
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoAdded command to enable/disable/query BI-swap for MXC NAND
Erik Ahlén [Tue, 13 Dec 2011 10:47:49 +0000 (11:47 +0100)]
Added command to enable/disable/query BI-swap for MXC NAND

Change-Id: Ifa3eb739afe0760a974b57c5a17cc3bf7704ba79
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/270
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoMade BI-swap optional in mxc.
Erik Ahlén [Tue, 13 Dec 2011 10:39:52 +0000 (11:39 +0100)]
Made BI-swap optional in mxc.

Change-Id: Ibdf3b1e415adcf1fdb38de25fe05da726ef58ca4
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/269
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoAdded board type as a parameter to mx2 NFC as they have different base addresses.
Erik Ahlén [Tue, 13 Dec 2011 10:19:17 +0000 (11:19 +0100)]
Added board type as a parameter to mx2 NFC as they have different base addresses.

Change-Id: I7bc326e9a8d9f6817f046a7faeebede567c53dd2
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/268
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoat91sam3XXX.cfg: Configure JTAG clock to 500 kHz.
Ulf Samuelsson [Tue, 20 Dec 2011 18:09:26 +0000 (19:09 +0100)]
at91sam3XXX.cfg: Configure JTAG clock to 500 kHz.

This affects all configurations including target/at91sam3XXX.cfg

Change-Id: I2c1e1edf0986d30e63f109604a38bf402ded369e
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
Reviewed-on: http://openocd.zylin.com/292
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoOlimex-ARM-USB-OCD-H: Add udev rule
Ulf Samuelsson [Tue, 20 Dec 2011 13:47:43 +0000 (14:47 +0100)]
Olimex-ARM-USB-OCD-H: Add udev rule

Change-Id: Ifc9a1f7fa9445e05560c335b5bba3a33caeccc51
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
Reviewed-on: http://openocd.zylin.com/288
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agojtag: only if an in_value storage is provided will the captured IR value be checked
Øyvind Harboe [Thu, 22 Dec 2011 12:14:00 +0000 (13:14 +0100)]
jtag: only if an in_value storage is provided will the captured IR value be checked

added comments and removed bogus assert.

Change-Id: Ic7aa56570a84834b1265df03d25a47fd11c4d626
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/297
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agogit should ignore patches from format-patch
Ulf Samuelsson [Wed, 21 Dec 2011 21:15:30 +0000 (22:15 +0100)]
git should ignore patches from format-patch

Change-Id: Iafce872fa7559180834532ba80941dec3db7d079
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
Reviewed-on: http://openocd.zylin.com/295
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agojtag: stop using sharp corner of JTAG API
Øyvind Harboe [Wed, 14 Dec 2011 06:30:33 +0000 (07:30 +0100)]
jtag: stop using sharp corner of JTAG API

this particular edge case of the JTAG API will no
longer be supported.

the in_value buffer must be provided by the caller when
the callback needs the buffer.

Change-Id: I552c72a64af6875f4aa4fa9b923194dcf3b57b64
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/265
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agojtag: make caller always allocate buffer
Øyvind Harboe [Tue, 13 Dec 2011 22:44:34 +0000 (23:44 +0100)]
jtag: make caller always allocate buffer

simplifies the API and there is only one remaining user at this point.

Is the implementation busted where the check does not actually happen
now?

Change-Id: I776a43766f5576a08df320f6fe41a2750d101bde
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/264
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agojtag: retire jtag_alloc_in_value32
Øyvind Harboe [Tue, 13 Dec 2011 22:28:10 +0000 (23:28 +0100)]
jtag: retire jtag_alloc_in_value32

no longer used after arm7/9tdmi.c stopped using it.

Change-Id: I65bfe67641970e63e8276cbd378aa68f5701a8d9
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/263
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agojtag: retire jtag_alloc_in_value32 API
Øyvind Harboe [Tue, 13 Dec 2011 22:21:06 +0000 (23:21 +0100)]
jtag: retire jtag_alloc_in_value32 API

not needed, reduce area of interface and sharp edges to
API.

Change-Id: I5347352e7595686634bd0de13fcf6de6e55027b0
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/262
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoSTM32F2x: check flash unlock, add mass erase
Mathias K [Fri, 16 Dec 2011 06:51:17 +0000 (07:51 +0100)]
STM32F2x: check flash unlock, add mass erase

Add verification of the flash unlock sequence and return an error if the
flash is still locked.
Add mass erase subcommand.

Change-Id: Id586b1eaf983a3f25b933847dd6608c15bf0b07e
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/281
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agobuild: libusb use AC_CHECK_HEADER
Spencer Oliver [Mon, 12 Dec 2011 15:15:00 +0000 (15:15 +0000)]
build: libusb use AC_CHECK_HEADER

use AC_CHECK_HEADER rather than AC_CHECK_HEADERS so that we do not
generate a unrequired HAVE_LIBUSB_1_0_LIBUSB_H define.

Change-Id: I23a93d3813716dce797ca1514fdcb84533454c31
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/259
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agobuild: update to using new AC_OUTPUT macro
Spencer Oliver [Mon, 12 Dec 2011 15:11:06 +0000 (15:11 +0000)]
build: update to using new AC_OUTPUT macro

Change-Id: I4937fac73345a85fcad62a2aeb0a106bd4a62467
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/258
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
8 years agobuild: correctly quote m4 parameters
Spencer Oliver [Mon, 12 Dec 2011 15:10:26 +0000 (15:10 +0000)]
build: correctly quote m4 parameters

Change-Id: If7ccb52c107cb4ad7629ffcf237f9003f60e63d0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/257
Tested-by: jenkins
8 years agoRenamed mx2/imx27 to mxc.
Erik Ahlén [Tue, 13 Dec 2011 09:24:11 +0000 (10:24 +0100)]
Renamed mx2/imx27 to mxc.

Renamed all functions, enums, structs and defines from mx2/imx27 to mxc. This is in preparation of adding support for mx35 NFC(v2).

Change-Id: I92ad23f0cfab605215bbf0d5846c5c288423facf
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/267
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoIndentation and white space fixes.
Erik Ahlén [Tue, 13 Dec 2011 08:34:33 +0000 (09:34 +0100)]
Indentation and white space fixes.

Change-Id: Iffbaefea4f3d5e9b56b3c36496b44969d7c07e82
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/266
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoInitialize return value.
Mathias K [Thu, 15 Dec 2011 16:43:23 +0000 (17:43 +0100)]
Initialize return value.

Because no future error checking we will initialize the pointer to
a know value.

Change-Id: I2466eeb413245a398927ec9f3742c2a9a3d51baf
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/283
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agocheckpatch: fix false indent trigger
Spencer Oliver [Fri, 16 Dec 2011 10:48:53 +0000 (10:48 +0000)]
checkpatch: fix false indent trigger

we have changed the indent to 4 to match OpenOCD coding style.

Change-Id: I4870a3410eb20fc2f6df6a3e5891d4d4e598131a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/285
Tested-by: jenkins
8 years agocheckpatch: disable extern and switch indent checks
Spencer Oliver [Fri, 16 Dec 2011 10:04:43 +0000 (10:04 +0000)]
checkpatch: disable extern and switch indent checks

We allow extern's in c files so disable checkpatch checks.

Change-Id: Ia649585cd70ec45289c4edaf26c1fd773a140db4
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/284
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoChange checkpatch.pl tab expanding to 4 characters.
Erik Ahlén [Thu, 15 Dec 2011 08:43:37 +0000 (09:43 +0100)]
Change checkpatch.pl tab expanding to 4 characters.

The C coding style guide says that tab width is 4 characters but checkpatch.pl expands tabs to 8 characters which produces false negatives.

Change-Id: Ibdabbb55269b7cf6bcd38042cccb8bd235e42ce2
Signed-off-by: Erik Ahlén <erik.ahlen@avalonenterprise.com>
Reviewed-on: http://openocd.zylin.com/275
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoUpdating FSF Address.
Dean Glazeski [Thu, 15 Dec 2011 06:24:29 +0000 (00:24 -0600)]
Updating FSF Address.

Change-Id: Ic6895b89e8798a3636333dd50a8540eae643719a
Signed-off-by: Dean Glazeski <dnglaze@gmail.com>
Reviewed-on: http://openocd.zylin.com/274
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agozy1000: fix crash in JTAG over TCP/IP
Øyvind Harboe [Tue, 13 Dec 2011 16:57:20 +0000 (17:57 +0100)]
zy1000: fix crash in JTAG over TCP/IP

disable asynchronous callbacks and reads as minidriver requires
reads and callbacks to be synchronous.

Could possibly be fixed by some design work.

Change-Id: I7ca79a551085b2e8ba6928e1762d1baed6e95d4b
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/260
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agojlink libusb-1.0 driver.
Mauro Gamba [Mon, 21 Nov 2011 16:57:22 +0000 (17:57 +0100)]
jlink libusb-1.0 driver.

jlink modified to use the new usb abstaction layer.
During the configuration process we can select if use
libusb0 or libusb-1.0 library for this driver.

Change-Id: I70bc9ee2f89b7597e0f64ea80cad7f1b9070f01b
Signed-off-by: Mauro Gamba <maurillo71@gmail.com>
Reviewed-on: http://openocd.zylin.com/236
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoHACKING: add explanation why we want cool-off times as long as a week or two
Øyvind Harboe [Wed, 7 Dec 2011 14:36:41 +0000 (15:36 +0100)]
HACKING: add explanation why we want cool-off times as long as a week or two

Change-Id: I281e9145f43bc7ac173e02c4e209834f0deaae2b
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/254
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - indent fix
rodrigo_l_rosa [Mon, 5 Dec 2011 19:22:27 +0000 (11:22 -0800)]
dsp5680xx - indent fix

no logic changes, only coding style (spaces to tabs, etc)

Change-Id: I5933447c633990e103bc62d088ca2e12f11f031d
Signed-off-by: rodrigo_l_rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/253
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoTCL/SPEAr: default one DDR chip
Antonio Borneo [Fri, 2 Dec 2011 11:23:54 +0000 (19:23 +0800)]
TCL/SPEAr: default one DDR chip

Handle default case of single DDR chip
Propagate global variable for multi DDR chip

Change-Id: I315380f91ee7fcc2976437aa5836d88a7964fc9d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/251
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agomake checkpatch.sh take an optional 'since' refspec
Andreas Fritiofson [Thu, 1 Dec 2011 20:25:43 +0000 (21:25 +0100)]
make checkpatch.sh take an optional 'since' refspec

Change-Id: I793778037db08bd5462f61b9bcafd484708cc1b6
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/250
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoHACKING - checkpatch before pushing makes life quicker
rodrigo_l_rosa [Sat, 3 Dec 2011 20:17:06 +0000 (12:17 -0800)]
HACKING - checkpatch before pushing makes life quicker

Change-Id: I4c3cde2aae7bdea138413e373ac986be3efd54de
Signed-off-by: rodrigo_l_rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/252
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agolibusb: Fix build issues under cygwin/mingw
Spencer Oliver [Mon, 28 Nov 2011 14:56:13 +0000 (14:56 +0000)]
libusb: Fix build issues under cygwin/mingw

This fixes issues with the folliwing patch under cygwin/mingw builds.
http://openocd.zylin.com/236

Change-Id: I7dd0b2d09cc64568bc99b16aa32e791a8273c5db
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/240
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Mauro Gamba <maurillo71@gmail.com>
8 years agogdb_server: use strndup to allocate debug messages
Spencer Oliver [Thu, 1 Dec 2011 12:48:31 +0000 (12:48 +0000)]
gdb_server: use strndup to allocate debug messages

Lets be consistent and use strndup to allocate the debug buffer.

Change-Id: I535ad270ebfeae6e09d28372ab3749c822971223
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/245
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoopenocd.c: whitespace cleanup
Spencer Oliver [Wed, 30 Nov 2011 09:54:19 +0000 (09:54 +0000)]
openocd.c: whitespace cleanup

Change-Id: Ieb8c1e4eb72f66a6343b169a12a058555d67069e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/242
Tested-by: jenkins
8 years agoFix remaining incorrect reference to target/at91sam3uXX.cfg
Peter Stuge [Fri, 2 Dec 2011 06:19:57 +0000 (07:19 +0100)]
Fix remaining incorrect reference to target/at91sam3uXX.cfg

Commit 1794e5ee5452c83b5bef6d0a5a8a3f23d647e9c6 renamed the file to
have all lowercase characters according to most references to the
file, but the commit didn't change the existing reference to the
old filename.

Change-Id: I380e52e947a8091d48cf010e3919bf2caed7fdff
Signed-off-by: Peter Stuge <peter@stuge.se>
Reviewed-on: http://openocd.zylin.com/248
Tested-by: jenkins
8 years agomake sure file name case of at91sam3uxx matches what other files include
Harald Welte [Thu, 1 Dec 2011 16:51:35 +0000 (17:51 +0100)]
make sure file name case of at91sam3uxx matches what other files include

Before this patch, at91sam3u4c.cfg includes "at91sam3uxx.cfg" which
doesn't exist - the filename was at91sam3uXX.

However, many operating systems have case sensitive file names!

Change-Id: I8b2f987f1f4214269b80ef5cba8177ce05ad90b6
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Reviewed-on: http://openocd.zylin.com/247
Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agobinarybuffer: use strndup to allocate string
Spencer Oliver [Thu, 1 Dec 2011 14:15:10 +0000 (14:15 +0000)]
binarybuffer: use strndup to allocate string

Change-Id: I65d8f37b18d5b5a798406b956f50ab7bb550e172
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/246
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoFix compile error when _DEBUG_GDB_IO_ is set
James Zhao [Wed, 30 Nov 2011 22:23:24 +0000 (14:23 -0800)]
Fix compile error when _DEBUG_GDB_IO_ is set

Compile error is encountered when _DEBUG_GDB_IO_ is set,
due to duplicate variables.
Fixed by renaming the variable.

Change-Id: I729c06e317fdb899142c9ceaf543b7f580088807
Signed-off-by: James Zhao <jamzhao@gmail.com>
Reviewed-on: http://openocd.zylin.com/243
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agotarget init sanity check
Mathias K [Tue, 29 Nov 2011 08:37:44 +0000 (09:37 +0100)]
target init sanity check

Add a test if the pointer to the target_init function in the target struct
is set before the function pointer is used.

Change-Id: Ie4ea542f64f35efce8c5bce2ced9b881bf283ec1
Signed-off-by: Mathias K <kesmtp@freenet.de>
Reviewed-on: http://openocd.zylin.com/241
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoAdd stack alignment support to RTOS awareness - needed for ARM ABI processors
Evan Hunter [Tue, 22 Nov 2011 06:14:56 +0000 (17:14 +1100)]
Add stack alignment support to RTOS awareness - needed for ARM ABI processors

Change-Id: I69a2f3d0606a97d48b7738561a85da87f458b82b
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/238
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agoFix unused variables error in amt_jtagaccel
Evan Hunter [Tue, 22 Nov 2011 05:05:39 +0000 (16:05 +1100)]
Fix unused variables error in amt_jtagaccel

Change-Id: Ic64cf4e3b5cf8c1ea75a13577728b0cb0d70068e
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/237
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - match page erase with mass erase
rodrigo_l_rosa [Mon, 21 Nov 2011 18:34:24 +0000 (10:34 -0800)]
dsp5680xx - match page erase with mass erase

when last==first==0 then mass erase is executed, it's faster.
the page marking was wrong in this case.

Change-Id: I5c579d59b5c4778cf057cb5986e086abdd4209b2
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/232
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - flash module clk to freescale cfg value
rodrigo_l_rosa [Sat, 19 Nov 2011 23:40:51 +0000 (15:40 -0800)]
dsp5680xx - flash module clk to freescale cfg value

the flash module clock was set according to a spreadsheet from freescale, now it's set according to the configuration file used by the Freescale Flash Programmer.
both work, but i think it's better to use the one used by a software that's made by Freescale (should be correct...)

Change-Id: I382197a3eb43dd47ff4b9b83d5e05008d5613fc6
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/223
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - mark erase after unlocking flash
rodrigo_l_rosa [Sat, 19 Nov 2011 23:39:20 +0000 (15:39 -0800)]
dsp5680xx - mark erase after unlocking flash

the unlocking procedure erases the flash mem (even if it wasn't locked), so it should be marked as erased after unlocking.

Change-Id: I5cc6a1e1d6cf4e1f243de532eff54111ffd66187
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/222
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - fix jtag debug request failure handling
rodrigo_l_rosa [Wed, 5 Oct 2011 01:17:25 +0000 (18:17 -0700)]
dsp5680xx - fix jtag debug request failure handling

if JTAG debug request fails then halting with a reset should be attempted.
the failure was ignored previously.

Change-Id: Ibec08e2e97f962d164a110c21aaa80bfc17b7f1a
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/221
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - separate debug from halt
rodrigo_l_rosa [Sat, 3 Sep 2011 06:22:21 +0000 (23:22 -0700)]
dsp5680xx - separate debug from halt

i had assumed two possible halt/debug states:
  - halted + debug mode
  - running + not debug mode
turns out this one also exists
  - halted + NOT in debug mode
added code to handle this in an appropiate way.

Change-Id: Ia0ddcd55d1890c90d100a9e6f5e84ed8dda812a3
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/220
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - fix - flashing algorithm check
rodrigo_l_rosa [Tue, 15 Nov 2011 16:14:32 +0000 (08:14 -0800)]
dsp5680xx - fix - flashing algorithm check

now the flash algorithm running on the 568013 checks the buffer_empty bit (instead of the command_finished bit) before trying to write a new word to the flash mem.
this should speed up the flashing procedure. since it is open loop, this change may reduce the risk of failure. flashing will fail if JTAG speed is such that the flash module cannot keep up.

also, the USTAT register is only read once, as suggested in the flow chart provided by freescale (per. ref. manual @ 6-11)

the last step of the flow chart, exiting after commands are complete, is not implemented.
the algorithm will stay waiting for more data. it is up to the PC side to *not* send more data.

Change-Id: I47fe4b50de7da85f80868f5986a89a7e2152616c
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/219
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - added more error codes
rodrigo_l_rosa [Sat, 3 Sep 2011 05:27:00 +0000 (22:27 -0700)]
dsp5680xx - added more error codes

Change-Id: I36962a0ab0cc9d1eb6a29d7e577c24c38cab946b
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/218
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - fix jtag status mask
rodrigo_l_rosa [Sat, 3 Sep 2011 05:25:53 +0000 (22:25 -0700)]
dsp5680xx - fix jtag status mask

Change-Id: I17a0f22cbeb20e4f6ea4065236243f93d826ccf0
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/217
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - relocating code
rodrigo_l_rosa [Sat, 3 Sep 2011 04:15:54 +0000 (21:15 -0700)]
dsp5680xx - relocating code

moved reset_jtag to the top, since it will be needed in future changes.
also send a define to the .h

Change-Id: I53ef9c02ffa70e7d0416364525a6fbfef855e222
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/216
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agodsp5680xx - error codes
rodrigo_l_rosa [Sat, 3 Sep 2011 03:31:12 +0000 (20:31 -0700)]
dsp5680xx - error codes

added logging of target error codes to enable automatic error handling from tcl.
the plan is to use a computer to execute a series of tcl commands, the changes allow simple parsing of return messages to detect errors.

Change-Id: Ia98d3bd036e1b6065b475ffff6c1d30baeaf7417
Signed-off-by: Rodrigo L. Rosa <rodrigorosa.lg@gmail.com>
Reviewed-on: http://openocd.zylin.com/215
Tested-by: jenkins
Tested-by: Øyvind Harboe <oyvindharboe@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
8 years agotarget: fix init_targets script handling
Spencer Oliver [Wed, 23 Nov 2011 23:39:57 +0000 (23:39 +0000)]
target: fix init_targets script handling

This fixes an issue when init is called before init_targets has been
executed.

Make sure init_targets is called before init.

Change-Id: Icd5bd4c2a8eea2e399d9de4e331a77560e9672ac
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/235
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
8 years agoTCL/SPEAr: fix name of included file
Antonio Borneo [Tue, 22 Nov 2011 16:12:58 +0000 (00:12 +0800)]
TCL/SPEAr: fix name of included file

Fix error introduced in recent commit.
Correct the name of the board file.

Change-Id: I46bca8329812fb24bc4f8d316be9e7cba9b56496
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/234
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL: Add board file for EVAL_SPEAr320CPU
Antonio Borneo [Fri, 18 Nov 2011 05:10:00 +0000 (13:10 +0800)]
TCL: Add board file for EVAL_SPEAr320CPU

Initial support for SPEAr320 chip and for evaluation
board named EVAL_SPEAr320CPU.

Change-Id: I85524655769bcc610294a26db47a7a399256fbb7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/231
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL: Add board file for EVALSPEAr300
Antonio Borneo [Fri, 18 Nov 2011 05:09:14 +0000 (13:09 +0800)]
TCL: Add board file for EVALSPEAr300

Initial support for SPEAr300 chip and for evaluation
board named EVALSPEAr300.
Currently supports only those parts in common with
SPEAr310.

Change-Id: I8075aa721cf3dfaac561ee51e5df4ce9a2992e3e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/230
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: remove code to autodetect DDR
Antonio Borneo [Mon, 21 Nov 2011 04:20:18 +0000 (12:20 +0800)]
TCL/SPEAr: remove code to autodetect DDR

The code to autodetect DDR was wrong and not complete.
Replaced with a parameter passed to TCL proc.
Split DDR configuration in the two cases of single and
dual DDR chip, using single chip as default.

Change-Id: If39aa518670398e8e4f207d7db6e812a49743e15
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/229
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: move DDR activation in common code
Antonio Borneo [Mon, 21 Nov 2011 03:46:59 +0000 (11:46 +0800)]
TCL/SPEAr: move DDR activation in common code

DDR controller activation should not be in DDR chip
specific code, but in generic DDR controller part.

Change-Id: If1b178228352b48b0097d7b9b300005fb5bb4fb6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/228
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: Join two initialization files.
Antonio Borneo [Fri, 21 Jan 2011 06:57:14 +0000 (14:57 +0800)]
TCL/SPEAr: Join two initialization files.

The support for SPEAr3xx family members does not require
dedicated files for each member.
Join the initialization scripts in a single file.

Change-Id: I45e9dc64809a6f52c4592e3e0eef5529394887c6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/227
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: move device generic code
Antonio Borneo [Fri, 21 Jan 2011 06:49:47 +0000 (14:49 +0800)]
TCL/SPEAr: move device generic code

The initialization of RAS enable and clock is required by
all SPEAr3xx devices

Change-Id: Iea4cd0902e4da219475d7f35b4c25fc87ec6b902
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/226
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: move device specific code
Antonio Borneo [Fri, 21 Jan 2011 04:53:19 +0000 (12:53 +0800)]
TCL/SPEAr: move device specific code

The initialization of memory port 1 is required by
SPEAr310 only

Change-Id: I9d655da1026795f02ff2f82aed36441068cf266d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/225
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoTCL/SPEAr: Add reference to ST Application Note
Antonio Borneo [Sat, 27 Nov 2010 03:43:32 +0000 (11:43 +0800)]
TCL/SPEAr: Add reference to ST Application Note

ST-AN was mentioned but there was no reference

Change-Id: Ie065f8faba94d63cf391a994ec895692d499394e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/224
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoscripts: use adapter_khz not deprecated jtag_khz
Spencer Oliver [Tue, 15 Nov 2011 09:17:27 +0000 (09:17 +0000)]
scripts: use adapter_khz not deprecated jtag_khz

Change-Id: Ibaeebf564a95360dcf21a0921ec99f5263f11915
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/202
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agousbprog: fix shadowed declaration warning
Spencer Oliver [Tue, 15 Nov 2011 09:39:10 +0000 (09:39 +0000)]
usbprog: fix shadowed declaration warning

see Trac #38

Change-Id: If86fda797391f10d745384794b68e60380ef0b21
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/204
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoscripts: notify user of deprecated jtag_* functions
Spencer Oliver [Tue, 15 Nov 2011 09:18:44 +0000 (09:18 +0000)]
scripts: notify user of deprecated jtag_* functions

Change-Id: Ia97dda6918e20fb29d6e76d43856eede8fcc60dd
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/203
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agolibusb-1.0 support
Mauro Gamba [Wed, 16 Nov 2011 14:01:04 +0000 (15:01 +0100)]
libusb-1.0 support

The configuration script check for libusb-1.0 availability first and only
if not found check for libusb-0. So if both libraries are installed on the
system the build script will use libusb-1.0
It's possible to force compiling with libusb-0 with the --enable-libusb0 switch.
If the driver support only libusb0 the script check anly for it.

Change-Id: I7eb045d4e2bd553abefad53f3f4023ff46b0f5f6
Signed-off-by: Mauro Gamba <maurillo71@gmail.com>
Reviewed-on: http://openocd.zylin.com/33
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoflash: cleanup stm32f2x loader
Spencer Oliver [Mon, 14 Nov 2011 13:33:30 +0000 (13:33 +0000)]
flash: cleanup stm32f2x loader

Change-Id: I89efdc45bcd61ded437d67d4cbee4c53345d4d76
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/197
Tested-by: jenkins
8 years agoRevert "build: fix gcc 4.6.2 warnings"
Spencer Oliver [Fri, 18 Nov 2011 15:09:34 +0000 (15:09 +0000)]
Revert "build: fix gcc 4.6.2 warnings"

This reverts commit 0ef5a90d93c5a026bcf70132e60e957ae339d1e1

Causes older versions of gcc to break - need to look into a better fix.

This passed through the jenkins build as we originally did not build this module - we do now.

Change-Id: Iafeac8442b2249269ff45a52ccd3e2870920f635
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/214
Tested-by: jenkins
8 years agobuild: fix gcc 4.6.2 warnings
Spencer Oliver [Mon, 14 Nov 2011 15:43:35 +0000 (15:43 +0000)]
build: fix gcc 4.6.2 warnings

see trac #47

Change-Id: I48a3e963354dfc82209477672c2508c96fb737d6
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/198
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agopresto: fix tms_sequence short issue
Robert Pasz [Mon, 14 Nov 2011 20:25:05 +0000 (20:25 +0000)]
presto: fix tms_sequence short issue

fix issue when using tms_sequence short

see Trac #31

Change-Id: I22a9cd2af59eae4d8a276dae60b6a99d05af53bb
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/201
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agogdb: Potential rounding error in reg_packet_size gdb_get_registers_packet
Philip Nye [Mon, 14 Nov 2011 20:11:51 +0000 (20:11 +0000)]
gdb: Potential rounding error in reg_packet_size gdb_get_registers_packet

The calculation for reg_packet_size in gdb_get_registers_packet() could
generate a wrong result in the case of multiple registers whose size is
not a multiple of 8.

The current calculation sums the sizes for all registers then rounds the result
up to the next multiple of 8.

Instead it should round each register size up individually and sum the results for all registers.

Change-Id: Idfb5e5eeee0e69a6889dbe9769c0bf17feacb63b
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/200
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agogdb: fix multi core gdb issue
Philip Nye [Mon, 14 Nov 2011 19:44:32 +0000 (19:44 +0000)]
gdb: fix multi core gdb issue

gdb_memory_map() correctly calculates the target specific number of flash banks, but then uses the total number (all targets) instead of the target specific number to construct its GDB response, causing a crash.

Change-Id: I3f8639b3e90303a59753ebe140ce4fff96fd5db0
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/199
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agocontrib: stm32f2x use std naming rules
Spencer Oliver [Mon, 14 Nov 2011 12:59:01 +0000 (12:59 +0000)]
contrib: stm32f2x use std naming rules

Change-Id: I109297aa480b3474f1251571cb8e1a0baa1442fd
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/195
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash: match stm32f2x loader src name
Spencer Oliver [Mon, 14 Nov 2011 13:00:42 +0000 (13:00 +0000)]
flash: match stm32f2x loader src name

Change-Id: I60523f809f2d9ec9c9283e0456746ce9a63576a7
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/196
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoconfiguration for Freescale TWRK60N512 board
Tomas Frydrych [Sun, 13 Nov 2011 14:31:00 +0000 (14:31 +0000)]
configuration for Freescale TWRK60N512 board

Based on the K40/Kwikstik config files

Change-Id: Icb3adc7126bacea65209b712ebaa0eb3b894372e
Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
Reviewed-on: http://openocd.zylin.com/210
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>