Commit Graph

10709 Commits

Author SHA1 Message Date
Marc Schink a75feb0bfd target/armv7m: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() to indicate which target the message belongs to.

Change-Id: Ib1cd37fe6eca2ea42095d2d371116446a936e20a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8664
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-30 15:58:10 +00:00
Marc Schink 78bc6f34d4 target/esirisc: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() for log messages as it is used for other targets.

Change-Id: Ia7e9629d89f2e6cb3f9c156e74ac1a02960f9373
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8663
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-30 15:57:45 +00:00
Marc Schink 4193322315 target/mem_ap: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() for log messages as it is used for other targets.

Change-Id: I2f937c937a5c09d91dc82b4323be3276ab60b01a
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8662
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-30 15:57:27 +00:00
Marc Schink e4ad10e0a1 helper/log: Add LOG_TARGET_USER()
Add a target-related log function for user messages as it already
exists for other log levels.

Change-Id: I9076677d6451b900332583e748bab3f83df56d3b
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8661
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-30 15:57:01 +00:00
Tomas Vanek 5284a5f3ec tcl/interface: Find proper alias for RP1 on Raspberry Pi 5
Previously, Linux assigned gpiochip numbers sequentially depending on
when the chip driver was probed. As RP1 is on the end of a PCIe link, it
is probed later than the on-board chips (including expanders connected
over SPI/I2C). This meant that RP1's gpiochip assignment was at an
offset that could potentially change.

A downstream kernel patch now assigns fixed offsets for RP1 and the
onboard gpiochips. Query the device tree to get proper GPIO_CHIP index.

Change-Id: I759978d4b3021c815a7d9febb41961cd1d3d185c
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8650
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tested-by: jenkins
2024-12-29 07:27:45 +00:00
Marc Schink 15d90dd21c tcl/target: Add config for STM32U0x
Tested with NUCLEO-U083RC development board.

Change-Id: Iec668b45166543adcd1fa5077d41c57a35d3becf
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8648
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-12-29 07:26:13 +00:00
Marc Schink 66faa420a4 flash/nor/stm32l4x: Add support for STM32U0 series
Tested flash programming / erasing and write protection feature on the
STM32U083RC microcontroller.

Change-Id: I3af51452f76d1f046d34d61b22d51abe2d0db3e8
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8647
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2024-12-29 07:25:36 +00:00
Marc Schink 7d5a0b6a27 tcl/board: Add nRF54L15-DK config file
This patch adds support for the nRF54L15 development kit from Nordic
Semiconductor.

Change-Id: I5e362227fed3982ef21f36e41aade196e0ac7031
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8610
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:57:21 +00:00
Marc Schink 4d1b3cbafc tcl/target: Add support for Nordic nRF54L series
The RISC-V coprocessor is currently not supported. It is attached to the
DAP via AP#2 but the AP implementation is unknown.

The nRFL54L series uses resistive RAM (RRAM) as non-volatile memory
which can be programmed directly. Since it does not fit in the current
flash memory infrastructure of OpenOCD there is no NVM support so far.

Change-Id: I9934af4fd3bb8b7272954fc4b17638c7dabbbee0
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8609
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-22 09:57:09 +00:00
Marc Schink 1f2db5d59a rtos/rtos: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant.

Change-Id: Ib064d1031f5ad14ed7711c09bb5f5254d0054d59
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8633
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:55:56 +00:00
Marc Schink 3be1bee753 target/mips: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant.

Change-Id: Ieecfb3583d484847514f1298e819ccf6d26abd84
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8632
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-22 09:55:35 +00:00
Marc Schink 9cd0b37112 target/xtensa: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant. While at it, also
get rid of the useless exclamation mark.

Change-Id: I16fd6a88b533fac19b4c622cf9740fd32ba7892c
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8611
Reviewed-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:55:22 +00:00
R. Diez 7f9d25d58a configure.ac: switch from $host to $host_os
Suggested during review https://review.openocd.org/c/openocd/+/8533
Only the OS part was being checked anyway.
The aim is to facilitate merging all $host_os checks in the future.

Change-Id: Idce1d5872cf19ef423429fa0c3b2ff7ee3945332
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8607
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:54:54 +00:00
R. Diez bb2fc63357 configure.ac: enable the Dummy adapter by default
The Dummy adapter is useful when developing generic JimTcl code.
Besides, the distributed BUGS file states that you should
try to reproduce any crashes with the Dummy adapter, so
it does not make sense that it is not enabled by default.

Change-Id: I145de06de4d2c0011619b1b941200b63e200db23
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8608
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2024-12-22 09:54:35 +00:00
Antonio Borneo cd9e64a25a rtos: mqx: minor rework to avoid a cast
Change the type of task_name[] to char in order to drop a cast.

Change-Id: I233fc862e972e52130fd4ffcb29a3da36f4f8923
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8599
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
2024-12-22 09:52:32 +00:00
Paul Fertser dca76cd5da rtos: mqx: replace malloc+strcpy with strdup
Using strcpy is potentially dangerous so just use a safer and easier way
to do the same.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Id85f3b7f8af1eaf14c9951ae710546d2437c70b5
Reviewed-on: https://review.openocd.org/c/openocd/+/8597
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-12-22 09:52:20 +00:00
Antonio Borneo 42f70a3b95 target: aarch64: fix out-of-bound access to array
The command 'arm core_state' uses the enum in 'arm->core_state' as
an index in the table of strings to print the core state.

With [1] the enum has been extended with the new state for AArch64
but not the corresponding table of strings.
This causes an access after the limit of arm_state_strings[].

Rewrite the table using c99 array designators to better show the
link between the enum list and the table.
Add the function arm_core_state_string() to check for out-of-bound
values allover the file.

Change-Id: I06473c2c8088b38ee07118bcc9e49bc8eafbc6e2
Fixes: [1] 9cbfc9feb3 ("arm_dpm: Add new state ARM_STATE_AARCH64")
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8594
Tested-by: jenkins
2024-12-22 09:50:50 +00:00
Marc Schink 1710954977 doc/manual: Add section about logging
The log messages are very inconsistent across the code base. Add a
guideline for log messages to help improve consistency. The guideline is
based on the most commonly used style in the current code base.

Change-Id: I076d68abe588dd04b59580379e97b82d537def23
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8576
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2024-12-22 09:45:53 +00:00
fanoush cc02bd752c rtt server: fix for dropped data when target has no space
rtt_write_channel may write less data than requested,
default device buffer size for channel 0 is 16 bytes,
so currently anything larger than this is dropped.

This fix implements per connection buffer and uses the
connection->input_pending flag to retry writes.

Change-Id: I00c845fccb0248550ad0f0fd9cda7bac7976b92b
Signed-off-by: fanoush <fanoush@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8360
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-22 09:43:37 +00:00
Pete Moore cb3b8afe47 jimtcl: Fix command not found
During the ./configure build stage, error './configure.gnu: line 1: -e:
command not found' can occur.

Problem: the -e flag with echo is not portable. While some shells support
it (e.g., Bash), others (e.g., POSIX /bin/sh on some systems) do not.

Solution: replacing echo -e with printf, since printf is POSIX-compliant
and works consistently across different shells.

Change-Id: I9efbba662599a61bbe1fc56a33dc1ee7ad58826c
Signed-off-by: Pete Moore <pmoore@mozilla.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8653
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2024-12-22 00:40:33 +00:00
Pete Moore d60e1f6693 flash/nor/sfdp: Fix broken DEBUG log line on macOS
https://review.openocd.org/c/openocd/+/8439 changed variable `words`
from uint8_t to unsigned int in sfdp.c but failed to update the
LOG_DEBUG line to reflect the new type. On macOS this caused:

src/flash/nor/sfdp.c:107:28: error: format specifies type 'unsigned
char' but the argument has type 'unsigned int' [-Werror,-Wformat]

The formatting of the debug line has been updated to reflect the updated
type.

Change-Id: Ifc7ddb1279ab2603901c969d9c09af847f3a3caf
Signed-off-by: Pete Moore <pmoore@mozilla.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8660
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-12-21 10:25:58 +00:00
Henrik Mau 133dd9d669 target/xtensa: add maskisr command support for NX
Add maskisr command support to Xtensa NX targets allowing masking
of interrupts during single stepping.

Change-Id: I3835479de8015f1a2842afd1aeab24829e385031
Signed-off-by: Henrik Mau <henrik.mau@analog.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8575
Reviewed-by: Ian Thompson <ianst@cadence.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-11-23 13:54:44 +00:00
Marc Schink 76e228f733 target/cortex_m: Use LOG_TARGET_xxx()
Use LOG_TARGET_xxx() for the remaining log messages.

Change-Id: If52e3935b57e4c39212ce6b5111ff65159de1373
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8580
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:54:03 +00:00
Marc Schink c837beaf5d target/breakpoints: Use LOG_TARGET_ERROR()
Use LOG_TARGET_xxx() for the remaining log messages.

Change-Id: I4b86b206d17dead0662388e827204b40a7d29edd
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8579
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:53:42 +00:00
Marc Schink 6973613175 rtos: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant. While at it, also
get rid of the useless exclamation mark.

Change-Id: I8707342c602cea735c5a423b37ebe40a3aafb137
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8578
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:53:24 +00:00
Marc Schink f5036aff3a target/xtensa: Remove 'ERROR: ' prefix in error log
Remove the prefix since it is redundant.

Change-Id: I9c23c0479ba40be24e471309e720060cd03763ee
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8577
Tested-by: jenkins
Reviewed-by: Ian Thompson <ianst@cadence.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:52:56 +00:00
R. Diez 11f24fc2f2 configure.ac: improve validation of some --enable-xxx options
Catch an invalid option like "--enable-buspirate=rubbish".
Also mention all valid values in the help text for those options.

Change-Id: Ib0fb8904132d07cc5cde421aa816ca6971a08769
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8540
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-11-23 13:51:20 +00:00
R. Diez 2627f8ce6d configure.ac: show the linuxgpiod adapter in the configuration summary
List AC_ARG_ADAPTERS was missing a comma separating two of the elements.

Also verify that each adapter is set to either 'auto', 'yes' or 'no',
which should prevent such issues from going unnoticed in the future.

Change-Id: I0d407e03b1e5a3edc61d7dc93d5ffa70fe079b3c
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8534
Tested-by: jenkins
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:50:34 +00:00
R. Diez 9ff79fd61f enable the Bus Pirate adapter by default on most systems
Also convert the Bus Pirate to the common PROCESS_ADAPTERS logic.

Change-Id: Ifa8ebcee380c16d7e308ba7a75dbffdb74208285
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8533
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
2024-11-23 13:49:42 +00:00
Antonio Borneo c582cfbf75 driver: stlink: get adapter speed through adapter_get_speed_khz()
The stlink driver, both in dapdirect and in HLA modes, pretends to
store locally the value of the adapter speed in order to use it
later-on during adapter initialization.
It doesn't work in dapdirect mode since the code to store locally
the value will not be executed until the adapter is already fully
initialized.

This cause an issue in dapdirect mode:
- due to the local value, still kept at -1, the adapter will be
  initialized to the lowest clock speed (5 KHz on stlink v2 in SWD
  mode);
- after the adapter initialization the framework will again set
  the speed with the value requested by the user.

Some target, like nRF51822, only accepts JTAG/SWD speed in a
defined range of frequencies. The initial speed of 5 KHz used by
dapdirect can be out of range, making the target debug port not
working.

The adapter framework already stores the value of speed and makes
it available through adapter_get_speed_khz().

Drop struct hl_interface_param::initial_interface_speed.
Let the code to use adapter_get_speed_khz().

Change-Id: Ie11bf0234574f2a9180d3d3a16efb78e08dfcd86
Reported-by: Andrzej Sierżęga <asier70@gmail.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8574
Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
Tested-by: jenkins
2024-11-23 13:49:16 +00:00
Marc Schink 8c739a45a0 helper/jim-nvp.h: Rework 'isconfigure' variable
Change the variable name to 'is_configure' to be compatible with the
coding style and use 'bool' as data type.

Change-Id: I8609f9807c8bd14eaf6c93acf63fd51b55c9bbbb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8573
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-23 13:48:52 +00:00
Antonio Borneo 61fbcbeca8 semihosting: make local functions static
The functions:
- semihosting_opcode_to_str();
- semihosting_write_fields();
- semihosting_set_field();
are not referenced outside the file.

Make them static.

Change-Id: Ia8d35554673145fdfe0e501543eb18919863039f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8551
Tested-by: jenkins
2024-11-23 13:48:25 +00:00
Antonio Borneo b04a58e3fc target: esirisc: make local functions static
The function esirisc_jtag_get_eid() is not used outside the file.
Make it static.

The function esirisc_jtag_disable_debug() is never used.
Make it static and mark it as unused.

Change-Id: I5c99cbf77cc9c527b6e18a3f67caa24f8551d09c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8550
Tested-by: jenkins
2024-11-23 13:48:12 +00:00
Antonio Borneo df42faf51d target: aarch64: drop unused armv8_mmu_translate_va()
The function is not used.
Drop it!

Change-Id: I1625e03714b5a842f668098191c39cce34f815e8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8549
Tested-by: jenkins
2024-11-23 13:47:55 +00:00
Antonio Borneo c5babec794 target: x86_32: make x86_32_common_read_io() static
The function is not referenced outside the file.
Make it static.

Change-Id: Ic2552c040b6b46c0334851a4fc0fdaa400e11e4c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8548
Tested-by: jenkins
2024-11-23 13:47:33 +00:00
Antonio Borneo f3aeb3d676 target: dsp563xx: make dsp563xx_once_reg_read_ex() static
The function is not referenced outside the file.
Make it static.

Change-Id: Ifeccc5e38f3da4b4111422860bc1c1447d00f7fe
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8547
Tested-by: jenkins
2024-11-23 13:47:15 +00:00
Antonio Borneo a34d4b8cb4 pld: make get_pld_device_by_num() static
The function is not referenced outside the file.
Make it static.

Change-Id: I5f2a2c70085b9158df8806432bb9ed09bb256ab5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8546
Tested-by: jenkins
2024-11-23 13:46:59 +00:00
Antonio Borneo 4da8f6d27a rtt: drop unused function rtt_started()
The function is not used.
Drop it!

Change-Id: I176c9d6ba077e36b762c14f9b877d5152992763c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8545
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
2024-11-23 13:46:35 +00:00
Antonio Borneo 644742b4b2 driver: mpsse: make local functions static
The functions:
- mpsse_divide_by_5_config();
- mpsse_purge();
- mpsse_rtck_config();
- mpsse_set_divisor();
are not referenced outside the file.

Make them static.

Change-Id: Id6930183a3ce26693b2113f622046168ba289df8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8544
Tested-by: jenkins
2024-11-23 13:46:20 +00:00
Antonio Borneo f4ac0c7022 jtag: driver: make local functions static
The functions:
- interface_jtag_add_callback();
- interface_jtag_add_callback4();
are not referenced outside the file.

Make them static.

Change-Id: I84f738309d23c8d0b5329aa04436db750cf185e5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8543
Tested-by: jenkins
2024-11-23 13:46:01 +00:00
Antonio Borneo f82664ff82 jtag: core: make local functions static
The functions:
- jtag_error_clear();
- jtag_tap_count();
are not referenced outside the file.

Make them static.

Change-Id: I00fcf06b1838b9f6c955c19772f1d41d486459e9
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8542
Tested-by: jenkins
2024-11-23 13:45:42 +00:00
Antonio Borneo 2465f18515 adapter: make adapter_config_khz() static
The function is not referenced outside the file.
Make it static.

Change-Id: I72e96624749ae4cc7f4566d737a88186e899616a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8541
Tested-by: jenkins
2024-11-23 13:45:19 +00:00
Antonio Borneo 989e9e8b54 gitignore: drop ignoring files not generated anymore
With the drop of the code for the probe zy1000 [1] and then the
drop of minidriver code [2], there are no more auto-generated
source files.

Remove them from the list of generated files to be ignored.

Change-Id: Iee65e21528674ea4cc94018e52126f882da4f07c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
[1] b0fe92dba7 ("zy1000: drop the code, deprecated in v0.10.0")
[2] 25218e8935 ("jtag: remove minidriver code and minidriver-dummy")
Reviewed-on: https://review.openocd.org/c/openocd/+/8522
Tested-by: jenkins
2024-11-23 13:41:02 +00:00
Antonio Borneo 8a37230226 checkpatch: exclude gerrit's Change-Id line from commit description
Checkpatch rejects patches that have empty commit description and
logs them with:
	WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
But if the patch has a gerrit's Change-Id line placed before the
line Signed-off-by, then checkpatch considers the Change-Id line
as a valid commit description text.

Use the Change-Id tag as a marker of the end of the commit message,
thus not counting its line as part of the commit description.

This patch is not relevant for the Linux kernel development process
as gerrit is not involved and the Change-Id tag is rejected. But
other projects, like OpenOCD, base the development on gerrit and
reuse kernel's checkpatch with flag '--ignore GERRIT_CHANGE_ID'.

This patch has been refused [1] in Linux upstream because it has
not been considered relevant for that project.
Let's take it as another add-on in OpenOCD checkpatch.

Change-Id: I3b55b8fffa07ce67177c108e7c9554ca46674246
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Link: [1] https://lore.kernel.org/lkml/20230410100255.16755-1-borneo.antonio@gmail.com/
Reviewed-on: https://review.openocd.org/c/openocd/+/8539
Tested-by: jenkins
2024-11-16 14:25:35 +00:00
R. Diez 6d60ac5c08 Make bootstrap more robust
Change-Id: I67cc22752b34dd49c277e247f0b648047927a02b
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8532
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-16 14:20:48 +00:00
R. Diez 564b24e7f8 Makefile.am: generate ChangeLog with git log instead of git2cl
git log is faster than git2cl and the result has a better format.

Change-Id: I465ca62e3e30fed230fe9661e82a987980c05459
Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8531
Tested-by: jenkins
Reviewed-by: R. Diez <rdiez-2006@rd10.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-16 14:20:06 +00:00
Jan Matyas d4a64e3f38 autoconf: Add support for code coverage
Add support for code coverage collection. This helps
developers to check if their test scenarios really exercised
all the OpenOCD functionality that they intended to test.

- Option --enable-gcov has been added to configure.ac
  which enables the coverage collection using Gcov. (Disabled
  by default.)

- The steps to collect and inspect the coverage have been
  described in HACKING file.

Change-Id: I259e401937a255e7ad7f155359a0b7787e4d0752
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8521
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-16 14:18:57 +00:00
Evgeniy Naydanov fd62626dff target/breakpoints: fix types in `watchpoint_add_internal()`
There was a conflict:
1. commit 2cd8ebf44d ("breakpoints: use 64-bit type for watchpoint mask
   and value")
2. commit 0bf3373e80 ("target/breakpoints: Use 'unsigned int' for
   length")

The second commit was created erlier, but merged later so the types of
`mask` and `value` became `uint32_t` in `watchpoint_add_internal()`.

This created a bug:
`WATCHPOINT_IGNORE_DATA_VALUE_MASK` is defined as `(~(uint64_t)0)`.
Truncation to uint32_t makes it so the comparisons with the constant
don't work.

Change-Id: I19c414c351f52aff72a60330d83c29db7bbca375
Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8500
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Karl Palsson <karlp@tweak.au>
2024-11-11 17:33:56 +00:00
Marek Kraus b68d23da3c tcl/target/bl702: implement full software reset
In previous implementation, it was known that it does not perform
full reset, and that some peripherals, such as GLB core,
which handles among other stuff GPIOs, was not reset.

It was presumed, that full reset by software is not possible,
although, by accident, even when comment says that
CTRL_PWRON_RESET is set to 1, it is not
(value written into 0x40000018 supposed to be 0x7, not 0x6).

CTRL_PWRON_RESET indeed triggers full "power-on like" reset,
so this method is implemented in this commit.
There are some workarounds to make reset seamless, without any
error messages, which are described in comments of TCL script.

Only down-side of this reset is, that chip is halted after reset
bit later in BootROM than previous implementation,
but it's still good.

Change-Id: Ife2cdcc6a2d96a2e24039bfec149705baf046318
Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8529
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-11-09 21:06:05 +00:00
Mark Zhuang bcebc84882 contrib: convert 'unsigned' to 'unsigned int'
Conversion done with
        checkpatch --fix-inplace -types UNSPECIFIED_INT

Change-Id: I0e31f87d437fcf3503736474f10a63f9c6be242b
Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8368
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
2024-11-09 21:05:18 +00:00