Commit Graph

10594 Commits

Author SHA1 Message Date
Marek Vasut cbed09ee9b tcl/target: Make sure R-Car Gen3 _targets variable is global
The _targets has to be global as it is accessed at the end of this file.
This is already the case for setup_a5x {}, assure it is the same way for
setup_crx{} . Without this change, the _targets at the end of this file
is empty in case the Cortex-R is the boot core, fix this.

Change-Id: I4979e3125ec7d93bbd56eee0096ae1d9c5f6a565
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8470
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-09-07 11:42:25 +00:00
Adam Novak 75b418faa7 tcl/board: Support for Digilent Anvyl board
Support Digilent Anvyl board JTAG chain

Change-Id: I6fb52284429af6c98c19411fc8bc3ab983dfa9b8
Signed-off-by: Adam Novak <interfect@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8467
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-09-07 11:41:22 +00:00
Parshintsev Anatoly f9b2a1a2bd jtag_vpi: fix signed/unsigned comparison jtag_vpi_stableclocks
Change-Id: Id2b00fbc8ba627f4465c109fbde6e010faaff9d2
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8462
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-09-07 11:40:45 +00:00
Adam Novak 324469da57 cpld: update warning to suggest virtex2 refresh
virtex2 refresh replaced virtex2 program, but the even older programming
commands like xc6s_program still suggest the old, now-removed program
command. This changes the warnings to suggest the command that is still
there, and also adds some indication that you will need to use the .pld
name instead of the .tap name.

Change-Id: I292da62a95a9b414c69cdb1bba8a28dfd16a7336
Signed-off-by: Adam Novak <interfect@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8468
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Daniel Anselmi <danselmi@gmx.ch>
2024-09-07 11:39:22 +00:00
Ondřej Hošek 7e271c9151 flash/stm32l4x: option_write usage: mask is optional
If no mask is given, the value in the option register is replaced
completely. If a mask is set, only those bits that are set in the mask
are transferred into the option register; the others remain unchanged.

Change-Id: If488a10f92d7dcc0e0f192aef5e67c255fd529c3
Signed-off-by: Ondřej Hošek <ondra.hosek@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8466
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-09-07 11:38:52 +00:00
Ondřej Hošek ca72d23c3b doc: fix stm32l4x option_write usage
stm32l4x option_write works like stm32h7x option_write, i.e. expects the
value to write after reg_offset and optionally reg_mask after the value.

Change-Id: I57fb4fb1dbf7f43fe063b48f4db2dd5f2ef0ade0
Signed-off-by: Ondřej Hošek <ondra.hosek@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8464
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-09-07 11:38:30 +00:00
Marcus Nilsson e01e180f62 drivers/cmsis_dap: Fix buffer overflow in cmsis_dap_hid_open()
Use mbstowcs() to get required length of wide character string and
include space for terminating null wide character.

Change-Id: I668de6f0acc9b3ec5aca033d870dd9ef354f9077
Signed-off-by: Marcus Nilsson <brainbomb@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8232
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-09-07 11:37:46 +00:00
Antonio Borneo 4680d6ebdf binarybuffer: str_to_buf(): align prefix to TCL syntax
Integer values are interpreted by TCL as decimal, binary, octal
or hexadecimal if prepended with '0d', '0b', '0o' or '0x'
respectively.
The case of '0' prefix has been interpreted as octal till TCL 8.6
but is interpreted as part of a decimal number by JimTCL and from
TCL 9.

Align str_to_buf() to latest TCL syntax by:
- addding support for '0d', '0b' and '0o' prefix;
- dropping support for '0' prefix.

Change-Id: I708ef72146d75b7bf429df329a0269cf48700a44
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8465
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
2024-09-07 11:37:15 +00:00
Tomas Vanek e09bb72da5 target/cortex_m: add DSCSR_CDSKEY bit definition
Needed e.g. for flash drivers handling secure mode.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: If6cb49609140d06a73bcf2e446b6a634d6326e80
Reviewed-on: https://review.openocd.org/c/openocd/+/8435
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:44:16 +00:00
Karl Palsson e7a060090e rtt: default the ID to "SEGGER RTT"
Instead of making people type this in all the time, just default to
"SEGGER RTT" so more things work out of the box.

Change-Id: I147142cf0a755e635d3f66e047be2eb5049cf511
Signed-off-by: Karl Palsson <karl.palsson@marel.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8354
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:43:22 +00:00
Richard Allen 5cb184a732 target: fix profiler output on Windows
Open output file in binary mode to disable EOL
conversion on Windows (and sometimes cygwin depending
on installation settings and path).

Change-Id: I38276dd1af011ce5781b0264b7cbb08c32a1a2ad
Signed-off-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8278
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:42:44 +00:00
Parshintsev Anatoly ff22f78d46 doc: document that breakpoints are disabled on step/resume
OpenOCD disables breakpoints on step/resume if they
match the current code position. This is a non-obvious
behavior that should be documented

Change-Id: Id762066569ec6452869a58dfcd9df88c8a14d6ab
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8388
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:42:14 +00:00
Marc Schink 0bf3373e80 target/breakpoints: Use 'unsigned int' for length
Change-Id: I233efb5b18de5f043fdc976807437db0a94236d1
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7056
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-25 12:41:05 +00:00
Peter Collingbourne 941fa8538f arm_cti: Add CTIDEVCTL to register list
This is useful for setting a reset catch on a CPU that is being
brought out of reset.

Change-Id: Id8fe9bc3f75fd170f207f470a9f3b0faba7f24c1
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8422
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:40:24 +00:00
Peter Collingbourne fc1e73b9cf arm_cti: Clean up the list of CTI registers
Reduce the amount of boilerplate by moving cti_regs into its only
user, making it a local variable and removing the now-redundant
p_val pointer.

Change-Id: I778cc1e960532fae1ac1a952c6ff19c54e578a5f
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8421
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-25 12:40:00 +00:00
Peter Collingbourne 7eb9a48f2d arm_adi_v5: Also clear sticky overrun bit on init
Some targets start up with the sticky overrun bit set. On such targets
we need to clear it in order to avoid subsequent incorrect reads.

Change-Id: I3e939a9e092de6fcea9494d3179a3386aa1701d2
Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8420
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-08-25 12:39:25 +00:00
Antonio Borneo d3f50ea914 target: arm_adi_v5: add more CoreSight P/N
Add part numbers for:
- Cortex-A65AE,
- Cortex-M52,
- Cortex-M55,
- Cortex-R52+,
- STAR-MC1.

Change-Id: I6282768896dd727e803a071139816494470744f1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8319
Tested-by: jenkins
2024-08-25 12:38:28 +00:00
Marc Schink 16429f6252 target/arm_cti: Use suitable data types
While at it, fix some small coding style issues.

Change-Id: Ifb8e78b55d29a06d69a3ce71d12d0040777aef13
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8423
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-25 12:37:20 +00:00
Antonio Borneo ceae51ad74 checkpatch: only report error on hit
The Linux checkpatch script used by OpenOCD reports hits either as
error, warning and check.
Such classification is meaningful for Linux maintainers, but for
OpenOCD Jenkins they are all considered as errors.

Having such classification in the checkpatch report by Jenkins is
misleading for developers that expect 'warnings' to be probably
ignored by maintainers, while having no idea what 'checks' means.

This patch flattens all the checkpatch reports to 'error' only.

Checkpatch can trigger false positives. OpenOCD uses the tag
	Checkpatch-ignore:
in the commit message to prevent Jenkins to report the error, as
described in HACKING.

Change-Id: I1d3164ba1f725c0763dfe362192ffa669b3856e6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8424
Reviewed-by: Karl Palsson <karlp@tweak.au>
Tested-by: jenkins
2024-08-25 12:36:57 +00:00
Antonio Borneo bfd3110e59 binarybuffer: str_to_buf(): simplify it and fix scan-build error
The function str_to_buf() can be simplified by writing directly
the intermediate results in the output buffer.
Such simplification improves the readability and also makes
scan-build happy, as it does not trigger anymore the warning:
	src/helper/binarybuffer.c:328:8: warning: Use of memory
	allocated with size zero [unix.Malloc]
		if ((b256_buf[(buf_len / 8)] & mask) != 0x0) {

Change-Id: I1cef9a1ec5ff0e5841ba582610f273e89e7a81da
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8396
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Tested-by: jenkins
2024-08-25 12:36:29 +00:00
Antonio Borneo bee5999a44 binarybuffer: str_to_buf(): rename buf_len as buf_bitsize
The name 'buf_len' is misleading, as it usually refers to the byte
length of a buffer. Here we use it for the length in bits.

Rename it as 'buf_bitsize'.
While there, fix checkpatch error by changing the index type to
'unsigned int'.

Change-Id: I78855ed79a346d996d9c0100d94d14c64a36b228
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8395
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
2024-08-25 12:36:13 +00:00
Antonio Borneo 8a3efbf21f binarybuffer: simplify the prototype of str_to_buf()
With 'radix' always zero and '_detected_radix' always NULL, drop
the two parameters and simplify str_to_buf().

While there:
- drop some redundant assert(),
- drop the re-check for the base prefix,
- simplify str_strip_number_prefix_if_present() and rename it, as
  the prefix MUST be present,
- fix a minor typo,
- update the doxygen description of str_to_buf().

Change-Id: I1abdc8ec0587b23881953d3094101c04d5bb1c58
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8394
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
2024-08-25 12:36:00 +00:00
Antonio Borneo ea859e1cd0 helper: command: drop radix parameter from command_parse_str_to_buf()
Commit 53b94fad58 ("binarybuffer: Fix str_to_buf() parsing
function") introduces the helper command_parse_str_to_buf() to
parse as number a string on TCL command-line.
The parameter 'radix' can specify the base (decimal, octal,
hexadecimal, or auto-detected).

TCL is supposed to use decimal numbers by default, while octal and
hexadecimal numbers must be prefixed respectively with '0' and
'0x' (or '0X').
This would require the helper to always run auto-detection of the
base, thus always set the 'radix' parameter to zero. This makes
the parameter useless.

Keeping the 'radix' parameter can open the door to future abuse of
TCL syntax, E.g. a command can require an octal value without the
mandatory TCL '0' prefix; the octal value cannot be the result of
TCL expression.

To prevent any future abuse of the 'radix' parameter, drop it.

Change-Id: I88855bd83b4e08e8fdcf86a2fa5ef3269dd4ad57
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8393
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
2024-08-25 12:35:47 +00:00
Antonio Borneo a414ffaf65 doc: document command 'ms'
Add documentation for the commands 'ms'.

Change-Id: I247adce1c586c4f4cd36d044d48298c370635e67
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8432
Tested-by: jenkins
2024-08-25 12:35:27 +00:00
Tomas Vanek ac63cd00d7 tcl/interface/raspberrypi5-gpiod: fix string match pattern escaping
Use correct TCL syntax and save string map operation.

Change-Id: Ic2a522bd57cf6610b7df1d9cddd0fbdc2076ed62
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8426
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-16 04:45:11 +00:00
Marc Schink efe9022197 server/telnet: Always allow 'exit' command
The telnet 'exit' command is only available in the execution phase of
OpenOCD. Thus, a telnet session cannot be closed via 'exit' if OpenOCD
is started with 'noinit'. Make the 'exit' command always available.

Change-Id: I14447ecde63e579f1c523d606f048ad29cc84a35
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8379
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2024-08-06 14:31:29 +00:00
Marc Schink b9224c0c0f transport: Remove echo in transport selection
Do not echo the selected transport to avoid stray and confusing
messages in the output of OpenOCD. For example, the "swd" line here:

  Open On-Chip Debugger 0.12.0+dev-00559-ge02f6c1b9-dirty
  Licensed under GNU GPL v2
  For bug reports, read
  	http://openocd.org/doc/doxygen/bugs.html
  swd
  Info : Listening on port 6666 for tcl connections
  Info : Listening on port 4444 for telnet connections

While at it, fix some small documentation style issues.

Change-Id: Ie85426c441289bbaa35615dbb7b53f0b5c46cfc0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8217
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 16:08:32 +00:00
Marc Schink d5adab697f target/breakpoints: Fix 'orig_instr' output
The 'orig_instr' information of software breakpoints is incorrect
because buf_to_hex_str() expects the length of the buffer to be
converted in bits and not bytes.

Change-Id: I9a9ed383a8c25200d461b899749d5259ee4c6e3d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8218
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 16:07:33 +00:00
Marc Schink 5b3d503e2e doc: Add 'jlink targetpower' command
Change-Id: I7e6c9e75f3c70675a3ea55fd5f0d7de1a35f2c4b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8418
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 16:06:26 +00:00
Marc Schink 4cab20b599 adapter/jlink: Allow to determine the target power state
Change-Id: I0b4f543e0ba0e48c43f78e32e4fa41d7dec9d7b8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8417
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 16:06:04 +00:00
Marc Schink fc0ec6cf0b adapter/jlink: Use COMMAND_PARSE_* instead of sscanf()
While at it, apply some coding style fixes.

Change-Id: I77a6917a045af733ebe9211ca338952dbd49c89b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8416
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 16:05:33 +00:00
Marc Schink 2b6d63a44d jtag: Use 'unsigned int' data type
This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: I364467b88f193f8387623a19e6994ef77899d117
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8414
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:05:07 +00:00
Marc Schink 7d56407ba7 jtag: Use 'unsigned int' for 'scan_field.num_bits'
This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: Idcbbbbbea2705512201eb326c3e6cef110dbc674
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8413
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:04:49 +00:00
Marc Schink 9ef59daef0 target/avrt: Remove unused parameter 'rti'
Change-Id: Ib6957b89190188f5c15fadc3d4036709f19a6cea
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8412
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:04:24 +00:00
Marc Schink 0847a4d7fb jtag/commands: Use 'unsigned int' data type
This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be addresses
in following patches.

While at it, apply coding style fixes if these are not too extensive.

Change-Id: Ie048b3d472f546fecb6733f17f9d0f17fda40187
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8404
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:03:28 +00:00
Marc Schink 42450345dd jtag: Use 'unsigned int' for 'ir_length'
This patch modifies as little code as possible in order to simplify the
review. Data types that are affected by these changes will be modified
in following patches.

Change-Id: I83921d70e017095d63547e0bc9fe61779191d9d0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8403
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:02:25 +00:00
Marc Schink 4fac13827f jtag: Use 'unsigned int' for 'abs_chain_position'
Change-Id: I1ac0a6a86f820b051619aa132754a69b8f8e0ab9
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8402
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:01:59 +00:00
Marc Schink 632df9e5cb jtag: Use bool data type for 'jtag_verify'
Change-Id: Iae46e45c7523252eee44224e6b9b3b1484aaeb35
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8401
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 16:01:31 +00:00
Antonio Borneo 882749dd2f uncrustify.cfg: add SPDX license
Add the SPDX tag line.

Change-Id: I701580948a0cacdb7fe31d91ed730e848da9b0ba
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8411
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
2024-08-02 16:01:12 +00:00
Antonio Borneo 5543bb4a90 doc: Makefile.am: add SPDX license
Add the SPDX tag line.

Change-Id: Iffe73faaf20614f9e5237b7afba3c580dfa03a9e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8410
Tested-by: jenkins
2024-08-02 16:00:50 +00:00
Antonio Borneo 4c77f942e1 tcl: fix minor typos and repeated words
Detected with checkpatch.

Change-Id: Id306928496cf70bbe7ff065bf726bc7dceadce26
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8409
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2024-08-02 16:00:22 +00:00
Antonio Borneo 13f9f29fa8 checkpatch: extend checks to TCL, Makefile.am and configure.ac files
The script, originally written for Linux code, skips several tests
on files whose name's extension is not in Perl list
'(h|c|s|S|sh|dtsi|dts)$'.
This causes such tests to not be executed on OpenOCD TCL files and
on Makefile.am and configure.ac.

Modify the script to include the OpenOCD files in the list.

Change-Id: I17c96bf32ee40d9390e60996e176e4e927c00197
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8408
Reviewed-by: Marek Kraus <gamelaster@outlook.com>
Tested-by: jenkins
2024-08-02 16:00:09 +00:00
Marek Kraus 1b5c137e43 tcl/target: add initial Bouffalo Lab BL702 chip series support
Adds initial support for the BL702 series of chips, BL702, BL704 and BL706.
No flash bank support yet.

File name bl702.tcl was chosen over bl70x.tcl, because Bouffalo Lab
uses bl702 to mark the whole series in many of their tools.

The ndmreset bit in the RISC-V Debug Module isn't implemented correctly,
so it doesn't trigger a system reset as it should.
To solve this problem, the software reset is implemented
in the reset-assert-pre hook, which uses best reset method I could find.
What is not reset is the GLB core, which handles GPIOs, pinmux, etc.
The reset mechanism has been extensively tested, and works correctly
for both "reset run" and "reset halt", which the latter
halts very early in the BootROM.

Change-Id: I5ced6eb3902d1b9d9c1bba56f817ec5dc3493cb0
Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8407
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-08-02 15:59:42 +00:00
Marc Schink a8a0b4c507 configure: Use pkg-config for jimtcl
The jimtcl project supports pkg-config, use it for a simpler
configuration of compiler and linker flags and to enforce the minimum
required package version.

Since the jimtcl pkg-config file is not available on all systems, use
AC_CHECK_HEADER() as fallback.

Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8383
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-08-02 15:59:07 +00:00
Grant Ramsay 16c114c058 flash/startup.tcl: Tidy flash program preverify documentation
Remove the hyphen from "pre-verify" in usage text.
Add preverify to the help text and procedure comment

Change-Id: I6d96e78ca84d99929300d461e435f5b4ce07b5db
Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8376
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-07-28 13:36:58 +00:00
Antonio Borneo 2cbfd141e8 jep106: update to revision JEP106BJ.01 July 2024
Change-Id: Iebab3f6a3b1f6d82f955997fd4e691c55d01c767
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8406
Tested-by: jenkins
2024-07-28 13:34:26 +00:00
Antonio Borneo 4c6646f10a doc: fix makeinfo warning
Build returns a makeinfo warning:
	openocd.texi:5201: warning: `.' or `,' must follow @xref, not f

Add a dummy ',' after '@xref{..}' to silent the warning.

Fixes: 44cfdef0a4 ("server/gdb: Restructure commands")
Change-Id: Ic0bff8fc9b54942ebb72762816686ea7c7881345
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8392
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2024-07-28 13:27:57 +00:00
Antonio Borneo 5b7b77349c cortex_m: fix scan-build false positive
Scan-build is unable to detect that 'target->dbg_msg_enabled' does
not change across the function cortex_m_fast_read_all_regs().
It incorrectly assumes that it can be false at the first check (so
'dcrdr' get not assigned) and it is true later on (when 'dcrdr'
get used).
This triggers a false positive:
	src/target/cortex_m.c:338:12: warning:
		3rd function call argument is an uninitialized value
		[core.CallAndMessage]
	retval = mem_ap_write_atomic_u32(armv7m->debug_ap, DCB_DCRDR, dcrdr);

Use a local variable for 'target->dbg_msg_enabled' so scan-build
can track it as not modified.
While there, change the type of 'target->dbg_msg_enabled' to
boolean as there is no reason to use uint32_t.

Change-Id: Icaf1a1b2dea8bc55108182ea440708ab76396cd7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8391
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-07-28 13:26:05 +00:00
Tarek BOCHKATI 052a4a69b5 flash/stm32l4x: support STM32U53/U54x devices
STM32U53/U54x devices are similar to U57/U58x devices
with 2 flash banks up to 256 KB each

Change-Id: I774ef0df4dddac5f06bbfc2e6c3fc2e628d2249e
Signed-off-by: FBOSTM <fedi.bouzazi@st.com>
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7515
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-07-25 04:07:35 +00:00
Tarek BOCHKATI 6554d176e9 flash/stm32l4x: support STM32U59/U5Ax devices
STM32U59/U5Ax devices are similar to U57/U58x devices
with 2 flash banks up to 2 MB each

while at there update STM32U57x/U58x revisions

Change-Id: I7e5c1700acf8c9fda34f660c9274bfd8bcb1381b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6875
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-07-18 08:18:28 +00:00