openocd.git
5 months agomips32: MIPS32_OP_SRL was using SRA opcode. 13/3613/4
Tobias Diedrich [Mon, 1 Aug 2016 18:29:41 +0000 (20:29 +0200)]
mips32: MIPS32_OP_SRL was using SRA opcode.

The mips opcode macro for the SRL opcode was using the wrong constant
value:

SRA -- Shift right arithmetic
Encoding: 0000 00-- ---t tttt dddd dhhh hh00 0011

SRL -- Shift right logical
Encoding: 0000 00-- ---t tttt dddd dhhh hh00 0010

This corrects the opcode constant for SRL and adds the SRA opcode for
completeness.

There is only one user of MIPS32_OP_SRL in src/flash/nor/cfi.c:
Since the mask constant (0x00000080 for the DQ7 mask) shifted in this
case would never have the sign bit set, it worked fine even though it
was accidentally using the SRA opcode instead of SRL.

Change-Id: I0a80746e2075c7df1ce35b9db00d9d0b997a3feb
Signed-off-by: Tobias Diedrich <ranma+openocd@tdiedrich.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/3613
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
5 months agojtag/drivers/kitprog: Restructure commands 67/7967/3
Marc Schink [Tue, 7 Nov 2023 16:14:09 +0000 (17:14 +0100)]
jtag/drivers/kitprog: Restructure commands

Use a command group 'kitprog' with subcommands instead of individual
commands with 'kitprog_' prefix.

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

Change-Id: I7f0d447939819ffc488a3d7a8de672b58887127f
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7967
Reviewed-by: Bohdan Tymkiv <bohdan200@gmail.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agodrivers/cmsis_dap: drop unused variable 65/7965/2
Tomas Vanek [Tue, 7 Nov 2023 12:23:14 +0000 (13:23 +0100)]
drivers/cmsis_dap: drop unused variable

The variable 'mode' was introduced in
commit 4dc8cd201c66 ("cmsis-dap: add initial cmsis-dap support")
but never has been used (just cleared)

Change-Id: Ia741d181ee8006bd0d872f3358a57e045235741a
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7965
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agojtag/drivers/cmsis-dap: Return error in 'backend' command 64/7964/3
Marc Schink [Mon, 6 Nov 2023 15:22:53 +0000 (16:22 +0100)]
jtag/drivers/cmsis-dap: Return error in 'backend' command

Change-Id: Ib9bf7ab50cbe193e9e726efb3cb58e53723a6dd1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7964
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agojtag/drivers/cmsis-dap: Restructure commands 63/7963/2
Marc Schink [Mon, 6 Nov 2023 14:50:40 +0000 (15:50 +0100)]
jtag/drivers/cmsis-dap: Restructure commands

Use a command group 'cmsis-dap' with subcommands instead of individual
commands with 'cmsis_dap_' prefix.

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

Change-Id: I75facb7572a86354c2ce6144aa7fadf3b5a6db4e
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7963
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agocontrib/firmware: add 'send not acknowledged' function to the i2c bit-banging impleme... 11/7811/5
Ahmed BOUDJELIDA [Mon, 16 Oct 2023 09:05:59 +0000 (11:05 +0200)]
contrib/firmware: add 'send not acknowledged' function to the i2c bit-banging implementation

Change-Id: I60597ebc126da4acb00654513b96f52261253e12
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7811
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agocontrib/firmware: extend the number of bytes to be sent in the i2c bit-banging read... 10/7810/5
Ahmed BOUDJELIDA [Mon, 16 Oct 2023 09:04:16 +0000 (11:04 +0200)]
contrib/firmware: extend the number of bytes to be sent in the i2c bit-banging read operation

Change-Id: Iaeb3d5ba37da1bd77d36ad0ebbc6b45c46860dec
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7810
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agocontrib/firmware: remove unnecessary delay commands in the i2c bit-banging implementation 09/7809/3
Ahmed BOUDJELIDA [Mon, 16 Oct 2023 09:00:28 +0000 (11:00 +0200)]
contrib/firmware: remove unnecessary delay commands in the i2c bit-banging implementation

Change-Id: I741244be7a1bf186cfcb66a5b93e2a1a2ab0fde5
Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7809
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agoaarch64: Use 64-bit reads/writes to access SCTLR_EL1 39/7939/2
Peter Collingbourne [Wed, 18 Oct 2023 02:04:00 +0000 (19:04 -0700)]
aarch64: Use 64-bit reads/writes to access SCTLR_EL1

We were previously inadvertently clearing the top 32 bits of SCTLR_EL1
during read_memory/write_memory as a result of using 32-bit operations
to access the register and because the fields used to temporarily
store the register were 32-bit. Fix it.

Change-Id: I657d7f949e1f7ab6bf90609e3f91cae09cade31a
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7939
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agoopenocd: src/target: Correctly handle CCSIDR_EL1.Associativity=0 16/7916/2
Peter Collingbourne [Thu, 28 Sep 2023 00:02:03 +0000 (17:02 -0700)]
openocd: src/target: Correctly handle CCSIDR_EL1.Associativity=0

Associativity=0 means that only one CMO is needed for all ways.
It could also mean that the cache is 1-way, but this is less likely.

Currently Associativity=0 causes us to hang in the while loop in
decode_cache_reg. Fix it by skipping the loop in this case. We can let
way_shift be set to the arbitrary value of 0 because in the case where
Associativity=0 we only ever shift 0 by it before ORing it into the
CMO operand.

Change-Id: I7c1de68d33f6b3ed627cbb1e2401d43185e4c1e3
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7916
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agobreakpoints: Add target logging to breakpoints and watchpoints 22/7922/6
Marek Vrbka [Fri, 29 Sep 2023 11:14:10 +0000 (13:14 +0200)]
breakpoints: Add target logging to breakpoints and watchpoints

This patch adds target logging to breakpoint
handling code. This makes it easier to
debug multicore/multithread systems.

Change-Id: I6bea8079a457070a8f63d0ce381a4ece6f5a190a
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7922
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 months agobreakpoints: Fix endless loop in bp/wp_clear_target 40/7940/5
Kirill Radkin [Wed, 18 Oct 2023 16:13:25 +0000 (19:13 +0300)]
breakpoints: Fix endless loop in bp/wp_clear_target

If we can't remove bp/wp, we will stuck in endless loop

Change-Id: I44c0a164db1d15c0a0637d33c75087a49cf5c0f4
Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7940
Tested-by: jenkins
Reviewed-by: Anatoly P <kupokupokupopo@gmail.com>
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agoxtensa: update XDM register map for TRAX support 73/7973/5
ianst [Thu, 9 Nov 2023 15:28:50 +0000 (07:28 -0800)]
xtensa: update XDM register map for TRAX support

- Include additional debug module registers
- Add translation function for DM reg addr -> ID
- Add DM read/write commands

Signed-off-by: ianst <ianst@cadence.com>
Change-Id: If95419d24a9f27a40fa695c8c15326cdfd127ef1
Reviewed-on: https://review.openocd.org/c/openocd/+/7973
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agodoc: xtensa architecture clarifications/fixes 72/7972/2
ianst [Fri, 20 Oct 2023 20:00:41 +0000 (13:00 -0700)]
doc: xtensa architecture clarifications/fixes

- Fix Xtensa .cfg file references for NXP EVK
- Add clarification note for "xtensa xtmem" command
- Resolve TEX build warnings

Signed-off-by: ianst <ianst@cadence.com>
Change-Id: I0f2b56d0d084d86f557fadf3ac35fd04bf99650c
Reviewed-on: https://review.openocd.org/c/openocd/+/7972
Tested-by: jenkins
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotarget: Remove break/watchpoints in target_destroy() 56/7956/2
Marc Schink [Wed, 1 Nov 2023 08:27:05 +0000 (09:27 +0100)]
target: Remove break/watchpoints in target_destroy()

Break- and watchpoints are not removed when a target is destroyed
which introduces a memory leak.

Change-Id: I6143d48f7efd765b7752a12fdc337da3496d896f
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7956
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotarget: fix segmentation fault on target create 62/7962/2
Antonio Borneo [Sun, 5 Nov 2023 16:02:26 +0000 (17:02 +0100)]
target: fix segmentation fault on target create

In the unusual (and even incorrect) case of running the command
target create ...
before defining an adapter and the associated transport, the
command causes a segmentation fault. E.g.:
openocd -c 'target create cpu cortex-m -endian little'

Check that get_current_transport() returns a valid pointer before
referencing it.

Change-Id: I9796a7e92196ef3df5c7152b27c34102045dc9e7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7962
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
5 months agotarget: use boolean values for 'valid' and 'dirty' flags 61/7961/3
Antonio Borneo [Sun, 5 Nov 2023 11:55:27 +0000 (12:55 +0100)]
target: use boolean values for 'valid' and 'dirty' flags

Convert to boolean the remaining numeric assignment and comparison

Change-Id: Idc25221d93e85236185aab9ee36f0a379939c89c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7961
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
5 months agonor: rsl10: fix minor coding style 60/7960/2
Antonio Borneo [Sat, 4 Nov 2023 14:55:24 +0000 (15:55 +0100)]
nor: rsl10: fix minor coding style

I use a script to compare the commands in the code with the ones
in the documentation.
Fix the style of the data to simplify the parsing.

Change-Id: I0f1d7e9ff5e2928312ca1a2f3424f82d2910580a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7960
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
5 months agocontrib/rtos-helpers/FreeRTOS-openocd: change license to CC0-1.0 95/7995/2
Antonio Borneo [Thu, 9 Nov 2023 14:15:10 +0000 (15:15 +0100)]
contrib/rtos-helpers/FreeRTOS-openocd: change license to CC0-1.0

This file is intended to be included in any user's project that
plans to use OpenOCD awareness for FreeRTOS.
It is supposed to be distributed under a permissive license to not
impact the original license of the user's project.

Distribute it under Creative Commons Zero v1.0 Universal license.

Change-Id: I7ac90e8b742517bcafc08c00662625671c8159c4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7995
Reviewed-by: Karl Palsson <karlp@tweak.au>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
5 months agoLICENSES: Add the CC0-1.0 license 94/7994/2
Antonio Borneo [Thu, 9 Nov 2023 14:12:08 +0000 (15:12 +0100)]
LICENSES: Add the CC0-1.0 license

Add the full text of the CC0-1.0 license to the OpenOCD tree. It
was copied directly from:

  https://spdx.org/licenses/CC0-1.0.html#licenseText

Add the required tags for reference and tooling.

Change-Id: Iae9c1431b6ffdd68ad5780deb78a257edb0b67f3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7994
Tested-by: jenkins
Reviewed-by: Karl Palsson <karlp@tweak.au>
5 months agopld/certus: fix crash when loading bitstream 08/7908/2
Daniel Anselmi [Sun, 24 Sep 2023 22:05:38 +0000 (00:05 +0200)]
pld/certus: fix crash when loading bitstream

Loading a bitstream to cetrus device crashed due to
missing initialization.

Change-Id: Ibd9a04b84e514f9635af01a2b73bae478e534eb7
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7908
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotcl/board: Add TI AM273 launchpad config 51/7951/2
Nishanth Menon [Tue, 17 Oct 2023 21:10:17 +0000 (16:10 -0500)]
tcl/board: Add TI AM273 launchpad config

Add basic connection details with AM273 Launchpad

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

Change-Id: I88a02cdbccb65c185e808503d080cc1f12c909ae
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7951
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotcl/target/ti_k3: Add AM273 SoC 50/7950/2
Nishanth Menon [Tue, 17 Oct 2023 21:07:41 +0000 (16:07 -0500)]
tcl/target/ti_k3: Add AM273 SoC

Add support for the TI K3 family AM273 SoC.

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

Change-Id: Ifa21d0760831f4f525ecd976fb8d086ffdbc9e9f
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7950
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/board: Add TI AM263 launchpad config 49/7949/2
Nishanth Menon [Tue, 17 Oct 2023 21:02:44 +0000 (16:02 -0500)]
tcl/board: Add TI AM263 launchpad config

Add basic connection details with AM263 Launchpad

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

Change-Id: I94c7a9ca70734ae89c6df3f02137d5bd32fde774
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7949
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 months agotcl/target/ti_k3: Add AM263 SoC 48/7948/2
Nishanth Menon [Tue, 17 Oct 2023 21:00:27 +0000 (16:00 -0500)]
tcl/target/ti_k3: Add AM263 SoC

Add support for the TI K3 family AM263 SoC.

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

Change-Id: I9a91b3d675511661dfc2710a7183bd59b98da133
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7948
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 months agotcl/board: Add TI AM243 launchpad config 47/7947/2
Nishanth Menon [Tue, 17 Oct 2023 20:53:59 +0000 (15:53 -0500)]
tcl/board: Add TI AM243 launchpad config

Add basic connection details with AM243 Launchpad

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

Change-Id: Id8cec6675a222888b0007484209558d6503dbcda
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7947
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
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>

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)