openocd.git
5 months agotcl/target/ti_k3: Add AM243 SoC 46/7946/2
Nishanth Menon [Tue, 17 Oct 2023 20:50:49 +0000 (15:50 -0500)]
tcl/target/ti_k3: Add AM243 SoC

Add support for the TI K3 family AM243 SoC. This SoC is built on the
same base of AM642, so reuse the configuration with the exception of
Cortex-A53 which is not available on this device.

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

Change-Id: I971ba878b0f503e5120f6853634776eb61d05080
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7946
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotcl/target/ti_k3: Sort the SoC documentation alphabetically 45/7945/2
Nishanth Menon [Tue, 17 Oct 2023 20:47:12 +0000 (15:47 -0500)]
tcl/target/ti_k3: Sort the SoC documentation alphabetically

Sort the documentation for the TI K3 parts alphabetically.

Change-Id: I2c40714ad590e3d9232a6f915c157d677e0c3610
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7945
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/target/ti_k3: Make Cortex-A processors optional 44/7944/2
Nishanth Menon [Tue, 17 Oct 2023 20:36:55 +0000 (15:36 -0500)]
tcl/target/ti_k3: Make Cortex-A processors optional

The AM2x family of K3 SoCs typically do not contain a Cortex-A53 or
A72 processor. So, make the cpu "up" functions available when armv8
processor count > 0.

Change-Id: I985b194fe7cc63e4134ad84ccd921cc456eb412f
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7944
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotcl/target/ti_k3: Convert memory access ap port num as a variable 43/7943/2
Nishanth Menon [Wed, 18 Oct 2023 18:45:39 +0000 (13:45 -0500)]
tcl/target/ti_k3: Convert memory access ap port num as a variable

Convert the memory access ap port num as a variable to allow support
for the AM2x family of K3 SoCs.

Change-Id: Ibd96c94055721f60d95179dab21d014c15b0f562
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7943
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/target/ti_k3: Convert Cortex-R5 ap port num as a variable 42/7942/2
Nishanth Menon [Tue, 17 Oct 2023 18:56:00 +0000 (13:56 -0500)]
tcl/target/ti_k3: Convert Cortex-R5 ap port num as a variable

Convert the Cortex-R5 ap port num as a variable to allow support for
the AM2x family of K3 SoCs.

Change-Id: I7dc8b459dca8b5f21395230b5cb782b14538bd48
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7942
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/target/ti_k3: Convert sysctrl ap port num as a variable 41/7941/2
Nishanth Menon [Tue, 17 Oct 2023 18:51:51 +0000 (13:51 -0500)]
tcl/target/ti_k3: Convert sysctrl ap port num as a variable

Convert the sysctrl ap port num as a variable to allow support for the
AM2x family of K3 SoCs.

Change-Id: I1b5b55e48240e6654779dd636fdf07bca055e192
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7941
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotarget: Add a debug_reason command 52/7952/4
Peter Collingbourne [Fri, 20 Oct 2023 02:07:29 +0000 (19:07 -0700)]
target: Add a debug_reason command

This allows programmatically determining the debug reason.

Change-Id: I0c3e85cebb6dc28fc0fc212beca84a484ac654a5
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7952
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotarget/breakpoints: make breakpoint_watchpoint_remove_all static 55/7955/2
Erhan Kurubas [Sat, 28 Oct 2023 18:58:08 +0000 (20:58 +0200)]
target/breakpoints: make breakpoint_watchpoint_remove_all static

Fixes below Sparse tool warning.
warning: symbol 'breakpoint_watchpoint_remove_all' was not declared.
Should it be static?

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I4af1d5aa54abcb45f746b877513ba0b5fccbeb47
Reviewed-on: https://review.openocd.org/c/openocd/+/7955
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
5 months agotarget: fix a memory leak in image_open 35/7935/3
Evgeniy Naydanov [Tue, 10 Oct 2023 10:57:43 +0000 (13:57 +0300)]
target: fix a memory leak in image_open

Change-Id: I629be26e7752858091ad58c2b3b07f43e22e8c23
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7935
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotarget/mips32: update mips32 config register parsing 11/7911/7
Walter Ji [Tue, 26 Sep 2023 09:11:00 +0000 (17:11 +0800)]
target/mips32: update mips32 config register parsing

Enhance `mips32_read_config_regs` to better detect MIPS32 ISA,
DSP, and FPU features, allowing user to get more detailed
target information.
Most of these information will be used in MIPS m/iAptiv support.

Change-Id: I23571a626ec64fa019acac91bdbfcb434373bfc1
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7911
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
5 months agotarget: Fix get_reg, prevent returning invalid data 58/7958/5
Marek Vrbka [Fri, 3 Nov 2023 09:48:02 +0000 (10:48 +0100)]
target: Fix get_reg, prevent returning invalid data

This patch forces a read of register from the target
in the get_reg command in case the register cache
does not hold a valid value at that moment.

Note that the command "reg" already handles it
correctly, no fix is needed there.

Change-Id: I75fad25188e94ee4e06162ab6d600ea24dbf590a
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7958
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/board: add board configuration for Advantech IMX8QM DMSSE20 74/7974/4
Oliver Graute [Wed, 1 Nov 2023 21:46:33 +0000 (22:46 +0100)]
tcl/board: add board configuration for Advantech IMX8QM DMSSE20

Change-Id: Iebf2a901b428cf3b99110aea0f3ab0e1f17b0250
Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7974
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
5 months agotarget/target: Use boolean values for 'valid' flag 59/7959/2
Marc Schink [Fri, 3 Nov 2023 10:04:08 +0000 (11:04 +0100)]
target/target: Use boolean values for 'valid' flag

Change-Id: Ieaa25b9ef0997c0f75ddfb652325c1a9e53a8d8d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7959
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
5 months agojep106: update to revision JEP106BH September 2023 54/7954/2
Antonio Borneo [Fri, 27 Oct 2023 15:42:45 +0000 (17:42 +0200)]
jep106: update to revision JEP106BH September 2023

The original documents from Jedec since JEP106BG, do not report
the entry for "21  NXP (Philips)", replaced by "c".
It's clearly a typo.

Keep the line from JEP106BF.01 for "NXP (Philips)".

Change-Id: I273c8c5ecf48336ce5189b484a7236273ba90184
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7954
Tested-by: jenkins
6 months agoOpenOCD memory leak in `hwthread_update_threads()` 34/7934/2
Kirill Radkin [Mon, 25 Sep 2023 10:10:20 +0000 (13:10 +0300)]
OpenOCD memory leak in `hwthread_update_threads()`

Update `os_free()` from `rtos/rtos.c:96` to fix memory leaks

Change-Id: Id7b4c775291b735a0b4423151c2930afce6bf0bd
Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7934
Reviewed-by: Tim Newsome <tim@sifive.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
6 months agoflash/nor/spi: add guide to select proper erase cmd 25/7925/2
Tomas Vanek [Mon, 2 Oct 2023 14:40:23 +0000 (16:40 +0200)]
flash/nor/spi: add guide to select proper erase cmd

Extend comments in flash_devices array.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I7ab85a2d37803b6bc9fc7a2a91ae2effb6ec288d
Reviewed-on: https://review.openocd.org/c/openocd/+/7925
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
6 months agojtag/drivers: Extension of jtag_libusb_open 38/7938/3
EasyDevKits [Sat, 14 Oct 2023 19:48:56 +0000 (21:48 +0200)]
jtag/drivers: Extension of jtag_libusb_open

In jtag_libusb_open I've added a parameter for delivering the device
description for which this function should search and adjusted all
callers of this function. A new driver for WCH CH347 JTAG chips
will use this new parameter.
See also: https://review.openocd.org/c/openocd/+/7937

Change-Id: I85e1d7b1f7912ba5e223f0f26323ff3b7600e17d
Signed-off-by: EasyDevKits <info@easydevkits.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7938
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agotools/scripts: iManufacturer added to camelcase.txt 36/7936/2
EasyDevKits [Sat, 14 Oct 2023 16:14:13 +0000 (18:14 +0200)]
tools/scripts: iManufacturer added to camelcase.txt

The iManufacturer is also a member of structure libusb_device_descriptor.
No need to output a check message by checkpatch.sh

Change-Id: Ibbb2eb9cde3482c8d4d6ea784f51a973eb36f8c5
Signed-off-by: EasyDevKits <info@easydevkits.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7936
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
6 months agotarget/mips32: check read regs result in save context 32/7932/2
Walter Ji [Mon, 9 Oct 2023 03:42:44 +0000 (11:42 +0800)]
target/mips32: check read regs result in save context

Add result check for mips32_pracc_read_regs in mips32_save_context.

Change-Id: Ie796d2b05a9feb11e246c2d0771b52cad4fb70db
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7932
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agotarget/mips32: rework mips core register related functions 64/7864/11
Walter Ji [Tue, 26 Sep 2023 08:56:02 +0000 (16:56 +0800)]
target/mips32: rework mips core register related functions

Update mips core definitions.
Reworked mips core register structure and read/write function.
Add coprocessor0 register definitions for target configuration.

Change-Id: I59c1f4cc4020db8a78e8d79f7421b87382fa1709
Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7864
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agotarget: check if target is not examined on reg command 41/7841/3
Parshintsev Anatoly [Sun, 30 Jul 2023 12:35:45 +0000 (15:35 +0300)]
target: check if target is not examined on reg command

Change-Id: I46093c85374986a36d10eaac38b98bd5e05835ca
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7841
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
6 months agoserver/gdb_server: Log gdb index in debug messages. 95/7895/3
Tim Newsome [Wed, 16 Aug 2023 19:47:57 +0000 (12:47 -0700)]
server/gdb_server: Log gdb index in debug messages.

This makes it easier to look at log files where multiple gdb instances
are connected.

Change-Id: Ic5aca52b32ee03ac35ffbed9a2fc552abb0a1cba
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7895
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotarget: Change the watchpoint type print from number to letter 09/7909/3
Marek Vrbka [Mon, 25 Sep 2023 08:00:42 +0000 (10:00 +0200)]
target: Change the watchpoint type print from number to letter

Previously, when listing the watchpoints, OpenOCD printed
numbers 0, 1 and 2 representing READ, WRITE and ACCESS type
watchpoints.

This patch changes it to 'r', 'w' and 'a'. This increases the
clarity as what type the watchpoint actually is.

Change-Id: I9eac72dfd0bb2a9596a5b0c080a3f584556ed599
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7909
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
6 months agobreakpoints: add rwp all command 07/7907/8
Marek Vrbka [Fri, 22 Sep 2023 11:57:04 +0000 (13:57 +0200)]
breakpoints: add rwp all command

This patch adds the "all" option to the rwp command.
It removes all watchpoints, much like rbp all removes
all breakpoints.

Change-Id: Id58dd103085e558f17afa4a287888cf085566ca9
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7907
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agocommand: Prepend logs during command capture 02/7902/3
Marek Vrbka [Mon, 18 Sep 2023 12:32:44 +0000 (14:32 +0200)]
command: Prepend logs during command capture

Previously, if you ran a tcl command in capture like so:
"capture { reg 0x1000 hw }"
Such command did overwrite the tcl result if LOG_LVL_INFO or
lower was logged during it.

This patch changes it by prepending the log to the tcl result instead.
As the tcl results should not be lost during capture.

Change-Id: I37381b45e15c931ba2844d65c9d38f6ed2f6e4fd
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7902
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
6 months agotarget: Fix an issue with rwp/rbp command in smp targets 10/7910/5
Kirill Radkin [Tue, 26 Sep 2023 13:49:09 +0000 (16:49 +0300)]
target: Fix an issue with rwp/rbp command in smp targets

If wp/bp is missing at address rwp/rbp won't return zero code (on smp).
Now it fixed.

Fixes: 022e438292de ("target: Change policy of removing watchpoints/breakpoints.")
Change-Id: I3a3c245f7088fc23227b286d2191fc7f3edba702
Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7910
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agoarm_opcode: Add support for ARM MCRR/MRRC 28/5228/8
Florian Fainelli [Mon, 18 Mar 2019 23:00:07 +0000 (16:00 -0700)]
arm_opcode: Add support for ARM MCRR/MRRC

Add support for the ARM MCRR/MRRC instructions which require the use of
two registers to transfer a 64-bit co-processor registers. We are going
to use this in a subsequent patch in order to properly dump 64-bit page
table descriptors that exist on ARMv7A with VMSA extensions.

We make use of r0 and r1 to transfer 64-bit quantities to/from DCC.

Change-Id: Ic4975026c1ae4f2853795575ac7701d541248736
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Michael Chalfant <michael.chalfant@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/5228
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agotarget/nrf52: Create and configure TPIU 01/7901/4
Frank Plowman [Sun, 17 Sep 2023 18:20:04 +0000 (19:20 +0100)]
target/nrf52: Create and configure TPIU

Firstly, create the TPIU nrf52.tpiu if using the nrf52 target. This is
standard, using AP 0 and TPIU base address 0xE0040000.
Secondly, add a pre_enable handler for this TPIU which configures the
TRACEMUX field of the TRACECONFIG register. This register is reset
every time the MCU resets, so the pre_enable handler creates a
reset-end handler to ensure the register remains set.

Change-Id: I408b20fc03dc2060c21bad0c21ed713eee55a113
Signed-off-by: Frank Plowman <post@frankplowman.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7901
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotcl/target/ti_k3: Add AXI-AP port for direct SoC memory map access 99/7899/6
Nishanth Menon [Thu, 14 Sep 2023 12:49:02 +0000 (07:49 -0500)]
tcl/target/ti_k3: Add AXI-AP port for direct SoC memory map access

While we can read and write from memory from the view of various
processors, all K3 debug systems have a AXI Access port that allows
us to directly access memory from debug interface. This port is
especially useful in the following scenarios:

1. Debug cache related behavior on processors as this provides a
   direct bypass path.
2. Processor has crashed or inaccessible for some reason (low power
   state etc.)
3. Scenarios prior to the processor getting active.
4. Debug MMU or address translation issues (example: TI's Region
   Address Table {RAT} translation table used to physically map
   SoC address space into R5/M4F processor address space)

The AXI-AP port is the same for all processors in TI's K3 family.

To prevent a circular-loop scenario for axi-ap accessing debug memory
with dmem (direct memory access debug), enable this only when dmem is
disabled.

Change-Id: Ie4ca9222f034ffc2fa669fb5124a5f8e37b65e3b
Reported-by: Dubravko Srsan <dubravko.srsan@dolotron.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7899
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotcl/target/ti_k3: Introduce RTOS array variable to set various CPU RTOSes 98/7898/5
Nishanth Menon [Wed, 13 Sep 2023 22:57:29 +0000 (17:57 -0500)]
tcl/target/ti_k3: Introduce RTOS array variable to set various CPU RTOSes

The Texas Instruments' K3 devices are a mix of AMP and SMP systems.
The operating systems used on these processors can vary dramatically
as well. Introduce a RTOS array variable, which is keyed off the cpu
to identify which RTOS is used on that CPU. This can be "auto" or
"hwthread" in case of SMP debug etc.

For example:
AM625 with an general purpose M4F running Zephyr and 4 A53s running SMP
Linux could be invoked by:
openocd -c 'set V8_SMP_DEBUG 1' -c 'set RTOS(am625.cpu.gp_mcu) Zephyr' \
-c "set RTOS(am625.cpu.a53.0) hwthread" -f board/ti_am625evm.cfg

Change-Id: Ib5e59fa2583b3115e5799658afcdd0ee91935e82
Reported-by: Dubravko Srsan <dubravko.srsan@dolotron.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7898
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agotcl/target/ti_k3: Add coreid identification to SMP processors 97/7897/4
Dubravko Srsan [Wed, 13 Sep 2023 21:23:03 +0000 (16:23 -0500)]
tcl/target/ti_k3: Add coreid identification to SMP processors

Describe the SMP Armv8 cores in SMP configuration with coreid
explicitly called out. This allows for gdb session to call the smp
behavior clearly.

Change-Id: Ie43be22db64737bbb66181f09d3c83567044f3ac
Signed-off-by: Dubravko Srsan <dubravko.srsan@dolotron.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7897
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotcl/target/ti_k3: Fix smp target description 96/7896/4
Dubravko Srsan [Wed, 13 Sep 2023 19:02:09 +0000 (14:02 -0500)]
tcl/target/ti_k3: Fix smp target description

When _v8_smp_targets is used with V8_SMP_DEBUG=1, describe the targets
as SMP targets. However, the variable expansion is not in the context of
a proc, and a typo in referring to global $_v8_smp_targets causes this
to fail. Just refer to $_v8_smp_targets directly.

Change-Id: Iffe5fd2703bed6a9c840284285e70b8a8ce84e17
Signed-off-by: Dubravko Srsan <dubravko.srsan@dolotron.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7896
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotarget: return error if attempting to access non-existing registers 86/7886/2
Parshintsev Anatoly [Tue, 5 Sep 2023 18:08:02 +0000 (21:08 +0300)]
target: return error if attempting to access non-existing registers

Change-Id: Ic22edcab46d21dbc71f78275a78bdea9c2bcc394
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7886
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 months agotarget/arc: do not invalidate icache when (un)setting breakpoints 67/7767/3
Artemiy Volkov [Thu, 6 Jul 2023 11:25:00 +0000 (13:25 +0200)]
target/arc: do not invalidate icache when (un)setting breakpoints

Currently, instruction cache is being invalidated in
arc_{un,}set_breakpoint() regardless of whether the breakpoint's type is
HW or SW. For SW breakpoints, this has no net effect as the caches are
flushed as a by-product of overwriting instructions in main memory and
is thus merely unnecessary; but for HW breakpoints this invalidation is
not preceded by a flush and might lead to loss of data. This patch
removes the invalidate() call altogether to correct this undesired
behavior for HW breakpoints.

With this patch applied, all supported HW breakpoint tests from the gdb
testsuite are now passing with the arc-openocd backend.

Change-Id: I3d252b97f01f1a1e2bf0eb8fb257bdab0c544bc2
Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7767
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 months agoarmv8_dpm: fix registers read at debug entry 87/7887/2
Antonio Borneo [Thu, 7 Sep 2023 07:58:25 +0000 (09:58 +0200)]
armv8_dpm: fix registers read at debug entry

The comment above armv8_dpm_read_current_registers() doesn't match
the implementation, as the function reads all the registers from
ARMV8_PC and above.
The registers currently read are not relevant to answer to the
usual GDB initial request through the 'g' packet. Plus the lack of
differentiation per core state (AArch32 vs AArch64) causes the
read of not existing registers in AArch32 triggering errors, as
tentatively fixed by https://review.openocd.org/5517/

Fix the code to read the registers initially required by GDB.
Modify the comment to report the register list in AArch32 and in
AArch64.
Keep the extra checks inside the read loop, even if they are
mostly irrelevant; this could prevent errors if someone needs to
extend the number of registers to read.

The current implementation of the register's description in
OpenOCD does not allow to discriminate among AArch32 and AArch64
registers. Add a TODO comment to highlight it.

Change-Id: Icd47d93c19a9e1694a7b51bbc5ca7e21a578df41
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7887
Tested-by: jenkins
6 months agotarget/cortex_m: support Infineon Cortex-M33 from SLx2 MCU 79/7879/11
Ahmed Boughanmi [Wed, 30 Aug 2023 00:26:40 +0000 (02:26 +0200)]
target/cortex_m: support Infineon Cortex-M33 from SLx2 MCU

The secure microcontroller Infineon SLx2 uses a custom Cortex-M33.
The register CPUID reports value 0x490FDB00.

Reference link to the product:
Link: https://www.infineon.com/cms/en/about-infineon/press/market-news/2022/INFCSS202211-034.html
Change-Id: I8911712c55bd50e24ed53cf49958352f470027a5
Signed-off-by: Ahmed Boughanmi <boughanmi.external@infineon.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7879
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
6 months agoimage: log error when unknown image type is specified 83/7883/2
Marek Vrbka [Tue, 5 Sep 2023 13:25:50 +0000 (15:25 +0200)]
image: log error when unknown image type is specified

This patch adds error reporting when unknown image type is specified.
Previously, OpenOCD replied with an empty string.

Change-Id: I16220b1f5deb3b966a21731f0adf7911a78e8959
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7883
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agojtag/drivers/bcm2835gpio: fix bcm2835_peri_base output format 88/7888/3
Vincent Fazio [Wed, 6 Sep 2023 16:10:41 +0000 (11:10 -0500)]
jtag/drivers/bcm2835gpio: fix bcm2835_peri_base output format

Previously, the bcm2835_peri_base value would be printed as a decimal
value despite having a "0x" prefix, implying it should be a hex value.

  BCM2835 GPIO: peripheral_base = 0x1056964608

Now, the value is correctly converted to hexidecimal.

  BCM2835 GPIO: peripheral_base = 0x3F000000

Change-Id: Id59185423917e6350f99ef68320e2102a3192291
Fixes: b41b368255d5 ("jtag/drivers/bcm2835gpio: extend peripheral_base to off_t")
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7888
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/target: add support for Cavium Octeon II CN61xx 49/5249/8
Peter Mamonov [Wed, 26 Jun 2019 15:43:16 +0000 (18:43 +0300)]
tcl/target: add support for Cavium Octeon II CN61xx

Change-Id: Ia14854bc64f5a31b6591be69be4edee9cd1310c3
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/5249
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/target: Add XLP3xx configuration files 23/2323/32
Peter Mamonov [Fri, 26 Sep 2014 10:04:51 +0000 (14:04 +0400)]
tcl/target: Add XLP3xx configuration files

The patch adds configuration files for the following XLP 300-series
processors: XLP304, XLP308, XLP316.

Change-Id: Iaf2b807abf9fc4d7b51222fd40bdb18c6aca7d9c
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
CC: Antony Pavlov <antonynpavlov@gmail.com>
CC: Dongxue Zhang <elta.era@gmail.com>
CC: Oleksij Rempel <linux@rempel-privat.de>
CC: Paul Fertser <fercerpav@gmail.com>
CC: Salvador Arroyo <sarroyofdez@yahoo.es>
CC: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: https://review.openocd.org/c/openocd/+/2323
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotarget/adi_v5_xxx: use ADIV5_DP_SELECT_APBANK 39/7539/4
Tomas Vanek [Tue, 14 Mar 2023 13:31:30 +0000 (14:31 +0100)]
target/adi_v5_xxx: use ADIV5_DP_SELECT_APBANK

and DP_SELECT_DPBANK.
Use the defined symbols instead of magic numbers.

Change-Id: I19c86b183e57e42b96f76eed180c0492cd67bee1
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7539
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotarget/arm_adi_v5,jtag/drivers: rename ADIv5 only defines 38/7538/4
Tomas Vanek [Tue, 14 Mar 2023 12:30:49 +0000 (13:30 +0100)]
target/arm_adi_v5,jtag/drivers: rename ADIv5 only defines

DP_SELECT_APSEL and DP_SELECT_APBANK is no more used in ADIv6.

Change-Id: I4176574d46c6dc8eb3fe3aef6daab6e33492c050
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7538
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agopld: harmonize refresh commands 39/7839/12
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
pld: harmonize refresh commands

add refresh command for lattice devices
rename gowin reprogram to refresh
rename virtex2 program to refresh

Change-Id: I9da83a614b96da3e947ac4608b0a291b1d126914
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7839
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtagspi/pld: add support from gatemate driver 38/7838/11
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from gatemate driver

Provide jtagspi with specific procedures to be able to
use jtagspi for programming spi-flash devices on cologne
chip gatemate devices.

Change-Id: Ifa1c4ca6e215d7f49bd21620898991af213812e9
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7838
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agojtagspi/pld: add support from intel driver 37/7837/12
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from intel driver

Provide jtagspi with information to use jtagspi for
programming spi-flash devices on intel devices using
a proxy bitstream.

Change-Id: Ib947b8c0dd61e2c6fa8beeb30074606131b1480f
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7837
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtagspi/pld: add support from xilinx driver 36/7836/11
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from xilinx driver

Provide jtagspi with information to use jtagspi for
programming spi-flash devices on xilinx devices
using a proxy bitstream.

Change-Id: I68000d71de25118ed8a8603e544cff1dc69bd9ba
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7836
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtagspi/pld: add support from efinix driver 26/7826/12
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from efinix driver

Provide jtagspi with information to use jtagspi for
programming spi-flash devices on efinix trion and
titanium devices using a proxy bitstream.

Change-Id: I4a851fcaafe832c35bd7b825d95a3d08e4d57a7b
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7826
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agojtagspi/pld: add support from lattice certus driver 25/7825/12
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from lattice certus driver

Provide jtagspi with specific procedures to be able to
use jtagspi for programming spi-flash devices on lattice
certus and certus po devices.

Change-Id: I6a8ec16be78f86073a4ef5302f6241185b08e1c6
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7825
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtagspi/pld: add support from lattice ecp5 driver 24/7824/12
Daniel Anselmi [Sat, 17 Dec 2022 12:11:30 +0000 (13:11 +0100)]
jtagspi/pld: add support from lattice ecp5 driver

Provide jtagspi with specific procedures to be able to
use jtagspi for programming spi-flash devices on lattice
ecp5 devices.

Change-Id: I4a4a60f21d7e8685a5b8320b9c6ebdc2693bbd21
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7824
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agojtagspi/pld: add support from lattice ecp2/ecp3 driver 23/7823/12
Daniel Anselmi [Fri, 24 Feb 2023 14:57:30 +0000 (15:57 +0100)]
jtagspi/pld: add support from lattice ecp2/ecp3 driver

Provide jtagspi with specific procedures to be able to
use jtagspi for programming spi-flash devices on lattice
ecp2 and ecp3 devices.

Change-Id: I39028aba47a74a0479be16d52d318f4bff7f2ed4
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7823
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agojtagspi/pld: add interface to get support from pld drivers 22/7822/14
Daniel Anselmi [Fri, 24 Feb 2023 14:57:30 +0000 (15:57 +0100)]
jtagspi/pld: add interface to get support from pld drivers

Jtagspi is using a proxy bitstream to "connect" JTAG to the
SPI pins. This is not possible with all FPGA vendors/families.
In this cases a dedicated procedure is needed to establish such
a connection.

This patch adds a jtagspi-mode for these cases. It also adds the
needed interfaces to jtagspi and the pld-driver so the driver
can select the mode and provide the necessary procedures.

For the cases where a proxy bitstream is needed, the pld driver
will select the mode and provide instruction code needed in this
case.

Change-Id: I9563f26739589157b39a3664a73d91152cd13f77
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7822
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/board: Add TI am62pevm config 93/7893/4
Nishanth Menon [Wed, 6 Sep 2023 15:26:48 +0000 (10:26 -0500)]
tcl/board: Add TI am62pevm config

Add basic connection details with AM62P SK/EVM

For further details, see: https://www.ti.com/lit/zip/sprr487

Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I1ba5e0c7627cf09cc8c221701bc44f73523a4574
Reviewed-on: https://review.openocd.org/c/openocd/+/7893
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Bryan Brattlof <hello@bryanbrattlof.com>
7 months agotcl/target/ti_k3: Add AM62P SoC 92/7892/3
Nishanth Menon [Wed, 6 Sep 2023 15:21:09 +0000 (10:21 -0500)]
tcl/target/ti_k3: Add AM62P SoC

Add support for the TI K3 family AM62P SoC. This SoC is built on the
same base of AM62A7, so reuse the configuration with the exception of
the JTAG ID and the actual name used for the R5 core (moved from main
domain to wakeup domain).

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

Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I3a80be9e71204ed7697e51ac1ad488ef405744ef
Reviewed-on: https://review.openocd.org/c/openocd/+/7892
Reviewed-by: Bryan Brattlof <hello@bryanbrattlof.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/board: Add TI j784s4evm config 91/7891/2
Nishanth Menon [Wed, 6 Sep 2023 13:07:16 +0000 (08:07 -0500)]
tcl/board: Add TI j784s4evm config

Add basic connection details with J784S4 SK/EVM

For further details, see:
Texas Instruments J784S4 EVM: https://www.ti.com/tool/J784S4XEVM
Texas Instruments SK-AM69: https://www.ti.com/tool/SK-AM69

Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I09c8a193d53e13b27adb5a6d01f6d937d6be49a1
Reviewed-on: https://review.openocd.org/c/openocd/+/7891
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/target/ti_k3: Add J784s4 SoC 90/7890/2
Nishanth Menon [Wed, 6 Sep 2023 12:59:23 +0000 (07:59 -0500)]
tcl/target/ti_k3: Add J784s4 SoC

Add support for the TI K3 family J784S4/AM69 SoC.

For further details, see  http://www.ti.com/lit/zip/spruj52

Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I3c899aed0cb79ab8bbf8077ca6dfe0636cf72288
Reviewed-on: https://review.openocd.org/c/openocd/+/7890
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/target/ti_k3: Set _CHIPNAME in one place 89/7889/2
Nishanth Menon [Wed, 6 Sep 2023 15:10:20 +0000 (10:10 -0500)]
tcl/target/ti_k3: Set _CHIPNAME in one place

$_soc is set per platform, no point in duplicating _CHIPNAME to
explicitly set the information provided by $_CHIPNAME itself.

So move it out after the check for CHIP_NAME

Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I60d30d6a9a2ce352f66c5bc03075e4ba638e3062
Reviewed-on: https://review.openocd.org/c/openocd/+/7889
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoflash/nor: remove useless bank->next = NULL 85/7885/2
Tomas Vanek [Tue, 5 Sep 2023 16:52:38 +0000 (18:52 +0200)]
flash/nor: remove useless bank->next = NULL

struct flash_bank must be zeroed anyway, calloc() is always used.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I7ab3b9c66f99688c6095a0a547a05448c9e37d68
Reviewed-on: https://review.openocd.org/c/openocd/+/7885
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoflash/nor/at91sam7: fix flash bank allocation 84/7884/2
Tomas Vanek [Tue, 5 Sep 2023 16:32:57 +0000 (18:32 +0200)]
flash/nor/at91sam7: fix flash bank allocation

at91sam7 flash driver allocates a flash bank based on detected flash
structure.
Use calloc() instead of malloc() - struct flash_bank has to be zeroed.

While on this:
Return error in case of struct flash_bank or driver_priv allocation fail.
Set default_padded_value and erased_value.
Use strdup() on bank->name, pointer is freed in flash_free_all_banks()

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Id890496bfbadb7970ef583256aa4f30a7bff832f
Reviewed-on: https://review.openocd.org/c/openocd/+/7884
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoflash/stm32l4x: support STM32WBA5xx devices 94/7694/4
Tarek BOCHKATI [Wed, 31 May 2023 14:16:35 +0000 (15:16 +0100)]
flash/stm32l4x: support STM32WBA5xx devices

STM32WBA5x have a single bank flash up to 1MB

Change-Id: I3d720e202f0fdd89ecd8aa7224653ca5a7ae187b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7694
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotarget/cortex_m: support DWT version 2.1 for Archv8_M 00/7800/4
Fedi Bouzazi [Mon, 14 Aug 2023 12:03:31 +0000 (13:03 +0100)]
target/cortex_m: support DWT version 2.1 for Archv8_M

According to Arm®v8-M Architecture Reference Manual:
section D1.2.59 DWT_DEVARCH, DWT Device Architecture Register,
the field REVISION bits [19:16] defines two DWT architectures revision

Signed-off-by: Fedi Bouzazi <fedi.bouzazi@st.com>
Change-Id: I948dae0710ac921a7f0fbcef3ccacdae99184fe4
Reviewed-on: https://review.openocd.org/c/openocd/+/7800
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoflash: npcx: fix memory leak in npcx_flash_bank_command 94/7894/2
Antonio Borneo [Sat, 9 Sep 2023 07:24:59 +0000 (09:24 +0200)]
flash: npcx: fix memory leak in npcx_flash_bank_command

Recent commit 62f76b216930 ("flash/nor: add support for Nuvoton
NPCX4/K3 series flash") introduces a memory leak for a missing
free() on early return for an error.

Add the free() on the return path on error.

Change-Id: Ica8568a986802e23df2ab7bed4e8cc4bbb6305a5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 62f76b216930 ("flash/nor: add support for Nuvoton NPCX4/K3 series flash")
Reviewed-on: https://review.openocd.org/c/openocd/+/7894
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 months agotarget/aarch64: add AArch64 mdd and mwd support 92/7192/4
Daniel Goehring [Sat, 11 Sep 2021 02:19:08 +0000 (22:19 -0400)]
target/aarch64: add AArch64 mdd and mwd support

For ARMv8, add AArch64 mdd and mwd support. AArch32 not supported.

Change-Id: I25490471e16943e5a67d7649595d77643aa9a095
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7192
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/interface/ftdi: Add documentation for HS2 81/7881/2
Joshua Nekl [Fri, 1 Sep 2023 23:29:33 +0000 (16:29 -0700)]
tcl/interface/ftdi: Add documentation for HS2

Change-Id: I75d6aa0292bf7ff4ebee8752a5e7a3516500cd04
Signed-off-by: Joshua Nekl <Joshua.Nekl@skyworksinc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7881
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotcl/interface/ftdi: digilent-hs2.cfg SWD config 63/7863/3
Joshua Nekl [Fri, 25 Aug 2023 19:24:54 +0000 (12:24 -0700)]
tcl/interface/ftdi: digilent-hs2.cfg SWD config

Add SWD_EN and SWDIO_OE config for Digilent HS2

Change-Id: I3f7479bbe2e518ad6f84bf9eb729b54fee4a0f9b
Signed-off-by: Joshua Nekl <Joshua.Nekl@skyworksinc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7863
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoserver/gdb_server.c: support unavailable registers 76/7876/6
Evgeniy Naydanov [Tue, 22 Aug 2023 13:24:30 +0000 (16:24 +0300)]
server/gdb_server.c: support unavailable registers

According to gdb documentation, `g` and `p` packets can report a
register being unavailable by a string of 'x' instead of register's
value.

Change-Id: I8ef279f1357c2e612f5d3290eb0022c1b47d9fa7
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7876
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Anatoly Parshintsev <kupokupokupopo@gmail.com>
Tested-by: jenkins
7 months agojtag/drivers/am335xgpio: do not configure push-pull inputs as output 77/7877/2
Vincent Fazio [Tue, 29 Aug 2023 12:30:23 +0000 (07:30 -0500)]
jtag/drivers/am335xgpio: do not configure push-pull inputs as output

Previously, if a pin was configured as ADAPTER_GPIO_INIT_STATE_INPUT and
its drive value was ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, initialize_gpio
would configure the pin as an output.

The set_gpio_value function is optimized to not set the direction for
pins configured as ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL as it only needs to
be set once. When initialize_gpio performs this setup, it checked only
that the drive value was ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL to set the
output direction but did not exclude input pins which have already had
their direction set.

Now, input pins are ignored when initialize_gpio checks for
ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL to set the mode to output.

Fixes: ace028262ba0 ("drivers/am335xgpio: Migrate to adapter gpio commands")
Change-Id: I9ea502c400ea4ffae37080b9cee891ca9176a47d
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7877
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Steve Marple <stevemarple@googlemail.com>
7 months agoimage: fix binary detection for small files 80/7880/4
Marek Vrbka [Thu, 31 Aug 2023 06:30:37 +0000 (08:30 +0200)]
image: fix binary detection for small files

Previously, if the image file was less than 9 bytes long,
it was assumed to be an error when it could be a binary
image file. This patch makes OpenOCD detect these cases
as binary files.

Change-Id: I5b4dad2b547786246887812ac75907378fe58671
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7880
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agoflash/nor: add support for Nuvoton NPCX4/K3 series flash 94/7794/12
Luca Hung [Mon, 31 Jul 2023 07:08:18 +0000 (15:08 +0800)]
flash/nor: add support for Nuvoton NPCX4/K3 series flash

Added NPCX flash driver to support the Nuvoton NPCX4/K3 series
microcontrollers. Add config file for these series.

Change-Id: I0b6e128fa51146b561f422e23a98260594b1f138
Signed-off-by: Luca Hung <YCHUNG0@nuvoton.com>
Signed-off-by: Mulin CHao <mlchao@nuvoton.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7794
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agodoc/style: clarify default case for enumerators 75/7875/2
Antonio Borneo [Mon, 28 Aug 2023 10:11:48 +0000 (12:11 +0200)]
doc/style: clarify default case for enumerators

Enumerator's case were not specified in the coding style.

Add enumerators together with macros for upper-case preference.
While there, add the word CamelCase beside the less common, but
already used, MixedCaps. This could help linking this chapter to
the output of checkpatch script.

Change-Id: I6d4af06cc6f4bc46f525e99e9a74ecc167606c49
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7875
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
7 months agotarget: Unify the output of "bp" command 61/7861/4
Marek Vrbka [Wed, 23 Aug 2023 13:20:47 +0000 (15:20 +0200)]
target: Unify the output of "bp" command

This patch unifies the lines printed by the "bp" command
so that different types of breakpoints are printed in
the same format.

Change-Id: Ic1335eda1c58072a334aed9cf0011431c8ec86a4
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7861
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 months agotarget: Change policy of removing watchpoints/breakpoints. 38/7738/17
Kirill Radkin [Tue, 8 Aug 2023 10:17:29 +0000 (13:17 +0300)]
target: Change policy of removing watchpoints/breakpoints.

Now internal watch/breakpoint will not be removed in case
of error during removing triggers from hardware.

Also change signature of some functions (for deletion
bp/wp) to print message in case of some error.

Change-Id: I71cd1f556a33975005d0ee372fc384fddfddc3bf
Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7738
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 months agotcl/arc: Fix ARC v2 registers r22/r23 60/7860/2
Robert Kovacsics [Sat, 19 Aug 2023 14:36:27 +0000 (15:36 +0100)]
tcl/arc: Fix ARC v2 registers r22/r23

There was a typo in the register numbering.

Signed-off-by: Robert Kovacsics <kovirobi@gmail.com>
Change-Id: Ie5d306725962c42f1bce976b80968145e6d0a177
Reviewed-on: https://review.openocd.org/c/openocd/+/7860
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
8 months agojtag/drivers/bcm2835gpio: do not configure push-pull inputs as output 62/7862/2
Brandon Pupp [Fri, 18 Aug 2023 14:51:06 +0000 (09:51 -0500)]
jtag/drivers/bcm2835gpio: do not configure push-pull inputs as output

Previously, if a pin was configured as ADAPTER_GPIO_INIT_STATE_INPUT and
its drive value was ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL, initialize_gpio
would configure the pin as an output.

The set_gpio_value function is optimized to not set the direction for
pins configured as ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL as it only needs to
be set once. When initialize_gpio performs this setup, it checked only
that the drive value was ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL to set the
output direction but did not exclude input pins which have already had
their direction set.

Now, input pins are ignored when initialize_gpio checks for
ADAPTER_GPIO_DRIVE_MODE_PUSH_PULL to set the mode to output.

Change-Id: I4fc7a8132a6b00c7f213ec9fd05c7bbb37ee5f20
Fixes: 0dd969d83bad ("drivers/bcm2835gpio: Migrate to adapter gpio commands")
Signed-off-by: Brandon Pupp <bpupp@xes-inc.com>
[vfazio: update commit message]
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7862
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 months agocontrib/firmware: add new i2c bit-banging feature to angie's firmware 96/7796/12
Ahmed BOUDJELIDA [Wed, 16 Aug 2023 15:05:05 +0000 (17:05 +0200)]
contrib/firmware: add new i2c bit-banging feature to angie's firmware

add new i2c bit-banging feature, we can now connect in JTAG with the SoC
target and in i2c with the main board components at the same time.

Change-Id: I8e4516fe1ad5238e0373444f1c3c9bc0814d0f52
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7796
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag/drivers: add new VIDs for angie driver - add a check for a returned value 95/7795/6
Ahmed BOUDJELIDA [Wed, 16 Aug 2023 15:01:10 +0000 (17:01 +0200)]
jtag/drivers: add new VIDs for angie driver - add a check for a returned value

add a line that checks the returned value of set signals function

add two VIDs of other original boards (have onboard angie architecture)
so angie driver can connect to them and change their VID after
renumeration.

Change-Id: Ide4f1f6f38168a410191bf3ff75bcd59dcf7ef50
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7795
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agomips32: add per-cpu quirks feature 59/7859/5
Artur Rojek [Sun, 13 Aug 2023 14:47:28 +0000 (16:47 +0200)]
mips32: add per-cpu quirks feature

Introduce the ability to detect CPUs based on CP0 PRId register and
apply cpu specific quirks, which alter the default ejtag behavior.

First of those is EJTAG_QUIRK_PAD_DRET, which makes sure extra NOPs are
placed after the DRET instruction on exit from debug mode. This fixes
resume behavior on Ingenic JZ4780 SoC.

The proper detection of some (currently unsupported) CPUs becomes quite
complicated, so please consult the following Linux kernel code when
adding new CPUs:
* arch/mips/include/asm/cpu.h
* arch/mips/kernel/cpu-probe.c

Change-Id: I0f413d5096cd43ef346b02cea85024985b7face6
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7859
Tested-by: jenkins
8 months agostlink: increase stlink v2 max speed to 2.25 Mbps 48/7848/2
Marcin Niestroj [Thu, 3 Aug 2023 15:43:39 +0000 (17:43 +0200)]
stlink: increase stlink v2 max speed to 2.25 Mbps

stlink v2 on Nucleo-64 board (e.g. NUCLEO-L476RG) has target SWO signal
connected to STM32F103CB'S PA10, which is UART1_RX. UART1 within this
MCU in theory can be configured to 4.5 Mbps baudrate, which means this
is the upper limit supported by HW. As a confirmation BMP (Black Magic
Probe) project also states in documentation that UART1 can be used with
up to 4.5 Mbps baudrate.

Tests have shown that configuring 4.5 Mbps baudrate on stlink v2
available on NUCLEO-L476RG board results in receiving corrupted data.
Using 2.25 Mbps however allows to successfully receive all data from
SWO. This makes sense in terms of STM32F103CB capabilities, since 2.25
Mbps is the next supported baudrate due to division by 2.

Increase supported stlink v2 SWO speed from 2 to 2.25 Mbps.

Tested with NUCLEO-L476RG:

  $ stm32l4x.tpiu configure -protocol uart \
    -traceclk 80000000 -pin-freq 2250000 \
    -output /dev/stdout
  $ stm32l4x.tpiu enable

2.25 Mbps speed confirmed with logic analyzer.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Change-Id: Icbec04585664aba8b217e8f9a75458e577f7617f
Reviewed-on: https://review.openocd.org/c/openocd/+/7848
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotcl/board: Add j721e native swd configuration 59/7259/6
Kaelin Laundry [Tue, 4 Oct 2022 18:11:02 +0000 (13:11 -0500)]
tcl/board: Add j721e native swd configuration

Direct memory driver swd native configuration for j721E

Signed-off-by: Kaelin Laundry <wasabifan@outlook.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Change-Id: I27455040f48c47271ae110afd114fce005824969
Reviewed-on: https://review.openocd.org/c/openocd/+/7259
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotcl/board: Add am625 native swd configuration 91/7091/10
Nishanth Menon [Thu, 14 Jul 2022 21:37:54 +0000 (16:37 -0500)]
tcl/board: Add am625 native swd configuration

Direct memory driver swd native configuration for am625.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jason Peck <jpeck@ti.com>
Change-Id: I6cf521fe9af0a4b8f8ab4853bc25722368b713e6
Reviewed-on: https://review.openocd.org/c/openocd/+/7091
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agojtag/drivers: dmem: Add Emulated AP mode 89/7089/9
Jason Peck [Mon, 18 Jul 2022 18:45:05 +0000 (13:45 -0500)]
jtag/drivers: dmem: Add Emulated AP mode

This emulation mode supports software translation of an AP request
into an address mapped transaction that does not rely on physical AP
hardware. This is necessary in some hardware such as K3 SoCs since the
hardware architecture anticipates a potential race condition between
AP doing direct memory access generating transactions back to system
bus and firewalls that data path out.

This emulation mode allows direct memory driver to emulate CoreSight
Access Port (AP) and reuse the SoC configuration meant for JTAG
debuggers.

Since the address ranges are flat in nature, the requisite memory base
and size will need to be provided a-priori to the driver for mapping.
The other design alternative would be to map requested memory map for
every register operation, but, that would defeat our intent of getting
max debug performance.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jason Peck <jpeck@ti.com>
Change-Id: I2d3c5f7833f1973e90b4f6b247827f62fc2905d0
Reviewed-on: https://review.openocd.org/c/openocd/+/7089
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agojtag/drivers: Add dmem driver 88/7088/8
Nishanth Menon [Thu, 14 Jul 2022 21:37:54 +0000 (16:37 -0500)]
jtag/drivers: Add dmem driver

Direct memory driver support for CoreSight Access Port(AP).

Even though we emulate SWD (serial wire debug), we aren't actually
using swd. Instead, we are using a direct memory access to get to the
register set. This is similar in approach to other fast access native
drivers such as am335xgpio drivers.

Example operation on Texas Instrument's AM62x K3 SoC:

+-----------+
|  OpenOCD  |   SoC mem map
|    on     |--------------+
| Cortex-A53|              |
+-----------+              |
                           |
+-----------+        +-----v-----+
|Cortex-M4F |<───────|           |
+-----------+        |           |
                     |  DebugSS  |
+-----------+        |           |
|Cortex-M4F |<───────|           |
+-----------+        +-----------+

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Jason Peck <jpeck@ti.com>
Change-Id: I8470cb15348863dd844b2c0e3f63a9063cb032c6
Reviewed-on: https://review.openocd.org/c/openocd/+/7088
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotcl/board: add TI am62a7evm config 55/7855/3
Jason Kacines [Tue, 8 Aug 2023 20:37:38 +0000 (15:37 -0500)]
tcl/board: add TI am62a7evm config

Add basic connection details with am625 SK/EVM

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

Change-Id: I0b6b4004f3a04be7a90207e44c588a4f68aff47a
Signed-off-by: Jason Kacines <j-kacines@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7855
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
8 months agotcl/target/ti_k3: Add AM62A7 SoC 54/7854/3
Jason Kacines [Wed, 9 Aug 2023 14:10:13 +0000 (09:10 -0500)]
tcl/target/ti_k3: Add AM62A7 SoC

Add support for the TI K3 family AM62A7 SoC.

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

Change-Id: Ie69bde4895f34b04f9967f63d1ca9c8149c50b8a
Signed-off-by: Jason Kacines <j-kacines@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7854
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
8 months agotcl/target/ti_k3: Add missing documentation for supported SoCs 53/7853/2
Jason Kacines [Wed, 9 Aug 2023 14:07:28 +0000 (09:07 -0500)]
tcl/target/ti_k3: Add missing documentation for supported SoCs

Add links for the SoCs are supported by the conf file for future
reference.

Change-Id: Ic5b7786ef3ac31414fe2ce56c1237a18ce99aaa1
Signed-off-by: Jason Kacines <j-kacines@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7853
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 months agortos/zephyr: arm: fetch arm exc return offset 51/7851/3
Bruno Mendes [Tue, 8 Aug 2023 14:19:41 +0000 (15:19 +0100)]
rtos/zephyr: arm: fetch arm exc return offset

Since zephyrproject-rtos/zephyr@c3eeae8,
Zephyr OS exposes offset of mode_exc_return in the arch struct for ARM.

Accounting for this allows for consistency and enables
logic with further offsets that may be added after this.

Signed-off-by: Bruno Mendes <bd_mendes@outlook.com>
Change-Id: Id53ebd80c5d98a7d94eb6b00ad638ce51e719822
Reviewed-on: https://review.openocd.org/c/openocd/+/7851
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agotcl/target: add Realtek RTL872xD config 47/7847/7
Karl Palsson [Tue, 1 Aug 2023 00:02:36 +0000 (00:02 +0000)]
tcl/target: add Realtek RTL872xD config

Sufficient to probe both cores via multiple APs.
No support listed for jtag in the datasheet or usermanual.
Tested against a BW-16 board:
  https://www.amebaiot.com/en/amebad/#partner_bw16

Change-Id: Idf82085e7b7327fdf3d6d668e6fb59eff6e0431b
Signed-off-by: Karl Palsson <karlp@tweak.au>
Reviewed-on: https://review.openocd.org/c/openocd/+/7847
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agotarget/cortex_m: Add Realtek Real-M200 and M300 46/7846/6
Karl Palsson [Wed, 2 Aug 2023 21:42:08 +0000 (21:42 +0000)]
target/cortex_m: Add Realtek Real-M200 and M300

These cores are advertised as M23 and M33 compatible, but are identified
by the Realtek implementor id.  These cores are found on the RTL872xD
family, at least.

Raw CPUIDs:
Real-M200 (KM0): 721cd200
Real-M300 (KM4): 721fd220

Change-Id: I4106ccb7e8c562f98072a71e9e818f57999d664e
Signed-off-by: Karl Palsson <karlp@tweak.au>
Reviewed-on: https://review.openocd.org/c/openocd/+/7846
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotarget/cortex_m: check core implementor field 45/7845/10
Karl Palsson [Wed, 2 Aug 2023 21:38:58 +0000 (21:38 +0000)]
target/cortex_m: check core implementor field

Presently, we only look at the Part Number field of the CPUID, and
completely ignore the Implmentor field, simply assuming it to be ARM.

Parts have since been found, with different implementors, that use
overlapping part numbers, causing detection to fail.

Expand the "part number" field to be a full implementor+part number,
excluding the revision/patch fields, to make checking more reliable.

Change-Id: Id81774f829104f57a0c105320d0d2e479fa01522
Signed-off-by: Karl Palsson <karlp@tweak.au>
Reviewed-on: https://review.openocd.org/c/openocd/+/7845
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 months agoefm32: drop unnecessary and incomplete checks 44/7844/4
Karl Palsson [Wed, 2 Aug 2023 21:33:32 +0000 (21:33 +0000)]
efm32: drop unnecessary and incomplete checks

There's really no reason to try and add an extra layer of cpu
verification here.

Change-Id: If8c4aa03754607be6c089f514ae300b09b067ffa
Signed-off-by: Karl Palsson <karlp@tweak.au>
Reviewed-on: https://review.openocd.org/c/openocd/+/7844
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agoflash/nor/spi: Improve erase performance on zd25q16 50/7850/2
Nikolay Dimitrov [Fri, 4 Aug 2023 20:56:49 +0000 (23:56 +0300)]
flash/nor/spi: Improve erase performance on zd25q16

Use blocks (64 KiB) instead of sectors (4 KiB) when erasing the zd25Q16
SPI flash memory (thanks to Tomas Vanek!)

Change-Id: I969a69ad35f51b84eb3e11b93f0d79db3e98613a
Signed-off-by: Nikolay Dimitrov <nikolay.dimitrov@retrohub.org>
Reviewed-on: https://review.openocd.org/c/openocd/+/7850
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
8 months agoflash/nor/spi: add zetta zd25q16 49/7849/2
Nikolay Dimitrov [Thu, 3 Aug 2023 20:50:55 +0000 (23:50 +0300)]
flash/nor/spi: add zetta zd25q16

* Zetta 16 Mbit (2 MiB) SPI flash
* Tested on Olimex RP2040-PICO30 and Neo6502 boards

Change-Id: I02224dd7a72a9b72f01b31edbd958daa23f28956
Signed-off-by: Nikolay Dimitrov <nikolay.dimitrov@retrohub.org>
Reviewed-on: https://review.openocd.org/c/openocd/+/7849
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
8 months agopld: allow calling of configuration functions before 'init' 35/7835/4
Daniel Anselmi [Mon, 31 Jul 2023 19:10:52 +0000 (21:10 +0200)]
pld: allow calling of configuration functions before 'init'

Change-Id: I7c475fbbf8c13ae227e3393f01528eb180e9de51
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7835
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agopld: fix sparser warnings 28/7828/4
Daniel Anselmi [Tue, 25 Jul 2023 21:31:54 +0000 (23:31 +0200)]
pld: fix sparser warnings

Change-Id: I31c5b19cd93ac41b026f824337488c9aa9b12439
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7828
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotarget/aarch64: add missing aarch64_poll() calls 37/7737/3
Daniel Goehring [Tue, 6 Jun 2023 20:44:13 +0000 (14:44 -0600)]
target/aarch64: add missing aarch64_poll() calls

Add missing aarch64_poll() calls to ensure the event
TARGET_EVENT_HALTED is called when necessary.

This is needed with the poller update introduced in commit
95603fae18f8 ("openocd: revert workarounds for 'expr' syntax change")

Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Change-Id: I6e91f1b6bc1f0d16e6f0eb76fc67d20111e3afd2
Reviewed-on: https://review.openocd.org/c/openocd/+/7737
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agotcl: add configuration files for the ARC HSDK-4xD board 29/7829/2
Artemiy Volkov [Mon, 17 Jul 2023 15:07:28 +0000 (17:07 +0200)]
tcl: add configuration files for the ARC HSDK-4xD board

This commit provides startup files for the Synopsys DesignWare ARC
HSDK-4xD board. These have been adapted from the corresponding
snps_hsdk.cfg files, the only functional change being the JTAG IDs for
the new board's CPU cores.

Change-Id: I19a0cd13bc09de90cfe2a7cccf1239e459fd8077
Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7829
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
8 months agotcl/interface/ftdi: support for SIPEED RV-Debugger 30/7830/2
gudvinr [Thu, 27 Jul 2023 12:03:57 +0000 (15:03 +0300)]
tcl/interface/ftdi: support for SIPEED RV-Debugger

BL702-based JTAG debugger that emulates FT2232D device

Change-Id: Iefbf03645e6d8d154f4b1cad3385b8bc09da37dd
Signed-off-by: gudvinr <gudvinr@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7830
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agojtag/drivers: Add new driver for ANGIE USB-JTAG Adapter 02/7702/38
Ahmed BOUDJELIDA [Fri, 16 Jun 2023 23:11:15 +0000 (01:11 +0200)]
jtag/drivers: Add new driver for ANGIE USB-JTAG Adapter

This is the driver code for NanoXplore's ANGIE USB-JTAG Adapter.
The driver is based on the openULINK project.

This driver communicate with ANGIE's firmware in order to establish
JTAG protocol to debug the target chip.

Since the ANGIE Adapter has a Spartan-6 FPGA in addition to the
FX2 microcontroller, the driver adds two functions, one to download
the firmware (embedded C) to the FX2, and the second to program
the FPGA with its bitstream.

Add ANGIE's configuration file to tcl/interface/
Add the device VID/PID to 60-openocd.rules file.
Add ANGIE to OpenOCD's documentation

Change-Id: Id17111c74073da01450d43d466e11b0cc086691f
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7702
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
8 months agocontrib/firmware: add new adapter ANGIE's firmware/bitstream code 01/7701/25
Ahmed BOUDJELIDA [Fri, 16 Jun 2023 21:19:05 +0000 (23:19 +0200)]
contrib/firmware: add new adapter ANGIE's firmware/bitstream code

This is ANGIE's firmware and bitstream code.
The 'Embeded C' code is based on the openULINK project.
The hdl bitstream source code is for the spartan-6 FPGA included in
ANGIE.

Since ANGIE has a different microcontroller (EZ-USB FX2) than openULINK
(EZ-USB AN2131), the registers file (reg_ezusb.h) has been changed
completely, so are the descriptors, interruptions and the endpoints
configuration.

Change-Id: I70590c7c58bac6f1939c5ffba57e87d86850664d
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7701
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 months agolibusb_helper: split error and returned value 56/7756/5
Antonio Borneo [Sun, 2 Jul 2023 21:48:42 +0000 (23:48 +0200)]
libusb_helper: split error and returned value

The USB control transfer can be executed without any data.
The libusb API libusb_control_transfer() can thus be called with
zero 'size', thus returning zero byte transferred when succeed.

The OpenOCD API jtag_libusb_control_transfer() returns zero either
in case of transfer error and in case of libusb_control_transfer()
returning zero, making impossible discriminating the two cases.

Extend jtag_libusb_control_transfer() with separate return value
for error code and explicit parameter's pointer for transferred
bytes.
Make the transferred pointer optional, as many callers do not
properly handle the returned value.
Use 'int' type pointer for transferred, instead of the 'uint16_t'
that would have matched the type of 'size'. This can simplify the
caller's code by using a single 'int transferred' variable shared
with other jtag_libusb_bulk_read|write, while keeping possible the
comparison int vs uint16_t without cast.

This change is inspired from commit d612baacaa3f
("jtag_libusb_bulk_read|write: return error code instead of size")

Change-Id: I14d9bff3e845675be03465c307a136e69eebc317
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7756
Tested-by: jenkins
Reviewed-by: ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
8 months agoLICENSES: Add the LGPL-2.1 license 43/7743/12
Thomas Gleixner [Sun, 18 Jun 2023 10:22:07 +0000 (12:22 +0200)]
LICENSES: Add the LGPL-2.1 license

Add the full text of the LGPL 2.1 license to OpenOCD. It was
copied directly from:

  https://spdx.org/licenses/LGPL-2.1.html#licenseText

Add the required tags for reference and tooling.

Checkpatch-ignore: FSF_MAILING_ADDRESS
Change-Id: I081f2197fb3c60e17cd6e3353d38194c720ee8a3
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7743
Tested-by: jenkins
Reviewed-by: ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>

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)