openocd.git
4 years agoarmv7a_mmu: Remove armv7a_mmu_translate_va() 13/5213/5
Florian Fainelli [Wed, 5 Jun 2019 19:37:13 +0000 (12:37 -0700)]
armv7a_mmu: Remove armv7a_mmu_translate_va()

This function is not used anywhere in the tree, remove it, such that we
only have a single function moving forward that might need to deal with
short vs. long format specifics.

Change-Id: I80e81cd7eba1e028d1afaeaedb675b46c0ca6fa1
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-on: http://openocd.zylin.com/5213
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agoarmv7a_mmu: Check earlier for PAR read 15/5215/3
Florian Fainelli [Wed, 5 Jun 2019 22:23:33 +0000 (15:23 -0700)]
armv7a_mmu: Check earlier for PAR read

Check earlier that the read of the PAR register was successful instead
of starting the decoding and then checking for an error reading that
register.

Change-Id: Id96c2b2f76d2d1c745fcfa55ad4c1e6db92106f9
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-on: http://openocd.zylin.com/5215
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
4 years agocontrib/rpc_examples: remove 'ocd_' command prefix from haskell example 91/5191/2
Antonio Borneo [Fri, 31 May 2019 15:03:10 +0000 (17:03 +0200)]
contrib/rpc_examples: remove 'ocd_' command prefix from haskell example

The prefixed commands has been removed in commit 0840414f0e57
("helper/command: do not replace new commands with ocd_ prefix").

Change-Id: I9f101beb85533973041386896bbb215bb141962f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5191
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
4 years agocontrib/rpc_examples: Remove 'ocd_' command prefix 90/5190/2
Marc Schink [Fri, 31 May 2019 11:42:28 +0000 (13:42 +0200)]
contrib/rpc_examples: Remove 'ocd_' command prefix

The prefix is not necessary anymore.

Change-Id: Ie0df06a70ff51e6719d7564396739d28618b0196
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/5190
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 years agotarget/armv7m: fix register number in armv7m_get_core_reg() 03/5203/2
Tomas Vanek [Tue, 4 Jun 2019 23:09:15 +0000 (01:09 +0200)]
target/armv7m: fix register number in armv7m_get_core_reg()

armv7m_get_core_reg() calls arm->read_core_reg()
arm->read_core_reg() expects the register number as an index
to core reglist, not an ARMv7M specific register code.
Use reg->number instead of armv7m_reg->num.

The change solves assert
  src/target/armv7m.c:222: armv7m_read_core_reg: Assertion
  `num < (int)armv7m->arm.core_cache->num_regs' failed.
when gdb 'info reg' is issued on a Cortex-M target and
no cortex_m_debug_entry() has been called since OpenOCD start
(target was halted before OpenOCD start).

Change-Id: I32a2294693ef979b613be93aeceb3b0eb06ee6df
Ticket: https://sourceforge.net/p/openocd/tickets/216/
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5203
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
4 years agojtag: set default "jtag_only" to uninitialized transports 93/4893/3
Antonio Borneo [Tue, 22 Jan 2019 15:03:15 +0000 (16:03 +0100)]
jtag: set default "jtag_only" to uninitialized transports

For legacy support, drivers that do not define a list of
transports get identified as jtag_only.

Cleanup this old crust and initialize properly the transports
field in the jtag_interface for all the drivers.

Change-Id: I9c86064e5d05bd0212bc18f4424414e615e617fe
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4893
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agogdb_server: remove call to jtag_execute_queue() 11/4911/4
Antonio Borneo [Wed, 13 Feb 2019 17:28:50 +0000 (18:28 +0100)]
gdb_server: remove call to jtag_execute_queue()

In the initial commit 6c9b804d6187edda4f46f8458deec0b17ec76bb9
in 2007's svn://svn.berlios.de/openocd/trunk@246
a target script gdb_program_config was called before gdb flash
programming. To guarantee the script does not left any pending
command in the jtag queue, a call to jtag_execute_queue() was
inserted after the execution of the script.

In following commit ef1cfb23947bd32798077c6abb5c25a049460ae9
in 2008's svn://svn.berlios.de/openocd/trunk@975
the script was replaced by the event "old-gdb_program_config" and
the call to jtag_execute_queue() get executed in every case, even
if the event handler was not present.

At last, commit bb3793c9a4ccd232c4ee3ce0a36bf200589ca0bb
("target: remove legacy target events") stripped away the
obsolete event but left the call to jtag_execute_queue(), now
completely useless.

Remove the call to jtag_execute_queue() and clean-up the code
around it.

Change-Id: I284f54d656d431ad6cdc25ca18218c09db31bd25
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4911
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agotarget/cortex_m: remove dependency from jtag queue 12/4912/3
Antonio Borneo [Wed, 13 Feb 2019 16:15:58 +0000 (17:15 +0100)]
target/cortex_m: remove dependency from jtag queue

Since the first commit 09883194f867 that introduced cortex_m, the
code has a delay of 50ms after srst has been asserted.
The specific delay is implemented through the JTAG_SLEEP command
sent in the jtag queue.

To remove the dependency from the jtag queue, replace the delay
with a transport independent function.

In case of jtag transport, this change keeps the same behaviour
only if the jtag queue has been flushed before the delay. This
does not happen if the call to dap_dp_init(), few lines above,
fails while calling a dap_queue_dp_{read,write}(); in this case
the jtag queue will be flushed later, after the delay, while in
the original code the delay would follow the flushing of the
commands already queued. Anyway, this different behavior would
only happen in case of DAP already not responsive so anticipating
the delay in such error condition is not supposed to add further
problems.

Change-Id: If15978246764e4266b10e707d86c03e5ed907de7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4912
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agohelper: add bitmap helper primitives 94/4894/4
Antonio Borneo [Mon, 28 Jan 2019 17:22:21 +0000 (18:22 +0100)]
helper: add bitmap helper primitives

Mainly copied/inspired from Linux kernel code in
- include/linux/types.h
- include/linux/bitmap.h
- include/linux/bitops.h

Change-Id: I317b542993ab81530c86553f339b79505d0fef0f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4894
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojtag: simplify management of non-implemented handlers 92/4892/3
Antonio Borneo [Wed, 11 Jul 2018 08:21:04 +0000 (10:21 +0200)]
jtag: simplify management of non-implemented handlers

There is just a single entry point for the jtag API .khz(),
.speed_div(), .power_dropout(), .srst_asserted().

Simplify the code by in-lining the default handler.
The overall code behaviour is not changed.
This change prevents modifying at run-time the content of
struct jtag_interface.

Inspired from change http://openocd.zylin.com/943
by Evan Hunter <ehunter@broadcom.com>

Change-Id: I09aeb76d614db57b1884ac7ee9f00c152cd77849
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4892
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoswd: remove unused API frequency() 91/4891/3
Antonio Borneo [Mon, 6 Aug 2018 15:31:36 +0000 (17:31 +0200)]
swd: remove unused API frequency()

The specific SWD API to change/query the adapter speed is never
called because the equivalent JTAG API is used in place of it.
In the restructure of struct jtag_interface, the JTAG API is
promoted as global adapter API, thus a specific SWD one is not
anymore required.

Change-Id: I1e810d255b4dfcd5791b4fac8ae1260c31a057fd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4891
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agoConvert DEBUG_JTAG_IO to LOG_DEBUG_IO 10/3910/8
Andreas Fritiofson [Wed, 14 Dec 2016 00:33:17 +0000 (01:33 +0100)]
Convert DEBUG_JTAG_IO to LOG_DEBUG_IO

Change-Id: Ifee9723a57fea93a7022be3299f69680860f236b
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3910
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agogdb_server: fix GDB_BUFFER_SIZE usage, fix unaligned access during bulk transfers 09/5109/2
Bohdan Tymkiv [Tue, 16 Apr 2019 14:28:29 +0000 (17:28 +0300)]
gdb_server: fix GDB_BUFFER_SIZE usage, fix unaligned access during bulk transfers

Currently size of the GDB buffer is 16384 bytes but it is treated as
nul-terminated string in most of the code, so effective size of the
buffer is actually 16383 bytes. OpenOCD responds with `PacketSize=3fff`
to qSupported request. Result of GDB's `m` command is encoded in hex so
each data byte uses two bytes in the buffer. As a result GDB will split
bulk read requests into chunks 0x1fff bytes each. This causes troubles
on targets (or memory regions) which support only aligned, word-sized
access (such as MMIO buffers).

Steps to reproduce (psoc6 target):
gdb> dump binary memory dump.bin 0x040320000 (0x040320000 + 65536)

OpenOCD:
Error: Failed to read memory at 0x40321ffe
Error: Failed to read memory at 0x40321000
Error: Failed to read memory at 0x40323000
Error: Failed to read memory at 0x40325ffe
Error: Failed to read memory at 0x40329ffa
Error: Failed to read memory at 0x40329ffc
Error: Failed to read memory at 0x4032bffc
Error: Failed to read memory at 0x4032dffa

Consolidate GDB_BUFFER_SIZE usage: ensure size of each buffer is
(GDB_BUFFER_SIZE + 1), add explicit comment that additional byte is used
for nul-termination. Report correct size of the buffer to GDB (0x4000)
as recommended in GDB's docummentation: `if the stub stores packets in a
NUL-terminated format, it should allow an extra byte in its buffer for
the NUL`

Checked with clang-asan, clang-analyzer, valgrind - no new errors.

Change-Id: I909e8a2c6b010c5d4a304641808d4a807a4ec18d
Signed-off-by: Bohdan Tymkiv <bhdt@cypress.com>
Reviewed-on: http://openocd.zylin.com/5109
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojlink: add usb location support 96/4596/10
Oleksij Rempel [Wed, 4 Jul 2018 14:40:58 +0000 (16:40 +0200)]
jlink: add usb location support

this patch needs latest extended libjaylink version

Change-Id: Ib688ba18740717ccce7863e08c09425975b5f153
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4596
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojtag/drivers/jtag_usb_common: Fix variable name 54/5154/4
Marc Schink [Mon, 6 May 2019 15:01:22 +0000 (17:01 +0200)]
jtag/drivers/jtag_usb_common: Fix variable name

Change-Id: I3773afa75724dc71801af39cc9135b7b9585bc47
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/5154
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agolibjaylink: Update to latest Git version 29/4629/5
Oleksij Rempel [Thu, 2 Aug 2018 16:13:24 +0000 (18:13 +0200)]
libjaylink: Update to latest Git version

This version introduces jaylink_device_get_usb_bus_ports()

Change-Id: Ib3fea95c3545c1340a6798e100f5ca644ec89510
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-on: http://openocd.zylin.com/4629
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
4 years agojtag/drivers/jtag_usb_common: Remove warning 55/5155/4
Marc Schink [Mon, 6 May 2019 15:09:21 +0000 (17:09 +0200)]
jtag/drivers/jtag_usb_common: Remove warning

The warning appears for every possible device during enumeration
and provides no useful information for an end-user.

Change-Id: I56e7889a5d9d4656de13ad9e21be3a6e1906e05f
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/5155
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
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>

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)