aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-11-18Merge pull request #1165 from aap-sc/aap-sc/resume_debug_errorsEvgeniy Naydanov1-5/+17
target/riscv: detailed error messages for cases when resume operation fails
2024-11-18Merge pull request #1157 from zqb-all/support-disable-auto-fenceEvgeniy Naydanov4-13/+56
target/riscv: support disable auto fence
2024-11-18Merge pull request #1163 from en-sc/en-sc/from_upstreamEvgeniy Naydanov220-1158/+1427
Merge up to fd62626dff25cf503a25040d3040b0a2bb9b2a76 from upstream
2024-11-16checkpatch: exclude gerrit's Change-Id line from commit descriptionAntonio Borneo1-0/+3
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-16Make bootstrap more robustR. Diez1-10/+18
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-16Makefile.am: generate ChangeLog with git log instead of git2clR. Diez3-9/+5
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-16autoconf: Add support for code coverageJan Matyas5-1/+54
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-14Merge pull request #1161 from en-sc/en-sc/deassert-resetEvgeniy Naydanov1-7/+10
target/riscv: avoid updating `target` if `ackhavereset` fails
2024-11-14target/riscv: detailed error messages for cases when resume operation failsParshintsev Anatoly1-5/+17
This change aims to provide more context in case if resume operation fails. Before the change messages were quite confusing.
2024-11-12Merge pull request #1160 from zqb-all/reduce-logEvgeniy Naydanov1-68/+30
[NFC] target/riscv: remove LOG_ERROR when COMMAND check ARGC fail
2024-11-12Merge up to fd62626dff25cf503a25040d3040b0a2bb9b2a76 from upstreamEvgeniy Naydanov220-1158/+1427
Conflicts are related to `unsigned`->`unisgned int` cleanup: * `src/jtag/drivers/ftdi.c` -- between 6749c70a3ae891552296888986e6eeae1e17f11a and a64dc23bf19fb4a7626fbda3c02693523ab5a75b. * `src/rtos/hwthread.c` -- between ef3e61bebc53f619f42bb06cfd194cd547cceb69 and 436e6f1770e4da6ec5b52724cfb637e8916b535a. * `src/target/target.c` and `.h` -- between 53ec10b61da5de553c01f92bddf80c076bd49331 and e72733d59025b5d595bf955b227e95e5db7305c7. * `src/target/riscv/*` -- due to 957eb741a0980408fe4d0682fccb99a183f90998 and fec3b224214e3784b0c00970d2421212402da880. Resolved by: * Changing the return type of `riscv_batch_get_dmi_read_op()` to `uint32_t`. * Using RISC-V OpenOCD's version in other cases. Change-Id: Ia6e2129c6fddb1dec26adcd936506af2539412ef
2024-11-11target/breakpoints: fix types in `watchpoint_add_internal()`Evgeniy Naydanov1-1/+1
There was a conflict: 1. commit 2cd8ebf44d1a ("breakpoints: use 64-bit type for watchpoint mask and value") 2. commit 0bf3373e808a ("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-11target/riscv:Perform single step before resume if necessaryzhusonghe2-12/+115
Two cases where single step is needed before resume: 1. ebreak used in software breakpoint; 2. a trigger that is taken just before the instruction that triggered it is retired. Signed-off-by: Songhe Zhu <zhusonghe@eswincomputing.com> Co-developed-by: Fei Gao <gaofei@eswincomputing.com> Co-developed-by: xiatianyi <xiatianyi@eswincomputing.com>
2024-11-09tcl/target/bl702: implement full software resetMarek Kraus1-1/+14
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-09contrib: convert 'unsigned' to 'unsigned int'Mark Zhuang2-22/+22
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-08target/riscv: avoid updating `target` if `ackhavereset` failsEvgeniy Naydanov1-7/+10
`target`'s `state` and `debug_reason` should not be updated in `deassert_reset` if sending reset acknowledgment fails. Change-Id: I86136fe829e7a7c6b69f718f0cf32322e40341b0 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-11-06[NFC] target/riscv: remove LOG_ERROR when COMMAND check ARGC failMark Zhuang1-68/+30
Per current OpenOCD conventions, LOG_ERROR should not be printed when ERROR_COMMAND_SYNTAX_ERROR is returned. OpenOCD will print the command syntax to the user on its own.
2024-11-06target/riscv: support disable auto fenceMark Zhuang4-13/+56
Support disable automatic fence, it's useful for debug some cache related issue.
2024-11-02tcl/target/renesas_rz_g2: Rename to renesas_rz and add RZ/V2L-G3SMicBiso1-20/+58
Rename file to get it more generic and add more targets belonging to the same family. Add support for two new devices: RZ/V2L and RZ/G3S Change-Id: Idb7f4d81d2f95ad15ef686e940f43ed29f49f343 Signed-off-by: MicBiso <michele.bisogno.ct@renesas.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8211 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-11-02adapter/parport: Coding style changesMarc Schink1-60/+70
Apply some coding style changes according to the C style guide. The patch is tested for regression with the 'wiggler' parallel port cable. Change-Id: I43774f596831d8c46f90f18893418178041a930b Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8516 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-11-02adapter/bitbang: Use 'bool' data type for blink()Marc Schink8-17/+17
Change-Id: I187f8944ad5fd92f28cbd32e447f9ec1a97e16d6 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8515 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-11-02tcl/interface: Restructure parport config filesMarc Schink4-22/+42
Provide cable specific configuration files like for the FTDI interface. Depcrecate the old configuration files but keep them until the next release for compatibility reasons. Change-Id: I436bd60779a107120c9e1b1f0b8a69a39a240ad4 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8514 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-11-02jtag: convert 'unsigned' to 'unsigned int'Mark Zhuang1-2/+2
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Change-Id: I2c2d56aa98e89bcc6088a1bd51d70066d67d6dad Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8367 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-02flash: convert 'unsigned' to 'unsigned int'Mark Zhuang2-9/+9
Change-Id: I8e8da78385eed714524891b580e19a79cfb459d3 Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8370 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-02server: convert 'unsigned' to 'unsigned int'Mark Zhuang2-7/+7
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Ignore the cast as they could be better addressed. Change-Id: Ib0cbd9388d61659f8d47c8f57c09baa6df123487 Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8369 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-02target: riscv: convert 'unsigned' to 'unsigned int'Mark Zhuang1-2/+1
Change-Id: I10b9abf9e42389eb91b210b8c2f01219ca9068cd Signed-off-by: Mark Zhuang <mark.zhuang@spacemit.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8366 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-11-02stlink: deprecate HLA supportAntonio Borneo55-92/+94
The STLink API that supports dap-direct is available from STLink firmware v2j24, published in early 2015. We can reasonably expect that any old STLink still in use today has got at least one firmware update during the last 10 years. Most of the board files in upstream OpenOCD still use the STLink in HLA mode. This limits the test coverage of the dap-direct code, which was introduced in OpenOCD v0.11.0. - Rename interface/stlink.cfg as interface/stlink-hla.cfg to still provide support for HLA, adding a deprecated message. - Rename interface/stlink-dap.cfg as interface/stlink.cfg to make dap-direct the default trasport. - Add a redirect file interface/stlink-dap.cfg for users that have out-of-tree custom board files. - Update all the board files to the new setup. - Remove STLink HLA mentions from the documentation, while adding a reference to interface/stlink-hla.cfg Checkpatch-ignore: LONG_LINE Change-Id: I99366bb03cd3b83f8f408514e657f30e59813063 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8523 Tested-by: jenkins Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
2024-11-02target: cortex_m: fix polling for target kept under resetAntonio Borneo1-0/+12
In multi-target SoC not all the targets are running simultaneously and some target could be powered off or kept under reset. Commit 4892e32294c6 ("target/cortex_m: allow poll quickly get out of TARGET_RESET state") does not considers the case of a target that is kept in reset and expects the target to change state from TARGET_RESET immediately. This causes OpenOCD to log continuously: Info : [stm32mp15x.cm4] external reset detected Info : [stm32mp15x.cm4] external reset detected Info : [stm32mp15x.cm4] external reset detected Read again dhcsr to detect the 'stable' reset status and quit, waiting for next poll to re-check the target's status. Change-Id: Ic66029b988404a1599bb99bc66d4a8845b8b02c6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 4892e32294c6 ("target/cortex_m: allow poll quickly get out of TARGET_RESET state") Reviewed-on: https://review.openocd.org/c/openocd/+/8399 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2024-11-02configure: show adapter Xilinx XVC/PCIe in the configuration summaryR. Diez1-25/+19
Adapter Xilinx XVC/PCIe was not appearing in the configuration summary because of the wrong variable name: build_xlnx_pcie_xvc instead of enable_xlnx_pcie_xvc. Also build this adapter automatically on Linux. Change-Id: I69ea92f550052b9ce55ce32597ac446a15a87388 Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8312 Tested-by: jenkins Reviewed-by: R. Diez <rdiez-2006@rd10.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-10-30Merge pull request #1154 from en-sc/en-sc/dcsr-ebreak-halt-on-resetEvgeniy Naydanov1-1/+7
target/riscv: avoid unnecessary `dcsr.ebreak*` update on reset
2024-10-30Merge pull request #1156 from zqb-all/max-macroEvgeniy Naydanov2-2/+2
[NFC] target/riscv: simplify code with MAX macros
2024-10-28[NFC] target/riscv: simplify code with MAX macrosMark Zhuang2-2/+2
slightly improves readability
2024-10-28Merge pull request #1149 from zqb-all/read-write-cross-pageEvgeniy Naydanov2-28/+78
riscv: fix read/write virtual memory across page boundaries
2024-10-25target/riscv: avoid unnecessary `dcsr.ebreak*` update on resetEvgeniy Naydanov1-1/+7
There is no need to change if `dcsr.ebreak*` fields after a reset if a user requested a configuration that will result `dcsr.ebreak*` field values equal to reset values. Change-Id: I2844d30aef8f735c7b37394ee422e9b3f04a2e3b Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-10-24[NFC] target/riscv: refactor riscv_read_memory,riscv_write_memoryMark Zhuang1-52/+35
Reduce duplicate code
2024-10-24target/riscv: fix cross-page misaligned access when mmu not enabledMark Zhuang1-13/+24
When mmu is disabled, simply call the physical read/write function
2024-10-24target/riscv: fix read/write virtual memory across page boundariesMark Zhuang2-12/+68
When read/write virtual addresses cross page boundaries, the physical addresses are not necessarily contiguous and need to call virt2phys again.
2024-10-24Merge pull request #1152 from fk-sc/translation-driversEvgeniy Naydanov6-62/+162
target/riscv: added translation drivers
2024-10-23target/riscv: added translation driversFarid Khaydari6-62/+162
Existing flags: 'enable_virtual' and 'enable_virt2phys' were replaced with explicit translation drivers. Motivation: (1) Having 'enable_virtual' and 'enable_virt2phys' flags set simultaneously may cause double address translation which is unacceptable (2) Flags were global for all targets which is wrong too Signed-off-by: Farid Khaydari <f.khaydari@syntacore.com>
2024-10-20gdb_server: Improve const correctnessJan Matyas4-8/+8
On several packet-handling functions, add "const" to arguments that represent read-only packet buffers. For instance on GCC 13.2.0, this code: const char *some_packet = "..."; gdb_put_packet(conn, some_packet, strlen(some_packet)); would prior to the fix produce warning: passing argument 2 of ‘gdb_put_packet’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Change-Id: Idb62f57d37ed323c39de38982e57afdd3882e280 Signed-off-by: Jan Matyas <jan.matyas@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8517 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-10-20gitignore: Start ignoring ".vscode"Jan Matyas1-0/+3
To help the developers who use Visual Studio Code IDE, ignore the ".vscode" folder in Git. This folder contains local configuration of the VSCode workspace. Change-Id: I1d54d8ce2bd0680f2fa1fb773bb33c786bdcc608 Signed-off-by: Jan Matyas <jan.matyas@codasip.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8518 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2024-10-20arm_adi_v5: Added Cortex-A55 debug unit identifierFlorian Fainelli1-0/+1
Add identifier of the Cortex-A55 debug unit. Change-Id: I67336094a5153a3187cccc32c0e38d78ae4af542 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8430 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-10-20target: riscv: remove non-trivial 'unsigned' castAntonio Borneo3-4/+4
Change the prototype of riscv_batch_get_dmi_read_op(). Now that 'target->smp' is unsigned, drop the cast. Change-Id: I2a54268ed1e4bf0ea884b62cceb73f5c7451da78 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8484 Tested-by: jenkins
2024-10-20target: riscv: convert 'unsigned' to 'unsigned int'Antonio Borneo8-121/+121
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Ignore the cast as they could be better addressed. Fix only minor additional checkpatch issue (spacing and line length). Change-Id: I11f10eddadc21e051c96eb3d4d4c0554a2cddd15 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8483 Tested-by: jenkins
2024-10-20checkpatch: check SPDX in MakefileAntonio Borneo1-1/+1
The firmware in contrib folder use Makefile for the build. Force checkpatch to check these Makefile for the SPDX. Change-Id: I815bf6df636c96a15f82c3d8a9de0c4f219303d2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8520 Tested-by: jenkins
2024-10-18Merge pull request #1146 from en-sc/en-sc/select-dmi-bypassEvgeniy Naydanov2-4/+26
target/riscv: check other TAPs in `select_dmi()`
2024-10-17Merge pull request #1150 from borneoa/riscvEvgeniy Naydanov6-58/+58
target: riscv: convert 'unsigned' to 'unsigned int'
2024-10-16target/riscv: check other TAPs in `select_dmi()`Evgeniy Naydanov2-4/+26
If some other TAP is not in BYPASS, an IR scan is needed to select BYPASS on that TAP. Change-Id: Iae425a415109b1a853db3718762661877eea56e8 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-10-12target: riscv: convert 'unsigned' to 'unsigned int'Antonio Borneo6-58/+58
Conversion done with checkpatch --fix-inplace -types UNSPECIFIED_INT Change-Id: I62fad88dd33716c24154d44c5a23ae2c0f7c4a4c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-10-08Merge pull request #1142 from en-sc/en-sc/from_upstreamEvgeniy Naydanov15-158/+233
Merge up to 1173473f662bbdf6d1499654568256257eee6cdd from upstream