]> www.infradead.org Git - users/borneoa/openocd-next.git/log
users/borneoa/openocd-next.git
6 months agotarget: use 'unsigned int' for smp group
Antonio Borneo [Sun, 8 Sep 2024 19:44:32 +0000 (21:44 +0200)]
target: use 'unsigned int' for smp group

Change the type to 'struct target::smp' and to the initialization
variable 'smp_group'.

Change-Id: I5f5a30a796aaf4e0014a38e81abdf4fb4afbdf48
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8478
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
6 months agoopenocd: fix conversion string for stdint values
Antonio Borneo [Sun, 8 Sep 2024 21:11:45 +0000 (23:11 +0200)]
openocd: fix conversion string for stdint values

Detected while converting 'unsigned' to 'unsigned int'.

Use the correct conversion string for stdint values.

Change-Id: I99f3dff4c64dfd7acf2bddb130b56e9ebe1e6c60
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8477
Tested-by: jenkins
6 months agotcl: update to new syntax of telnet command
Antonio Borneo [Sat, 21 Sep 2024 09:11:36 +0000 (11:11 +0200)]
tcl: update to new syntax of telnet command

Commit ad216136180e ("server/telnet: Restructure commands")
modifies the syntax.

sed -i 's/telnet_port/telnet port/'

Change-Id: If1ad34a1ec54824dbc124acd36a894862276a34f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8502
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
6 months agotarget/mips32: add dsp access support for gdb
Walter Ji [Thu, 22 Feb 2024 09:06:53 +0000 (17:06 +0800)]
target/mips32: add dsp access support for gdb

Change order of dsp register name array and removed hi0 and lo0
to comply with gdb definition of dsp in mips-dsp.xml, the regs
name array is now mapping corresponding dsp accumulator names
onto `mips32_regs` and `core_regs` instead of mapping to instr
arrays in dsp functions.
feature now requires a place to store cached dsp registers.
Add dsp registers to reg_list for gdb to access them.
Add dsp module enable detection to avoid DSP Disabled exception
while reading dsp accumulators.
Add dsp register reading procedure in `mips32_pracc_read_regs`
and writing procedure in `mips32_pracc_write_regs`.

Change-Id: Iacc335da030ab85989922c81aac7925b3dc17459
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8476
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
6 months agojep106: update to revision JEP106BK Sep 2024
Antonio Borneo [Sat, 21 Sep 2024 08:07:52 +0000 (10:07 +0200)]
jep106: update to revision JEP106BK Sep 2024

Change-Id: Ica84e22b8d2da152cec39fc569c8333677c19490
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8501
Tested-by: jenkins
6 months agojtag: update constant names to follow code style guidelines
Parshintsev Anatoly [Tue, 10 Sep 2024 03:53:17 +0000 (06:53 +0300)]
jtag: update constant names to follow code style guidelines

Change-Id: Ib081433c67f3be0e5be0b39469680bcce079e0cc
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8485
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agoHACKING: add info on ignoring check-patch checks
Antonio Borneo [Sun, 2 Apr 2023 18:47:41 +0000 (20:47 +0200)]
HACKING: add info on ignoring check-patch checks

Due to checkpatch internal state machine, the field 'Checkpatch-ignore:'
must be in the commit message before the 'Signed-off-by:' line.
Report it in the documentation and add that multiple 'Checkpatch-ignore:'
lines are allowed.

Change-Id: I770cdc4cb5b33bcf63c860c154ab3cbd4785ad20
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7572
Tested-by: jenkins
6 months agortos: chibios: fix version display
Antonio Borneo [Sun, 1 Sep 2024 12:45:36 +0000 (14:45 +0200)]
rtos: chibios: fix version display

The field 'struct chibios_chdebug::ch_version' is 16 bits wide, so
using le_to_h_u32() and be_to_h_u32() overflows in the following
fields of the struct.

Restrict the endianness conversion to 16 bits and use the target
endianness dependent target_buffer_get_u16().
Convert the 'struct chibios_chdebug::ch_version' to an array of
uint8_t.

Change-Id: Iaa80e9cb1a65c27512919398b8ffbf14e5c240cd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8473
Tested-by: jenkins
6 months agoflash/nor/atsame5: add PIC32CX-SG device IDs
Matt Trescott [Wed, 10 Jul 2024 18:46:28 +0000 (14:46 -0400)]
flash/nor/atsame5: add PIC32CX-SG device IDs

These devices are essentially the same as the E54 series with the
exception of immutable boot (SG41, SG61) and HSM (SG60, SG61), and some
bug fixes found only in E54 revision F. When the security features are
not enabled, they behave identically except for the different DIDs.

Signed-off-by: Matt Trescott <mtc@melexis.com>
Change-Id: Ic93313f3e20af0ed4a5768880d17b335a7b7bb04
Reviewed-on: https://review.openocd.org/c/openocd/+/8355
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agoserver/telnet: Restructure commands
Marc Schink [Mon, 24 Jun 2024 14:26:02 +0000 (16:26 +0200)]
server/telnet: Restructure commands

Use a command group 'telnet' with subcommands instead of individual
commands with 'telnet_' prefix. Even though there is only one subcommand
at the moment, make this change to ensure consistency with other commands.

The old command is still available to ensure backwards compatibility,
but are marked as deprecated.

Change-Id: I5e88632fa0d0ce5a8129e9fcf5ae743fc5b093cb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8378
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoserver/gdb_server: improve error handling for `Z/z` packet
Evgeniy Naydanov [Thu, 12 Sep 2024 12:16:45 +0000 (15:16 +0300)]
server/gdb_server: improve error handling for `Z/z` packet

* Report errors for `z` packet.
* Report not supported types as required by GDB Remote Protocol's
  documentation:
  > Implementation notes: A remote target shall return an empty string
    for an unrecognized breakpoint or watchpoint packet type.

Link: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Packets.html#insert-breakpoint-or-watchpoint-packet
Change-Id: I9130400aca5dbc54fefb413ed74f27d75fe50640
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8488
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agobinarybuffer: Invert buf_cmp* return value and rename to buf_eq*
Jessica Clarke [Fri, 13 Sep 2024 17:10:48 +0000 (18:10 +0100)]
binarybuffer: Invert buf_cmp* return value and rename to buf_eq*

The current semantics are a bit confusing, as the return value looks
like memcmp (0/false being equal) but the bool return type means one
likely expects true to mean equal. Make this clearer by switching them
out for buf_eq* functions that do that instead.

Checkpatch-ignore: UNSPECIFIED_INT
Change-Id: Iee0c5af794316aab5327cb9c168051fabd3bc1cb
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8490
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agosrc/rtos/rtos_nuttx_stackings.c: Fix stack alignment for cortex-m targets
daniellizewski [Thu, 21 Mar 2024 13:58:34 +0000 (09:58 -0400)]
src/rtos/rtos_nuttx_stackings.c: Fix stack alignment for cortex-m targets

Backtraces performed by GDB on any thread other than the current
thread would fail if hardware 8 byte ISR stack alignment
was enabled on cortex_m targets. Stack reads now adjust
the stored SP to account for a potential offset introduced by hardware.
Fixed incorrect register offsets for cortex_m Nuttx frames by reading
the TCB info symbols to determine correct offsets.
Fixed offsets can no longer be used since the offsets have changed
multiple times for different Nuttx versions.
Tested on nuttx-12.1.0.
Tested using custom stm32h7 board and custom s32k148 board variants.
Built with CONFIG_ARCH_FPU enabled and disabled to
test FPU and non FPU frame logic.

Change-Id: Ifcbeefb0ddcfbcb528daa9d1d95732ca9584c9ef
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8180
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agoaarch64: Invalidate caches on reset
Peter Collingbourne [Thu, 1 Aug 2024 22:48:25 +0000 (15:48 -0700)]
aarch64: Invalidate caches on reset

When a target is reset we must invalidate register caches in order
to avoid showing stale register values or writing them back to
registers. Use EDPRSR.SR to detect a previous reset, and EDPRSR.R to
detect a current reset state.

Change-Id: Ia1e97d7154cf7789d392274eee475733086a835b
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8425
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agobinarybuffer: Fix inverted return value in buf_cmp
Jessica Clarke [Thu, 12 Sep 2024 19:12:05 +0000 (20:12 +0100)]
binarybuffer: Fix inverted return value in buf_cmp

This is the fast path for when there is a mismatch in the leading whole
bytes, which means we should return true to indicate not equal like all
the other cases here and in the surrounding functions. Otherwise we'll
incorrectly report _buf1 == _buf2 if and only if there are mismatches in
the leading whole bytes.

This was introduced during the refactor and optimisation referenced
below.

The only in-tree caller of this is jtag_check_value_inner, which will
just fail to catch some errors. However, downstream in riscv-openocd it
gets used in the riscv target to determine whether an IR scan is needed
to select the debug module, and with an IRLEN >= 8 this breaks resetting
if the encoding for the DMI isn't all-ones in its leading whole bytes
(to match BYPASS), since it will believe they are the same and not do an
IR scan, failing (with "At least one TAP shouldn't be in BYPASS mode")
in the subsequent DR scan due to the TAP still being recorded as having
bypass set (and really having an instruction of either BYPASS or
IDCODE).

Fixes: e4ee891759b0 ("improve buf_cmp and buf_cmp_mask helpers")
Change-Id: Ic4f7ed094429abc4c06a775eb847a8b3ddf2e2d6
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8489
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
7 months agoREADME: Use proper Markdown syntax
Marc Schink [Wed, 3 Jul 2024 13:16:27 +0000 (15:16 +0200)]
README: Use proper Markdown syntax

The README file contains a mixture of Markdown and non-Markdown syntax.
Refurbish the document and use only Markdown syntax according to the
specification in [1].

[1] https://www.markdownguide.org/

Change-Id: If58f4e2971dc798a03a78841226804ab1f2d33c8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8387
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agodoc/xtensa: update supported architecture list
Ian Thompson [Tue, 3 Sep 2024 21:32:42 +0000 (14:32 -0700)]
doc/xtensa: update supported architecture list

- Xtensa LX8 is fully supported in addition to prior LX and NX cores.

Change-Id: I2f3f0a21ce1518b3ced6d241f0ab84c65af64423
Signed-off-by: Ian Thompson <ianst@cadence.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8362
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/target: Add SpacemiT Key Stone K1 config
liangzhen [Mon, 2 Sep 2024 12:21:48 +0000 (20:21 +0800)]
tcl/target: Add SpacemiT Key Stone K1 config

Add basic connection details with Key Stone K1

Change-Id: I3e51d4194cfd3b7fe8ae395e0aca0fa4799dfb73
Signed-off-by: liangzhen <zhen.liang@spacemit.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8361
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agocheckpatch: check for SPDX in linker scripts
Antonio Borneo [Mon, 2 Sep 2024 09:02:19 +0000 (11:02 +0200)]
checkpatch: check for SPDX in linker scripts

Current script does not enforces the check for the SPDX tag in the
linker scripts.
Add the extension '.ld' in the OpenOCD specific part.

Change-Id: I1cb6bc52e9dd86d99a26393085c7e2c9e8bac11f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8475
Tested-by: jenkins
7 months agotarget: add imx8mp and evk board support
Jiafei Pan [Tue, 18 Jun 2024 04:15:21 +0000 (12:15 +0800)]
target: add imx8mp and evk board support

Have verified with JLink:
openocd -f interface/jlink.cfg -f board/nxp_imx8mp-evk.cfg
-c "gdb_breakpoint_override hard"

Change-Id: I74f8766b8c5334ca5758c2672c283ff2405de4c3
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8352
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agoflash/nor/sfdp, stmqspi: use native type for buffer size
Tomas Vanek [Wed, 14 Aug 2024 07:17:36 +0000 (09:17 +0200)]
flash/nor/sfdp, stmqspi: use native type for buffer size

Two different sizes uint8_t and uint32_t was used for this value
without a good reason.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I4bb60cc5397ffd0d37e7034e3930e62793140c8d
Reviewed-on: https://review.openocd.org/c/openocd/+/8439
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Tested-by: jenkins
7 months agoflash/nor/sfdp: expose SFDP_MAGIC in sfdp.h
Tomas Vanek [Wed, 14 Aug 2024 07:15:46 +0000 (09:15 +0200)]
flash/nor/sfdp: expose SFDP_MAGIC in sfdp.h

Could be handy for dummy transfer size detection.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ibb485218f6c2ff9066910bb58be0fc614b77add3
Reviewed-on: https://review.openocd.org/c/openocd/+/8438
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
7 months agotarget/espressif: add profiling function for ESP32-S3
Richard Allen [Thu, 1 Aug 2024 01:53:52 +0000 (20:53 -0500)]
target/espressif: add profiling function for ESP32-S3

Use the TRAX interface DEBUGPC if available.
Otherwise use default stop-and-go profiling.

ESP32-S3, before this patch:
Internal: 8 samples/second
FT2232H: 12 samples/second

After this patch:
Internal: 18ksamples/second
FT2232H: 100ksamples/second

Change-Id: I681f0bccf4263c1e24f38be511e3b3aec8bf4d60
Signed-off-by: Richard Allen <rsaxvc@rsaxvc.net>
Reviewed-on: https://review.openocd.org/c/openocd/+/8431
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Ian Thompson <ianst@cadence.com>
Reviewed-by: Yurii Shutkin <yurii.shutkin@gmail.com>
7 months agortos: use target_buffer_get_u32()
Antonio Borneo [Sun, 1 Sep 2024 13:01:56 +0000 (15:01 +0200)]
rtos: use target_buffer_get_u32()

Simplify the code using the target endianness independent API.

Change-Id: I39f720d0db9cf24eb41d7f359e4321bbc2045658
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8474
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agobinarybuffer: add asserts for the number of requested bits for get/set functions
Parshintsev Anatoly [Sat, 3 Aug 2024 19:10:57 +0000 (22:10 +0300)]
binarybuffer: add asserts for the number of requested bits for get/set functions

Change-Id: Ieca5b4e690c9713ad60dc9d8c223c2d64822e2f5
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8427
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/boards: Add support of LP-CC1352P7 board
Alexandre Bailon [Fri, 29 Mar 2024 20:14:54 +0000 (21:14 +0100)]
tcl/boards: Add support of LP-CC1352P7 board

This adds support of TI LP-CC1352P7 evaluation kit.

For further details, see https://www.ti.com/tool/LP-CC1352P7.

Change-Id: I4aba160dbf4920febb7897458d06450e7d134147
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8194
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Vaishnav M A <vaishnav@beagleboard.org>
7 months agotcl/target: Add support of CC1352P7
Alexandre Bailon [Fri, 29 Mar 2024 20:14:29 +0000 (21:14 +0100)]
tcl/target: Add support of CC1352P7

This adds support for TI CC13X2X7 / CC26X2X7 family.

For further details, see https://www.ti.com/lit/ug/swcu192/swcu192.pdf.

Change-Id: Ifd9b505716ddf0abbdd00f617e50a93a3d4fbe6a
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8193
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Vaishnav M A <vaishnav@beagleboard.org>
7 months agoflash/nor: Update cc26xx flash driver to support cc13x2x7
Alexandre Bailon [Fri, 29 Mar 2024 20:13:17 +0000 (21:13 +0100)]
flash/nor: Update cc26xx flash driver to support cc13x2x7

This updates the flash driver to support more than one bank.
This is required to support the cc1352p7 which has two banks.

This only have been tested on a cc1352p7.
The loader has been built using a gcc-arm-none-eabi-4_8-2014q3
toolchain.

Change-Id: Ia813421ececd96d6e2fd4dae910ad60fcc3d3c88
Signed-off-by: Alexandre Bailon <abailon@baylibre.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8192
Tested-by: jenkins
Reviewed-by: Vaishnav M A <vaishnav@beagleboard.org>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agosrc/flash/nor/kinetis.c: Fixed flash bank write gap
daniellizewski [Fri, 23 Aug 2024 12:31:04 +0000 (08:31 -0400)]
src/flash/nor/kinetis.c: Fixed flash bank write gap

Flash banks created in kinetis_create_missing_banks did not populate
bank->minimal_write_gap. The default value of 0 was interpreted as
FLASH_WRITE_CONTINUOUS. This created unnecessary large padding if your
binary had a gap in the populated flash. It also caused flash errors
when loading with GDB because the erroneously padded pages were not
erased first. Tested using an S32k148 using s32k.cfg.

Change-Id: I9b7af698e29ac2c4f5fc8ecd82fa7f4b1a0d43f1
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8463
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agotcl/interface/ftdi: add support for Sipeed USB-JTAG/TTL Debugger
Jun Yan [Sat, 31 Aug 2024 11:28:46 +0000 (19:28 +0800)]
tcl/interface/ftdi: add support for Sipeed USB-JTAG/TTL Debugger

Sipeed USB-JTAG/TTL Debugger is a compact FT2232D-based JTAG adapter.

Change-Id: Ibc9075723f47cd9b49ba4bb39e3d292e7d80bed7
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8472
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agodrivers/jlink: Print serial numbers when multiple devices are connected
Marcus Nilsson [Wed, 7 Aug 2024 09:24:04 +0000 (11:24 +0200)]
drivers/jlink: Print serial numbers when multiple devices are connected

When multiple jlink programmers are connected and no specific serial
or USB location is specified, print out the detected serial numbers.

Signed-off-by: Marcus Nilsson <brainbomb@gmail.com>
Change-Id: I280da2b85363f7054c5f466637120427cadcf7d1
Reviewed-on: https://review.openocd.org/c/openocd/+/8356
Reviewed-by: Mark Zhuang <mark.zhuang@spacemit.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agortos/hwthread: fix threadid generation
Parshintsev Anatoly [Fri, 30 Aug 2024 19:45:07 +0000 (22:45 +0300)]
rtos/hwthread: fix threadid generation

Looks like 7f2d3e2925 introduced a regression by incorrectly assigning
threads. The title of the commit message says that the intention was to
"derive threadid from SMP index", this is not what happens, however.
Instead threadid is assigned based on an index of all examined targets
in an SMP group.

This introduces two logical errors.

*Error 1*

Here is the code that assigns threads to harts:

```
foreach_smp_target(head, target->smp_targets) {
  struct target *curr = head->target;

  if (!target_was_examined(curr))
    continue;

  threadid_t tid = threads_found + 1;
  hwthread_fill_thread(rtos, curr, threads_found, tid);
```

Now, imagine a situation when we have two targets: `target.A` and
`target.B`.  Let's assume that `target.A` is NOT examined (it could be
under reset, for example).  Then, according to the algorithm when
assigning thread identifiers `target.B` will be assigned tid of 1. The
respected inferior on GDB side will be called `Thread 1`.

Now, imagine that `target.A` activates and succefully examined - OpenOCD
will re-assign thread identifiers. And now on GDB side `Thread 1` will
represent the state of `target.A`. Which is incorrect.

*Error 2*

The reverse mapping between `threadid` and targets does not take the
state of targets into account.

```
static struct target *
hwthread_find_thread(struct target *target, threadid_t thread_id)
...
  threadid_t tid = 1;
  foreach_smp_target(head, target->smp_targets) {
    if (thread_id == tid)
      head->target;
    ++tid;
  }
```

So the constructed mapping is incorrect. Since in example above
`Thread 1` will get mapped to `target.A`.

*Solution:*

It seems that threadids should be assigned based on position of the
thread in an smp group disregarding the target state.

Change-Id: Ib93b7ed3bb03696afdf56a105b333e22b9ec69b5
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8471
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Mark Zhuang <mark.zhuang@spacemit.com>
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
7 months agotcl/target: Make sure R-Car Gen3 _targets variable is global
Marek Vasut [Thu, 22 Aug 2024 23:29:02 +0000 (01:29 +0200)]
tcl/target: Make sure R-Car Gen3 _targets variable is global

The _targets has to be global as it is accessed at the end of this file.
This is already the case for setup_a5x {}, assure it is the same way for
setup_crx{} . Without this change, the _targets at the end of this file
is empty in case the Cortex-R is the boot core, fix this.

Change-Id: I4979e3125ec7d93bbd56eee0096ae1d9c5f6a565
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8470
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/board: Support for Digilent Anvyl board
Adam Novak [Mon, 26 Aug 2024 02:36:29 +0000 (22:36 -0400)]
tcl/board: Support for Digilent Anvyl board

Support Digilent Anvyl board JTAG chain

Change-Id: I6fb52284429af6c98c19411fc8bc3ab983dfa9b8
Signed-off-by: Adam Novak <interfect@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8467
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtag_vpi: fix signed/unsigned comparison jtag_vpi_stableclocks
Parshintsev Anatoly [Tue, 20 Aug 2024 13:07:17 +0000 (16:07 +0300)]
jtag_vpi: fix signed/unsigned comparison jtag_vpi_stableclocks

Change-Id: Id2b00fbc8ba627f4465c109fbde6e010faaff9d2
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8462
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agocpld: update warning to suggest virtex2 refresh
Adam Novak [Mon, 26 Aug 2024 02:51:22 +0000 (22:51 -0400)]
cpld: update warning to suggest virtex2 refresh

virtex2 refresh replaced virtex2 program, but the even older programming
commands like xc6s_program still suggest the old, now-removed program
command. This changes the warnings to suggest the command that is still
there, and also adds some indication that you will need to use the .pld
name instead of the .tap name.

Change-Id: I292da62a95a9b414c69cdb1bba8a28dfd16a7336
Signed-off-by: Adam Novak <interfect@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8468
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Daniel Anselmi <danselmi@gmx.ch>
7 months agoflash/stm32l4x: option_write usage: mask is optional
Ondřej Hošek [Sun, 25 Aug 2024 21:50:07 +0000 (23:50 +0200)]
flash/stm32l4x: option_write usage: mask is optional

If no mask is given, the value in the option register is replaced
completely. If a mask is set, only those bits that are set in the mask
are transferred into the option register; the others remain unchanged.

Change-Id: If488a10f92d7dcc0e0f192aef5e67c255fd529c3
Signed-off-by: Ondřej Hošek <ondra.hosek@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8466
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agodoc: fix stm32l4x option_write usage
Ondřej Hošek [Sun, 25 Aug 2024 11:54:15 +0000 (13:54 +0200)]
doc: fix stm32l4x option_write usage

stm32l4x option_write works like stm32h7x option_write, i.e. expects the
value to write after reg_offset and optionally reg_mask after the value.

Change-Id: I57fb4fb1dbf7f43fe063b48f4db2dd5f2ef0ade0
Signed-off-by: Ondřej Hošek <ondra.hosek@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8464
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agodrivers/cmsis_dap: Fix buffer overflow in cmsis_dap_hid_open()
Marcus Nilsson [Mon, 6 May 2024 09:40:00 +0000 (11:40 +0200)]
drivers/cmsis_dap: Fix buffer overflow in cmsis_dap_hid_open()

Use mbstowcs() to get required length of wide character string and
include space for terminating null wide character.

Change-Id: I668de6f0acc9b3ec5aca033d870dd9ef354f9077
Signed-off-by: Marcus Nilsson <brainbomb@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8232
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agobinarybuffer: str_to_buf(): align prefix to TCL syntax
Antonio Borneo [Sun, 25 Aug 2024 13:38:07 +0000 (15:38 +0200)]
binarybuffer: str_to_buf(): align prefix to TCL syntax

Integer values are interpreted by TCL as decimal, binary, octal
or hexadecimal if prepended with '0d', '0b', '0o' or '0x'
respectively.
The case of '0' prefix has been interpreted as octal till TCL 8.6
but is interpreted as part of a decimal number by JimTCL and from
TCL 9.

Align str_to_buf() to latest TCL syntax by:
- addding support for '0d', '0b' and '0o' prefix;
- dropping support for '0' prefix.

Change-Id: I708ef72146d75b7bf429df329a0269cf48700a44
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8465
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
8 months agotarget/cortex_m: add DSCSR_CDSKEY bit definition
Tomas Vanek [Mon, 5 Feb 2024 10:51:24 +0000 (11:51 +0100)]
target/cortex_m: add DSCSR_CDSKEY bit definition

Needed e.g. for flash drivers handling secure mode.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: If6cb49609140d06a73bcf2e446b6a634d6326e80
Reviewed-on: https://review.openocd.org/c/openocd/+/8435
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agortt: default the ID to "SEGGER RTT"
Karl Palsson [Tue, 16 Jan 2024 13:52:56 +0000 (13:52 +0000)]
rtt: default the ID to "SEGGER RTT"

Instead of making people type this in all the time, just default to
"SEGGER RTT" so more things work out of the box.

Change-Id: I147142cf0a755e635d3f66e047be2eb5049cf511
Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8354
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotarget: fix profiler output on Windows
Richard Allen [Wed, 15 May 2024 17:29:05 +0000 (12:29 -0500)]
target: fix profiler output on Windows

Open output file in binary mode to disable EOL
conversion on Windows (and sometimes cygwin depending
on installation settings and path).

Change-Id: I38276dd1af011ce5781b0264b7cbb08c32a1a2ad
Signed-off-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8278
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agodoc: document that breakpoints are disabled on step/resume
Parshintsev Anatoly [Thu, 4 Jul 2024 17:52:13 +0000 (20:52 +0300)]
doc: document that breakpoints are disabled on step/resume

OpenOCD disables breakpoints on step/resume if they
match the current code position. This is a non-obvious
behavior that should be documented

Change-Id: Id762066569ec6452869a58dfcd9df88c8a14d6ab
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8388
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotarget/breakpoints: Use 'unsigned int' for length
Marc Schink [Wed, 31 Jul 2024 07:35:03 +0000 (09:35 +0200)]
target/breakpoints: Use 'unsigned int' for length

Change-Id: I233efb5b18de5f043fdc976807437db0a94236d1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7056
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agoarm_cti: Add CTIDEVCTL to register list
Peter Collingbourne [Thu, 1 Aug 2024 02:05:06 +0000 (19:05 -0700)]
arm_cti: Add CTIDEVCTL to register list

This is useful for setting a reset catch on a CPU that is being
brought out of reset.

Change-Id: Id8fe9bc3f75fd170f207f470a9f3b0faba7f24c1
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8422
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agoarm_cti: Clean up the list of CTI registers
Peter Collingbourne [Thu, 1 Aug 2024 02:02:42 +0000 (19:02 -0700)]
arm_cti: Clean up the list of CTI registers

Reduce the amount of boilerplate by moving cti_regs into its only
user, making it a local variable and removing the now-redundant
p_val pointer.

Change-Id: I778cc1e960532fae1ac1a952c6ff19c54e578a5f
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8421
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agoarm_adi_v5: Also clear sticky overrun bit on init
Peter Collingbourne [Wed, 31 Jul 2024 01:03:33 +0000 (18:03 -0700)]
arm_adi_v5: Also clear sticky overrun bit on init

Some targets start up with the sticky overrun bit set. On such targets
we need to clear it in order to avoid subsequent incorrect reads.

Change-Id: I3e939a9e092de6fcea9494d3179a3386aa1701d2
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8420
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 months agotarget: arm_adi_v5: add more CoreSight P/N
Antonio Borneo [Fri, 7 Jun 2024 12:42:58 +0000 (14:42 +0200)]
target: arm_adi_v5: add more CoreSight P/N

Add part numbers for:
- Cortex-A65AE,
- Cortex-M52,
- Cortex-M55,
- Cortex-R52+,
- STAR-MC1.

Change-Id: I6282768896dd727e803a071139816494470744f1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8319
Tested-by: jenkins
8 months agotarget/arm_cti: Use suitable data types
Marc Schink [Thu, 1 Aug 2024 07:22:02 +0000 (09:22 +0200)]
target/arm_cti: Use suitable data types

While at it, fix some small coding style issues.

Change-Id: Ifb8e78b55d29a06d69a3ce71d12d0040777aef13
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8423
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agocheckpatch: only report error on hit
Antonio Borneo [Thu, 1 Aug 2024 08:43:41 +0000 (10:43 +0200)]
checkpatch: only report error on hit

The Linux checkpatch script used by OpenOCD reports hits either as
error, warning and check.
Such classification is meaningful for Linux maintainers, but for
OpenOCD Jenkins they are all considered as errors.

Having such classification in the checkpatch report by Jenkins is
misleading for developers that expect 'warnings' to be probably
ignored by maintainers, while having no idea what 'checks' means.

This patch flattens all the checkpatch reports to 'error' only.

Checkpatch can trigger false positives. OpenOCD uses the tag
Checkpatch-ignore:
in the commit message to prevent Jenkins to report the error, as
described in HACKING.

Change-Id: I1d3164ba1f725c0763dfe362192ffa669b3856e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8424
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
8 months agobinarybuffer: str_to_buf(): simplify it and fix scan-build error
Antonio Borneo [Sun, 14 Jul 2024 12:59:34 +0000 (14:59 +0200)]
binarybuffer: str_to_buf(): simplify it and fix scan-build error

The function str_to_buf() can be simplified by writing directly
the intermediate results in the output buffer.
Such simplification improves the readability and also makes
scan-build happy, as it does not trigger anymore the warning:
src/helper/binarybuffer.c:328:8: warning: Use of memory
allocated with size zero [unix.Malloc]
if ((b256_buf[(buf_len / 8)] & mask) != 0x0) {

Change-Id: I1cef9a1ec5ff0e5841ba582610f273e89e7a81da
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8396
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Tested-by: jenkins
8 months agobinarybuffer: str_to_buf(): rename buf_len as buf_bitsize
Antonio Borneo [Sun, 14 Jul 2024 10:31:53 +0000 (12:31 +0200)]
binarybuffer: str_to_buf(): rename buf_len as buf_bitsize

The name 'buf_len' is misleading, as it usually refers to the byte
length of a buffer. Here we use it for the length in bits.

Rename it as 'buf_bitsize'.
While there, fix checkpatch error by changing the index type to
'unsigned int'.

Change-Id: I78855ed79a346d996d9c0100d94d14c64a36b228
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8395
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
8 months agobinarybuffer: simplify the prototype of str_to_buf()
Antonio Borneo [Sun, 14 Jul 2024 10:09:15 +0000 (12:09 +0200)]
binarybuffer: simplify the prototype of str_to_buf()

With 'radix' always zero and '_detected_radix' always NULL, drop
the two parameters and simplify str_to_buf().

While there:
- drop some redundant assert(),
- drop the re-check for the base prefix,
- simplify str_strip_number_prefix_if_present() and rename it, as
  the prefix MUST be present,
- fix a minor typo,
- update the doxygen description of str_to_buf().

Change-Id: I1abdc8ec0587b23881953d3094101c04d5bb1c58
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8394
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
8 months agohelper: command: drop radix parameter from command_parse_str_to_buf()
Antonio Borneo [Sun, 14 Jul 2024 09:28:49 +0000 (11:28 +0200)]
helper: command: drop radix parameter from command_parse_str_to_buf()

Commit 53b94fad58ab ("binarybuffer: Fix str_to_buf() parsing
function") introduces the helper command_parse_str_to_buf() to
parse as number a string on TCL command-line.
The parameter 'radix' can specify the base (decimal, octal,
hexadecimal, or auto-detected).

TCL is supposed to use decimal numbers by default, while octal and
hexadecimal numbers must be prefixed respectively with '0' and
'0x' (or '0X').
This would require the helper to always run auto-detection of the
base, thus always set the 'radix' parameter to zero. This makes
the parameter useless.

Keeping the 'radix' parameter can open the door to future abuse of
TCL syntax, E.g. a command can require an octal value without the
mandatory TCL '0' prefix; the octal value cannot be the result of
TCL expression.

To prevent any future abuse of the 'radix' parameter, drop it.

Change-Id: I88855bd83b4e08e8fdcf86a2fa5ef3269dd4ad57
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8393
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
8 months agodoc: document command 'ms'
Antonio Borneo [Mon, 12 Aug 2024 11:39:36 +0000 (13:39 +0200)]
doc: document command 'ms'

Add documentation for the commands 'ms'.

Change-Id: I247adce1c586c4f4cd36d044d48298c370635e67
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8432
Tested-by: jenkins
8 months agotcl/interface/raspberrypi5-gpiod: fix string match pattern escaping
Tomas Vanek [Fri, 2 Aug 2024 17:45:09 +0000 (19:45 +0200)]
tcl/interface/raspberrypi5-gpiod: fix string match pattern escaping

Use correct TCL syntax and save string map operation.

Change-Id: Ic2a522bd57cf6610b7df1d9cddd0fbdc2076ed62
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8426
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agoserver/telnet: Always allow 'exit' command
Marc Schink [Mon, 24 Jun 2024 14:26:46 +0000 (16:26 +0200)]
server/telnet: Always allow 'exit' command

The telnet 'exit' command is only available in the execution phase of
OpenOCD. Thus, a telnet session cannot be closed via 'exit' if OpenOCD
is started with 'noinit'. Make the 'exit' command always available.

Change-Id: I14447ecde63e579f1c523d606f048ad29cc84a35
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8379
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
8 months agotransport: Remove echo in transport selection
Marc Schink [Mon, 15 Apr 2024 19:02:43 +0000 (21:02 +0200)]
transport: Remove echo in transport selection

Do not echo the selected transport to avoid stray and confusing
messages in the output of OpenOCD. For example, the "swd" line here:

  Open On-Chip Debugger 0.12.0+dev-00559-ge02f6c1b9-dirty
  Licensed under GNU GPL v2
  For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html
  swd
  Info : Listening on port 6666 for tcl connections
  Info : Listening on port 4444 for telnet connections

While at it, fix some small documentation style issues.

Change-Id: Ie85426c441289bbaa35615dbb7b53f0b5c46cfc0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8217
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agotarget/breakpoints: Fix 'orig_instr' output
Marc Schink [Sun, 21 Apr 2024 18:00:28 +0000 (20:00 +0200)]
target/breakpoints: Fix 'orig_instr' output

The 'orig_instr' information of software breakpoints is incorrect
because buf_to_hex_str() expects the length of the buffer to be
converted in bits and not bytes.

Change-Id: I9a9ed383a8c25200d461b899749d5259ee4c6e3d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8218
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agodoc: Add 'jlink targetpower' command
Marc Schink [Wed, 24 Jul 2024 18:56:38 +0000 (20:56 +0200)]
doc: Add 'jlink targetpower' command

Change-Id: I7e6c9e75f3c70675a3ea55fd5f0d7de1a35f2c4b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8418
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agoadapter/jlink: Allow to determine the target power state
Marc Schink [Wed, 24 Jul 2024 18:39:57 +0000 (20:39 +0200)]
adapter/jlink: Allow to determine the target power state

Change-Id: I0b4f543e0ba0e48c43f78e32e4fa41d7dec9d7b8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8417
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agoadapter/jlink: Use COMMAND_PARSE_* instead of sscanf()
Marc Schink [Mon, 22 Jul 2024 15:56:55 +0000 (17:56 +0200)]
adapter/jlink: Use COMMAND_PARSE_* instead of sscanf()

While at it, apply some coding style fixes.

Change-Id: I77a6917a045af733ebe9211ca338952dbd49c89b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8416
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agojtag: Use 'unsigned int' data type
Marc Schink [Mon, 22 Jul 2024 07:30:42 +0000 (09:30 +0200)]
jtag: Use 'unsigned int' data type

This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: I364467b88f193f8387623a19e6994ef77899d117
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8414
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag: Use 'unsigned int' for 'scan_field.num_bits'
Marc Schink [Sun, 21 Jul 2024 18:28:17 +0000 (20:28 +0200)]
jtag: Use 'unsigned int' for 'scan_field.num_bits'

This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: Idcbbbbbea2705512201eb326c3e6cef110dbc674
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8413
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotarget/avrt: Remove unused parameter 'rti'
Marc Schink [Sun, 21 Jul 2024 15:43:08 +0000 (17:43 +0200)]
target/avrt: Remove unused parameter 'rti'

Change-Id: Ib6957b89190188f5c15fadc3d4036709f19a6cea
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8412
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag/commands: Use 'unsigned int' data type
Marc Schink [Wed, 17 Jul 2024 15:35:42 +0000 (17:35 +0200)]
jtag/commands: Use 'unsigned int' data type

This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: Ie048b3d472f546fecb6733f17f9d0f17fda40187
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8404
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag: Use 'unsigned int' for 'ir_length'
Marc Schink [Wed, 17 Jul 2024 14:59:51 +0000 (16:59 +0200)]
jtag: Use 'unsigned int' for 'ir_length'

This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be modified
in following patches.

Change-Id: I83921d70e017095d63547e0bc9fe61779191d9d0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8403
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag: Use 'unsigned int' for 'abs_chain_position'
Marc Schink [Wed, 17 Jul 2024 14:48:14 +0000 (16:48 +0200)]
jtag: Use 'unsigned int' for 'abs_chain_position'

Change-Id: I1ac0a6a86f820b051619aa132754a69b8f8e0ab9
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8402
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag: Use bool data type for 'jtag_verify'
Marc Schink [Wed, 17 Jul 2024 13:11:46 +0000 (15:11 +0200)]
jtag: Use bool data type for 'jtag_verify'

Change-Id: Iae46e45c7523252eee44224e6b9b3b1484aaeb35
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8401
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agouncrustify.cfg: add SPDX license
Antonio Borneo [Sun, 21 Jul 2024 11:07:47 +0000 (13:07 +0200)]
uncrustify.cfg: add SPDX license

Add the SPDX tag line.

Change-Id: I701580948a0cacdb7fe31d91ed730e848da9b0ba
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8411
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
8 months agodoc: Makefile.am: add SPDX license
Antonio Borneo [Sun, 21 Jul 2024 11:06:58 +0000 (13:06 +0200)]
doc: Makefile.am: add SPDX license

Add the SPDX tag line.

Change-Id: Iffe73faaf20614f9e5237b7afba3c580dfa03a9e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8410
Tested-by: jenkins
8 months agotcl: fix minor typos and repeated words
Antonio Borneo [Sun, 21 Jul 2024 11:04:36 +0000 (13:04 +0200)]
tcl: fix minor typos and repeated words

Detected with checkpatch.

Change-Id: Id306928496cf70bbe7ff065bf726bc7dceadce26
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8409
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
8 months agocheckpatch: extend checks to TCL, Makefile.am and configure.ac files
Antonio Borneo [Sun, 21 Jul 2024 11:00:08 +0000 (13:00 +0200)]
checkpatch: extend checks to TCL, Makefile.am and configure.ac files

The script, originally written for Linux code, skips several tests
on files whose name's extension is not in Perl list
'(h|c|s|S|sh|dtsi|dts)$'.
This causes such tests to not be executed on OpenOCD TCL files and
on Makefile.am and configure.ac.

Modify the script to include the OpenOCD files in the list.

Change-Id: I17c96bf32ee40d9390e60996e176e4e927c00197
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8408
Reviewed-by: Marek Kraus <gamelaster@outlook.com>
Tested-by: jenkins
8 months agotcl/target: add initial Bouffalo Lab BL702 chip series support
Marek Kraus [Sat, 20 Jul 2024 14:29:19 +0000 (16:29 +0200)]
tcl/target: add initial Bouffalo Lab BL702 chip series support

Adds initial support for the BL702 series of chips, BL702, BL704 and BL706.
No flash bank support yet.

File name bl702.tcl was chosen over bl70x.tcl, because Bouffalo Lab
uses bl702 to mark the whole series in many of their tools.

The ndmreset bit in the RISC-V Debug Module isn't implemented correctly,
so it doesn't trigger a system reset as it should.
To solve this problem, the software reset is implemented
in the reset-assert-pre hook, which uses best reset method I could find.
What is not reset is the GLB core, which handles GPIOs, pinmux, etc.
The reset mechanism has been extensively tested, and works correctly
for both "reset run" and "reset halt", which the latter
halts very early in the BootROM.

Change-Id: I5ced6eb3902d1b9d9c1bba56f817ec5dc3493cb0
Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8407
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agoconfigure: Use pkg-config for jimtcl
Marc Schink [Tue, 2 Jul 2024 15:14:22 +0000 (17:14 +0200)]
configure: Use pkg-config for jimtcl

The jimtcl project supports pkg-config, use it for a simpler
configuration of compiler and linker flags and to enforce the minimum
required package version.

Since the jimtcl pkg-config file is not available on all systems, use
AC_CHECK_HEADER() as fallback.

Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8383
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agoflash/startup.tcl: Tidy flash program preverify documentation
Grant Ramsay [Tue, 25 Jun 2024 04:52:59 +0000 (16:52 +1200)]
flash/startup.tcl: Tidy flash program preverify documentation

Remove the hyphen from "pre-verify" in usage text.
Add preverify to the help text and procedure comment

Change-Id: I6d96e78ca84d99929300d461e435f5b4ce07b5db
Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8376
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agojep106: update to revision JEP106BJ.01 July 2024
Antonio Borneo [Thu, 18 Jul 2024 12:51:01 +0000 (14:51 +0200)]
jep106: update to revision JEP106BJ.01 July 2024

Change-Id: Iebab3f6a3b1f6d82f955997fd4e691c55d01c767
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8406
Tested-by: jenkins
8 months agodoc: fix makeinfo warning
Antonio Borneo [Sun, 14 Jul 2024 08:46:48 +0000 (10:46 +0200)]
doc: fix makeinfo warning

Build returns a makeinfo warning:
openocd.texi:5201: warning: `.' or `,' must follow @xref, not f

Add a dummy ',' after '@xref{..}' to silent the warning.

Fixes: 44cfdef0a40d ("server/gdb: Restructure commands")
Change-Id: Ic0bff8fc9b54942ebb72762816686ea7c7881345
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8392
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
8 months agocortex_m: fix scan-build false positive
Antonio Borneo [Sat, 13 Jul 2024 17:14:39 +0000 (19:14 +0200)]
cortex_m: fix scan-build false positive

Scan-build is unable to detect that 'target->dbg_msg_enabled' does
not change across the function cortex_m_fast_read_all_regs().
It incorrectly assumes that it can be false at the first check (so
'dcrdr' get not assigned) and it is true later on (when 'dcrdr'
get used).
This triggers a false positive:
src/target/cortex_m.c:338:12: warning:
3rd function call argument is an uninitialized value
[core.CallAndMessage]
retval = mem_ap_write_atomic_u32(armv7m->debug_ap, DCB_DCRDR, dcrdr);

Use a local variable for 'target->dbg_msg_enabled' so scan-build
can track it as not modified.
While there, change the type of 'target->dbg_msg_enabled' to
boolean as there is no reason to use uint32_t.

Change-Id: Icaf1a1b2dea8bc55108182ea440708ab76396cd7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8391
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agoflash/stm32l4x: support STM32U53/U54x devices
Tarek BOCHKATI [Fri, 28 Apr 2023 16:06:56 +0000 (17:06 +0100)]
flash/stm32l4x: support STM32U53/U54x devices

STM32U53/U54x devices are similar to U57/U58x devices
with 2 flash banks up to 256 KB each

Change-Id: I774ef0df4dddac5f06bbfc2e6c3fc2e628d2249e
Signed-off-by: FBOSTM <fedi.bouzazi@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7515
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agoflash/stm32l4x: support STM32U59/U5Ax devices
Tarek BOCHKATI [Fri, 3 Dec 2021 12:16:50 +0000 (13:16 +0100)]
flash/stm32l4x: support STM32U59/U5Ax devices

STM32U59/U5Ax devices are similar to U57/U58x devices
with 2 flash banks up to 2 MB each

while at there update STM32U57x/U58x revisions

Change-Id: I7e5c1700acf8c9fda34f660c9274bfd8bcb1381b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6875
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agortos/hwthread: derive threadid from SMP index
Evgeniy Naydanov [Tue, 31 Oct 2023 17:51:48 +0000 (20:51 +0300)]
rtos/hwthread: derive threadid from SMP index

As defined in `target/target.h`, `coreid` is the index of the target on
the TAP, so, if an SMP group includes targets from multiple TAPs, it can
not be used as the base for `threadid`.

Change-Id: Ied7cfa42197aaf4908ef6628c6436f28d4856ebe
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7957
Tested-by: jenkins
Reviewed-by: Mark Zhuang <mark.zhuang@spacemit.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/board: Add am62p/am62a7/j722s native swd configuration
Nishanth Menon [Thu, 16 May 2024 20:49:37 +0000 (15:49 -0500)]
tcl/board: Add am62p/am62a7/j722s native swd configuration

Direct memory driver swd native configuration for am62a7, am62p and
J722S SoCs. All three share common memory map for the debug address
map, so there is a strong reuse. However, introduce board file
specific to the board to allow users to directly get started.

Change-Id: I5609925a2e9918fd4c91d9fd40fbee98de27fdbc
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8283
Tested-by: jenkins
Reviewed-by: Vaishnav M A <vaishnav@beagleboard.org>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
9 months agotcl: Replace 'tcl_' prefix with 'tcl' command group
Marc Schink [Mon, 17 Jun 2024 14:39:10 +0000 (16:39 +0200)]
tcl: Replace 'tcl_' prefix with 'tcl' command group

Change-Id: Iee1e84a87d07172aa6b0adfb7b85fb465cefb979
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8345
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoserver/tcl: Restructure commands
Marc Schink [Mon, 17 Jun 2024 07:12:34 +0000 (09:12 +0200)]
server/tcl: Restructure commands

Use a command group 'tcl' with subcommands instead of individual
commands with 'tcl_' prefix.

The old commands are still available to ensure backwards compatibility,
but are marked as deprecated.

Change-Id: I1efd8a0e2c1403833f8cb656510a54d5ab0b2740
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8344
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotcl: Replace 'gdb_' prefix with 'gdb' command group
Marc Schink [Fri, 14 Jun 2024 14:28:38 +0000 (16:28 +0200)]
tcl: Replace 'gdb_' prefix with 'gdb' command group

Change-Id: I0490b4c112c1a922bf77a4b37df2a630a8f6cea1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8337
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agoserver/gdb: Restructure commands
Marc Schink [Fri, 14 Jun 2024 14:19:56 +0000 (16:19 +0200)]
server/gdb: Restructure commands

Use a command group 'gdb' with subcommands instead of individual
commands with 'gdb_' prefix.

The old commands are still available to ensure backwards compatibility,
but are marked as deprecated.

Change-Id: I037dc58554e589d5710cf46924e0a00f863aa300
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8336
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agojtag/drivers/mpsse: Added FT4232HA
Jonathan Forrest [Wed, 1 May 2024 04:25:32 +0000 (14:25 +1000)]
jtag/drivers/mpsse: Added FT4232HA

Added FT4232HA varianet of FTDI's FT4232H which has a different bcd.
Also added default PID/VID for the FT4243HA to contrib/60-openocd.rules.
And added default PID/VIDs for FTDI's HP ICs to contrib/60-openocd.rules
as this wasn't done previously.

BugLink: https://sourceforge.net/p/openocd/tickets/410/
Change-Id: Ia84b566aa004332d3f7815a3d22ac37eee4f522a
Signed-off-by: Jonathan Forrest <jonyscathe@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8225
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agobinarybuffer: Fix str_to_buf() parsing function
Jan Matyas [Mon, 3 Jun 2024 08:23:02 +0000 (10:23 +0200)]
binarybuffer: Fix str_to_buf() parsing function

The function str_to_buf() was too benevolent and did
not perform sufficient error checking on the input
string being parsed. Especially:

- Invalid numbers were silently ignored.
- Out-of-range numbers were silently truncated.

The following commands that use str_to_buf()
were affected:

- reg (when writing a register value)
- set_reg
- jtag drscan

This pull request fixes that by:

- Rewriting str_to_buf() to add the missing checks.
- Adding function command_parse_str_to_buf() which can
  be used in command handlers. It parses the input
  numbers and provides user-readable error messages
  in case of parsing errors.

Examples:

jtag drscan 10 huh10

- Old behavior: The string "huh10" is silently
  converted to 10 and the command is then executed.
  No warning error or warning is shown to the user.
- New behavior: Error message is shown:
  "'huh10' is not a valid number"

reg pc 0x123456789

Assuming the "pc" is 32 bits wide:

- Old behavior: The register value is silently
  truncated to 0x23456789 and the command is performed.
- New behavior: Error message is shown to the user:
  "Number 0x123456789 exceeds 32 bits"

Change-Id: I079e19cd153aec853a3c2eb66953024b8542d0f4
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8315
Tested-by: jenkins
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoflash/nor/nrf5: remove asserts on dereferenced pointers
Tomas Vanek [Sat, 8 Jun 2024 09:59:29 +0000 (11:59 +0200)]
flash/nor/nrf5: remove asserts on dereferenced pointers

The driver code works reliably, no need to use assert() everywhere.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Idb1942bfd31d370a74610b8a8836bc2e64370557
Reviewed-on: https://review.openocd.org/c/openocd/+/8324
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoflash/nor/nrf5: split chip and bank probes
Tomas Vanek [Sat, 8 Jun 2024 09:33:35 +0000 (11:33 +0200)]
flash/nor/nrf5: split chip and bank probes

nrf5_auto_probe() always re-probed chip hardware to
get flash geometry.

Introduce nrf5_probe_chip() and move chip related probing to it.
Save all flash parameters needed for bank setup to struct nrf5_info.

Introduce nrf5_setup_bank() and move bank setup code to it.

Call both chip probe and bank setup unconditionally from nrf5_probe():
in case of manual issuing 'flash probe' command, we should refresh actual
values from the device.

Call chip probe and bank setup only if not done before from
nrf5_auto_probe().

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Ib090a97fd7a41579b3d4f6e6634a5fdf93836c83
Reviewed-on: https://review.openocd.org/c/openocd/+/8322
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotarget/xtensa: flag additional write-only registers
Ian Thompson [Tue, 14 May 2024 22:55:58 +0000 (15:55 -0700)]
target/xtensa: flag additional write-only registers

intsetN, intclearN (for LX8)
mesrclr (for NX)

Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I0bb59728fcec761a71c4789189f733a10bad6375
Reviewed-on: https://review.openocd.org/c/openocd/+/8235
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotarget: cortex_m: replace 'implementor' with 'implementer'
Antonio Borneo [Tue, 4 Jun 2024 09:50:19 +0000 (11:50 +0200)]
target: cortex_m: replace 'implementor' with 'implementer'

ARM documentation for Cortex-M reports the field 'implementer' in
the register CPUID.
OpenOCD used the miss-spelled 'implementor'. Fix it!

Change-Id: I854d223971ae7a49346e1f7491c2c0415f5e2c1d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8318
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
9 months agotarget: cortex_m: add detection for Cortex-M52
Antonio Borneo [Tue, 4 Jun 2024 09:11:25 +0000 (11:11 +0200)]
target: cortex_m: add detection for Cortex-M52

Add Cortex-M52 to the list of known Cortex-M implementations to
allow detection of the core.
Values checked against the ARM document "Arm China Cortex®-M52
Processor Technical Reference Manual" 102776_0002_06_en.

Reported-by: Joseph Yiu <Joseph.Yiu@arm.com>
Change-Id: Id0bde8a0476f76799b7274835db9690f975e2dd6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8317
Tested-by: jenkins
9 months agotarget: cortex_m: fix detection of STAR-MC1 device
Antonio Borneo [Tue, 4 Jun 2024 08:30:20 +0000 (10:30 +0200)]
target: cortex_m: fix detection of STAR-MC1 device

The detection of Cortex-M STAR-MC1 was introduced with [1], at a
time when OpenOCD was only checking the field PartNo of the CPUID
register.
Later-on [2], OpenOCD extended the check to the field implementer
of CPUID register. The value for ARM (0x41) implementer was used
to all the Cortex-M, but no feedback for STAR-MC1 was available. A
comment reporting the possible mismatch was added.

As reported on OpenOCD mailing-list, the technical reference manual
for STAR-MC1 is now available [3] and it reports the implementer
as ARM China (0x63) [3].

Fix the STAR-MC1 implementer accordingly.

Reported-by: Joseph Yiu <Joseph.Yiu@arm.com>
Change-Id: I8ed1064a847b73065528ee7032be967b5c58b431
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] 7dc4be3157d6 ("target/arm: Add support with identify STAR-MC1")
Fixes: [2] 05ee88915520 ("target/cortex_m: check core implementor field")
Link: [3] https://www.armchina.com/download/Documents/Application-Notes/Technical-Reference-Manual?infoId=160
Reviewed-on: https://review.openocd.org/c/openocd/+/8316
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agotcl: Replace 'hla_' prefix with 'hla' command group
Marc Schink [Fri, 14 Jun 2024 14:37:39 +0000 (16:37 +0200)]
tcl: Replace 'hla_' prefix with 'hla' command group

Change-Id: I99ec2dc7f300352d091cf9eb807a690901c33307
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8338
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agojtag/hla: Restructure commands
Marc Schink [Thu, 9 Nov 2023 10:20:00 +0000 (11:20 +0100)]
jtag/hla: Restructure commands

Use a command group 'hla' with subcommands instead of individual
commands with 'hla_' prefix.

The old commands are still available to ensure backwards compatibility,
but are marked as deprecated.

Change-Id: I612e3cc080d308735932aea0f11001428eadc570
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8335
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoopenocd: fix some coding style
Mark Zhuang [Mon, 10 Apr 2023 03:17:17 +0000 (11:17 +0800)]
openocd: fix some coding style

Add space around math operators.

Change-Id: I50fce3da283a78ba02bf70b6a752f7bf778d79f5
Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7585
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoopenocd: build: prevent old clone to fail on git submodules
Antonio Borneo [Fri, 21 Jun 2024 12:32:45 +0000 (14:32 +0200)]
openocd: build: prevent old clone to fail on git submodules

Working on an old local git repository, the git sub-modules could
have been set before last changes in .gitmodules.
The script 'bootstrap' does not update the url of the repositories
and this can cause the script to fail.

Add 'git submodule sync' to the script to update the url of the
repositories.
While there, fuse 'git submodule init' and git submodule update'
in a single command.

Reported-by: Karl Hammar <karl@aspodata.se>
Change-Id: I61412f804dbbb7a843aa009139ddb4b8e71beefb
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8375
Tested-by: jenkins