openocd.git
4 years agoarm_adi_v5: Split CSW bits into AHB/APB/AXI 24/5124/3
Leonard Crestez [Tue, 16 Apr 2019 19:12:18 +0000 (22:12 +0300)]
arm_adi_v5: Split CSW bits into AHB/APB/AXI

The implementation-defined bits have different semantics for each bus
and different recommended defaults.

Change-Id: I562fe24643bb1f3abc696339e382a75ccf2f2873
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5124
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: make handle_md_output() global 75/5175/2
Tomas Vanek [Thu, 22 Nov 2018 18:05:04 +0000 (19:05 +0100)]
target: make handle_md_output() global

Remove a copy of handle_md_output() from src/target/dsp563xx.c

Change-Id: Iadd003fd1dcdbc7990d46a58ee2e7c30826ac6af
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5175
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 years agoconfigure.ac: fix minor typo 64/5164/2
Antonio Borneo [Sun, 5 May 2019 13:49:19 +0000 (15:49 +0200)]
configure.ac: fix minor typo

s/overide/override/

Change-Id: Iecacf0d6839a4d23cb1b029f867d7e1a21d482a4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5164
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoguess-rev.sh: fix minor typo 63/5163/2
Antonio Borneo [Sun, 5 May 2019 13:45:47 +0000 (15:45 +0200)]
guess-rev.sh: fix minor typo

s/reecognized/recognized/

Change-Id: I7129090d464d780632c0b7504e48fb90e847b30d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5163
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoHACKING: fix minor typos 62/5162/2
Antonio Borneo [Sat, 4 May 2019 13:23:30 +0000 (15:23 +0200)]
HACKING: fix minor typos

s/additonal/additional/
s/seperately/separately/
Use uppercase after a '.'

Change-Id: I933894ae44924363d634fa07d3de4ceeb4b329e2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5162
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agocortex_m: set the debug reason to DBGRQ when NVIC_DFSR indicates EXTERNAL 57/5157/2
Tarek BOCHKATI [Tue, 7 May 2019 15:16:15 +0000 (17:16 +0200)]
cortex_m: set the debug reason to DBGRQ when NVIC_DFSR indicates EXTERNAL

By definition the EXTERNAL bit in Debug Fault Status Register indicates
that an external debug request (EDBGRQ) signal was asserted.

Usage example: this could be done by CTI in multicore devices in order to
halt all the cores together.

Change-Id: I7830455ce5da6702b7d08c8fa7bfe80e4d8a5055
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/5157
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper/command: remove dead code in command_unknown() 96/5096/2
Antonio Borneo [Sun, 7 Apr 2019 10:18:05 +0000 (12:18 +0200)]
helper/command: remove dead code in command_unknown()

Commit 89fa493a3bc34d22eeca06fa4e78523ac3b766a8 removes the top
level command "unknown" and adds in command_unknown() some unclear
code that should detect a user-implemented "unknown" command.
But, all the commands that trigger the execution of the function
command_unknown() are registered in register_command_handler() and
have the command name prefixed with "ocd_".
Due to such "ocd_" prefix in cmd_name, the condition
if (strcmp(cmd_name, "unknown") == 0) { ... }
is always false.
Nobody complained for almost 10 years so we can proceed to remove
this dead code, before merging any change that obsoletes the
prefix "ocd_" and potentially makes the condition true.

Remove the dead code guarded by the condition above.

Change-Id: Icf11a956bb2d68fc84e6eb5779edf8e35db8fa53
Fixes: 89fa493a3bc3 ("remove unknown handler")
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5096
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: remove unused function target_buffer_get_u8() 53/5153/3
Antonio Borneo [Sun, 5 May 2019 12:32:37 +0000 (14:32 +0200)]
target: remove unused function target_buffer_get_u8()

Left unused after commit "target: unify memory read/write
commands", can be removed.

Change-Id: Iea6ef9204c8071283a66a679b3d6edbb0c929c5c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5153
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agostm32f7x: Use CHIPNAME-specific name for ITCM bank 02/5102/3
Christopher Head [Wed, 10 Apr 2019 21:16:13 +0000 (14:16 -0700)]
stm32f7x: Use CHIPNAME-specific name for ITCM bank

Change-Id: Icf67eaecd56ac3fb88bcfa2b7084b846109454e6
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5102
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
4 years agodoc/openocd.texi: fix bad aarch64 merge 81/5181/3
Steven Stallion [Tue, 21 May 2019 18:29:27 +0000 (11:29 -0700)]
doc/openocd.texi: fix bad aarch64 merge

The documentation added for commit b3d29cb5441ee5d38e8f7b561a58f03eb269dbe4
was merged after the end of the eSi-RISC section rather than AARCH64.
This patch relocates this hunk to the correct location.

Change-Id: I46a2d24442556e9e8000b46a5e1af03b83de6d98
Signed-off-by: Steven Stallion <stallion@squareup.com>
Reviewed-on: http://openocd.zylin.com/5181
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotcl/target: Fix V3M/V3H SoC chipname 40/5140/3
Marek Vasut [Tue, 2 Apr 2019 03:28:17 +0000 (05:28 +0200)]
tcl/target: Fix V3M/V3H SoC chipname

The V3M SoC is R8A77970 while the V3H SoC is R8A77980 . Update the
CHIPNAME and swap the SoCs to keep the list sorted.

Change-Id: I7e1777c0c7181e5e0beac98333f2047cb443d0df
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: http://openocd.zylin.com/5140
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotcl/target: Add Renesas RZ/A1H target 41/5141/3
Marek Vasut [Fri, 5 Oct 2018 20:48:04 +0000 (22:48 +0200)]
tcl/target: Add Renesas RZ/A1H target

Add configuration for the Renesas RZ/A1H target.
This is an SoC with one Cortex A9 ARMv7a core and
up to 10 MiB of on-SoC SRAM.

Change-Id: I20fd54b385fe1ba1cc325451c3fdfa3a835d4884
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: http://openocd.zylin.com/5141
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotcl/board: Add Renesas RZ/A1H GR-Peach board 42/5142/3
Marek Vasut [Fri, 5 Oct 2018 20:48:13 +0000 (22:48 +0200)]
tcl/board: Add Renesas RZ/A1H GR-Peach board

Add configuration for the Renesas RZ/A1H GR-Peach board,
which is a cheap development kit for the RZ/A1H SoC.

Change-Id: I7f5596ae47e6dff8e6d06cffd4dddca20f57d0ca
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: http://openocd.zylin.com/5142
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agohelper/command: print the command output in case of error 78/5178/2
Antonio Borneo [Wed, 15 May 2019 14:27:26 +0000 (16:27 +0200)]
helper/command: print the command output in case of error

In case of error, a command should use command_print() to report
the error message, so it get printed only on the session that run
the command itself, and the message can be intercepted with the
tcl command catch if it has to be handled differently.
Current code drops the command output when the command returns
error, claiming that it's the command that *should* have printed
it already. This is true only if we *abuse* of the LOG functions,
but accepting the side issue of having the LOG printed in every
session and being unable to catch{} the error message.

Since we have switched to command_print(), change the code to
propagate the command output also in case of error.

Change-Id: I95de424a65e63702bdb3b2277749a0ac6aaaa503
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5178
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoFix 'adapter usb location' documentation 56/5156/2
Marc Schink [Tue, 7 May 2019 11:20:30 +0000 (13:20 +0200)]
Fix 'adapter usb location' documentation

Change-Id: Ifd1d21f2a3cc25ee25e3c7dd04dbb8190d41a1ea
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/5156
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojtag/drivers/imx_gpio: fixed calls to command_print 76/5176/3
Jan Matyas [Wed, 15 May 2019 05:38:51 +0000 (07:38 +0200)]
jtag/drivers/imx_gpio: fixed calls to command_print

Two calls to command_print() in imx_gpio fixed - the first parameter
adjusted (CMD_CTX -> CMD) per the changes from this commit:
6cb5ba6f1136df2986850f5c176cb38e34ca1795

Change-Id: I6cb0909439a632d3109edfc68070b9b561f86d49
Signed-off-by: Jan Matyas <matyas@codasip.com>
Reviewed-on: http://openocd.zylin.com/5176
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 years agodrivers/bcm2835gpio: fix build for ARM host 74/5174/3
Antonio Borneo [Tue, 14 May 2019 21:38:29 +0000 (23:38 +0200)]
drivers/bcm2835gpio: fix build for ARM host

The commit 84ca4995adfa ("drivers/bcm2835gpio: fix usage messages")
has been merged before commit 6cb5ba6f1136 ("helper/command: change
prototype of command_print/command_print_sameline") introducing two
new call to command_print() that were not modified by the second
commit.
This triggers a compile error on ARM host.

Fix the incorrect function call.

Change-Id: I2736bae24141685b7590fd6b4aa5e6a29b2cab29
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5174
Tested-by: jenkins
4 years agojtag_vpi: fixed state transitions in "stableclocks" 51/5151/3
Jan Matyas [Mon, 6 May 2019 05:20:33 +0000 (07:20 +0200)]
jtag_vpi: fixed state transitions in "stableclocks"

In jtag_vpi_stableclocks() the TMS line needs to be set properly
based on the current JTAG TAP state (TMS=1 in TAP_RESET state vs.
TMS=0 in other cases).

Change-Id: Id49622ba83015f97b61b6a896edde4448f1fbdc6
Signed-off-by: Jan Matyas <matyas@codasip.com>
Reviewed-on: http://openocd.zylin.com/5151
Tested-by: jenkins
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojtag_vpi: correct runtest behavior 35/3635/4
Megan Wachs [Wed, 3 Aug 2016 01:44:10 +0000 (18:44 -0700)]
jtag_vpi: correct runtest behavior

Prevent the State Machine from moving at the end
of several cycles during run_test_idle
state.

Change-Id: Iabdf90a58334dd3d0e6e34b02983a85662062825
Signed-off-by: Megan Wachs <megan@sifive.com>
Reviewed-on: http://openocd.zylin.com/3635
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Franck Jullien <franck.jullien@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: Fix breakpoint usage 39/5139/2
Marc Schink [Mon, 29 Apr 2019 10:08:05 +0000 (12:08 +0200)]
target: Fix breakpoint usage

Change-Id: I28630e5062ffb16939250f7ec7549200f3a9b285
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/5139
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper/command: fix printing usage for incomplete commands 66/5166/3
Antonio Borneo [Sun, 12 May 2019 12:09:51 +0000 (14:09 +0200)]
helper/command: fix printing usage for incomplete commands

The commit "helper/command: do not replace new commands with
ocd_ prefix" breaks the print of usage text when a multi-word
command is typed incompletely.

Fix it by explicitly running the "usage" command.

Change-Id: I46f8e521d9b6ac617bff8938cf8fc96f0ade45c8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5166
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper/command: send command output only to the right server 93/5093/6
Antonio Borneo [Sun, 7 Apr 2019 03:12:31 +0000 (05:12 +0200)]
helper/command: send command output only to the right server

When opening multiple telnet connections, the command output on
one console is broadcast to all the other console.

Send the command output only to the output handler that has been
set for that context.
For the moment, still broadcast the errors.

Note that contexts which doesn't explicitly set the output handler
(e.g. gdb_server), will inherit the global output handler
configuration_output_handler() that will broadcast the output.

Change-Id: I1f2d6e6a3bbf730f5fa77246730fce1445742a1e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5093
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: fix output of command "targets" 92/5092/5
Antonio Borneo [Sat, 6 Apr 2019 14:26:31 +0000 (16:26 +0200)]
target: fix output of command "targets"

Part of the output is generated with log functions.

Change prototype of find_target() and use command_print() for all
the output of the command.

Change-Id: Ia9fdb653fd5b27be427381053a037545faa34414
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5092
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
4 years agotcl/psoc4: remove "ocd_" prefixed commands 90/5090/5
Antonio Borneo [Thu, 28 Mar 2019 11:22:25 +0000 (12:22 +0100)]
tcl/psoc4: remove "ocd_" prefixed commands

The commands prefixed with "ocd_" are removed.
Remove them from configuration files.

Change-Id: Ib44627ee17a39f3d06b479507ab5a025073bf9a8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5090
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
4 years agoTODO: remove references to "ocd_" prefix in documentation 89/5089/5
Antonio Borneo [Thu, 28 Mar 2019 11:15:47 +0000 (12:15 +0100)]
TODO: remove references to "ocd_" prefix in documentation

The commands prefixed with "ocd_" are removed.
No need to review the documentation.

Change-Id: Idad95e62f6c8574ff8b61930aeef04e9727fae8a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5089
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
4 years agodoc: remove references to "ocd_" prefixed commands 88/5088/5
Antonio Borneo [Thu, 28 Mar 2019 11:14:56 +0000 (12:14 +0100)]
doc: remove references to "ocd_" prefixed commands

The commands prefixed with "ocd_" are removed.
Remove any reference in the documentation.

Change-Id: I27cebaa4752752ec8700757bf1c98b267c24f15b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5088
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
4 years agohelper/command: remove search for "ocd_" prefix 87/5087/5
Antonio Borneo [Thu, 28 Mar 2019 10:58:10 +0000 (11:58 +0100)]
helper/command: remove search for "ocd_" prefix

We do not register commands with special "ocd_" prefix anymore.

Change-Id: I588816eb22c2435a97be5fbfa87ee5584274b02f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5087
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper/command: remove command "command type" 84/5084/4
Paul Fertser [Wed, 3 Apr 2019 16:50:41 +0000 (18:50 +0200)]
helper/command: remove command "command type"

Once the wrapper "ocd_bouncer" is removed (which was the only user
of this command), there is no reason to keep the command any
longer.

Remove it.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I979ce1c147babedb44dd77418751133f589f827c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5084
Tested-by: jenkins
4 years agohelper/command: do not replace new commands with ocd_ prefix 86/5086/4
Paul Fertser [Thu, 4 Apr 2019 07:40:27 +0000 (09:40 +0200)]
helper/command: do not replace new commands with ocd_ prefix

The TCL return values are now consistent, no need anymore for the
hack of registering the commands with "ocd_" prefix and override
them with proc ocd_bouncer.

Clean-up the command registration and remove the proc ocd_bouncer.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I2a467e73ecb068686ea3fda91bf961aba6db6427
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5086
Tested-by: jenkins
4 years agohelper/command: do not capture log in script_command_run() 85/5085/4
Paul Fertser [Thu, 4 Apr 2019 07:35:15 +0000 (09:35 +0200)]
helper/command: do not capture log in script_command_run()

Command's output should be put in JimTcl result.
We should not anymore capture the log output and pack it as a
JimTcl result.

Remove the log capture feature in script_command_run().

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Id326c8719e1cee9156d7fc15ae8355ec79a74951
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5085
Tested-by: jenkins
4 years agohelper/command: Handle Tcl return values consistently 15/1815/7
Paul Fertser [Thu, 4 Apr 2019 07:54:09 +0000 (09:54 +0200)]
helper/command: Handle Tcl return values consistently

Rationale:

1. There's logging output and there're return values;

2. If a function should return something, it should do it explicitly,
same for logging;

3. Interactive interfaces (telnet, Gdb and Tcl RPC) must always return
the result of the evaluation for the given expression. You can
suppress this output by adding ``; after 0'' to the end of your
expression.

4. Some commands "throw an exception" and if you want to be able to
collect both the return value (when it succeeds) and the log output
(when something goes wrong) you can use do like this:

set log_output [capture "catch {reset_config} return_value"]

So what I'm proposing is following:

1. Every jim_handler command should set the return value the standard
JimTcl way, without any tricks. If it needs to print some logging
output, it should use LOG_* functions.

2. The usual commands (COMMANDS) can easily construct their return
value by appending strings with command_print() and
command_print_sameline(). This required changing "struct
command_invocation" and passing a pointer to it to command_print*
functions.

The code is already functional, please test and comment.

TODO items:

1. Modify all jim_handler commands to properly return or log values
(some of them are commented out for now in this patch).

2. Properly document "capture" command and provide a convenience
function to automate log_output + return_value gathering.

3. Add appropriate Doxygen comments.

4. Add Tcl RPC interface description to the manual, all the example
clients in different languages (from the mailing list) to contrib/.

This change is the core part of http://openocd.zylin.com/1815 from
Paul Fertser. It has been extracted and rebased to simplify the
review and provided again as 1815.

Change-Id: I675c91aa9da1e4e7c6f0a8fe6112a00550b9e4db
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/1815
Tested-by: jenkins
4 years agoflash/nor: use command_print() in command "flash banks" 83/5083/3
Paul Fertser [Wed, 3 Apr 2019 15:31:57 +0000 (17:31 +0200)]
flash/nor: use command_print() in command "flash banks"

The command uses LOG_USER() instead of command_print().
Fix it.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I92e5e5954a75b96093b3ed6af73a7536c063b639
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5083
Tested-by: jenkins
4 years agonor/niietcm4: fix indentation 82/5082/2
Paul Fertser [Wed, 3 Apr 2019 15:29:21 +0000 (17:29 +0200)]
nor/niietcm4: fix indentation

After replace CMD_CTX with CMD, the indentation is incorrect.
Fix it.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I5d7c40227ceda2e9db8dab88088d74012d2254c4
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5082
Tested-by: jenkins
4 years agohelper/command: change prototype of command_print/command_print_sameline 81/5081/2
Antonio Borneo [Wed, 3 Apr 2019 08:37:24 +0000 (10:37 +0200)]
helper/command: change prototype of command_print/command_print_sameline

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should switch to CMD as
first parameter.

Change prototype of command_print() and command_print_sameline()
to pass CMD instead of CMD_CTX.
Since the first parameter is currently not used, the change can be
done though scripts without manual coding.
This patch is created using the command:
sed -i PATTERN $(find src/ doc/ -type f)
with all the following patters:
's/\(command_print(cmd\)->ctx,/\1,/'
's/\(command_print(CMD\)_CTX,/\1,/'
's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/'
's/\(command_print_sameline(cmd\)->ctx,/\1,/'
's/\(command_print_sameline(CMD\)_CTX,/\1,/'
's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/'

This change is inspired by http://openocd.zylin.com/1815 from Paul
Fertser but is now done through scripting.

Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/5081
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojlink: change prototype of show_config*() functions 80/5080/2
Paul Fertser [Mon, 1 Apr 2019 03:54:15 +0000 (05:54 +0200)]
jlink: change prototype of show_config*() functions

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of show_config*() functions to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I131a904774bf60ad1bf9d90dbc65927c246ac23a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5080
Tested-by: jenkins
4 years agotarget/esirisc_trace: change prototype of trace dump functions 79/5079/2
Paul Fertser [Mon, 1 Apr 2019 03:42:24 +0000 (05:42 +0200)]
target/esirisc_trace: change prototype of trace dump functions

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of esirisc_trace_dump*() functions to pass CMD
instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ia43bff112372cbb76e1aea9f59f4a9b6df05c15d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5079
Tested-by: jenkins
Reviewed-by: Steven Stallion <sstallion@gmail.com>
4 years agotarget/esirisc_trace: change prototype of trace analyse functions 78/5078/2
Paul Fertser [Mon, 1 Apr 2019 03:37:24 +0000 (05:37 +0200)]
target/esirisc_trace: change prototype of trace analyse functions

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of esirisc_trace_analyze*() functions to pass CMD
instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ie7cfd323fe591a987ea648a20be2bb9c7273dde8
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5078
Tested-by: jenkins
Reviewed-by: Steven Stallion <sstallion@gmail.com>
4 years agotarget: change prototype of binprint() 77/5077/2
Paul Fertser [Mon, 1 Apr 2019 03:22:35 +0000 (05:22 +0200)]
target: change prototype of binprint()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of binprint() to pass CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I5ebdc50417d97c791c98ac0cfe2218319809eb7f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5077
Tested-by: jenkins
4 years agotarget: change prototype of handle_bp_command_set() 76/5076/2
Paul Fertser [Mon, 1 Apr 2019 03:19:21 +0000 (05:19 +0200)]
target: change prototype of handle_bp_command_set()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of handle_bp_command_set() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: If00f9cfb784b53bb3df92d4469178e2f930a146a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5076
Tested-by: jenkins
4 years agotarget: change prototype of handle_bp_command_list() 75/5075/2
Paul Fertser [Mon, 1 Apr 2019 03:17:07 +0000 (05:17 +0200)]
target: change prototype of handle_bp_command_list()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of handle_bp_command_list() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ibff636d476bcd59784ce3da5409d930225cfe637
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5075
Tested-by: jenkins
4 years agotarget: change prototype of handle_md_output() 74/5074/2
Paul Fertser [Mon, 1 Apr 2019 03:14:26 +0000 (05:14 +0200)]
target: change prototype of handle_md_output()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of handle_md_output() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I2150201fad3fd3bc0be89249dcbd314b38a6f860
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5074
Tested-by: jenkins
4 years agotarget/arm_adi_v5: change prototype of dap_rom_display() 73/5073/2
Paul Fertser [Mon, 1 Apr 2019 03:10:56 +0000 (05:10 +0200)]
target/arm_adi_v5: change prototype of dap_rom_display()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of dap_rom_display() and dap_info_command() to
pass CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Idb97b20759c03fcecbac1184c354966f469caa5f
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5073
Tested-by: jenkins
4 years agotarget/etm: change prototype of etmv1_analyze_trace() 72/5072/2
Paul Fertser [Mon, 1 Apr 2019 03:03:21 +0000 (05:03 +0200)]
target/etm: change prototype of etmv1_analyze_trace()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of etmv1_analyze_trace() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ic923af5480a54c7272d2ff1abbe235ba941cf1a0
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5072
Tested-by: jenkins
4 years agotarget/x86_32_common: change prototype of handle_iod_output() 71/5071/2
Paul Fertser [Mon, 1 Apr 2019 02:53:19 +0000 (04:53 +0200)]
target/x86_32_common: change prototype of handle_iod_output()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of handle_iod_output() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I67f594c80d6bbbbf6c9567069a545f16877b1e94
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5071
Tested-by: jenkins
4 years agotarget/armv7a_cache_l2x: change prototype of arm7a_handle_l2x_cache_info_command() 70/5070/2
Paul Fertser [Mon, 1 Apr 2019 02:27:58 +0000 (04:27 +0200)]
target/armv7a_cache_l2x: change prototype of arm7a_handle_l2x_cache_info_command()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm7a_handle_l2x_cache_info_command() to pass
CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ib926cd7380ac8b6fb89f64e0a85d81d124633315
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5070
Tested-by: jenkins
4 years agotarget/armv7a: change prototype of armv7a_handle_cache_info_command() 69/5069/2
Paul Fertser [Mon, 1 Apr 2019 02:50:47 +0000 (04:50 +0200)]
target/armv7a: change prototype of armv7a_handle_cache_info_command()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of armv7a_handle_cache_info_command() to pass CMD
instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I27f507869cb41c74722a759e69dfd45658fcd4be
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5069
Tested-by: jenkins
4 years agotarget/armv4_5_cache: change prototype of armv4_5_handle_cache_info_command() 68/5068/2
Paul Fertser [Mon, 1 Apr 2019 02:42:23 +0000 (04:42 +0200)]
target/armv4_5_cache: change prototype of armv4_5_handle_cache_info_command()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of armv4_5_handle_cache_info_command() to pass
CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ib6ab3ec2fc6504c2a0635b654697a4b6e12a3750
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5068
Tested-by: jenkins
4 years agotarget/dsp563xx: change prototype of handle_md_output() 67/5067/2
Paul Fertser [Mon, 1 Apr 2019 02:24:33 +0000 (04:24 +0200)]
target/dsp563xx: change prototype of handle_md_output()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of handle_md_output() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ib0b84c933689ac8c940c9bbe62d9c95fd015c4f5
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5067
Tested-by: jenkins
4 years agotarget/armv8: change prototype of display_cache_info() 66/5066/2
Paul Fertser [Mon, 1 Apr 2019 02:16:34 +0000 (04:16 +0200)]
target/armv8: change prototype of display_cache_info()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of display_cache_info(),
armv8_handle_inner_cache_info_command() and
armv8_handle_cache_info_command() to pass CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I13519c79af82cdba57d5205ba84a5a27fce65a36
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5066
Tested-by: jenkins
4 years agotarget/xscale: change prototype of xscale_display_instruction() 65/5065/2
Paul Fertser [Mon, 1 Apr 2019 02:06:58 +0000 (04:06 +0200)]
target/xscale: change prototype of xscale_display_instruction()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of xscale_display_instruction() and of
xscale_analyze_trace() to pass CMD instead of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I8420f19c1b2ff0d2a2f2a8d3627767f7acda437c
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5065
Tested-by: jenkins
4 years agotarget/xscale: change prototype of xscale_verify_pointer() 64/5064/2
Paul Fertser [Mon, 1 Apr 2019 01:56:26 +0000 (03:56 +0200)]
target/xscale: change prototype of xscale_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of xscale_verify_pointer() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Id047fab41ec4f673a46756b0ab901e659e088544
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5064
Tested-by: jenkins
4 years agotarget/mips_m4k: change prototype of mips_m4k_verify_pointer() 63/5063/2
Paul Fertser [Mon, 1 Apr 2019 02:58:56 +0000 (04:58 +0200)]
target/mips_m4k: change prototype of mips_m4k_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of mips_m4k_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I9fa3e883d2ca9cc858caaefd33586f78638702f5
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5063
Tested-by: jenkins
4 years agotarget/mips32: change prototype of mips32_verify_pointer() 62/5062/2
Paul Fertser [Mon, 1 Apr 2019 02:57:01 +0000 (04:57 +0200)]
target/mips32: change prototype of mips32_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of mips32_verify_pointer() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ic4a4de10518ee009d6df420e7278fd028e1f22ca
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5062
Tested-by: jenkins
4 years agotarget/cortex_m: change prototype of cortex_m_verify_pointer() 61/5061/2
Paul Fertser [Mon, 1 Apr 2019 02:55:27 +0000 (04:55 +0200)]
target/cortex_m: change prototype of cortex_m_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of cortex_m_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Icf6d1e5f8b4a3ce115c4253e49769df19a5211ae
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5061
Tested-by: jenkins
4 years agotarget/arm946e: change prototype of arm946e_verify_pointer() 60/5060/2
Paul Fertser [Mon, 1 Apr 2019 02:46:29 +0000 (04:46 +0200)]
target/arm946e: change prototype of arm946e_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm946e_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ib7119e2b009d05eec47b50c3b9d32feaebc97538
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5060
Tested-by: jenkins
4 years agotarget/arm720t: change prototype of arm720t_verify_pointer() 59/5059/2
Paul Fertser [Mon, 1 Apr 2019 02:44:43 +0000 (04:44 +0200)]
target/arm720t: change prototype of arm720t_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm720t_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I7fa0628fabacd9ceb62ce921192f88edca659c15
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5059
Tested-by: jenkins
4 years agotarget/arm966e: change prototype of arm966e_verify_pointer() 58/5058/2
Paul Fertser [Mon, 1 Apr 2019 02:37:05 +0000 (04:37 +0200)]
target/arm966e: change prototype of arm966e_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm966e_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I92745591256ad56a588b6386842028e0b18dec96
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5058
Tested-by: jenkins
4 years agotarget/arm926ejs: change prototype of arm926ejs_verify_pointer() 57/5057/2
Paul Fertser [Mon, 1 Apr 2019 02:35:04 +0000 (04:35 +0200)]
target/arm926ejs: change prototype of arm926ejs_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm926ejs_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ibbb03429a7fe8b9979f9bb9e513f9eb86aee3b5b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5057
Tested-by: jenkins
4 years agotarget/arm920t: change prototype of arm920t_verify_pointer() 56/5056/2
Paul Fertser [Mon, 1 Apr 2019 02:32:12 +0000 (04:32 +0200)]
target/arm920t: change prototype of arm920t_verify_pointer()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of arm920t_verify_pointer() to pass CMD instead
of CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I9a603d7c032df91b3913aadb242de89dbed0358e
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5056
Tested-by: jenkins
4 years agonor/at91sam4: change prototype of get_current_sam4() 55/5055/2
Paul Fertser [Mon, 1 Apr 2019 01:50:38 +0000 (03:50 +0200)]
nor/at91sam4: change prototype of get_current_sam4()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of get_current_sam4() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I8dfa66f3f6be318d6ba89649279b1b4502f375d9
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5055
Tested-by: jenkins
4 years agonor/at91sam3: change prototype of get_current_sam3() 54/5054/2
Paul Fertser [Mon, 1 Apr 2019 01:45:54 +0000 (03:45 +0200)]
nor/at91sam3: change prototype of get_current_sam3()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of get_current_sam3() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ia1e7af79d0fc89d229b4e10df37317a374bbab62
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5054
Tested-by: jenkins
4 years agonand/tcl: pass CMD to nand_list_walker() 53/5053/2
Paul Fertser [Sun, 31 Mar 2019 16:34:25 +0000 (18:34 +0200)]
nand/tcl: pass CMD to nand_list_walker()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Pass CMD instead of CMD_CTX as parameter to nand_list_walker().

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: Ia11887dfc6dc58d5458a88ba84780cd895b8c253
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5053
Tested-by: jenkins
4 years agonand/fileio: change prototype of nand_fileio_start() 52/5052/2
Paul Fertser [Sun, 31 Mar 2019 16:18:01 +0000 (18:18 +0200)]
nand/fileio: change prototype of nand_fileio_start()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of nand_fileio_start() to pass CMD instead of
CMD_CTX.

This change was part of http://openocd.zylin.com/1815 from Paul
Fertser and has been extracted and rebased to simplify the review.

Change-Id: I7993f6aba997a2d2917949563651c8d0c213730d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5052
Tested-by: jenkins
4 years agotarget_request: replace command_print() with command_output_text() 51/5051/2
Antonio Borneo [Wed, 3 Apr 2019 08:14:29 +0000 (10:14 +0200)]
target_request: replace command_print() with command_output_text()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

When dumping traces or semihosting text, the command that enabled
it is already completed, so CMD is not a valid value.
Plus, we want the dump to be printed in the command context where
the enable command was executed.

Replace command_print() with command_output_text().

Change-Id: I297a2b799a914233499641062407cf6e8b9fe012
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5051
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: unify memory read/write commands 50/5050/2
Antonio Borneo [Tue, 2 Apr 2019 14:25:52 +0000 (16:25 +0200)]
target: unify memory read/write commands

Current code provides two independent implementations for the
memory read/write commands:
a) jim_target_md()/jim_target_mw() for the target specific
   commands "<target> m[dw][bhw]"
b) handle_md_command()/handle_mw_command() for the current target
   commands "m[dw][bhwd]"
The case a) misses the handling of doubleword and calls functions
command_print_sameline() with first parameter NULL because defined
as jim handler.

Remove the code in jim_target_md()/jim_target_mw() and use the
same code in b) for the target specific memory read/write.
This approach also provides support for 64-bit data size, not
present in the implementation in a).
The only drawback is that the implementation of memory read in b)
prints the data also as human readable ASCII characters, feature
missing in the implementation in a). This could introduced later
if it's really needed.

Update the documentation to:
- add 64-bit support
- add phys parameter
- add the count parameter

Add attribute "unused" to target_buffer_get_u8(), now not used
anymore.

Change-Id: Ib11ff924c409ad87e77fe708d628b2cc82b74d6a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5050
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: use LOG_USER to print errors in events 49/5049/2
Antonio Borneo [Mon, 1 Apr 2019 08:34:25 +0000 (10:34 +0200)]
target: use LOG_USER to print errors in events

Events are supposed to be executed asynchronously and not linked
with any command, so it's incorrect printing out an eventual error
using command_print().
Even in the case of events triggered by the command
<target> invoke-event <event-name>
the eventual error in the event handler is not propagated to the
command, so the command_print() is still not appropriate.

Replace command_print() with LOG_USER() in target_handle_event().
Add further info in the log to identify which event has generated
the error and its associated target.
Before return, clean-up the error message and the stacktrace from
the error already displayed, to avoid propagate them.

Change-Id: I5966aa25e7c81348f4ad4d6e7ce5d4dee44ea4c8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5049
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget: change prototype of target_process_reset() 48/5048/2
Antonio Borneo [Mon, 1 Apr 2019 06:44:26 +0000 (08:44 +0200)]
target: change prototype of target_process_reset()

To prepare for handling TCL return values consistently, all calls
to command_print/command_print_sameline should be ready to switch
to CMD as first parameter.

Change prototype of target_process_reset() to pass CMD instead of
CMD_CTX.
Replace NULL parameter of command_print().
Remove extra newline, already added by command_print().

Change-Id: Ieb820c2586e1ff74a0c2b63a9c8693ca7710dfb7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5048
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper/command: add macro CMD 47/5047/2
Antonio Borneo [Sun, 31 Mar 2019 15:55:43 +0000 (17:55 +0200)]
helper/command: add macro CMD

Accessing the variable "cmd" in a COMMAND_HANDLER is confusing
because the variable definition is not visible in the prototype,
thus "cmd" can be identified by the reader as a global variable
defined somewhere else.

Add the new macro CMD to make more evident it is a part of the
COMMAND_HANDLER.

Change-Id: I8f63da593a931045cc404323f143b88c5c80ab5e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5047
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget/arm946e: rewrite jim_arm946e_cp15 to arm945e_handle_cp15 00/5000/3
Tomas Vanek [Tue, 26 Mar 2019 10:55:37 +0000 (11:55 +0100)]
target/arm946e: rewrite jim_arm946e_cp15 to arm945e_handle_cp15

jim_arm946e_cp15() used command_print() in the jim handler.

Change-Id: I0a258aad5a60f45672b9b6fa6819691507d4f0f6
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5000
Tested-by: jenkins
4 years agotarget: rewrite jim_target_event_list to handle_target_event_list 93/4993/3
Tomas Vanek [Wed, 13 Mar 2019 20:31:57 +0000 (21:31 +0100)]
target: rewrite jim_target_event_list to handle_target_event_list

jim_target_event_list handler used command_print() in jim handler.

Rewriting the jim handler to the OpenOCD command is easy
as get_current_target() returns proper target for prefixed commands since
bb9d9c60264a905926e0d15f84842858d0de80b7

Change-Id: I3e937249386ca5dbd7a5dd6ebb0ccde0911325d8
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4993
Tested-by: jenkins
4 years agostm32h7x: fix incorrect indentation 33/5133/2
Christopher Head [Thu, 25 Apr 2019 00:26:40 +0000 (17:26 -0700)]
stm32h7x: fix incorrect indentation

Change-Id: I5dc16031c38576d853774b6123c93be1e1b4aa96
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5133
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoflash/nor/stm32h7x: use of wait queue flag instead of the busy flag 83/4883/4
Tarek BOCHKATI [Thu, 7 Feb 2019 17:30:10 +0000 (18:30 +0100)]
flash/nor/stm32h7x: use of wait queue flag instead of the busy flag

Based on RM0433.rev5 > Section 3.3.9 : Flash program operations:
  QW1/2: this bit indicates that a write, erase or option byte change
  operation is pending in the write queue or command queue buffer.
  It remains high until the write operation is complete.
  It supersedes the BSY1/2 status bit.

On this basis, stm32x_wait_status_busy is renamed accordingly to be
  'stm32x_wait_flash_op_queue'

Note : In this commit there is a fix of SR_ERROR_MASK value in flash loader algo
Note : This modification is mandatory for revision X, and backward compatible
  with old revisions

Change-Id: I59d2973317d76b01fbb0fb5e4a472a47d0a7a5b5
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/4883
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoflash/nor/atsame5: fix typo in dsu_reset_deassert help text 95/5095/2
Tomas Vanek [Sun, 7 Apr 2019 07:26:44 +0000 (09:26 +0200)]
flash/nor/atsame5: fix typo in dsu_reset_deassert help text

Change-Id: Iebed1a160376717d19c5f56b2553f7d4d1eed3a7
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5095
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
4 years agoflash/fespi: Use COMMAND_PARSE_ADDRESS 00/5100/2
Tim Newsome [Mon, 8 Apr 2019 21:06:04 +0000 (14:06 -0700)]
flash/fespi: Use COMMAND_PARSE_ADDRESS

Signed-off-by: Tim Newsome <tim@sifive.com>
Change-Id: If4d22fe1440f926271274820f96428718a127ac2
Reviewed-on: http://openocd.zylin.com/5100
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget/imx8m: Cleanup defaults 36/5036/4
Leonard Crestez [Wed, 3 Apr 2019 16:07:56 +0000 (19:07 +0300)]
target/imx8m: Cleanup defaults

* Add mem_ap for direct access to axi bus (without halting cpu)
* Mark m4 core with -defer-examine because it's not used by default
* Make a53.0 default target since it's the boot core

Change-Id: Id031533c5d4af346eb08a9ac2532fa1bca602913
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5036
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/imx6ul: Initial support 40/5040/3
Leonard Crestez [Thu, 4 Apr 2019 13:19:55 +0000 (16:19 +0300)]
target/imx6ul: Initial support

Unlike the rest of imx6 the 6UL 6ULL 6ULZ chips are based on Cortex-A7
which is at a different address so a custom script is required.

Tested on imx6ull-14x14-evk

Change-Id: I72822d2241045c318389fadbc66d7aaabaaf4cb5
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5040
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/imx6sx: Initial support 41/5041/3
Leonard Crestez [Thu, 4 Apr 2019 19:25:49 +0000 (22:25 +0300)]
target/imx6sx: Initial support

Unlike the rest of imx6 a Cortex-M4 was added with a second CoreSight
DAP so a separate script is required.

Tested on imx6sx-sdb running linux

Change-Id: I1561910b233015f42508f341175822c0827655ec
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5041
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/imx7ulp: Initial support 43/5043/3
Leonard Crestez [Thu, 4 Apr 2019 19:40:21 +0000 (22:40 +0300)]
target/imx7ulp: Initial support

Unlike imx7d/solo supported by imx7.cfg the M4 core is on a different AP
and is always running by default so no -defer-examine is required.

There is also only one Cortex-A7

Tested on imx7ulp-evk

Change-Id: Ifa923d1b9a372c788e6654bc2233fd4d9073a32d
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5043
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agodoc/openocd.texi: fix cross referencing 45/5045/2
Antonio Borneo [Sat, 6 Apr 2019 07:40:18 +0000 (09:40 +0200)]
doc/openocd.texi: fix cross referencing

Commit b04c7c2ca587feebd6506716cd84297212350608 adds the cross
reference target "adapter_usb_location", but references it with
the command @xref inside a text, where command @ref should be
used. This triggers a compile warning:
doc/openocd.texi:2517: warning: `.' or `,' must follow @xref, not c

Replace @xref with @ref and adapt both the text and the command
syntax.

Change-Id: I1520ffecb7d1d375f924492b1884d5b47f399007
Fixes: b04c7c2ca587 ("ftdi: use "adapter usb location" instead of
ftdi_location command")
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5045
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agoarmv7a: Improve parsing of MPIDR register to avoid error message for Cortex R5 08/5108/4
Tommy Vestermark [Thu, 11 Apr 2019 10:40:36 +0000 (20:40 +1000)]
armv7a: Improve parsing of MPIDR register to avoid error message for Cortex R5

References:
- ARM DDI0406C ARMv7 Architecture Reference Manual, section B4.1.106
- ARM DDI0460D Cortex-R5 Technical Reference Manual section 4.3.6
- ARM 100048_0002_0 Cortex-A73 Technical Reference Manual section 4.5.2

Tested on: TMS570LC4357

Change-Id: Ie0d45fb697697f78cc4ad4e7a0116be9772590ba
Signed-off-by: Tommy Vestermark <tov@vestermark.dk>
Reviewed-on: http://openocd.zylin.com/5108
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotcl/board: Add config for the Amazon Kindle 2 and DX 56/3956/4
Alexander Kurz [Tue, 24 Jan 2017 12:34:38 +0000 (13:34 +0100)]
tcl/board: Add config for the Amazon Kindle 2 and DX

Add a config to access the Amazon Kindle Model No. D00701 and D00801.
Both ebook readers are based on a Freescale i.MX31. A JTAG interface is
included in a 40 pin FFC connector marked "J9" on both variants.

Change-Id: I58bb1ded3d6706bc3798af488ca8bafb7dc45225
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3956
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/cortex_a: use extensively cortex_a_wait_dscr_bits() 13/5113/2
Antonio Borneo [Mon, 15 Apr 2019 21:46:29 +0000 (23:46 +0200)]
target/cortex_a: use extensively cortex_a_wait_dscr_bits()

We have the function to wait for bits in dscr. Use it whenever
possible.

When the bit to test is DSCR_INSTR_COMP, use instead the wrapper
function cortex_a_wait_instrcmpl().

Change-Id: I5c54c239a00f489712af448eb97752210b4b38b8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5113
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/cortex_a: check dscr before timeout 12/5112/2
Antonio Borneo [Mon, 15 Apr 2019 20:32:32 +0000 (22:32 +0200)]
target/cortex_a: check dscr before timeout

In function cortex_a_wait_dscr_bits() the last read on dscr gets
ignored in case of timeout, even if it finally provides the value
that would trigger a successful return.

Check the returned value before testing the timeout.
Also, print a message on failure reading dscr.

Change-Id: I261ac1545113db39374833a55be911a4da71d893
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5112
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agotarget/cortex_a: fix waiting for target halted after step 11/5111/3
Antonio Borneo [Mon, 15 Apr 2019 21:47:50 +0000 (23:47 +0200)]
target/cortex_a: fix waiting for target halted after step

Depending on adapter speed, the function cortex_a_poll() can take
time to execute and can complete successfully when the timeout is
already expired. Checking the timeout at function return causes a
timeout error while that could be avoided.

Check the target status at cortex_a_poll() return, before checking
for the timeout.

Change-Id: I4c1581f6e718298c566df7b1359255e16e3955d5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5111
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotarget/cortex_m: Implement maskisr steponly option 73/4673/9
Christopher Head [Wed, 1 Aug 2018 17:21:15 +0000 (10:21 -0700)]
target/cortex_m: Implement maskisr steponly option

`maskisr steponly` disables interrupts during single-stepping but
enables them during normal execution. This can be used as a partial
workaround for 702596 erratum in Cortex-M7 r0p1. See "Cortex-M7 (AT610)
and Cortex-M7 with FPU (AT611) Software Developer Errata Notice" from
ARM for further details.

Change-Id: I797a14e4d43f6dcb3706528ee4ab452846ebf133
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/4673
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
5 years agofix for sanitizer errors in left shifts 05/5005/4
Mete Balci [Sat, 30 Mar 2019 11:51:03 +0000 (12:51 +0100)]
fix for sanitizer errors in left shifts

The modified lines cause "runtime error: left shift of <X> by <Y>
places cannot be represented in type 'int'", because integer
literal is cast to int by default.

Change-Id: Ie38119b5eb46ee470e0d149959e523b48ac4d66d
Signed-off-by: Mete Balci <metebalci@gmail.com>
Reviewed-on: http://openocd.zylin.com/5005
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 years agotarget/riscv: Free registers to avoid memory leak 85/4885/3
Marc Schink [Mon, 1 Apr 2019 11:47:17 +0000 (13:47 +0200)]
target/riscv: Free registers to avoid memory leak

Tested with SiFive HiFive1 development board.

Change-Id: I96a9a528057fcf9fc54d3da46a672d2cd54c3d5f
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4885
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 years agoflash/stm32h7x: include IO_HSLV in user3_options 45/4745/3
Christopher Head [Tue, 30 Oct 2018 21:45:11 +0000 (14:45 -0700)]
flash/stm32h7x: include IO_HSLV in user3_options

Bit 29 of OPTSR is IO_HSLV. It ought to be read in stm32x_read_options
and written in stm32x_write_options. Adjust the bitmasks to do this.

Change-Id: I785a5291c991c98b774177f960dc58f2b5e045e2
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/4745
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 years agohelper/command: log an error for commands without usage 26/5026/2
Antonio Borneo [Sat, 30 Mar 2019 07:47:38 +0000 (08:47 +0100)]
helper/command: log an error for commands without usage

Every command has been fixed with proper usage field.
Change LOG_DEBUG with LOG_ERROR so a developer will get a visible
alert for missing usage field when adds a new command.

Change-Id: I077c3745fd6265aded8e54b3f9d202d4d6516966
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5026
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 years agotarget/imx6: Update list of supported TAPIDs 34/5034/5
Leonard Crestez [Fri, 10 Aug 2018 16:54:43 +0000 (19:54 +0300)]
target/imx6: Update list of supported TAPIDs

Copy all SJC TAPIPs from imx6 reference manuals.

Some imx6 chips are based on Cortex-A7 or have an additional Cortex-M4
and need separate scripts.

Change-Id: I3b07d94058c2c5e6313cfc8bb43134a90682a62e
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5034
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotarget/imx6: Fix indentation in DAP_TAPID handling 39/5039/2
Leonard Crestez [Thu, 4 Apr 2019 13:17:49 +0000 (16:17 +0300)]
target/imx6: Fix indentation in DAP_TAPID handling

OpenOCD scripts are usually indented with 4 spaces but here there are 8.

Change-Id: Iaad53e3b377d246d99119bb7bb5fd75d4422f564
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5039
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotarget/imx6: Add -ignore-version 31/5031/5
Leonard Crestez [Fri, 10 Aug 2018 13:06:43 +0000 (16:06 +0300)]
target/imx6: Add -ignore-version

Looking through imx6 manuals all of them claim that "In follow-on
silicon revisions the ID value is subject to change by incrementing the
first nibble".

Handle this by passing -ignore-version to jtag newtap command.

Change-Id: I7fc4779f9757d527ea20a5174a8c90f919580013
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5031
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotarget/imx7: Add ahb mem_ap 32/5032/5
Leonard Crestez [Fri, 10 Aug 2018 13:05:16 +0000 (16:05 +0300)]
target/imx7: Add ahb mem_ap

This allows bus access even when CPU is off.

Change-Id: I2d5c5581cd0169aecb92ac7b610810988a8dcef4
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5032
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agojtag: tcl: Add cget -idcode 33/5033/4
Leonard Crestez [Fri, 10 Aug 2018 14:09:41 +0000 (17:09 +0300)]
jtag: tcl: Add cget -idcode

This can be used to dynamically distinguish between similar chips in tcl
code.

Change-Id: Ic4dfb61693e78616355173142dc7f9b9683a9f73
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-on: http://openocd.zylin.com/5033
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agoFix incorrect commas in URLs 28/5028/2
Christopher Head [Mon, 1 Apr 2019 23:02:09 +0000 (16:02 -0700)]
Fix incorrect commas in URLs

In Texinfo, a comma inside an @url separates parameters to the @url
function rather than being included as part of a parameter. Use @comma{}
instead to resolve this.

Change-Id: I8b38939462cf4452e5bc2582ee484220aaf83ae0
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5028
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agoDocument the mem_ap target type 29/5029/2
Christopher Head [Mon, 1 Apr 2019 23:06:30 +0000 (16:06 -0700)]
Document the mem_ap target type

Change-Id: I56e971b38f20db8c4ad0cdee5cc42b42a25319ea
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/5029
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotarget: fix copy&paste error in cget -coreid 35/5035/3
Tomas Vanek [Wed, 3 Apr 2019 05:41:54 +0000 (07:41 +0200)]
target: fix copy&paste error in cget -coreid

Command should return target->coreid, not target->working_area_size
Solution appeared as an off topic fix in http://openocd.zylin.com/4935

Change-Id: Ic9701ce2001c75060dbaa75fbd013ed475a352e5
Suggested-by: Graham Sanderson <graham.sanderson@gmail.com>
Reported-by: Tim Newsome <tim@sifive.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5035
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
5 years agotopic: Remapped Flash over ITCM region in STM32F7x script 97/5097/5
Rocco Marco Guglielmi [Sun, 7 Apr 2019 14:18:36 +0000 (16:18 +0200)]
topic: Remapped Flash over ITCM region in STM32F7x script

This patch remaps the Flash over ITCM region as virtual to ensure that
any breakpoint placed in this area will be automatically set as an
hardware breakpoint. This patch is a fix to a regression introduced with
changes #4429.

Change-Id: I03d46d8537ef06b33a3d4a2328274667c6481969
Signed-off-by: Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>
Reviewed-on: http://openocd.zylin.com/5097
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
5 years agohelper/command: handle empty "usage" with add_help_text/add_usage_text 25/5025/2
Antonio Borneo [Sat, 30 Mar 2019 10:19:47 +0000 (11:19 +0100)]
helper/command: handle empty "usage" with add_help_text/add_usage_text

By using the command "add_help_text" to add a help text to a TCL
procedure it implicitly creates a new command_registration struct
that has field .usage set to NULL. This triggers a debug message
BUG: command '%s' does not have the '.usage' field filled out

Use an empty string if usage field is NULL.

Plus, do not annoy the user with a LOG_INFO when the command
"add_usage_text" replaces an empty usage.

Change-Id: I4a72646e0fb704ba354f938d774055540cde3967
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5025
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 years agoSet empty usage field for commands that do not need parameters 24/5024/2
Antonio Borneo [Fri, 4 Jan 2019 17:16:00 +0000 (18:16 +0100)]
Set empty usage field for commands that do not need parameters

The missing field causes runtime debug message
BUG: command '%s' does not have the '.usage' field filled out

While there, fix some minor typo in the help messages:
s/deasert/deassert/
s/Deasert/Deassert/

Change-Id: If3dd18265cda103ca0d05609f67f4ca58e7cbb27
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5024
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>

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)