2
0
mirror of git://git.code.sf.net/p/openocd/code synced 2025-08-15 15:33:46 +10:00
Commit Graph

10926 Commits

Author SHA1 Message Date
Antonio Borneo
2aa0592e0f flash: stellaris: fix deprecated command
The driver directly runs a TCL command that has been renamed with
commit 4d99e77419 ("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: 4d99e77419 ("jtag/hla: Restructure commands")
Reviewed-on: https://review.openocd.org/c/openocd/+/8832
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2025-04-19 09:25:09 +00:00
Junhui Liu
498e559029 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>
2025-04-19 09:24:48 +00:00
HAOUES Ahmed
797dc7aba7 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
2025-04-19 09:24:17 +00:00
Antonio Borneo
9a09d38478 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>
2025-04-19 09:23:18 +00:00
Antonio Borneo
61890e3dc3 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
2025-04-19 09:22:42 +00:00
Antonio Borneo
1d9b34baa3 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
2025-04-19 09:22:27 +00:00
Antonio Borneo
29e4a36622 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
2025-04-19 09:22:12 +00:00
Antonio Borneo
4a616ca4d8 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
2025-04-19 09:21:56 +00:00
Antonio Borneo
a1ecf0a03d target: don't free working areas during 'configure -chain-position'
Since commit ef1cfb2394 ("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
2025-04-19 09:21:17 +00:00
Antonio Borneo
cfed1f78db list: silent scan-build false positive
With commit c023534e7b ("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
2025-04-19 09:18:36 +00:00
Antonio Borneo
16c5c1b353 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
2025-04-19 09:18:00 +00:00
Antonio Borneo
339763ed2d 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>
2025-04-19 09:17:16 +00:00
Sofiane HAMAM
6834f022b9 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
2025-04-05 06:25:11 +00:00
R. Diez
e45d66fd9a 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
2025-04-05 06:24:47 +00:00
R. Diez
9eb2426411 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>
2025-04-05 06:24:26 +00:00
Antonio Borneo
160f7b3e5d 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
2025-04-05 06:23:53 +00:00
Antonio Borneo
c023534e7b 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
2025-04-05 06:23:37 +00:00
Antonio Borneo
04124c77f4 target: fix memory leak in handle_target_write_memory()
Commit f55ec6d449 ("target: rewrite command 'write_memory' as
COMMAND_HANDLER") adds a new return statement without freeing the
allocated buffer.

Add the needed free().

Fixes: f55ec6d449 ("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
2025-04-05 06:22:43 +00:00
Tomas Vanek
169d463a3d 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>
2025-04-01 04:50:42 +00:00
Antonio Borneo
fe3aa0a4bc 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>
2025-03-29 22:08:43 +00:00
Adrien Grassein
f885a8d76c 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>
2025-03-29 18:27:19 +00:00
Marek Vasut
a9fa339267 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>
2025-03-29 18:26:42 +00:00
Antonio Borneo
a86fdfc735 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>
2025-03-29 18:26:22 +00:00
Adrien Grassein
5773ff9d82 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
2025-03-29 18:25:49 +00:00
HAOUES Ahmed
98e34fd1f1 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>
2025-03-29 18:25:02 +00:00
Antonio Borneo
50c1a156ae 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
2025-03-29 18:23:46 +00:00
Antonio Borneo
f55ec6d449 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>
2025-03-29 18:23:15 +00:00
Antonio Borneo
864e1341ad 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
2025-03-29 18:22:48 +00:00
Antonio Borneo
6d139422cb 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
2025-03-29 18:22:27 +00:00
Adrien Grassein
72ff2e2d9f 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
2025-03-15 10:34:45 +00:00
Adrien Grassein
bb4c7e3233 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
2025-03-15 10:34:06 +00:00
Antonio Borneo
4275280698 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>
2025-03-15 10:20:47 +00:00
Antonio Borneo
6beb6280af adapter: drop command 'adapter transports'
The commit 93f2afa45f ("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
2025-03-15 10:20:32 +00:00
Antonio Borneo
e4a51b3235 doc: drop mention of not implemented SPI transport
The commit 93f2afa45f ("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
2025-03-15 10:20:12 +00:00
Evgeniy Naydanov
e12ceddd5e 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
2025-03-15 10:19:45 +00:00
R. Diez
a2d4b9b718 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>
2025-03-15 10:19:11 +00:00
R. Diez
fdd0c2b1d3 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>
2025-03-15 10:18:41 +00:00
Evgeniy Naydanov
16c6497a89 rtos/linux: fix name overwrite in linux_thread_extra_info()
commit 908ee4dc96 ("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>
2025-03-15 10:18:11 +00:00
Marc Schink
d892a4d763 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>
2025-03-15 10:17:15 +00:00
Shivasharan Nagalikar
80b1c9aff8 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>
2025-03-15 10:16:03 +00:00
Shivasharan Nagalikar
da7e369266 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
2025-03-15 10:15:46 +00:00
Shivasharan Nagalikar
c00228468c 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
2025-03-15 10:15:28 +00:00
Shivasharan Nagalikar
9e5ffed7d6 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>
2025-03-15 10:15:16 +00:00
Shivasharan Nagalikar
a2c3c791ad 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>
2025-03-15 10:14:58 +00:00
Nishanth Menon
a8555b0b6d 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>
2025-03-15 10:14:25 +00:00
Nishanth Menon
5300242a3e 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>
2025-03-15 10:14:10 +00:00
Daniel Goehring
f5dd564a7b 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>
2025-03-09 13:27:31 +00:00
Daniel Goehring
b2016dc443 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 7f2db80ebc ("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>
2025-03-09 13:27:15 +00:00
Nishanth Menon
b7ad702bc8 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
2025-03-09 13:26:52 +00:00
Nishanth Menon
c81cb4aa2d 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>
2025-03-09 13:26:26 +00:00