openocd.git
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>
9 months agobreakpoints: use 64-bit type for watchpoint mask and value 40/7840/6
Parshintsev Anatoly [Fri, 28 Jul 2023 17:41:32 +0000 (20:41 +0300)]
breakpoints: use 64-bit type for watchpoint mask and value

This patch changes data types of watchpoint value and mask to allow for
64-bit values match that some architectures (like RISCV) allow.

In addition this patch fixes the behavior of watchpoint command to
zero-out mask if only data value is provided.

Change-Id: I3c7ec1630f03ea9534ec34c0ebe99e08ea56e7f0
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7840
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agodoc: port "0" requests any available port for usage by OpenOCD server 42/7842/6
Parshintsev Anatoly [Tue, 1 Aug 2023 21:46:32 +0000 (00:46 +0300)]
doc: port "0" requests any available port for usage by OpenOCD server

Change-Id: I0d38533748898516dce44e81d0bff6bd35ee4aec
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7842
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
9 months agopld/virtex2: allow calling set_instr_codes and set_user_codes before 'init' 21/7821/4
Daniel Anselmi [Sun, 23 Jul 2023 23:43:58 +0000 (01:43 +0200)]
pld/virtex2: allow calling set_instr_codes and set_user_codes before 'init'

Change-Id: Ib21366b2fdbf33ee06a958e52b725989114751f4
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7821
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agoregister: refactor register_cache_invalidate() 35/7735/4
Marek Vrbka [Tue, 6 Jun 2023 13:32:09 +0000 (15:32 +0200)]
register: refactor register_cache_invalidate()

register_cache_invalidate() is written a way which uses
pointer arithmetic, which makes it harder to read. This patch
replaces it with more readable way to iterate over array of
structs.

Change-Id: Ia420f70a3bb6998c690c8c600c71301dca9f9dbf
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7735
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
9 months agotarget: fix messages and return values of failed op because not halted 19/7819/2
Tomas Vanek [Thu, 20 Jul 2023 12:52:54 +0000 (14:52 +0200)]
target: fix messages and return values of failed op because not halted

Lot of messages was logged as LOG_WARNING, but the operation failed
immediately. Sometimes no error message was logged at all.
Add missing messages, change warnings to errors.

Sometimes ERROR_TARGET_INVALID was returned. Some command handlers
returned ERROR_OK! Always return ERROR_TARGET_NOT_HALTED.

While on it use LOG_TARGET_ERROR() whenever possible.
Prefix command_print() message with 'Error:' to get closer
to LOG_TARGET_ERROR() variant.

Error message was not added to get() and set() methods of
struct xxx_reg_type - the return value is properly checked and a message
is logged by the caller in case of ERROR_TARGET_NOT_HALTED.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I2fe4187c6025f0038956ab387edbf3f461c69398
Reviewed-on: https://review.openocd.org/c/openocd/+/7819
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agojtag/drivers/xds110: Fix compiler warning. 13/7813/4
Tim Newsome [Thu, 13 Jul 2023 16:38:44 +0000 (09:38 -0700)]
jtag/drivers/xds110: Fix compiler warning.

Compiler would complain that `written` was used without being
initialized.

Simplify the code a little. The number of bytes written is already
checked in usb_write().

Signed-off-by: Tim Newsome <tim@sifive.com>
Change-Id: Ibada85dcccfca6f1269c584cdbc4f2e3b93bb8f3
Reviewed-on: https://review.openocd.org/c/openocd/+/7813
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
9 months agotarget/riscv: Add null pointer check before right shift for bscan tunneling. 14/7814/3
eolson [Thu, 22 Jun 2023 18:02:21 +0000 (13:02 -0500)]
target/riscv: Add null pointer check before right shift for bscan tunneling.

Change-Id: I5d4764c777f33d48705b3e5273eb840c13cfbfb7
Signed-off-by: eolson <erin.olson@seagate.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7814
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
9 months agotarget/arc: fix off-by-one error in arc_save_context() 65/7765/3
Artemiy Volkov [Wed, 5 Jul 2023 13:43:08 +0000 (15:43 +0200)]
target/arc: fix off-by-one error in arc_save_context()

While not affecting the function's main purpose, an error has
crept into arc_save_context() that results in logging wrong register
values when the debug level is 3 or more. For instance, when debugging a
trivial program and halting at entry to main, the following values are
printed to the log:

Debug: 2915 2020 arc.c:894 arc_save_context(): Get core register regnum=0,
name=r0, value=0x0000000
...
Debug: 2947 2020 arc.c:894 arc_save_context(): Get core register regnum=60,
name=lp_count, value=0x900002d8
Debug: 2948 2020 arc.c:894 arc_save_context(): Get core register regnum=63,
name=pcl, value=0xffffffff
Debug: 2949 2020 arc.c:909 arc_save_context(): Get aux register regnum=64,
name=pc, value=0x900000b4
Debug: 2950 2020 arc.c:909 arc_save_context(): Get aux register regnum=65,
name=lp_start, value=0x900000bc
Debug: 2951 2020 arc.c:909 arc_save_context(): Get aux register regnum=66,
name=lp_end, value=0x00080801
Debug: 2952 2020 arc.c:909 arc_save_context(): Get aux register regnum=67,
name=status32, value=0xffffffff

After the change, the register contents make much more sense:

Debug: 2923 3934 arc.c:889 arc_save_context(): Get core register regnum=0,
name=r0, value=0x00000000
...
Debug: 2955 3934 arc.c:889 arc_save_context(): Get core register regnum=60,
name=lp_count, value=0x00000000
Debug: 2956 3934 arc.c:889 arc_save_context(): Get core register regnum=63,
name=pcl, value=0x900002d8
Debug: 2957 3934 arc.c:903 arc_save_context(): Get aux register regnum=64,
name=pc, value=0x900002da
Debug: 2958 3934 arc.c:903 arc_save_context(): Get aux register regnum=65,
name=lp_start, value=0x900000b4
Debug: 2959 3934 arc.c:903 arc_save_context(): Get aux register regnum=66,
name=lp_end, value=0x900000bc
Debug: 2960 3934 arc.c:903 arc_save_context(): Get aux register regnum=67,
name=status32, value=0x00080801

While at it, simplify a couple of expressions.

Change-Id: I8f2d79404707fbac4503af45b393ea73f91e6beb
Signed-off-by: Artemiy Volkov <artemiy@synopsys.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7765
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/board: add esp32s3-builtin.cfg file 49/7749/2
Erhan Kurubas [Sun, 18 Jun 2023 11:05:35 +0000 (13:05 +0200)]
tcl/board: add esp32s3-builtin.cfg file

Board config file for ESP32-S3, to allow communication with
the builtin USB-JTAG adapter.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I1310f5db30f7df38fe9344f7ba2334611b53863e
Reviewed-on: https://review.openocd.org/c/openocd/+/7749
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotcl/interface: add Espressif builtin usb_jtag config file. 48/7748/2
Erhan Kurubas [Sun, 18 Jun 2023 10:59:19 +0000 (12:59 +0200)]
tcl/interface: add Espressif builtin usb_jtag config file.

This config file enables communication over USB-JTAG with
ESP32-C3, ESP32-S3, ESP32-H2 and ESP32-C6 chips

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Iceea26972588d8c4919d1f3248684ece48ca9121
Reviewed-on: https://review.openocd.org/c/openocd/+/7748
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotarget/espressif: cleanup unused macro definitions 62/7762/2
Erhan Kurubas [Tue, 4 Jul 2023 21:22:22 +0000 (23:22 +0200)]
target/espressif: cleanup unused macro definitions

Memory region addresses are not in use for now.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I9a2189e956ae59b56245ec914ab16719df857b2d
Reviewed-on: https://review.openocd.org/c/openocd/+/7762
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotarget/espressif: read entry addresses of pre-defined stub functions 58/7758/6
Erhan Kurubas [Mon, 3 Jul 2023 21:16:52 +0000 (23:16 +0200)]
target/espressif: read entry addresses of pre-defined stub functions

Debug stubs functionality provided by ESP IDF allows executing
target function in any address. e.g; esp32_cmd_gcov()

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I56d844e5a862c9bf33fdb991b01abb7a76047ca7
Reviewed-on: https://review.openocd.org/c/openocd/+/7758
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotarget/esp_xtensa: add xtensa on_halt handler 57/7757/2
Erhan Kurubas [Tue, 4 Jul 2023 16:40:36 +0000 (18:40 +0200)]
target/esp_xtensa: add xtensa on_halt handler

Right after target halt, some activities needs to be done
such as printing exception reason, disable wdts and reading
debug stubs information.
Missing activities will be submitted in the next patches.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I27aad5614d903f4bd7c8d6dba6bfb0bdb93ed8dc
Reviewed-on: https://review.openocd.org/c/openocd/+/7757
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotcl/target: update esp32s3.cfg to reference shared functions in the esp_common.cfg 47/7747/2
Erhan Kurubas [Sun, 18 Jun 2023 09:00:22 +0000 (11:00 +0200)]
tcl/target: update esp32s3.cfg to reference shared functions in the esp_common.cfg

This commit enhances code reusability, simplifies maintenance, and ensures
consistency across all chip configurations by consolidating commonly used
commands and variables into the common config file.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ifb0122f3b98a767f27746409499733b70fb7d0e8
Reviewed-on: https://review.openocd.org/c/openocd/+/7747
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/target: update esp32s2.cfg to reference shared functions in the esp_common.cfg 46/7746/2
Erhan Kurubas [Sun, 18 Jun 2023 09:18:31 +0000 (11:18 +0200)]
tcl/target: update esp32s2.cfg to reference shared functions in the esp_common.cfg

This commit enhances code reusability, simplifies maintenance, and ensures
consistency across all chip configurations by consolidating commonly used
commands and variables into the common config file.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I36c86fe4ebc99928ce48a5bff8cb9580a0fa3ac0
Reviewed-on: https://review.openocd.org/c/openocd/+/7746
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/target: update esp32.cfg to reference shared functions in the esp_common.cfg 45/7745/2
Erhan Kurubas [Sun, 18 Jun 2023 08:25:07 +0000 (10:25 +0200)]
tcl/target: update esp32.cfg to reference shared functions in the esp_common.cfg

This commit enhances code reusability, simplifies maintenance, and ensures
consistency across all chip configurations by consolidating commonly used
commands and variables into the common config file.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I9181737d83eeba4e983b6a455b8a1523f2576dd2
Reviewed-on: https://review.openocd.org/c/openocd/+/7745
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotcl/target: move Espressif shared functions to esp_common.cfg 44/7744/3
Erhan Kurubas [Sun, 18 Jun 2023 08:17:33 +0000 (10:17 +0200)]
tcl/target: move Espressif shared functions to esp_common.cfg

Consolidate commonly used commands and variables from
chip config files into functions in esp_common.cfg.
This includes "jtag newtap," "target create,"and "configure -event."
Enhances code reusability and simplifies maintenance.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I9e8bf07a4a15d4544ceb564607dea66837381d70
Reviewed-on: https://review.openocd.org/c/openocd/+/7744
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agodoc:usb_adapters: add lsusb dump of STLINK-V3PWR 68/7768/2
Antonio Borneo [Mon, 10 Jul 2023 09:59:27 +0000 (11:59 +0200)]
doc:usb_adapters: add lsusb dump of STLINK-V3PWR

Add USB VID:PID 0483:3755 and 0483:3757.

Change-Id: Iace29fa97f1b8e9d86078b9775561ca525635523
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7768
Tested-by: jenkins
9 months agoipdbg: fix 'double free' in case of failed start 70/7770/2
Daniel Anselmi [Mon, 10 Jul 2023 19:03:10 +0000 (21:03 +0200)]
ipdbg: fix 'double free' in case of failed start

Change-Id: Id241d9dd0793095106fea000422617fbef462669
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7770
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agoflash/nor/stm32l4x: Add revision 'V' for STM32L4R/S devices 63/7763/2
Marc Schink [Wed, 5 Jul 2023 13:25:12 +0000 (15:25 +0200)]
flash/nor/stm32l4x: Add revision 'V' for STM32L4R/S devices

See section 57.6.1 in RM0432.

Change-Id: Ic4977aee74d1838f420c1d9ff19925d09f8f6e2b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7763
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/ultrascale: add more ultrascale devices 16/7716/5
Daniel Anselmi [Fri, 14 Apr 2023 23:13:12 +0000 (01:13 +0200)]
tcl/ultrascale: add more ultrascale devices

Add more ultrascale devices. Set instruction codes for SSI devices
such that refresh/program read_stat and user registers will work.

Change-Id: Id0a0706f4016eb8a4732725a5b72ae61efd73421
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7716
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
9 months agotcl/cpld: add config files for virtex-7 devices with ir-length > 6 15/7715/6
Daniel Anselmi [Fri, 14 Apr 2023 23:13:12 +0000 (01:13 +0200)]
tcl/cpld: add config files for virtex-7 devices with ir-length > 6

Adding a single file for each different ir-length.

Change-Id: Iba3dd55b91c28fdb4d0cafa1ededd939fe61a267
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7715
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
9 months agotarget/espressif: fix build issue with older gcc versions 15/7815/2
Erhan Kurubas [Thu, 13 Jul 2023 21:06:14 +0000 (23:06 +0200)]
target/espressif: fix build issue with older gcc versions

Compilation on old gcc 4.8.4 fails:
error: missing braces around initializer [-Werror=missing-braces]

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ie8b5747f9e23ba5a82bd7f666846e7286284a338
Reviewed-on: https://review.openocd.org/c/openocd/+/7815
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
10 months agojtag/stlink: add STLINK-V3PWR support 55/7755/2
Laurent LEMELE [Tue, 13 Dec 2022 15:12:08 +0000 (16:12 +0100)]
jtag/stlink: add STLINK-V3PWR support

STLINK-V3PWR is both a standalone debugger probe compatible with
STLINK-V3 and a source measurement unit (SMU).
Link: http://www.st.com/stlink-v3pwr
This code adds support for the debugger probe functionality.

Change-Id: Ib056e55722528f922c5574bb6fbf77e2f2b2b0c1
Signed-off-by: Laurent LEMELE <laurent.lemele@st.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7755
Tested-by: jenkins
10 months agoipdbg/pld: ipdbg can get tap and hub/ir from pld driver. 69/7369/21
Daniel Anselmi [Fri, 14 Apr 2023 23:13:12 +0000 (01:13 +0200)]
ipdbg/pld: ipdbg can get tap and hub/ir from pld driver.

To start a ipdbg server one needs to know the tap and the
instruction code to reach the IPDBG-Hub. This instruction is
vendor/family specific. Knowledge which can be provided by the
pld driver.

Change-Id: I13eeb9fee895d65cd48544da4704fcc9b528b869
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7369
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 months agopld/virtex2: add program/refresh command 14/7714/8
Daniel Anselmi [Fri, 14 Apr 2023 23:13:12 +0000 (01:13 +0200)]
pld/virtex2: add program/refresh command

Change-Id: If6d237a6f27c4232849f73d08e7ca74276e6d464
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7714
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 months agopld/gowin: add missing documentation 36/7736/4
Daniel Anselmi [Tue, 6 Jun 2023 23:11:49 +0000 (01:11 +0200)]
pld/gowin: add missing documentation

Add short description for gowin {read_status/read_user/reload}
commands.

Change-Id: Ib441f3a2c0f00346decdeb505c27afa2630e9b5d
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7736
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 months agotcl/cpld: add config files for more xilinx fpga families 52/7352/15
Daniel Anselmi [Thu, 17 Nov 2022 01:01:04 +0000 (02:01 +0100)]
tcl/cpld: add config files for more xilinx fpga families

Use configurable virtex pld driver to add support for more
xilinx fpga families.

Change-Id: Iff10c8c511787734fa289bdba15f03131d51e071
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7352
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
10 months agopld/xilinx: make instruction codes configurable 13/7713/6
Daniel Anselmi [Fri, 14 Apr 2023 23:13:12 +0000 (01:13 +0200)]
pld/xilinx: make instruction codes configurable

Change-Id: I4d2c1fbd4d6007ba8d5c8c687a7c13e25fb6a474
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7713
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 months agopld: give devices a name for referencing in scripts 28/7728/8
Daniel Anselmi [Sat, 3 Jun 2023 18:16:19 +0000 (20:16 +0200)]
pld: give devices a name for referencing in scripts

Change-Id: I05e8596ffacdb6cd8da4dd8a40bb460183f4930a
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7728
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 months agotcl/board/bemicro: source cycloneiii.cfg from correct path 51/7751/2
Daniel Anselmi [Mon, 19 Jun 2023 21:37:08 +0000 (23:37 +0200)]
tcl/board/bemicro: source cycloneiii.cfg from correct path

Change-Id: Ib1d1be1067107633949a202a05f7fd06831ba84b
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7751
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
10 months agosemihosting: fix handling of errno 30/7730/5
Marek Vrbka [Thu, 1 Jun 2023 10:42:03 +0000 (12:42 +0200)]
semihosting: fix handling of errno

This patch fixes the handling of errno by setting the sys_errn
only if error has actually occurred during the semihosting call.
It also fixes few issues where error was not set in the first place.

Change-Id: I2fbe562f3ec5e6220b800de04cd33aa1f409c7a0
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7730
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
10 months agosemihosting: improve semihosting opcode debug messages 26/7726/3
Marek Vrbka [Tue, 30 May 2023 13:36:12 +0000 (15:36 +0200)]
semihosting: improve semihosting opcode debug messages

This patch introduces function semihosting_opcode_to_str() which
converts semihosting opcodes to strings. This function is then
used in debug messages to improve log analysis and troubleshooting.

Change-Id: Iffea49dae13d6a626ae0db40d379cba3c9ea5bd3
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7726
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
10 months agoriscv/semihosting: Fix ebreak skip on fileio mode 29/7729/3
Marek Vrbka [Mon, 5 Jun 2023 06:35:09 +0000 (08:35 +0200)]
riscv/semihosting: Fix ebreak skip on fileio mode

This patch fixes skipping the semihosting sequence if
the fileio mode is enabled on riscv. This change was
tested by me and is in the riscv-openocd fork for a year now.

Original merge request:
https://github.com/riscv/riscv-openocd/pull/699

Original author: Wu Zhigang
zhigang.wu@starfivetech.com
https://github.com/wzgpeter

Change-Id: Iadaa0a48d1f82d3a7ca168f8a6b656ff6ab78e03
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7729
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
11 months agotarget/ti-cjtag: make switching to JTAG more reliable 19/7419/3
Lorenz Brun [Sat, 24 Dec 2022 02:56:22 +0000 (03:56 +0100)]
target/ti-cjtag: make switching to JTAG more reliable

The current cJTAG to JTAG switching commands for TI chips are not
particularly reliable, especially on chips with accurate timing.
On a Raspberry Pi the existing sequence has (depending on cabling and
chip) a ~50% chance of working, on a much better-behaved FT2232H
it doesn't manage to enable full JTAG at all.

This change runs a bunch of test-idle cycles before actually attempting
to switch to full JTAG. This makes the switch reliable even at high
clock speeds (>100kHz) and from precise sources like the FT2232H.

Change-Id: I9293e884bf3e9606d529756ae4483b844d3c39db
Reported-by: Phil Wiggum <p1mail2015@mail.com>
Fixes: https://sourceforge.net/p/openocd/tickets/375/
Signed-off-by: Lorenz Brun <lorenz@brun.one>
Reviewed-on: https://review.openocd.org/c/openocd/+/7419
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agojep106: update to revision JEP106BG May 2023 27/7727/2
Antonio Borneo [Thu, 1 Jun 2023 08:50:50 +0000 (10:50 +0200)]
jep106: update to revision JEP106BG May 2023

The original document from Jedec does 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: I30215c4ff08d5f112305cde6ab7a3176cdcef948
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7727
Tested-by: jenkins
11 months agosemihosting: fix non-zero value on Windows isatty() 25/7725/2
Marek Vrbka [Tue, 30 May 2023 12:16:38 +0000 (14:16 +0200)]
semihosting: fix non-zero value on Windows isatty()

On Windows, isatty() can return any non-zero value if it's an interactive
device. Which diverges from the ARM semihosting specification. This patch
introduces a fix to make the SYS_ISTTY operation conform to spec.

Change-Id: I9bc4f3cb82370812825d52419851910b3e3f35cc
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7725
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
11 months agogdb_server: refactor and unify function gdb_get_char_inner 24/7724/3
Marek Vrbka [Tue, 30 May 2023 08:07:18 +0000 (10:07 +0200)]
gdb_server: refactor and unify function gdb_get_char_inner

The old implementation of gdb socket error handling
in the gdb_get_char_inner() differs between Windows and *nix
platforms. This patch simplifies it by using an existing
function log_socket_error() which handles most of the platform
specific things. It also provides better error messages.

Change-Id: Iec871c4965b116dc7cfb03c3565bab66c8b41958
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7724
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agogdb_server: add debug signal reason prints 20/7720/4
Marek Vrbka [Mon, 29 May 2023 12:41:34 +0000 (14:41 +0200)]
gdb_server: add debug signal reason prints

Added debug prints to show what is the target debug reason. Also added
debug print for Ctrl-C response. This is useful for troubleshooting and
log analysis.

Change-Id: I055936257d989efe7255656198a8d73a367fcd15
Signed-off-by: Marek Vrbka <marek.vrbka@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7720
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
11 months agoflash/nor: add support for NXP QN908x 84/5584/11
iosabi [Thu, 9 Apr 2020 22:00:58 +0000 (22:00 +0000)]
flash/nor: add support for NXP QN908x

This patch adds support for the NXP QN908x family of Bluetooth
microcontrollers, such as the QN9080. This chip features a Cortex-M4F
with 512 KiB of flash on all the available versions, although the
documentation suggests that there might be 256 kB versions as well.

The initial support allows to read, erase and write the whole user flash
area. Three new sub-commands under the new "qn908x" command are added
in this patch as well: disable_wdog to disabled the watchdog,
mass_erase to perform a mass erase and allow_brick to allow programming
images that disable the SWD interface.

Disabling the watchdog is required after a "reset halt" in order to run
the CRC algorithm from RAM when verifying the chip. However, this is not
done automatically on probing or other initialization since disabling
the watchdog might interfere with debugging real applications.

The "mass_erase" command allows to erase the whole flash without
probing it, since in some scenarios the chip can be locked such that no
flash or ram can be accessed from the SWD interface, allowing only to
run a mass_erase to be able to flash the program.

The flashing process allows to compute a checksum, similar to the
lpc2000 driver "calc_checksum" but done over a different region of the
memory. This checksum is required to be present for the QN908x
bootloader ROM to boot, and otherwise is useless. As with the lpc2000
design, verification when using "calc_checksum" is expected to fail if
the checksum was not valid in the image being verified.

This was manually tested on a QN9080, including the scan-view,
AddressSanitizer/UBSan and test coverage configurations.

Change-Id: Ibd6d8f3608654294795085fcaaffb448b77cc58b
Co-developed-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Signed-off-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Signed-off-by: iosabi <iosabi@protonmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/5584
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
11 months agojtag/vdebug: adding xtensa config 23/7723/2
Jacek Wuwer [Mon, 29 May 2023 17:00:27 +0000 (19:00 +0200)]
jtag/vdebug: adding xtensa config

This change adds the extensa sample target and board configurations.
it removes the obsoleted vd_xtensa_jtag.cfg from targets.

Change-Id: I9d4d25abde46c0b15e5211a973012447872cb405
Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7723
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
11 months agojtag/vdebug: using tap_state 22/7722/2
Jacek Wuwer [Mon, 29 May 2023 16:38:44 +0000 (18:38 +0200)]
jtag/vdebug: using tap_state

This change implements the predefined type tap_state instead of generic
uint8_t in the driver

Change-Id: I3478e8d7b40b961f3ba77711179016cdcc35cd32
Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7722
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
11 months agojtag/vdebug: fix endianness support 21/7721/2
Jacek Wuwer [Mon, 29 May 2023 15:46:08 +0000 (17:46 +0200)]
jtag/vdebug: fix endianness support

This change fixes endianness support in the driver.

Change-Id: Ida360bb58e988cea0a66fdc79e1610b528846fc4
Signed-off-by: Jacek Wuwer <jacekmw8@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7721
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agotarget/espressif: fix clang scan-build warning 19/7719/3
Erhan Kurubas [Sun, 28 May 2023 11:56:56 +0000 (14:56 +0300)]
target/espressif: fix clang scan-build warning

Clang reports that 3rd function call argument is an uninitialized value
file esp32_apptrace.c line:1270

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I73e254d4eb0c6b3152229717d8827d334784ab92
Reviewed-on: https://review.openocd.org/c/openocd/+/7719
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
11 months agotcl/board/calao-usb-a9g20-c01: add proper initialization 78/7578/4
Wolfram Sang [Tue, 28 Mar 2023 19:28:35 +0000 (21:28 +0200)]
tcl/board/calao-usb-a9g20-c01: add proper initialization

Initialize clocks to max speed and setup SDRAM. NAND support is still
incomplete. Originally found at:

elinux.org/index.php?title=Calao_Atmel_AT91_development_board&oldid=73933

Updated the code from 2011 and improved it a bit.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: I83474e07c8de8cc3b5d058029551935549693ef9
Reviewed-on: https://review.openocd.org/c/openocd/+/7578
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agoAdd/Correct STM8L15xx2/3/4/6/8 devices 90/7690/5
Dominik Wernberger [Thu, 18 May 2023 14:51:55 +0000 (16:51 +0200)]
Add/Correct STM8L15xx2/3/4/6/8 devices

Change-Id: I83fe1e50821ec15e1853aca96ebb32fe1ff5328f
Signed-off-by: Dominik Wernberger <dominik.wernberger@gmx.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7690
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agoflash: jtagspi: fix clang build warning 18/7718/2
Antonio Borneo [Sat, 27 May 2023 15:01:58 +0000 (17:01 +0200)]
flash: jtagspi: fix clang build warning

Clang is unable to fully track the content of the array
write_buffer[] and incorrectly complains that it could contain
some uninitialized value.

To help clang to track the execution flow, rewrite the handling of
the buffer by using simpler indexing and by moving away cmd_byte
from the first buffer's element to the variable cmd_byte.

While there:
- fix the error codes returned while parsing the command line and
- use directly command_print_sameline() instead of passing through
  intermediate buffers.

Change-Id: I1969e896887ea3a4abebee057cc04c03005fa57c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7718
Tested-by: jenkins
11 months agoflash: psoc4: fix clang error 17/7717/2
Antonio Borneo [Sat, 27 May 2023 13:56:44 +0000 (15:56 +0200)]
flash: psoc4: fix clang error

Clang 15.0.7 complains about snprintf output truncation due to
output between 13 and 22 bytes into a destination of size 20.

Increase the size of the buffer.

Change-Id: I0369255ca1bc02a0cf494f765e91a608c960a0d6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7717
Tested-by: jenkins
11 months agocortex_m: fix reading of DCB_DSCSR register 93/7693/3
Bohdan Tymkiv [Tue, 23 May 2023 11:40:11 +0000 (14:40 +0300)]
cortex_m: fix reading of DCB_DSCSR register

Value in the 'dscsr' variable is garbage until the DAP queue is run.
Postpone evaluation of the 'secure_state' variable. Reading the
core registers in between will execute the DAP queue.

Change-Id: I44959e882dbafb1b9779e813c3d13f3b3dbcd47f
Signed-off-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7693
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
11 months agotarget: armv8: fix support of pointer authentication 12/7712/2
Antonio Borneo [Thu, 25 May 2023 08:49:20 +0000 (10:49 +0200)]
target: armv8: fix support of pointer authentication

The registers pauth_dmask and pauth_cmask are not accessible in
AARCH32 mode. Tagging them as 'hidden' is not enough and triggers
error:
Failed to read pauth_dmask register
while halting the core.

Tag the pauth registers as not existing, unless required by user.

Note: for non existing registers there should be no need to
      allocate their register cache. Let's keep this for a further
      improvement.

Change-Id: Iaa0d006a3d8ee611ee93333ed49a8615a6c94276
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: d0436b0cdabb ("armv8: Add support of pointer authentication")
Reviewed-on: https://review.openocd.org/c/openocd/+/7712
Tested-by: jenkins
Reviewed-by: Koudai Iwahori <koudai@google.com>
11 months agoflash/jtagspi: sending command and setting parameters without probing. 32/7432/5
Daniel Anselmi [Tue, 21 Mar 2023 22:23:12 +0000 (23:23 +0100)]
flash/jtagspi: sending command and setting parameters without probing.

Change-Id: I6b9d90265ca5112b9ab2aae97bb4c6cf3ebc4112
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7432
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
11 months agotarget/xtensa: add file-IO support 50/7550/5
Ian Thompson [Fri, 24 Mar 2023 00:30:53 +0000 (17:30 -0700)]
target/xtensa: add file-IO support

- Manual integration of File-IO support from xt0.2 release
- Verified with applications linked using gdbio LSP
- No new clang static analysis warnings

Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: Iedc5f885b2548097ef4f11ae1a675b5944f5fdf0
Reviewed-on: https://review.openocd.org/c/openocd/+/7550
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agojtag/adapter: Removed unused include of strings.h 87/7687/3
Jan Matyas [Mon, 15 May 2023 08:27:59 +0000 (10:27 +0200)]
jtag/adapter: Removed unused include of strings.h

Removed an unused include from src/jtag/adapter.c.

Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Change-Id: Ia5ea0acdfa1c011d7c88decd0f63e8032aafd699
Reviewed-on: https://review.openocd.org/c/openocd/+/7687
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agojtag: rewrite jim_jtag_tap_enabler() as COMMAND_HANDLER 54/7554/3
Antonio Borneo [Mon, 2 Jan 2023 16:12:04 +0000 (17:12 +0100)]
jtag: rewrite jim_jtag_tap_enabler() as COMMAND_HANDLER

The function is used for commands:
- jtag tapisenabled
- jtag tapenable
- jtag tapdisable

While there, add the missing .help and .usage fields and fix the
incorrect check in jtag_tap_enable() and jtag_tap_disable().

Change-Id: I0e1c9f0b8d9fbad19d09610a97498bec8003c27e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7554
Tested-by: jenkins
11 months agojtag: rewrite commands 'jtag newtap' and 'swd newdap' as COMMAND_HANDLER 31/7431/4
Antonio Borneo [Mon, 2 Jan 2023 00:11:44 +0000 (01:11 +0100)]
jtag: rewrite commands 'jtag newtap' and 'swd newdap' as COMMAND_HANDLER

While there:
- fix memory leak in case of error on values tap->chip,
  tap->tapname, tap->expected_ids;
- check for out of memory error;
- fix minor coding style issue;
- add the missing .usage field;
- remove functions not in use anymore.

Change-Id: I1c8c3ffeb324e9eacb919c7e0d94fd72122c9a81
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7431
Tested-by: jenkins
11 months agotarget: use unsigned int for timeout_ms 62/7562/3
Antonio Borneo [Mon, 27 Mar 2023 11:01:20 +0000 (13:01 +0200)]
target: use unsigned int for timeout_ms

Change the prototype of functions:
- target_run_algorithm()
- target_wait_algorithm()
- target_wait_state()
- struct target_type::run_algorithm()
- struct target_type::wait_algorithm()
to use unsigned int for timeout_ms instead of int.
Change accordingly the variables passed as parameter.

Change-Id: I0b8d6e691bb3c749eeb2911dc5a86c38cc0cb65d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7562
Tested-by: jenkins
11 months agotarget: rewrite command 'arp_waitstate' as COMMAND_HANDLER 61/7561/3
Antonio Borneo [Mon, 27 Mar 2023 10:03:13 +0000 (12:03 +0200)]
target: rewrite command 'arp_waitstate' as COMMAND_HANDLER

While there, add the missing .usage field and remove the now
unused function jim_target_tap_disabled().

Change-Id: I79afcc5097643fc264354c6c3957786a55f40498
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7561
Tested-by: jenkins
11 months agotarget: rewrite command 'arp_examine' as COMMAND_HANDLER 60/7560/3
Antonio Borneo [Mon, 27 Mar 2023 09:38:35 +0000 (11:38 +0200)]
target: rewrite command 'arp_examine' as COMMAND_HANDLER

Change-Id: I8f227b219ca39f198e1e39847ddd36bb9880a328
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7560
Tested-by: jenkins
11 months agotarget: espressif: apptrace: declare a local function as static 76/7676/3
Antonio Borneo [Sat, 6 May 2023 20:26:06 +0000 (22:26 +0200)]
target: espressif: apptrace: declare a local function as static

The function esp32_cmd_apptrace_generic() is not used outside the
file.

Declare it as static.
Detected through 'sparse' tool.

Change-Id: I08c6b92fb01594320bc3ae6b16067ac4eb51ca12
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7676
Tested-by: jenkins
11 months agotarget/espressif: add system level tracing feature 06/7606/6
Erhan Kurubas [Thu, 13 Apr 2023 22:07:18 +0000 (00:07 +0200)]
target/espressif: add system level tracing feature

Produces traces compatible with SEGGER SystemView tool.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: If1057309edbb91ed2cf1ebf9137c378d3deb9b88
Reviewed-on: https://review.openocd.org/c/openocd/+/7606
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agoRevert "target/image: zero-initialize ELF segments up to p_memsz" 58/7658/2
Antonio Borneo [Sat, 6 May 2023 09:44:53 +0000 (11:44 +0200)]
Revert "target/image: zero-initialize ELF segments up to p_memsz"

This reverts commit 047b1a8fc237af480e3bab66a9827a358afd7547.

Commit 047b1a8fc237 ("target/image: zero-initialize ELF segments
up to p_memsz") breaks the backward compatibility introducing some
problem:
- an empty bss segment with paddr in SRAM gets zero filled at load
  but does not survive after a reset, causing verify to fail;
- an empty bss segment with paddr in FLASH causes excessive flash
  usage, which can exceed flash size (causing error) and makes
  flash aging faster.

Revert it while looking for a better implementation.

Change-Id: Iaaf926dafce46a220a5bbe20c8576eb449996d76
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7658
Reviewed-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-by: Peter Collingbourne <pcc@google.com>
Tested-by: jenkins
11 months agoflash/nor/stm32f2x: Show error message when unprotecting OTP 15/7615/2
Matthijs Kooijman [Thu, 27 Apr 2023 16:34:44 +0000 (18:34 +0200)]
flash/nor/stm32f2x: Show error message when unprotecting OTP

Trying to disable OTP write protection by running e.g. `flash protect
1 0 1 off` would already be rejected with an error code, but that would
result in a generic "failed setting protection for blocks 0 to 1"
message. Now a more specific error message is also printed, telling the
user why it failed.

Change-Id: I6d4974eb0bcd23a0a6cf68ff955d9e59b8b1b06a
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Reviewed-on: https://review.openocd.org/c/openocd/+/7615
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
11 months agoflash/nor/stm32f2x: Fix typos in log messages 14/7614/3
Matthijs Kooijman [Thu, 27 Apr 2023 14:05:02 +0000 (16:05 +0200)]
flash/nor/stm32f2x: Fix typos in log messages

Change-Id: I0f27e1c64972a58ac146c391761008cdca610afe
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Reviewed-on: https://review.openocd.org/c/openocd/+/7614
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
11 months agotarget/riscv-013: clear sticky error when DMI operation fails 88/7688/2
Amaury Pouly [Wed, 17 May 2023 11:09:32 +0000 (12:09 +0100)]
target/riscv-013: clear sticky error when DMI operation fails

When a DMI operation does not succeed (either because of a timeout
or an error), the specification says that the error in the `op`
field is sticky and needs to cleared by writing `dmireset` in `dtmcs`.
This is already done for timeouts in increase_dmi_busy_delay
but not for errors.

Change-Id: I7c5f27a5cf145511a1a8b64a45a586521e1cbe41
Signed-off-by: Amaury Pouly <amaury.pouly@lowrisc.org>
Reviewed-on: https://review.openocd.org/c/openocd/+/7688
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
11 months agoflash/stm32l4x: support STM32C0x devices 74/6874/6
Tarek BOCHKATI [Fri, 3 Dec 2021 11:58:33 +0000 (12:58 +0100)]
flash/stm32l4x: support STM32C0x devices

this new STM32 series family introduces 2 devices:
STM32C011xx (0x443) and STM32C031xx (0x453)

both devices have 32 Kbytes single flash bank.

Change-Id: I4e890789e44e3b174c0e9c0e1068383ecdbb865f
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6874
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
11 months agojtag/drivers/bcm2835gpio: add peripheral_mem_dev config command 50/7350/5
Tomas Vanek [Sat, 13 May 2023 04:39:48 +0000 (06:39 +0200)]
jtag/drivers/bcm2835gpio: add peripheral_mem_dev config command

The bcm2835gpio driver preferred /dev/gpiomem for access to
memory mapped GPIO control and used /dev/mem as a fallback
only if it couldn't open /dev/gpiomem.

/dev/mem usually requires elevated rights or specific capabilities
of the opening process, so the fallback failed anyway.

Although /dev/gpiomem is the strongly preferred option with respect
to security, there could be also use cases which require /dev/mem
even if /dev/gpiomem is available (e.g. changing the GPIO pad
settings is necessary or testing/debugging OpenOCD).
It was difficult to handle such cases because they required
to block globally the system device /dev/gpiomem
(remove, rename or chmod).

Drop the fallback feature and select the memory device
by 'bcm2835gpio peripheral_mem_dev' configuration command.
Use /dev/gpiomem as a default.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I60e427bda795d7a13d55d61443590dd31d694832
Reviewed-on: https://review.openocd.org/c/openocd/+/7350
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
11 months agojtag/drivers/bcm2835gpio: extend peripheral_base to off_t 85/7685/2
Tomas Vanek [Fri, 12 May 2023 10:04:22 +0000 (12:04 +0200)]
jtag/drivers/bcm2835gpio: extend peripheral_base to off_t

Raspberry Pi 4 with 64-bit kernel and arm_peri_high=1 config.txt
parameter needs peripheral_base 0x47e000000, uint32_t is not enough.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: Icedd084e2916657fa4478d452a5eb1e84a45c281
Reviewed-on: https://review.openocd.org/c/openocd/+/7685
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agojtag/drivers/bcm2835gpio: don't touch pad setting on /dev/gpiomem 84/7684/2
Tomas Vanek [Tue, 15 Nov 2022 08:47:43 +0000 (09:47 +0100)]
jtag/drivers/bcm2835gpio: don't touch pad setting on /dev/gpiomem

The pads were configured at a wrong memory address
if /dev/gpiomem was mapped.

The pad setting registers are not accessible in mapped /dev/gpiomem,
disable the pads setting if the driver doesn't open /dev/mem.

While on it, do not fail the driver initialization if pad mapping fails
- just emit a warning and work with unchanged pad setting.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I0bce76cade8f7efd75efd9087a7d9ba6511a6239
Reviewed-on: https://review.openocd.org/c/openocd/+/7684
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agotcl/target: Add support for TMS570LC43xx 82/7682/5
Phil Kirkpatrick [Tue, 9 May 2023 09:04:24 +0000 (11:04 +0200)]
tcl/target: Add support for TMS570LC43xx

Added support for TMS570LC43xx series parts.  This uses the pre-existing
ti_tms570.cfg parent config.  In ti_tms570.cfg, dbgbase was changed.
Note 1: Based on the following TI E2E post, the previous dbgbase was wrong
and the new value isn't due to a difference in parts.
Link: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1106954/tms570ls3137-debugging-with-openocd
Note 2: Both the previous dbgbase and the one suggested in the TI E2E post
have the 2 LSB set. In the current version of OpenOCD, this will cause
cortex_a_read_cpu_memory_fast and cortex_a_write_cpu_memory_fast to fail
due to an alignment checks in
mem_ap_<read/write>_buf_noincr()->mem_ap_<read/write>().
In all other uses of dbgbase for arm cortex parts, the 2 LSB are masked
and ignored.

Change-Id: Ic936722e5a4cfc7161b0df1fe3325ee12fd901c6
Signed-off-by: Phil Kirkpatrick <p.kirkpatrick@reflexaerospace.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7682
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agoflash/jtagspi: handle error return values where needed 22/7422/7
Daniel Anselmi [Thu, 29 Dec 2022 19:02:39 +0000 (20:02 +0100)]
flash/jtagspi: handle error return values where needed

Change-Id: Id46c2799f954fb1d4353f652ba3115796c88936d
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7422
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
11 months agopld/virtex2: check error propagated by virtex2_read_stat() 57/7657/2
Antonio Borneo [Sat, 6 May 2023 08:34:13 +0000 (10:34 +0200)]
pld/virtex2: check error propagated by virtex2_read_stat()

Commit dd9137dc0e0c ("pld/virtex2: add missing error checks") adds
checks on the return value of several functions, allowing also
virtex2_read_stat() to propagate such returned values.
This triggers an error with clang, as it is now able to identify a
possible execution path that makes uninitialized the variable
status.

Check for the returned value of virtex2_read_stat() before using
the variable status and propagate the returned value.
While there, drop a useless empty string.

Change-Id: I7a23d3f904d4e07cdb6f6dfdf1179889b6b8afb8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7657
Reviewed-by: Daniel Anselmi <danselmi@gmx.ch>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
11 months agoHACKING: add info on usage of sparse 79/7679/2
Antonio Borneo [Sun, 7 May 2023 14:15:46 +0000 (16:15 +0200)]
HACKING: add info on usage of sparse

Add short example on how to run the static analyser 'sparse' on
OpenOCD code.

Change-Id: Ieba8ae926d0e02ca9e6ac619b13b0832136f82cb
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7679
Tested-by: jenkins
11 months agortos: uCOS-III: split struct ucos_iii_params 78/7678/2
Antonio Borneo [Sun, 7 May 2023 13:50:26 +0000 (15:50 +0200)]
rtos: uCOS-III: split struct ucos_iii_params

The static analyser 'sparse' complains about using sizeof() on a
struct that has variable size:
src/rtos/uCOS-III.c:267:32: warning: using sizeof on a flexible structure
src/rtos/uCOS-III.c:269:41: warning: using sizeof on a flexible structure
src/rtos/uCOS-III.c:275:66: warning: using sizeof on a flexible structure
The struct ucos_iii_params contains either constants values for
different target type and variable fields. The last field is an
variable size array, always allocated to UCOS_III_MAX_THREADS
items. It's not practical to fix this size because we would get
too huge initialization in data segment.

Split away from struct ucos_iii_params all the variable fields and
put them in struct ucos_iii_private. Add in the new struct a
pointer to the selected element of ucos_iii_params_list[] and fix
the size of array threads[] to its maximum value; this would be
allocated at run-time, avoiding impacts to data segment.

Change-Id: I569011a257783d35a8795adbda06e942b4157f2a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7678
Tested-by: jenkins
11 months agortos: move prototype of rtos_thread_packet() in rtos.h 77/7677/2
Antonio Borneo [Sun, 7 May 2023 12:35:51 +0000 (14:35 +0200)]
rtos: move prototype of rtos_thread_packet() in rtos.h

The function rtos_thread_packet() is used across rtos and declared
locally as extern.

Move the prototype of the function in common include rtos.h

Change-Id: I50d311b583148a2de628de0997ef1afc9103a70e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7677
Tested-by: jenkins
11 months agotarget: arm_adi_v5: move in include file the declaration of dap_ops 75/7675/2
Antonio Borneo [Sat, 6 May 2023 20:17:36 +0000 (22:17 +0200)]
target: arm_adi_v5: move in include file the declaration of dap_ops

The struct containing SWD and JTAG operations are declared as
extern in the C file.

Mode them in include file arm_adi_v5.h to silent 'sparse' error
for global variable definition without declaration in an include
file.

Change-Id: I59088512c052d5a120c38404a882ed512a68ca02
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7675
Tested-by: jenkins
11 months agoflash: nand: move in include file the declaration of 'nand_devices' 74/7674/2
Antonio Borneo [Sat, 6 May 2023 20:09:06 +0000 (22:09 +0200)]
flash: nand: move in include file the declaration of 'nand_devices'

The pointer nand_devices is used in two file.

Move the extern prototype in code.h

Detected through 'sparse' tool.

Change-Id: I7237359fd1a008770a624725cd0b3d8632b4166e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7674
Tested-by: jenkins
11 months agoserver: gdb: export gdb_actual_connections through a function 73/7673/2
Antonio Borneo [Sat, 6 May 2023 19:59:31 +0000 (21:59 +0200)]
server: gdb: export gdb_actual_connections through a function

The internal variable 'gdb_actual_connections' is used by log and
by semihosting to determine if there are active GDB connections.

Keep the variable local in server's code and only export its value
through a dedicated function.

This solves the issue detected by 'parse' of the variable defined
as global but not declared in any include file.

Change-Id: I6e14f4cb1097787404094636f8a2a291340222dd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7673
Tested-by: jenkins
11 months agojtag: move declaration outside function 72/7672/2
Antonio Borneo [Sat, 6 May 2023 19:28:51 +0000 (21:28 +0200)]
jtag: move declaration outside function

The function jtag_debug_state_machine_() is only used by a static
inline function and declared inside it as private.
The static analyser 'sparse' complains that the function is
defined as global but not cross checked against a prototype in an
include file.

Move the declaration outside the inline function so it get visible
by interface.c, which already includes interface.h
While there, change the argument type from 'unsigned' to 'unsigned
int' to pass checkpatch check.

Change-Id: Ia5dfb92dc4bc6d52ead4f0cb8c68319c83ff85b0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7672
Tested-by: jenkins
11 months agohello: include hello.h 71/7671/2
Antonio Borneo [Sat, 6 May 2023 16:49:46 +0000 (18:49 +0200)]
hello: include hello.h

Let source file to include its file .h to validate the exported
prototypes.

Detected through 'sparse' tool.

Change-Id: I6197f21c857833dafc3d6e3b750c764bf4610abd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7671
Tested-by: jenkins
11 months agohelper: types: rework h_u32_to_le() and similar for sparse 70/7670/2
Antonio Borneo [Sat, 6 May 2023 14:35:57 +0000 (16:35 +0200)]
helper: types: rework h_u32_to_le() and similar for sparse

The static analyser 'sparse' complains about values bigger that
255 that gets cast-ed and/or stored in an 8 bit variable.

Rework the functions:
- h_u32_to_le()
- h_u32_to_be()
- h_u24_to_le()
- h_u24_to_be()
- h_u16_to_le()
- h_u16_to_be()
to avoid all the related warnings, without adding any functional
change. Any modern compiler should not be impacted by this.

Change-Id: I0b84043600a41c72d0e4ddb3dd195d69e3b2896b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7670
Tested-by: jenkins
11 months agotarget: arm_dpm: with pointers, use NULL instead of 0 69/7669/2
Antonio Borneo [Sat, 6 May 2023 14:24:04 +0000 (16:24 +0200)]
target: arm_dpm: with pointers, use NULL instead of 0

Don't assign pointer to 0, use NULL.

Detected through 'sparse' tool.

Change-Id: I34551112ddab9dedf8537c8111d32356c170e7d5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7669
Tested-by: jenkins
11 months agopld: fix new warnings from sparse 68/7668/2
Antonio Borneo [Sat, 6 May 2023 14:19:55 +0000 (16:19 +0200)]
pld: fix new warnings from sparse

The new committed files add some warning from the static analyser
'sparse':
- Don't assign pointer to 0, use NULL.
- switch with no cases.

Fix them.

Change-Id: I2c02d629bd80b71c8e42553be5d9388bb9b6bcd0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7668
Tested-by: jenkins
11 months agohelper: replacements: rework including replacements.h 67/7667/2
Antonio Borneo [Sat, 6 May 2023 14:14:15 +0000 (16:14 +0200)]
helper: replacements: rework including replacements.h

The static analyser 'sparse' complains that the functions
clear_malloc() and fill_malloc() are defined global but not cross
checked against a prototype in an include file.

Rework replacements.h and replacements.c to let the former be
included by the latter.

Change-Id: I536393a9c3718dcd7e144cde8f02e169f64c88e0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7667
Tested-by: jenkins
11 months agonand: declare exported function in core.h 66/7666/2
Antonio Borneo [Sun, 30 Apr 2023 22:55:15 +0000 (00:55 +0200)]
nand: declare exported function in core.h

Don't use 'extern' in a C file, but declare the exported function
in a H file.
This helps validating the function prototype across declaration
and use.

Detected through 'sparse' tool.

Change-Id: I2c22b084fb513f4b3b1b1db96dfbc8fa4bfe7238
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7666
Tested-by: jenkins
11 months agojtag: move in interface.h the adapter_driver's declaration 65/7665/2
Antonio Borneo [Sun, 30 Apr 2023 22:40:18 +0000 (00:40 +0200)]
jtag: move in interface.h the adapter_driver's declaration

The static analyser 'sparse' complains, while compiling a jtag
driver, that the struct adapter_driver is declared in the file as
non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of adapter_driver's declaration in interface.h
Drop the preprocessor #ifdef/#endif around the declaration, as it
has no effect when the declaration is not used and/or the symbol
does not exist.

Change-Id: I5b8f5fe48a89ff0ffce38d547c551cd196379fbf
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7665
Tested-by: jenkins
11 months agopld: validate exported functions by including its own .h 64/7664/2
Antonio Borneo [Sun, 30 Apr 2023 22:29:11 +0000 (00:29 +0200)]
pld: validate exported functions by including its own .h

Let source files to include its file .h to validate the exported
prototypes.

Detected through 'sparse' tool.

Change-Id: I217c2903fdb19e1a2cce39d2536a903c3d72f3f7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7664
Tested-by: jenkins
11 months agopld: move in pld.h the pld_driver's declaration 63/7663/2
Antonio Borneo [Sun, 30 Apr 2023 22:24:37 +0000 (00:24 +0200)]
pld: move in pld.h the pld_driver's declaration

The static analyser 'sparse' complains, while compiling a pld
driver, that the struct pld_driver is declared in the file as
non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of pld_driver's declaration in pld.h

Change-Id: I0f917aecc7534c1b51af0afa9b32ccfd33db3511
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7663
Tested-by: jenkins
11 months agonor: move in driver.h the flash_driver's declaration 62/7662/2
Antonio Borneo [Sun, 30 Apr 2023 22:17:23 +0000 (00:17 +0200)]
nor: move in driver.h the flash_driver's declaration

The static analyser 'sparse' complains, while compiling a nor
driver, that the struct flash_driver is declared in the file as
non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of flash_driver's declaration in driver.h
Fix some incorrect non-const declaration and remove redundant
forward declarations.

Change-Id: I5e41d094307aac4a57dfa9a70496ff3cf180bd92
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7662
Tested-by: jenkins
11 months agonand: move in driver.h the nand_flash_controller's declaration 61/7661/2
Antonio Borneo [Sun, 30 Apr 2023 22:08:32 +0000 (00:08 +0200)]
nand: move in driver.h the nand_flash_controller's declaration

The static analyser 'sparse' complains, while compiling a nand
driver, that the struct nand_flash_controller is declared in the
file as non static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of nand_flash_controller's declaration in driver.h
While there, drop the unused/commented boundary scan controller.

Change-Id: I7dc32cef55be13ba537abe0f4c47b135d837126c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7661
Tested-by: jenkins
11 months agortos: move in rtos.h the rtos_type's declaration 60/7660/2
Antonio Borneo [Sun, 30 Apr 2023 21:54:44 +0000 (23:54 +0200)]
rtos: move in rtos.h the rtos_type's declaration

The static analyser 'sparse' complains, while compiling a rtos'
file, that the struct rtos_type is declared in the file as non
static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of rtos_type's declaration in rtos.h

Change-Id: Ia96dff077407a6653b11920519c1724e4c1167a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7660
Tested-by: jenkins
11 months agotarget: move in target_type.h the target_type's declaration 59/7659/2
Antonio Borneo [Sun, 30 Apr 2023 22:00:47 +0000 (00:00 +0200)]
target: move in target_type.h the target_type's declaration

The static analyser 'sparse' complains, while compiling a target's
file, that the struct target_type is declared in the file as non
static, but it is not exposed through an include file.
The message is:
warning: symbol 'XXX' was not declared. Should it be static?

Move the list of target_type's declaration in target_type.h
While there, fix a name clash in stm8.c

Change-Id: Ia9c681e0825cfd04d509616dbc04a0cf4944f379
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7659
Tested-by: jenkins
11 months agojtag: tcl: show error message when attempting manual "drscan" on a bypassed tap 54/7654/3
Paul Fertser [Tue, 2 May 2023 12:15:21 +0000 (15:15 +0300)]
jtag: tcl: show error message when attempting manual "drscan" on a bypassed tap

To perform any meaningful manipulations with DR the corresponding IR should
be set to a relevant instruction, not BYPASS, so warn the user accordingly.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: I42580ecd75ae824a4145f6f17f0df9bcf825b50f
Reviewed-on: https://review.openocd.org/c/openocd/+/7654
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
11 months agojtag: tcl: change drscan usage to show at least one value is required 53/7653/3
Paul Fertser [Tue, 2 May 2023 12:10:11 +0000 (15:10 +0300)]
jtag: tcl: change drscan usage to show at least one value is required

It's customary to use [] brackets to mean the argument is optional, but
drscan requires at least one pair of "num_bits value" so change it to ().
In common regular expressions * means 0 or more, and + means 1 or more,
so change that too.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Ib15d833bda2aa398ad1345a042f97d91c98dbf66
Reviewed-on: https://review.openocd.org/c/openocd/+/7653
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
11 months agotarget: rewrite command 'arp_reset' as COMMAND_HANDLER 59/7559/2
Antonio Borneo [Mon, 27 Mar 2023 09:11:46 +0000 (11:11 +0200)]
target: rewrite command 'arp_reset' as COMMAND_HANDLER

While there, add the missing .usage field and move in target.c the
enum nvp_assert.

Change-Id: Ia4f2f962887b5a35faeaa4eae128fa2865569b24
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7559
Tested-by: jenkins
11 months agotarget: rewrite command 'arp_halt' as COMMAND_HANDLER 58/7558/2
Antonio Borneo [Mon, 27 Mar 2023 08:43:30 +0000 (10:43 +0200)]
target: rewrite command 'arp_halt' as COMMAND_HANDLER

While there, add the missing .usage field.

Change-Id: I748382cafe08443c458ff1d4e47819610cfbf85c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7558
Tested-by: jenkins
11 months agotarget: rewrite command 'arp_poll' as COMMAND_HANDLER 57/7557/2
Antonio Borneo [Mon, 27 Mar 2023 08:34:14 +0000 (10:34 +0200)]
target: rewrite command 'arp_poll' as COMMAND_HANDLER

While there, add the missing .usage field.

Change-Id: I16e0aeacdaaada09fa77ad29552fa4025eff0c45
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7557
Tested-by: jenkins
11 months agojtag: rewrite command 'pathmove' as COMMAND_HANDLER 56/7556/2
Antonio Borneo [Mon, 2 Jan 2023 21:32:53 +0000 (22:32 +0100)]
jtag: rewrite command 'pathmove' as COMMAND_HANDLER

Change-Id: I1f8c6722021f392b1f065484b63a19964db69ad5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7556
Tested-by: jenkins
11 months agojtag: rewrite command 'drscan' as COMMAND_HANDLER 55/7555/2
Antonio Borneo [Mon, 2 Jan 2023 21:16:46 +0000 (22:16 +0100)]
jtag: rewrite command 'drscan' as COMMAND_HANDLER

Reorganize the code to parse the command line only once.
Add check for successful memory allocation.

Change-Id: Ibf6068e177c09e93150d11aecfcf079348c47c21
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7555
Tested-by: jenkins
11 months agoopenocd: trivial replace of jim-nvp with new nvp 53/7553/2
Antonio Borneo [Mon, 26 Dec 2022 21:46:19 +0000 (22:46 +0100)]
openocd: trivial replace of jim-nvp with new nvp

For some trivial case only, replace calls to jim-nvp with calls
to the new OpenOCD nvp.

Change-Id: Ifd9aff32b67748af8ab808e6a6b6e64f5271b888
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7553
Tested-by: jenkins

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)