aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-02-17target/riscv: merged read/write functions to one access functionFarid Khaydari4-178/+111
Commit merges read/write functions to access function. It allows to decrease amount of code duplication. Signed-off-by: Farid Khaydari <f.khaydari@syntacore.com>
2025-02-17Merge up to 1f3f635693a1ddc85f362dc324cb49c3e7b75f27 from upstreamEvgeniy Naydanov97-445/+3014
Conflict in `src/rtos/hwthread.c` between commit 57dbcb1d02c9a603364d40aebdc5d9bc8c2be2d7 ("Improve a couple of user/debug messages. (#763)") and commit 7f2db80ebc168d74a56dc8b76be5355ee4878be6 ("rtos/hwthread: Use LOG_TARGET_xxx()"). Resolved by using `LOG_TARGET_xxx()` without changing the message. Change-Id: I1c1ab321b54f2ef8267f0dca63e16ca8ed6b4655 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-02-17Merge pull request #1218 from fk-sc/fk-sc/ref-mem-acc-resEvgeniy Naydanov1-38/+35
target/riscv: refactored memory access result codes
2025-02-17Merge pull request #1209 from en-sc/en-sc/riscv-info-mtopxEvgeniy Naydanov4-47/+24
target/riscv: drop `mtopi_readable/mtopei_readable` `riscv_info` fields
2025-02-17Merge pull request #1208 from en-sc/en-sc/pass-tapEvgeniy Naydanov5-45/+47
target/riscv: pass `jtag_tap` instead of `target`
2025-02-16build: drop space after 'angie' folder nameAntonio Borneo1-1/+1
The makefile consider the two white spaces between the end of the folder name and the '#' character for the beginning of the comment as part of the folder name. This cause 'make install' to create a folder named 'angie ' that is not welcome on all the OS. Drop the comment and the space after the folder name. Reported-by: Liviu Ionescu <ilg@livius.net> Change-Id: Iadd6803431edb83d0d84f4e4dc6d36b454f912ac Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 0ed03df6e95b ("amend angie build definitions to fix make dist") Reviewed-on: https://review.openocd.org/c/openocd/+/8740 Reviewed-by: Liviu Ionescu Tested-by: jenkins Reviewed-by: Adrien Charruel <acharruel@nanoxplore.com>
2025-02-16jtag/core: fix segfault when adapter driver has no reset methodTomas Vanek1-0/+7
xlnx-pcie-xvc and linuxspidev adapter drivers does not implement the reset method. Although it is likely both adapters will implement the method in the near future, avoid segfault and return an error instead. Change-Id: If8ddf165dbc563cf6d64b2094968151075778ba7 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Fixes: commit 8850eb8f2c51 ("swd: get rid of jtag queue to assert/deassert srst") Reviewed-on: https://review.openocd.org/c/openocd/+/8735 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-02-16target/cortex_m: call adapter_deassert_reset() only if srst is configuredTomas Vanek1-2/+4
Deasserting is useless if reset was not asserted except the very corner case: changed reset_config during reset processing. Change-Id: I1d1ea142980d67293daa348a2869b68ffd78d0eb Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/8734 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-02-16Makefile.am: DISTCHECK_CONFIGURE_FLAGS -> AM_DISTCHECK_CONFIGURE_FLAGSR. Diez1-1/+1
The Automake manual states: "The user can still extend or override the flags provided there by defining the DISTCHECK_CONFIGURE_FLAGS variable". Overriding variable DISTCHECK_CONFIGURE_FLAGS in Makefile.am makes it impossible for the user to do that. I discovered this when trying to pass --enable-internal-jimtcl to distcheck. Change-Id: Ibe5b1f23ccf3fbaa21c48b574a1b3f3e9f6fb916 Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8724 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-02-16configure.ac: show vdebug in the config summaryR. Diez1-11/+5
Also enable this adapter by default (auto). Change-Id: Id011168b93c4cdc602ab78eabfb9a64ca8d8a7df Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8601 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2025-02-16options.c: option --help should yield exit code 0R. Diez1-1/+1
--help is supported and there is no reason to signal failure Change-Id: I59fda5336df47ec0b8172541a5fbfe60014bba7e Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8723 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-02-16README: report dependency from libjimAntonio Borneo1-3/+1
The support for jimtcl submodule is deprecated. Report libjim as a dependency for building OpenOCD. Change-Id: Iaaeb03dc810451c0d72add281016c81b8cbf7059 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8722 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16target/arc: allow reading memory while target runsDaniel DeGrasse1-10/+0
There is no reason that ARC can't support reading from memory over JTAG while the target is executing, and this is in fact required for RTT support. Remove this check from arc_mem_read and arc_mem_write Change-Id: I2accfb4b99bf77c5473d133623e0eb0632cb45f6 Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8721 Tested-by: jenkins Reviewed-by: Evgeniy Didin <didin@synopsys.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-02-16target/arc: add RTT commandsChris Friedt2-0/+4
Since RTT is architecture agnostic, add support for using it on the ARC architecture as well. Change-Id: Icd0dec105177a1a224bfb1a63f0be5f03561b166 Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8720 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2025-02-16checkpatch: enable check for new typedefsAntonio Borneo1-1/+0
We should strictly check for every new typedef. Let checkpatch detect them and let developer use Checkpatch-ignore: NEW_TYPEDEFS if it's really needed to add a new typedef. With this change chackpatch will not complain for typedef on function's type but only on enum, struct, variable's type. Change-Id: I644a753e97de877d892af3a0219716f022fb1c59 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8710 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16jtag: drop useless typedef tap_state_tAntonio Borneo46-232/+232
No need to use a typedef for an enum. Drop it. Change-Id: I9eb2dc4f926671c5bb44e61453d92880e3036848 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8709 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-16jtag: openjtag: drop useless typedef openjtag_tap_state_tAntonio Borneo1-2/+2
No need to use a typedef for an enum. Drop it. Change-Id: I31531b80eaf7f3d0ee6cd22844e60a05c6b748dc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8708 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16jtag: bitbang: drop useless typedef bb_value_tAntonio Borneo11-18/+18
No need to use a typedef for an enum. Drop it. Change-Id: I8800c95f97d2bafe27c699d7d451fb9b54286d99 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8707 Tested-by: jenkins
2025-02-16jtag: remote_bitbang: drop useless typedef flush_bool_tAntonio Borneo1-3/+3
No need to use a typedef for an enum. Drop it. Change-Id: I122784ddd7b81ccd86da258b08526685c3d70033 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8706 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-16target_request: drop useless typedef target_req_cmd_tAntonio Borneo2-3/+3
No need to use a typedef for an enum. Drop it. Change-Id: Ib5a872b52a6f3d7379d2662e4ff84f32c2bd2ef8 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8705 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16target: trace: drop useless typedef trace_status_tAntonio Borneo5-8/+8
No need to use a typedef for an enum. Drop it. Change-Id: I31e0e3869c7277bcb14e05cfcac82c9655963ae6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8704 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-16target: etm: drop useless typedefsAntonio Borneo1-4/+4
No need to use a typedef for an enum. Drop etmv1_pipestat_t and etmv1_branch_reason_t. Change-Id: I03ae4de3efe699d9635fc4f162649f6bedcef4c0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8703 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16nor: lpc2000: drop useless typedef lpc2000_variantAntonio Borneo1-3/+3
No need to use a typedef for an enum. Drop it. Change-Id: Iec690ebf6704f346d010cad1e6c65496f7bcc218 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8702 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-16target: esp_algorithm: drop useless typedefsAntonio Borneo1-65/+60
There is no need to use extra typedef for the functions in struct esp_algorithm_run_data. Declare the type of the functions in the struct. Split the comment lines to stay in the line limits. Change-Id: I0afa6242e57133f8bf1b13ba541abd6b067350b0 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8701 Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Tested-by: jenkins
2025-02-16drivers: rshim: drop useless typedefAntonio Borneo1-6/+6
Use 'struct name' instead of typedef. Change-Id: Ifff56811f53a260c314c8f5473d368599e0912e6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8700 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-16openocd: drop useless typedefAntonio Borneo1-19/+18
There is no need to use typedef for the array of functions. Drop it. While there, move the declaration outside the function and use the array size to drop the error-prone sentinel to NULL. Change-Id: I424964a6ef82ed1a7b27e78fbd19aa9f985b52c7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8699 Reviewed-by: zapb <dev@zapb.de> Tested-by: jenkins
2025-02-16rtt: drop useless typedefsAntonio Borneo1-17/+9
There is no need to use extra typedef for the rtt functions. Declare the type of the functions in the struct. Change-Id: Idf2fee6e63ec3b3add38d042bbebe8d74613627c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8698 Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de>
2025-02-14CI: Run the "snapshot" action only on the main branchJan Matyas1-1/+4
Make sure that the "snapshot" action only runs when pushing changes to the main branch - "riscv". No need to run it for individual commits under side-branches. Change-Id: I5877a3b5635fc6053af7718e38a4d5a093e02744 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2025-02-12github/workflow: build jimtcl from sourcesSamuel Obuch2-3/+27
JimTCL submodule was deprecated, this patch modifies the GitHub snapshot action to build from sources instead. Change-Id: Ie9ab20dbfd70506992d11a91489e82a9fa6e13ce Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8751 Reviewed-by: Marc Schink <dev@zapb.de> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
2025-02-11driver/linuxspidev: Clear queue on allocationRichard Pasek1-7/+15
SWD idle clocks are added to the queue by advancing the queue index assuming the queue is zeroed. If the queue isn't zeroed, these idle clocks end up being filled with junk data. Lets clear the queue and associated buffers on queue allocation. TEST: Connects successfully and ran the following TCL command: dump_image /dev/null 0x20000000 0x42000 Host: Unnamed Qualcomm SoC with QUPv3 based SPI port Target: RT500 Signed-off-by: Richard Pasek <rpasek@google.com> Change-Id: Ie660c10c27c4d0937ab0629138935ddbf5aeb0ae Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8730 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Jonathon Reinhart <jrreinhart@google.com> Tested-by: jenkins
2025-02-11drivers/linuxspidev: fix use of uninitialized speed variableTomas Vanek1-12/+0
Valgrind reported == Syscall param ioctl(generic) points to uninitialised byte(s) == at 0x4ABF990: ioctl (ioctl.S:26) == by 0x19D00B: spidev_speed (linuxspidev.c:181) == by 0x19D00B: spidev_init (linuxspidev.c:307) Indeed, spidev_init() uses adapter_get_speed(), it calls adapter_khz_to_speed() and it returns early without setting the output parameter if adapter is not initialized. Of course the adapter initialized flag is not set until spidev_init() returns. Simply drop this code as the adapter infrastructure initializes adapter speed just after spidev_init() return. Change-Id: I26f011ae59fc942a34d9bb517f467c22f735091d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8733 Tested-by: jenkins Reviewed-by: Richard Pasek <rpasek@google.com>
2025-02-11drivers/linuxspidev: fix minor memory leakTomas Vanek1-0/+4
free() strduped spi_path on quit. Found by valgrind. Change-Id: Iaa59c7258c920b5e60d615df790dfe815831b925 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Fixes: 83e0293f7ba3 ("Add Linux SPI device SWD adapter support") Reviewed-on: https://review.openocd.org/c/openocd/+/8732 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Richard Pasek <rpasek@google.com>
2025-02-11rtos/hwthread: Use LOG_TARGET_xxx()Marc Schink1-13/+16
Use LOG_TARGET_xxx() to indicate which target the message belongs to. While at it, fix some coding style issues. Change-Id: Iac0296498557a689468a4a19d0bc64f03178a0d0 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/8727 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2025-02-07target/riscv: drop `mtopi_readable/mtopei_readable` `riscv_info` fieldsEvgeniy Naydanov4-47/+24
These fields duplicate the info in the corresponding register cache entries. Change-Id: Ic0d264e78c527e92bb069258ce39b614d8f5bcde Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-02-07target/riscv: pass `jtag_tap` instead of `target`Evgeniy Naydanov5-45/+47
For some functions, passing `target` is excessive. The corresponding `tap` provides all the necessary data. Change-Id: Ie5836024a15222bda7c2b727f5dbaac38f459b3c Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-02-03target/riscv: refactored memory access result codesFarid Khaydari1-38/+35
Slightly refactored memory access result codes: * Changed enum formatting * Changed status handlers to decrease boilerplate Checkpatch-ignore: MACRO_ARG_PRECEDENCE, MULTISTATEMENT_MACRO_USE_DO_WHILE Checkpatch-ignore: TRAILING_SEMICOLON Signed-off-by: Farid Khaydari <f.khaydari@syntacore.com>
2025-01-31Merge pull request #1217 from sobuch/not_cachable_mcause_mstatusEvgeniy Naydanov1-2/+0
target/riscv: dont set mcause and mstatus as cachable
2025-01-31Merge pull request #1207 from en-sc/en-sc/fix-011-init-regsEvgeniy Naydanov1-11/+38
target/riscv: set VLENB/MTOPI/MTOPEI existence on 0.11 targets
2025-01-31Merge pull request #1215 from en-sc/en-sc/from_upstreamEvgeniy Naydanov33-178/+980
Merge up to a510d51a78f14fbb8416037a587ce1bfc6016d24 from upstream
2025-01-31flash/nor: add DesignWare SPI controller driverSergey Matsievskiy14-0/+2560
Driver for DesignWare SPI controller, found on many SoCs (see compatible list in Linux device tree bindings Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml). This implementation only supports MIPS as it was the only one available for the tests, however, adding support for other architectures should require only few adjustments. Driver relies on flash/nor/spi.h to find Flash chip info. Driver internal functions support 24bit addressing mode, but due to limitations of flash/nor/spi.h, it is not used. The reported writing speed is about 60kb/s. Lint, sanitizer and valgrind reported warnings were not related to the driver. Change-Id: Id3df5626ab88055f034f74f274823051dedefeb1 Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8400 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-01-31rtos: chibios: replace malloc+sprintf with alloc_printfPaul Fertser1-3/+5
This makes it safer and simpler at the same time. Signed-off-by: Paul Fertser <fercerpav@gmail.com> Change-Id: Ie294f1f6033ffc9f46b39210e2f7fc2f648e80ac Reviewed-on: https://review.openocd.org/c/openocd/+/8598 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2025-01-29Merge pull request #1190 from lz-bro/enable-hardware-translationEvgeniy Naydanov1-95/+64
target/riscv: move the dcsr modification out of program buffer
2025-01-29Merge pull request #1192 from cetygamer/patch-1Evgeniy Naydanov1-0/+3
Makefile.am: fixed missing includes for make dist targets
2025-01-28Merge up to a510d51a78f14fbb8416037a587ce1bfc6016d24 from upstreamEvgeniy Naydanov33-178/+980
Changed `.github/workflows` due to internall `jimtcl` deprecation. Change-Id: I628922a843a7116955cd6b48c48b0cd104bcaf20 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2025-01-27target/riscv: dont set mcause and mstatus as cachableSamuel Obuch1-2/+0
With CLIC extension (smclic), mcause and mstatus CSRs share mirrored fields for mpp and mpie. Therefore, neither can be assumed cachable. Signed-off-by: Samuel Obuch <samuel.obuch@espressif.com>
2025-01-27Merge pull request #1206 from JanMatCodasip/jm-codasip/remove-asm-hEvgeniy Naydanov5-44/+26
Remove target/riscv/asm.h
2025-01-27Merge pull request #1202 from JanMatCodasip/fix-datatypes-around-batchEvgeniy Naydanov5-64/+124
Fix data types around batch.{c,h}
2025-01-27Merge pull request #1200 from ↵Evgeniy Naydanov1-7/+19
JanMatCodasip/jm-codasip/semihosting-3-warn-if-encountered-but-disabled RISC-V Semihosting 3 of 3: Warn if encountered but disabled
2025-01-27Merge pull request #1193 from en-sc/en-sc/not-busyEvgeniy Naydanov1-0/+9
target/riscv: clear `abstract_cmd_maybe_busy` after commands
2025-01-27Merge pull request #1210 from en-sc/en-sc/from_upstreamEvgeniy Naydanov53-422/+679
Merge up to 26f2df80c3f9ac54fc488ed26f6320904881c0d4 from upstream