]> www.infradead.org Git - users/borneoa/openocd-next.git/log
users/borneoa/openocd-next.git
6 days agoflash: stellaris: fix deprecated command master next
Antonio Borneo [Sun, 6 Apr 2025 12:59:50 +0000 (14:59 +0200)]
flash: stellaris: fix deprecated command

The driver directly runs a TCL command that has been renamed with
commit 4d99e77419e3 ("jtag/hla: Restructure commands"), while the
original name has been deprecated.

Update the TCL command to the new syntax.

Change-Id: I2fc9ef9a209bae1d78951e253d54164b2ac00cdd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 4d99e77419e3 ("jtag/hla: Restructure commands")
Reviewed-on: https://review.openocd.org/c/openocd/+/8832
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
6 days agotcl/target: Add RCPU support for Spacemit K1
Junhui Liu [Wed, 26 Mar 2025 15:05:39 +0000 (23:05 +0800)]
tcl/target: Add RCPU support for Spacemit K1

Add support for the Real-Time CPU (RCPU) of K1, which is a 32-bit RISC-V
N308 High-Efficiency Processor Core designed by Nuclei System Technology
Co. Ltd.

The JTAG interface can be configured to connect to either X60s or RCPU
processors. To enable JTAG for RCPU, set TARGET to "rcpu".

For example:
openocd -c "set TARGET rcpu" -f interface/cmsis-dap.cfg \
        -f target/spacemit-k1.cfg

Change-Id: I9cd62fac332137afac17efa52702818de8f0b6f5
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-on: https://review.openocd.org/c/openocd/+/8821
Reviewed-by: liangzhen <zhen.liang@spacemit.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 days agoflash/stm32l4x: support STM32C05/09x devices
HAOUES Ahmed [Tue, 25 Mar 2025 13:29:30 +0000 (14:29 +0100)]
flash/stm32l4x: support STM32C05/09x devices

STM32C05/09x devices are similar to STM32C03/07x devices

Change-Id: I77c803356c32f06699c14622828585609c90a136
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8618
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 days agotarget: drop unused parameter to target_create()
Antonio Borneo [Sun, 6 Apr 2025 12:10:28 +0000 (14:10 +0200)]
target: drop unused parameter to target_create()

The parameter Jim_Interp to the target API target_create() is not
used by any target.

Drop it.

Change-Id: I67c492078a6c808db974505f9e297c45165f64d0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8831
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
6 days agotarget: rewrite function target_configure() as COMMAND_HELPER
Antonio Borneo [Sun, 3 Dec 2023 14:41:27 +0000 (15:41 +0100)]
target: rewrite function target_configure() as COMMAND_HELPER

The function target_configure() is used by the commands
'target create', 'configure' and 'cget', already rewritten as
COMMAND_HANDLER.

Rewrite the common function as COMMAND_HELPER.
While there:
- fix the check on arguments, even if it should be coded better;
- keep jimtcl code for target_type::target_jim_configure() and for
  rtos_create(); these would be rewritten later on.

Change-Id: I7e5699ca6d124e34d3b2199714e3ce584bfcce80
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8829
Tested-by: jenkins
6 days agotarget: rewrite commands 'configure' and 'cget' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 22:40:56 +0000 (23:40 +0100)]
target: rewrite commands 'configure' and 'cget' as COMMAND_HANDLER

Rewrite only the command, but still use the old jimtcl specific
code shared with 'target create'.

Change-Id: Ie5e1c9eb237531121c2d143d1732cf281dfdc9ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8828
Tested-by: jenkins
6 days agotarget: rewrite command 'target create' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 22:01:44 +0000 (23:01 +0100)]
target: rewrite command 'target create' as COMMAND_HANDLER

Rewrite only the command, but still use the old jimtcl specific
code shared with 'configure' and 'cget'.

Change-Id: I7cf220e494f0ebbf123f8075b1feb9251fd7f569
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8827
Tested-by: jenkins
6 days agotarget: rewrite command 'invoke-event' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 17:40:47 +0000 (18:40 +0100)]
target: rewrite command 'invoke-event' as COMMAND_HANDLER

The command shares with command 'target create' the
struct jim_nvp nvp_target_event[]

- Convert the 'struct jim_nvp' in 'struct nvp'.
- Create an alias 'struct jim_nvp' to decouple the commands
  'invoke-event' and 'target create', abusing the fact that the
  actual layout of the two struct's type is the same. This alias
  will be dropped in a following change.
- Rewrite the command 'invoke-event' and the helper function
  target_event_name().

Change-Id: I537732fe4c08042cc02bcd0f72142254d7968fa6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8826
Tested-by: jenkins
6 days agotarget: don't free working areas during 'configure -chain-position'
Antonio Borneo [Sat, 5 Apr 2025 23:20:44 +0000 (01:20 +0200)]
target: don't free working areas during 'configure -chain-position'

Since commit ef1cfb23947b ("Duane Ellis: "target as an [tcl]
object" feature.") merged in 2008, the commands:
$target_name configure -chain-position ...
target create ... -chain-position ...
cause the allocated working area to be freed.

There is no reason for this, it is probably caused by an incorrect
copy/paste from the author.

Drop the call to target_free_all_working_areas().

Change-Id: I61a9303afe7fee6953669218330635c0b965b20d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8825
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
6 days agolist: silent scan-build false positive
Antonio Borneo [Sat, 5 Apr 2025 15:04:43 +0000 (17:04 +0200)]
list: silent scan-build false positive

With commit c023534e7b6f ("target: use list for target events")
scan build incorrectly states that list_add() would be called with
the field 'next' of the parameter 'head' (thus 'head->next') set
to NULL. Then, list_add() would call linux_list_add() with the
parameter 'next' set to NULL that will cause a NULL dereference.

While this can really happen with broken code, it's not the case
with the code from the change above.

Add assert() in linux_list_add() to silent scan build on this
false positive and to detect future incorrect use of the list.

Change-Id: Iec7f3d70237312b646ac58f76ecaab2fa25eab41
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8824
Tested-by: jenkins
6 days agocommand: rewrite command 'capture' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 16:34:57 +0000 (17:34 +0100)]
command: rewrite command 'capture' as COMMAND_HANDLER

While there, use Jim_EvalObj() to execute the subcommand, so any
error will correctly report the TCL file and the line number that
have originated the error, instead of the silly:
> capture {bogus command}
command.c:703: Error: invalid command name "bogus"
at file "command.c", line 703

Change-Id: Ic75a6146d6cedf49e808d98501fa1a7d4235b58a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8587
Tested-by: jenkins
6 days agocommand: rewrite command 'command mode' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 16:06:17 +0000 (17:06 +0100)]
command: rewrite command 'command mode' as COMMAND_HANDLER

Another step to drop jim_handler.

Change-Id: I85cb567386a5aceb36aa273f8b66cbfd4a637c3f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8586
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2 weeks agoMakefile.am: Use SOURCE_DATE_EPOCH environment variable
Sofiane HAMAM [Fri, 28 Mar 2025 11:31:17 +0000 (12:31 +0100)]
Makefile.am: Use SOURCE_DATE_EPOCH environment variable

This package defines PKGBLDDATE as build timestamp which makes
it non reproducible. Use SOURCE_DATE_EPOCH if it is found, otherwise
use build timestamp. Following best practices, see :
https://reproducible-builds.org/docs/source-date-epoch/

The patch is BSD compatible too.

Change-Id: I26c1a00f2e8059ae31fe72a794b5962af5a84f44
Co-developed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr>
Reviewed-on: https://review.openocd.org/c/openocd/+/8619
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
2 weeks agoconfigure.ac: show the rshim adapter in the config summary
R. Diez [Sat, 22 Mar 2025 22:35:23 +0000 (23:35 +0100)]
configure.ac: show the rshim adapter in the config summary

Also enable this adapter by default (auto).

Change-Id: Ic302041ecb9e88ca58b03f9675fa92fb3d558821
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8811
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 weeks agoconfigure.ac: show the Remote Bitbang driver in the config summary
R. Diez [Sun, 23 Mar 2025 21:04:20 +0000 (22:04 +0100)]
configure.ac: show the Remote Bitbang driver in the config summary

Also enable this driver by default (auto).

Change-Id: I112d6c8c0796d0dc464651feb1f7f81fa8b93910
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8817
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 weeks agotarget: remove events that are set to empty string
Antonio Borneo [Sun, 23 Mar 2025 14:27:37 +0000 (15:27 +0100)]
target: remove events that are set to empty string

Current code allows replacing the body of an existing event, but
it doesn't provides a way to remove it.
Replacing the event with an empty string makes the event still
present and visible through
$target_name eventlist

The presence of empty events makes more complex checking for the
event not set or set to empty.

Remove the event when set to empty string.

While there, add 'Jim_Length' to the list of allowed CamelCase
symbols, avoiding the associated checkpatch error.

Change-Id: I1ec2e1a71d298a0eba0b6863902645bcc6c4cb09
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8814
Tested-by: jenkins
2 weeks agotarget: use list for target events
Antonio Borneo [Sun, 23 Mar 2025 11:09:28 +0000 (12:09 +0100)]
target: use list for target events

To simplify removing an event when it's set to an empty string,
switch event list from hardcoded simply linked list to helper's
double linked list.

While there, move the declaration of struct target_event_action
in 'target.c' as it is not anymore visible outside.

Change-Id: I799754c80055dc6d22db55aca483757e833714ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8813
Tested-by: jenkins
2 weeks agotarget: fix memory leak in handle_target_write_memory()
Antonio Borneo [Sat, 29 Mar 2025 21:51:59 +0000 (22:51 +0100)]
target: fix memory leak in handle_target_write_memory()

Commit f55ec6d44922 ("target: rewrite command 'write_memory' as
COMMAND_HANDLER") adds a new return statement without freeing the
allocated buffer.

Add the needed free().

Fixes: f55ec6d44922 ("target: rewrite command 'write_memory' as COMMAND_HANDLER")
Change-Id: I676d658118b32f4d7cc71eda3436bb52f1966cd8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8822
Tested-by: jenkins
3 weeks agotcl/target/nordic/nrf54l: minor corrections
Tomas Vanek [Tue, 11 Feb 2025 16:59:00 +0000 (17:59 +0100)]
tcl/target/nordic/nrf54l: minor corrections

Add SWD multidrop setting.
Fix the name of AP #1 to AUX-AP
Set AUX-AP CSW Prot bit[0] to make RISC-V debug accessible on AUX-AP.

Change-Id: I496e07acfe90dd858e4403176a8330d8c1a0b560
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8752
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
3 weeks agotarget: rewrite command 'get_reg' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 14:04:09 +0000 (15:04 +0100)]
target: rewrite command 'get_reg' as COMMAND_HANDLER

Print one register per line. Repeated registers will be printed
each time.
While there, fix the 'usage' string.

Change-Id: I4eb21696705bdf15cd2cb7a4a9caa41f9ffdbf64
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8583
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
3 weeks agotarget/aarch64: Cleanup on exit
Adrien Grassein [Thu, 18 Jan 2024 10:54:15 +0000 (11:54 +0100)]
target/aarch64: Cleanup on exit

Restore target configuration on exit so that OpenOCD get correct values
when restarting.

Change-Id: I8cbba1fdae1d3c4a580197b7a97691443780ed06
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8654
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 weeks agotcl/target: Add Renesas R-Car Gen4 R8A779G0 V4H and R8A779H0 V4M targets
Marek Vasut [Thu, 22 Aug 2024 23:29:12 +0000 (01:29 +0200)]
tcl/target: Add Renesas R-Car Gen4 R8A779G0 V4H and R8A779H0 V4M targets

Add support for Renesas R-Car Gen4 R8A779G0 V4H and R8A779H0 V4M SoCs.
Those contain 4x CA76 and 3x CR52 cores.

Change-Id: I4a701f0fec4dd574fc099a221d464ccc55db6252
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8807
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
3 weeks agotarget: drop last instances of 'target->cmd_name'
Antonio Borneo [Sun, 16 Mar 2025 10:50:04 +0000 (11:50 +0100)]
target: drop last instances of 'target->cmd_name'

The helper function 'target_name()' or, better, the log functions
'LOG_TARGET_xxx(target, ...)' should be used in place of taking
the target name directly from 'target->cmd_name'.

Replace the remaining instances in the code.

While there:
- address some indentation,
- drop trailing punctuation in log message,
- replace one LOG WARNING with LOG_TARGET_WARNING.

Change-Id: Ie6cf4c174ffe91b975c983e4697c735766267041
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8806
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
3 weeks agotarget/armv8: Handle instruction cache invalidate
Adrien Grassein [Thu, 18 Jan 2024 10:58:38 +0000 (11:58 +0100)]
target/armv8: Handle instruction cache invalidate

Some armv8 target have separate i-cache and d-cache.
The actual code only handles the flush of the d-cache.

Change-Id: I61a223b43c71646bbbed8fa63825360c67700988
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8655
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
3 weeks agoflash/stm32l4x: support STM32U5F/U5Gx devices
HAOUES Ahmed [Wed, 12 Mar 2025 13:37:46 +0000 (14:37 +0100)]
flash/stm32l4x: support STM32U5F/U5Gx devices

STM32U5F/U5Gx devices are similar to STM32U59/U5Ax devices
while at there update STM32U5xx revisions

Change-Id: I4f1c302cc91739a89cf4869401e9f5015dbc72b9
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8616
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
3 weeks agocommand: factorize jim_command_mode()
Antonio Borneo [Sat, 2 Dec 2023 15:50:14 +0000 (16:50 +0100)]
command: factorize jim_command_mode()

During 'help' dump, to determine the mode (e.g. COMMAND_CONFIG) of
a command, the current code executes the OpenOCD TCL command
"command mode", while it could directly call the implementation of
the TCL command above.

Factorize jim_command_mode() and call the inner implementation
instead of executing "command mode".

Change-Id: Id8c33d0ed1373b5744dcc3ac354c3e0a88576f75
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8585
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Tested-by: jenkins
3 weeks agotarget: rewrite command 'write_memory' as COMMAND_HANDLER
Antonio Borneo [Sat, 2 Dec 2023 13:21:42 +0000 (14:21 +0100)]
target: rewrite command 'write_memory' as COMMAND_HANDLER

While there:
- drop the command name from the error messages;
- check the returned value from Jim_GetWide() to detect incorrect
  numeric values.

Change-Id: I399402ac11b6d459f1771e59e44210aef3e2a637
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8582
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
3 weeks agotarget: read_memory: drop command name from error messages
Antonio Borneo [Sat, 23 Nov 2024 17:35:51 +0000 (18:35 +0100)]
target: read_memory: drop command name from error messages

The error message should not report the command name as it
should be already clear from the context.

Change-Id: I219e31be808bf6ff1924ce60f3025fb48ed7b125
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8803
Tested-by: jenkins
3 weeks agohelper: command: return correct error on command 'echo'
Antonio Borneo [Sat, 23 Nov 2024 17:15:40 +0000 (18:15 +0100)]
helper: command: return correct error on command 'echo'

In case of incorrect syntax, return ERROR_COMMAND_SYNTAX_ERROR so
the command framework will print the usage string.

Change-Id: I348debc77f470551d54fa77b4da780a48ff539c0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8802
Tested-by: jenkins
5 weeks agotarget/armv8: regularly send keep_alive packet.
Adrien Grassein [Thu, 18 Jan 2024 14:12:12 +0000 (15:12 +0100)]
target/armv8: regularly send keep_alive packet.

Flushing all d-cache may be a long operation.
We need to send keep_alive regularly to keep the connection alive.
If not done a warning is emitted.

Change-Id: I52c3ee9a9f9b8a1dc0b8d5439e8b71212f56165a
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8659
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 weeks agotcl/ngultra: Use newly created armv8r target
Adrien Grassein [Thu, 18 Jan 2024 11:04:02 +0000 (12:04 +0100)]
tcl/ngultra: Use newly created armv8r target

ngultra cores are cortex-r52, so use armv8r target now its created.

Change-Id: If2d22593ab1e200ac15e7b883c70937acf1d2a59
Signed-off-by: Adrien Grassein <agrassein@nanoxplore.com>
Signed-off-by: Adrien Charruel <acharruel@nanoxplore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8658
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 weeks agoadapter: simplify command 'adapter list'
Antonio Borneo [Sat, 30 Nov 2024 23:01:00 +0000 (00:01 +0100)]
adapter: simplify command 'adapter list'

The code of command 'adapter list' is called by command 'adapter
driver' to list the available drivers in case of error.
This dual possible entry points require a conditional check on the
number of command line arguments, reducing the code readability.

Split the command in a simpler code for the command 'adapter list'
that only checks the command line, and move in a common helper the
code that list the drivers.

While there, fix the output and the comments to report 'adapter
driver' instead of 'debug adapters'; we are not parsing the HW to
know which adapter is present.

Change-Id: I17538e86dc4a31a9589d404e49dcc65a29393390
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8672
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
5 weeks agoadapter: drop command 'adapter transports'
Antonio Borneo [Sun, 22 Dec 2024 16:13:59 +0000 (17:13 +0100)]
adapter: drop command 'adapter transports'

The commit 93f2afa45f4c ("initial "transport" framework") that
added the transport framework in 2010 was overly optimistic on the
possibility to dynamically add, at runtime, a new adapter and to
specify with the command 'adapter transports' the list of the
transports supported by the new adapter.

Such feature has never become part of OpenOCD, and the command
above has never become useful nor ever been used.

Drop the command 'adapter transports' and its documentation.
Drop the helper 'transport_list_parse', now unused.

Change-Id: Ie3d71c74d068fba802839b116bb9bc9af77cc83d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8671
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
5 weeks agodoc: drop mention of not implemented SPI transport
Antonio Borneo [Mon, 23 Dec 2024 19:59:28 +0000 (20:59 +0100)]
doc: drop mention of not implemented SPI transport

The commit 93f2afa45f4c ("initial "transport" framework") adds a
dedicated chapter in the documentation about a possible SPI
transport for flashing.
This transport has never been part of OpenOCD and should not be
listed in the documentation.

Drop the chapter.

Change-Id: I9b406754399abda4dc7c2f8cf09dd47730a7e1d9
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8670
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
5 weeks agohelper/log: mark `fmt` argument of `alloc_vprintf()` as format string
Evgeniy Naydanov [Fri, 14 Feb 2025 16:20:58 +0000 (19:20 +0300)]
helper/log: mark `fmt` argument of `alloc_vprintf()` as format string

Building on Ubuntu 22.04 with `-fsanitize=undefined` (GCC 12.3.0)
results in an error:
Checkpatch-ignore: COMMIT_LOG_LONG_LINE
```
In file included from /usr/include/stdio.h:894,
                 from <openocd>/src/helper/system.h:23,
                 from <openocd>/src/helper/replacements.h:18,
                 from <openocd>/src/helper/log.c:20:
In function ‘vsnprintf’,
    inlined from ‘alloc_vprintf’ at <openocd>/src/helper/log.c:347:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:85:10: error: null format string [-Werror=format-truncation=]
   85 |   return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   86 |                                     __glibc_objsize (__s), __fmt, __ap);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

The error mentiones the call site `src/helper/log.c:347`. There
`vsnprintf()` is called passing `fmt` as format string.

To mitigate this, mark the format string with the corresponding
attribute in `alloc_vprintf()`

Change-Id: I91011490715998ef5a931c19c3c9d74a1a304e5d
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8764
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
5 weeks agobcm2835gpio.c: change adapter init order
R. Diez [Sun, 3 Nov 2024 11:24:20 +0000 (12:24 +0100)]
bcm2835gpio.c: change adapter init order

Make also sure that the struct bitbang_interface with callbacks
that we pass to the bitbang driver is const.

Change-Id: I954014f062d6d9185db45f5fbd2ad0b0955aab82
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8536
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agoconfigure.ac: show the JTAG DPI and VPI adapters in the config summary
R. Diez [Sun, 16 Feb 2025 18:59:27 +0000 (19:59 +0100)]
configure.ac: show the JTAG DPI and VPI adapters in the config summary

Also enable these adapters by default (auto).

Change-Id: Icbbcd470eaf1d1bfb33900885776c1dbd0cccb5f
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8758
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agortos/linux: fix name overwrite in `linux_thread_extra_info()`
Evgeniy Naydanov [Fri, 14 Feb 2025 16:31:38 +0000 (19:31 +0300)]
rtos/linux: fix name overwrite in `linux_thread_extra_info()`

commit 908ee4dc9641bd3df2eb00264575501867da539d ("build: remove clang
unused variable assignment warnings") introduced an error:
```
-            tmp_str_ptr += sprintf(tmp_str_ptr, "%s", name);
+            sprintf(tmp_str_ptr, "%s", name);
             sprintf(tmp_str_ptr, "%s", temp->name);
```
This results in `name` being overwritten by `temp->name`.
Fix this, adding OOM handling along the way.

Change-Id: Id41f73247c3f7e6194d7c92187ad3163a9ea6c89
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8761
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agotarget/arm_adiv5: print DAP name if not found
Marc Schink [Wed, 4 Dec 2024 07:26:04 +0000 (08:26 +0100)]
target/arm_adiv5: print DAP name if not found

If a DAP is not found, include its name in the error message.

Change-Id: Icffc52894a1c5573f938b1f3e3b53441167f085e
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8636
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agotcl/board: Add TI AM261 launchpad config
Shivasharan Nagalikar [Fri, 21 Feb 2025 11:03:37 +0000 (16:33 +0530)]
tcl/board: Add TI AM261 launchpad config

Add basic connection details with AM261 Launchpad.

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

Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Change-Id: Ibf1270a8e470cc6ab5846dc3da64e451a8a769fd
Reviewed-on: https://review.openocd.org/c/openocd/+/8793
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Nishanth Menon <nm@ti.com>
5 weeks agotcl/target/ti_k3: Add support for AM261
Shivasharan Nagalikar [Wed, 19 Feb 2025 08:28:43 +0000 (13:58 +0530)]
tcl/target/ti_k3: Add support for AM261

AM261[1] is a optimized cutdown of AM263P SoC. The key difference is
the reduced number of R5F cores which is now dropped down to 2, and
the DIE ID is different from AM263p, but all other definitions are
compatible, so reuse the definition.

[1] https://www.ti.com/product/AM2612

Change-Id: Ib6ca0b59d0b8991df6e4ab349d371187438cb393
Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8792
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
5 weeks agotcl/board: Add TI AM263P launchpad config
Shivasharan Nagalikar [Fri, 21 Feb 2025 11:01:03 +0000 (16:31 +0530)]
tcl/board: Add TI AM263P launchpad config

Add basic connection details with AM263P Launchpad

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

Change-Id: I7232a0b9337583eab499bc72929bd059624b4ff1
Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8771
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
5 weeks agotcl/target/ti_k3: Add support for AM263P
Shivasharan Nagalikar [Wed, 19 Feb 2025 08:27:35 +0000 (13:57 +0530)]
tcl/target/ti_k3: Add support for AM263P

AM263P[1] adds additional features to AM263 SoC. [2] provides a
detailed list of differences, however, the key difference from
processor usage perspective is the increased SRAM and Remote L2(RL2)
Cache for improved performance of R5F. To differentiate the DIE ID
is different, however rest of the processor description remain
compatible to AM263, hence reuse the definition.

[1] https://www.ti.com/product/AM263P4
[2] https://www.ti.com/lit/pdf/spradb3

Change-Id: If47935caf1f995d7e606547e0d6545c39544678a
Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8770
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agotcl/target/ti_k3: Add support for system reset using powerAP
Shivasharan Nagalikar [Wed, 19 Feb 2025 08:23:03 +0000 (13:53 +0530)]
tcl/target/ti_k3: Add support for system reset using powerAP

TI K3 Debug systems have a Power Access Port (Power-AP) which allows
for functionality such as reset via debugger that using the SPREC
register. SoCs/Boards that do not have support for SRST or TRST can
make use of this to force a system reset via debug access.

Change-Id: Ic5f9cc7f7fba77b353b0c0b42d8afc02502251a0
Signed-off-by: Shivasharan Nagalikar <shivasharan.nagalikar@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8769
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agotcl/board: Add TI am62levm config
Nishanth Menon [Mon, 3 Mar 2025 12:57:23 +0000 (06:57 -0600)]
tcl/board: Add TI am62levm config

Add basic connection details with AM62l SK/EVM

For further details, see: https://www.ti.com/tool/TMDS62LEVM

Change-Id: Ic957a904dfe01951396f9767479884f2a121b181
Co-developed-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8799
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
5 weeks agotcl/target/ti_k3: Add AM62L SoC
Nishanth Menon [Mon, 3 Mar 2025 12:47:28 +0000 (06:47 -0600)]
tcl/target/ti_k3: Add AM62L SoC

Add support for the TI K3 family AM62L SoC.

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

Change-Id: I31e4e89507a1cd70a8c8c3242dd0a9dd7d0f2a06
Co-developed-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8798
Tested-by: jenkins
Reviewed-by: Bryan Brattlof <bryanbrattlof@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agotarget/armv8: fix 128-bit register writes
Daniel Goehring [Thu, 6 Mar 2025 15:55:20 +0000 (10:55 -0500)]
target/armv8: fix 128-bit register writes

Assert checking was recently added to the "buf_get_u64()"
procedure for the buffer size argument.

For 128-bit register writes, instead of calling "buf_get_u64()" with
a 128-bit argument which fails the assert check, use two 64-bit calls.

Change-Id: I32ddbdb7bbe68c43f3b0a27738537391a227b08c
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8801
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agotarget/target: fix RTOS thread awareness support
Daniel Goehring [Wed, 5 Mar 2025 22:48:01 +0000 (17:48 -0500)]
target/target: fix RTOS thread awareness support

This prior patch replaces "LOG_xxx()" with "LOG_TARGET_xxx()"
to indicate which target the message belongs to.

commit 7f2db80ebc16 ("rtos/hwthread: Use LOG_TARGET_xxx()")

To support this change for hardware thread awareness,
the target command name needs to be established before
calling the "target_configure()" routine.

Change-Id: I0dc70c23b84e983a2ee694fb5b9d01758f5c84a3
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8800
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agotcl/board: Add MSPM0 Launchpad support
Nishanth Menon [Thu, 28 Sep 2023 08:37:03 +0000 (03:37 -0500)]
tcl/board: Add MSPM0 Launchpad support

Add basic connection details for TI's MSPM0 Launchpad series of
evaluation kits:
https://www.ti.com/tool/LP-MSPM0L1306
https://www.ti.com/tool/LP-MSPM0C1104
https://www.ti.com/tool/LP-MSPM0G3507

Change-Id: I33499f2d5fef846185ff6c330f9bfd0251117eb6
Co-developed-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8386
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
6 weeks agotcl/target: Add support for TI MSPM0
Nishanth Menon [Thu, 28 Sep 2023 08:37:03 +0000 (03:37 -0500)]
tcl/target: Add support for TI MSPM0

Add basic support for Texas Instruments MSPM0L, C and G family of
Cortex-M0 based micro-controllers.

Change-Id: If2b5b1eca001f74d501ede67ec621c7497548a85
Co-developed-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8385
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: zapb <dev@zapb.de>
6 weeks agoflash/nor: Add basic support for TI's MSPM0L/G family
Nishanth Menon [Thu, 28 Sep 2023 08:37:03 +0000 (03:37 -0500)]
flash/nor: Add basic support for TI's MSPM0L/G family

Add basic flashing support for Texas Instruments MSPM0L, C and G
family of Cortex-M0 based micro-controllers.

This initial basic flashing support allows for controlling protection,
erase, write and read of non-main flash region.

This has been tested with:
* Valgrind (3.22.0):
  valgrind --leak-check=full --show-leak-kinds=all \
--track-origins=yes --verbose
* Ubuntu clang version 20.0.0
 (++20241014053649+ed77df56f272-1~exp1~20241014053827.1987)

Valgrind-clean, no new Clang analyzer or sparse warnings have been
introduced.

Change-Id: I29b8055ea6da9c38c5b7b91bea1ec7581c5bc8ff
Co-developed-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Henry Nguyen <h-nguyen8@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8384
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agortos/linux: handle OOM in `linux_gdb_thread_packet()`
Evgeniy Naydanov [Fri, 14 Feb 2025 16:30:55 +0000 (19:30 +0300)]
rtos/linux: handle OOM in `linux_gdb_thread_packet()`

Return an error in case `calloc()` fails.

Change-Id: Id1b758a1edbae3d71d625d1992579b99720d77d6
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8762
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
6 weeks agortos/rtos: handle OOM in `rtos_thread_packet()`
Evgeniy Naydanov [Fri, 14 Feb 2025 16:29:08 +0000 (19:29 +0300)]
rtos/rtos: handle OOM in `rtos_thread_packet()`

Return an error in case `calloc()` fails.

Change-Id: Ibb21a62991be83be8b219887953ccf27156f8af5
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8763
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
6 weeks agortt: Raise error if control block was not found
Marc Schink [Thu, 13 Feb 2025 22:37:40 +0000 (22:37 +0000)]
rtt: Raise error if control block was not found

Since RTT is not started if the control block was not found, an error
must be raised instead of just informing the user.

Change-Id: I2873e72f142ca572da97ee1fe91f6f1301307555
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8757
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
6 weeks agotarget: fix wrap-around detection for read_memory/write_memory
Parshintsev Anatoly [Fri, 8 Nov 2024 04:12:46 +0000 (07:12 +0300)]
target: fix wrap-around detection for read_memory/write_memory

while at it change the order of checks for requested region sizes to
get rid of potential overflow during multiplication.

Change-Id: I97dac68e7024591cfd7abb70c8c62dff791298fe
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8572
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agoconfigure: better differentiate CMSIS-DAP versions
Tomas Vanek [Tue, 18 Feb 2025 07:13:07 +0000 (08:13 +0100)]
configure: better differentiate CMSIS-DAP versions

and keep them together in the configuration summary.

Change-Id: I5937393590ac72f1d499457e67763686a79cadee
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8765
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agodrivers/cmsis_dap: fix misleading error selecting not compiled backend
Tomas Vanek [Mon, 17 Feb 2025 11:15:09 +0000 (12:15 +0100)]
drivers/cmsis_dap: fix misleading error selecting not compiled backend

If one of CMSIS-DAP backends was not compiled (due to
missing library or configure --disable-cmsis-dap) and
Tcl config explicitly selected it, a misleading message
"invalid backend argument to cmsis-dap backend <backend>"
was printed.

Create dummy backends in struct cmsis_dap_backend
to replace a not built backend.

Check for NULL open backend method to distinguish
the backend is dummy.

Rework 'cmsis-dap backend' command to honour dummy
backend. While on it print more helpful error messages.

Change-Id: I8f12aeaaecf19302032870bc232e5135c1d935e7
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8760
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agogdb_server: fix invalid free
Jim Paris [Fri, 21 Feb 2025 17:33:45 +0000 (12:33 -0500)]
gdb_server: fix invalid free

`gdb_service_free` calls `free(gdb_port_next)`, so this needs to be an
allocated string.  Otherwise we trip up detectors like Android's tagged
pointers.

Change-Id: Ib08ea55a38af4e15c4fbae95f10db0e3684ae1af
Signed-off-by: Jim Paris <jimparis@meta.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8768
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
7 weeks agotcl/target: add Bouffalo Lab BL602 and BL702L chip series support
Marek Kraus [Sat, 23 Nov 2024 14:54:26 +0000 (15:54 +0100)]
tcl/target: add Bouffalo Lab BL602 and BL702L chip series support

BL602, BL702 and BL702L series of chips are sharing same architecture,
so they all need same software reset mechanism as well.
Only difference (in terms of configuration needed for JTAG) are TAP ID,
workarea address and size. This is addressed by creating bl602_common.cfg
tcl file, which contains all those common stuff between the chips.
The script is prefixed by bl602, as this was
first *publicly* available chip from Bouffalo with this architecture.

This patch also improves reset mechanism. Previous reset mechanism did not
worked properly when slower JTAG adapter was used (it attached too late).
New reset mechanism uses various methods to keep CPU in BootROM, until
the JTAG adapter does not attach again after reset. Additionally,
we trigger SW Reset by directly using DMI commands to write to register
with system bus method, to avoid getting error about unsuccessful write.
The new method works on both FT232H (8MHz JTAG clock) and
unnamed CMSIS-DAP dongle (1.5MHz JTAG clock).

Change-Id: I5be3694927793fd3f64c9ed4ee6ded2db0d25cae
Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8593
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
7 weeks agotarget: algorithm: change reg_name to const in init_reg_param()
Antonio Borneo [Wed, 26 Feb 2025 22:25:03 +0000 (23:25 +0100)]
target: algorithm: change reg_name to const in init_reg_param()

The function init_reg_param() initializes a struct where the
pointer reg_name is assigned to a 'const char *'.

Change the prototype of init_reg_param() to make also the reg_name
parameter as 'const char *'.

Change-Id: Ib999eaa5786ad24aa2a361070162c6f362784758
Reported-by: Marek Kraus <gamelaster@outlook.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8797
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Marek Kraus <gamelaster@outlook.com>
2 months agortos: Use lower case filenames
Marc Schink [Wed, 12 Jun 2024 11:34:48 +0000 (13:34 +0200)]
rtos: Use lower case filenames

Change-Id: I309c7a649e33f516e28037fef2dc6e574d48c000
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8334
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agojep106: update to revision JEP106BL Feb 2025
Antonio Borneo [Wed, 19 Feb 2025 21:30:45 +0000 (22:30 +0100)]
jep106: update to revision JEP106BL Feb 2025

Update to latest available document.

Change-Id: Ic7f31bf74c25aaebc5a2ecc7d5a0e516321bf862
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8766
Tested-by: jenkins
2 months agotarget: Use 'bool' data type in target_{step,resume}
Marc Schink [Thu, 10 Oct 2024 15:07:20 +0000 (17:07 +0200)]
target: Use 'bool' data type in target_{step,resume}

While at it, adapt data types of related functions and fix some coding
style issues.

Change-Id: I74db9258fc17b1ee8aa446f35ae722ea7c2f67e6
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8524
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 months agodrivers/linuxspidev: fix compilation on Linux older than 3.15
Tomas Vanek [Sat, 15 Feb 2025 07:11:02 +0000 (08:11 +0100)]
drivers/linuxspidev: fix compilation on Linux older than 3.15

Although the commit [1] which introduced SPI_IOC_WR_MODE32 is 10 years
old, some hardware may enforce old Linux because the vendor
didn't bother with system updates.

Change-Id: I76d0b38c8646b1be329418860916b9f01b90990d
Link: [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/uapi/linux/spi/spidev.h?h=linux-3.15.y&id=dc64d39b54c1e9db97a6fb1ca52598c981728157
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8759
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agoflash/nor/rsl10: drop unused `rsl10_info` in `rsl10_protect_check()`
Evgeniy Naydanov [Wed, 12 Feb 2025 18:12:30 +0000 (21:12 +0300)]
flash/nor/rsl10: drop unused `rsl10_info` in `rsl10_protect_check()`

`struct rsl10_info *chip` is only used in `rsl10_protect_check()` in an
assertion triggerring `-Wunused-variable` when compiled with `DNDEBUG`.
Drop it.

Change-Id: Ib302aea742131479f04f32e8fe8a88a3230ae203
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8755
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2 months agotarget/adi_v5_swd: drop unused `swd_driver` in `swd_queue_dp_write()`
Evgeniy Naydanov [Wed, 12 Feb 2025 17:54:00 +0000 (20:54 +0300)]
target/adi_v5_swd: drop unused `swd_driver` in `swd_queue_dp_write()`

`struct swd_driver swd` is only used in `swd_queue_dp_write()` in an
assertion triggerring `-Wunused-variable` when compiled with `DNDEBUG`.
Drop it.

Change-Id: Id3283b9e2c36a74cda9fc4afc16da02ac4d62b69
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8754
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2 months agobuild: drop space after 'angie' folder name
Antonio Borneo [Thu, 6 Feb 2025 10:48:30 +0000 (11:48 +0100)]
build: drop space after 'angie' folder name

The makefile consider the two white spaces between the end of the
folder name and the '#' character for the beginning of the comment
as part of the folder name.
This cause 'make install' to create a folder named  'angie  ' that
is not welcome on all the OS.

Drop the comment and the space after the folder name.

Reported-by: Liviu Ionescu <ilg@livius.net>
Change-Id: Iadd6803431edb83d0d84f4e4dc6d36b454f912ac
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 0ed03df6e95b ("amend angie build definitions to fix make dist")
Reviewed-on: https://review.openocd.org/c/openocd/+/8740
Reviewed-by: Liviu Ionescu
Tested-by: jenkins
Reviewed-by: Adrien Charruel <acharruel@nanoxplore.com>
2 months agojtag/core: fix segfault when adapter driver has no reset method
Tomas Vanek [Mon, 3 Feb 2025 20:45:07 +0000 (21:45 +0100)]
jtag/core: fix segfault when adapter driver has no reset method

xlnx-pcie-xvc and linuxspidev adapter drivers does not implement
the reset method.
Although it is likely both adapters will implement the method in
the near future, avoid segfault and return an error instead.

Change-Id: If8ddf165dbc563cf6d64b2094968151075778ba7
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: commit 8850eb8f2c51 ("swd: get rid of jtag queue to assert/deassert srst")
Reviewed-on: https://review.openocd.org/c/openocd/+/8735
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 months agotarget/cortex_m: call adapter_deassert_reset() only if srst is configured
Tomas Vanek [Tue, 28 Jan 2025 19:43:33 +0000 (20:43 +0100)]
target/cortex_m: call adapter_deassert_reset() only if srst is configured

Deasserting is useless if reset was not asserted except the very corner
case: changed reset_config during reset processing.

Change-Id: I1d1ea142980d67293daa348a2869b68ffd78d0eb
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8734
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 months agoMakefile.am: DISTCHECK_CONFIGURE_FLAGS -> AM_DISTCHECK_CONFIGURE_FLAGS
R. Diez [Sat, 25 Jan 2025 22:04:50 +0000 (23:04 +0100)]
Makefile.am: DISTCHECK_CONFIGURE_FLAGS -> AM_DISTCHECK_CONFIGURE_FLAGS

The Automake manual states: "The user can still extend or override
the flags provided there by defining the DISTCHECK_CONFIGURE_FLAGS
variable". Overriding variable DISTCHECK_CONFIGURE_FLAGS in Makefile.am
makes it impossible for the user to do that. I discovered this
when trying to pass --enable-internal-jimtcl to distcheck.

Change-Id: Ibe5b1f23ccf3fbaa21c48b574a1b3f3e9f6fb916
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8724
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 months agoconfigure.ac: show vdebug in the config summary
R. Diez [Sat, 25 Jan 2025 20:04:05 +0000 (21:04 +0100)]
configure.ac: show vdebug in the config summary

Also enable this adapter by default (auto).

Change-Id: Id011168b93c4cdc602ab78eabfb9a64ca8d8a7df
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8601
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2 months agooptions.c: option --help should yield exit code 0
R. Diez [Sat, 25 Jan 2025 21:06:22 +0000 (22:06 +0100)]
options.c: option --help should yield exit code 0

--help is supported and there is no reason to signal failure

Change-Id: I59fda5336df47ec0b8172541a5fbfe60014bba7e
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8723
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agoREADME: report dependency from libjim
Antonio Borneo [Sat, 25 Jan 2025 16:26:16 +0000 (17:26 +0100)]
README: report dependency from libjim

The support for jimtcl submodule is deprecated.
Report libjim as a dependency for building OpenOCD.

Change-Id: Iaaeb03dc810451c0d72add281016c81b8cbf7059
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8722
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agotarget/arc: allow reading memory while target runs
Daniel DeGrasse [Fri, 17 Jan 2025 03:33:48 +0000 (22:33 -0500)]
target/arc: allow reading memory while target runs

There is no reason that ARC can't support reading from memory over JTAG
while the target is executing, and this is in fact required for RTT
support. Remove this check from arc_mem_read and arc_mem_write

Change-Id: I2accfb4b99bf77c5473d133623e0eb0632cb45f6
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8721
Tested-by: jenkins
Reviewed-by: Evgeniy Didin <didin@synopsys.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agotarget/arc: add RTT commands
Chris Friedt [Mon, 9 Dec 2024 21:11:03 +0000 (16:11 -0500)]
target/arc: add RTT commands

Since RTT is architecture agnostic, add support for using it on
the ARC architecture as well.

Change-Id: Icd0dec105177a1a224bfb1a63f0be5f03561b166
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8720
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agocheckpatch: enable check for new typedefs
Antonio Borneo [Fri, 10 Jan 2025 16:11:24 +0000 (17:11 +0100)]
checkpatch: enable check for new typedefs

We should strictly check for every new typedef.
Let checkpatch detect them and let developer use
Checkpatch-ignore: NEW_TYPEDEFS
if it's really needed to add a new typedef.
With this change chackpatch will not complain for typedef on
function's type but only on enum, struct, variable's type.

Change-Id: I644a753e97de877d892af3a0219716f022fb1c59
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8710
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agojtag: drop useless typedef tap_state_t
Antonio Borneo [Fri, 10 Jan 2025 16:05:29 +0000 (17:05 +0100)]
jtag: drop useless typedef tap_state_t

No need to use a typedef for an enum.
Drop it.

Change-Id: I9eb2dc4f926671c5bb44e61453d92880e3036848
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8709
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agojtag: openjtag: drop useless typedef openjtag_tap_state_t
Antonio Borneo [Fri, 10 Jan 2025 14:26:50 +0000 (15:26 +0100)]
jtag: openjtag: drop useless typedef openjtag_tap_state_t

No need to use a typedef for an enum.
Drop it.

Change-Id: I31531b80eaf7f3d0ee6cd22844e60a05c6b748dc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8708
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agojtag: bitbang: drop useless typedef bb_value_t
Antonio Borneo [Fri, 10 Jan 2025 14:25:15 +0000 (15:25 +0100)]
jtag: bitbang: drop useless typedef bb_value_t

No need to use a typedef for an enum.
Drop it.

Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8707
Tested-by: jenkins
2 months agojtag: remote_bitbang: drop useless typedef flush_bool_t
Antonio Borneo [Fri, 10 Jan 2025 14:22:17 +0000 (15:22 +0100)]
jtag: remote_bitbang: drop useless typedef flush_bool_t

No need to use a typedef for an enum.
Drop it.

Change-Id: I122784ddd7b81ccd86da258b08526685c3d70033
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8706
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agotarget_request: drop useless typedef target_req_cmd_t
Antonio Borneo [Fri, 10 Jan 2025 14:20:35 +0000 (15:20 +0100)]
target_request: drop useless typedef target_req_cmd_t

No need to use a typedef for an enum.
Drop it.

Change-Id: Ib5a872b52a6f3d7379d2662e4ff84f32c2bd2ef8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8705
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agotarget: trace: drop useless typedef trace_status_t
Antonio Borneo [Fri, 10 Jan 2025 14:17:08 +0000 (15:17 +0100)]
target: trace: drop useless typedef trace_status_t

No need to use a typedef for an enum.
Drop it.

Change-Id: I31e0e3869c7277bcb14e05cfcac82c9655963ae6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8704
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agotarget: etm: drop useless typedefs
Antonio Borneo [Fri, 10 Jan 2025 14:12:38 +0000 (15:12 +0100)]
target: etm: drop useless typedefs

No need to use a typedef for an enum.
Drop etmv1_pipestat_t and etmv1_branch_reason_t.

Change-Id: I03ae4de3efe699d9635fc4f162649f6bedcef4c0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8703
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agonor: lpc2000: drop useless typedef lpc2000_variant
Antonio Borneo [Fri, 10 Jan 2025 14:09:49 +0000 (15:09 +0100)]
nor: lpc2000: drop useless typedef lpc2000_variant

No need to use a typedef for an enum.
Drop it.

Change-Id: Iec690ebf6704f346d010cad1e6c65496f7bcc218
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8702
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agotarget: esp_algorithm: drop useless typedefs
Antonio Borneo [Fri, 10 Jan 2025 14:01:20 +0000 (15:01 +0100)]
target: esp_algorithm: drop useless typedefs

There is no need to use extra typedef for the functions in struct
esp_algorithm_run_data.
Declare the type of the functions in the struct.
Split the comment lines to stay in the line limits.

Change-Id: I0afa6242e57133f8bf1b13ba541abd6b067350b0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8701
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
2 months agodrivers: rshim: drop useless typedef
Antonio Borneo [Fri, 10 Jan 2025 12:55:18 +0000 (13:55 +0100)]
drivers: rshim: drop useless typedef

Use 'struct name' instead of typedef.

Change-Id: Ifff56811f53a260c314c8f5473d368599e0912e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8700
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agoopenocd: drop useless typedef
Antonio Borneo [Fri, 10 Jan 2025 12:40:59 +0000 (13:40 +0100)]
openocd: drop useless typedef

There is no need to use typedef for the array of functions.
Drop it.

While there, move the declaration outside the function and use the
array size to drop the error-prone sentinel to NULL.

Change-Id: I424964a6ef82ed1a7b27e78fbd19aa9f985b52c7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8699
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2 months agortt: drop useless typedefs
Antonio Borneo [Fri, 10 Jan 2025 11:13:30 +0000 (12:13 +0100)]
rtt: drop useless typedefs

There is no need to use extra typedef for the rtt functions.
Declare the type of the functions in the struct.

Change-Id: Idf2fee6e63ec3b3add38d042bbebe8d74613627c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8698
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2 months agogithub/workflow: build jimtcl from sources
Samuel Obuch [Tue, 11 Feb 2025 08:56:38 +0000 (09:56 +0100)]
github/workflow: build jimtcl from sources

JimTCL submodule was deprecated, this patch modifies
the GitHub snapshot action to build from sources instead.

Change-Id: Ie9ab20dbfd70506992d11a91489e82a9fa6e13ce
Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8751
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
2 months agodriver/linuxspidev: Clear queue on allocation
Richard Pasek [Thu, 30 Jan 2025 10:38:08 +0000 (05:38 -0500)]
driver/linuxspidev: Clear queue on allocation

SWD idle clocks are added to the queue by advancing the queue index
assuming the queue is zeroed. If the queue isn't zeroed, these idle
clocks end up being filled with junk data. Lets clear the queue and
associated buffers on queue allocation.

TEST: Connects successfully and ran the following TCL command:
  dump_image /dev/null 0x20000000 0x42000
  Host: Unnamed Qualcomm SoC with QUPv3 based SPI port
  Target: RT500

Signed-off-by: Richard Pasek <rpasek@google.com>
Change-Id: Ie660c10c27c4d0937ab0629138935ddbf5aeb0ae
Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8730
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Jonathon Reinhart <jrreinhart@google.com>
Tested-by: jenkins
2 months agodrivers/linuxspidev: fix use of uninitialized speed variable
Tomas Vanek [Mon, 3 Feb 2025 19:28:49 +0000 (20:28 +0100)]
drivers/linuxspidev: fix use of uninitialized speed variable

Valgrind reported
== Syscall param ioctl(generic) points to uninitialised byte(s)
==    at 0x4ABF990: ioctl (ioctl.S:26)
==    by 0x19D00B: spidev_speed (linuxspidev.c:181)
==    by 0x19D00B: spidev_init (linuxspidev.c:307)

Indeed, spidev_init() uses adapter_get_speed(), it calls
adapter_khz_to_speed() and it returns early without setting
the output parameter if adapter is not initialized.
Of course the adapter initialized flag is not set until
spidev_init() returns.

Simply drop this code as the adapter infrastructure initializes
adapter speed just after spidev_init() return.

Change-Id: I26f011ae59fc942a34d9bb517f467c22f735091d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8733
Tested-by: jenkins
Reviewed-by: Richard Pasek <rpasek@google.com>
2 months agodrivers/linuxspidev: fix minor memory leak
Tomas Vanek [Mon, 3 Feb 2025 19:23:08 +0000 (20:23 +0100)]
drivers/linuxspidev: fix minor memory leak

free() strduped spi_path on quit.
Found by valgrind.

Change-Id: Iaa59c7258c920b5e60d615df790dfe815831b925
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support")
Reviewed-on: https://review.openocd.org/c/openocd/+/8732
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Richard Pasek <rpasek@google.com>
2 months agortos/hwthread: Use LOG_TARGET_xxx()
Marc Schink [Sat, 7 Dec 2024 09:53:56 +0000 (10:53 +0100)]
rtos/hwthread: Use LOG_TARGET_xxx()

Use LOG_TARGET_xxx() to indicate which target the message belongs to.

While at it, fix some coding style issues.

Change-Id: Iac0296498557a689468a4a19d0bc64f03178a0d0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8727
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2 months agoflash/nor: add DesignWare SPI controller driver
Sergey Matsievskiy [Wed, 18 Sep 2024 17:12:48 +0000 (20:12 +0300)]
flash/nor: add DesignWare SPI controller driver

Driver for DesignWare SPI controller, found on many SoCs (see compatible
list in Linux device tree bindings
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml). This
implementation only supports MIPS as it was the only one available for the
tests, however, adding support for other architectures should require only
few adjustments. Driver relies on flash/nor/spi.h to find Flash chip info.
Driver internal functions support 24bit addressing mode, but due to
limitations of flash/nor/spi.h, it is not used. The reported writing speed
is about 60kb/s.
Lint, sanitizer and valgrind reported warnings were not related to the
driver.

Change-Id: Id3df5626ab88055f034f74f274823051dedefeb1
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8400
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2 months agortos: chibios: replace malloc+sprintf with alloc_printf
Paul Fertser [Tue, 26 Nov 2024 21:16:15 +0000 (23:16 +0200)]
rtos: chibios: replace malloc+sprintf with alloc_printf

This makes it safer and simpler at the same time.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Ie294f1f6033ffc9f46b39210e2f7fc2f648e80ac
Reviewed-on: https://review.openocd.org/c/openocd/+/8598
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2 months agobootstrap: Do not set up Git submodules by default
Marc Schink [Wed, 26 Jun 2024 13:50:45 +0000 (15:50 +0200)]
bootstrap: Do not set up Git submodules by default

Building OpenOCD with jimtcl and libjaylink Git submodules is deprecated
and will be removed in the upcoming releases. The remaining 'git2cl'
submodule is only required during the OpenOCD release process.

Only set up Git submodules when the 'with-submodules' argument is used,
for example during the OpenOCD release process or for the transition
period until all submodules are replaced by external dependencies.

We keep the existing 'nosubmodule' argument in order to not break
automatic testing with Jenkins.

Change-Id: Ia4fd765e3a2d6b2c40b084a1ffdf919d5f4f35bb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8381
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
2 months agoDeprecate jimtcl Git submodule
Marc Schink [Tue, 2 Jul 2024 15:12:46 +0000 (17:12 +0200)]
Deprecate jimtcl Git submodule

jimtcl was integrated as Git submodule for convenience and probably also
because packages were not widely available at the time. Today, jimtcl is
available in many popular package repositories [1] and the integration
as Git submodule adds unnecessary complexity to the OpenOCD build
process. For details, see the discussion on the mailing list in [2].

Disable the jimtcl Git submodule by default and announce it as
deprecated feature that will be removed in the next release. This gives
package maintainers time to adapt to the change and, if necessary,
build a package for jimtcl.

[1] https://repology.org/project/jimtcl/versions
[2] https://sourceforge.net/p/openocd/mailman/message/58786630/

Change-Id: I07930ac07f7d7a6317c08b21dc118f4f128b331c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8380
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2 months agohelper/log: Fix build using _DEBUG_FREE_SPACE_
Antonio Borneo [Tue, 20 Feb 2024 02:11:07 +0000 (20:11 -0600)]
helper/log: Fix build using _DEBUG_FREE_SPACE_

The glibc API 'mallinfo' is deprecated and the new 'mallinfo2'
should be used from glibc 2.33 (2021-02-01).

Throw an error when '--enable-malloc-logging' is used on systems
that compile without glibc.
Detect the glibc version and, for backward compatibility, define
'mallinfo2' as the old 'mallinfo'. Define a macro for the format
of 'fordblks'.

Change-Id: I68bff7b1b58f0ec2669db0b911f19c1c5a26ed30
Reported-by: Steven J. Hill <steven.hill@konsulko.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8589
Tested-by: jenkins
2 months agoconfigure: allow --enable-malloc-logging only with glibc
Antonio Borneo [Sun, 17 Nov 2024 21:46:15 +0000 (22:46 +0100)]
configure: allow --enable-malloc-logging only with glibc

The feature for 'malloc-logging' uses functionalities that are
available only in GNU libc.

Detect in 'configure' if OpenOCD is being compiled with glibc.
Set the macro '_DEBUG_FREE_SPACE_' only in case of glibc.

Change-Id: I43e9b87c7ad47171cfe3e7c1e5f96f11e19f98d0
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8592
Tested-by: jenkins
2 months agoconfigure: make more robust the check for elf 64
Antonio Borneo [Sun, 17 Nov 2024 20:35:45 +0000 (21:35 +0100)]
configure: make more robust the check for elf 64

The check if 'elf.h' defines the type 'Elf64_Ehdr' is currently
done through 'grep' on the file. While there is no false positive,
so far, such test could incorrectly find the text inside a comment
or in a block guarded by #if/#endif.

Use the autoconf macro AC_CHECK_TYPE() to detect if the type is
properly declared.

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