aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
20 hoursMerge pull request #1130 from en-sc/en-sc/fix-reg-hide-warningHEADlatestriscvEvgeniy Naydanov1-2/+2
Revert "target/riscv: re-apply patch do stop avoid warnings when a no… …n-existent CSR is hidden"
8 daystarget/riscv: do not emit warnings when a non-existent CSR is hiddenParshintsev Anatoly1-1/+1
hide_csrs should not emit warnings on an attempt to hide non-exitents CSR. hide_csrs funcitonality is intended to be used for scenarios when we don`t want certain groups of registers to be available in GDB. Typically this is needed to simplify integration with various IDE. In such scenarious it may be impractical/unfeseable to figure out which register is present on a target. So reporting a situation when a user wants to hide a non-existent register creates way too much noise. This commit reduces severity of relevant debug message to LOG_TARGET_DEBUG Change-Id: Icbb982c4bcce7586fe35b6b004d0874d6014d5a7
8 daysRevert "target/riscv: re-apply patch do stop avoid warnings when a ↵Evgeniy Naydanov1-1/+1
non-existent CSR is hidden" This reverts commit e56dc61697e91cf7273476ec3126078692a5e387. The reverted commit claims to be the same as b201a5db23c0db34c0e10fd1c7c08fc73a5ec3fc, but it's not -- it changes the warning in `riscv_reg_impl_expose_csrs()` instead of the one in `riscv_reg_impl_hide_csrs()`.
8 daysMerge pull request #1129 from rtwfroody/callocEvgeniy Naydanov1-2/+2
target/riscv: Fix calloc calls.
8 daysMerge pull request #1091 from en-sc/en-sc/no-extra-irEvgeniy Naydanov1-0/+3
target/riscv: avoid unnecessary IR scans
12 daystarget/riscv: Fix calloc calls.Tim Newsome1-2/+2
This was pointed out by gcc. Presumably it's a newer warning. I doubt it has any effect on anything.
12 daystarget/riscv: avoid unnecessary IR scansEvgeniy Naydanov1-0/+3
Change-Id: I03feb5c7d72d5aa38f2cc13c4ed30175cffde84a Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
12 daysMerge pull request #1112 from en-sc/en-sc/misa-xlenEvgeniy Naydanov1-8/+90
target/riscv: check `misa` value before reporting
12 daysMerge pull request #1111 from en-sc/en-sc/ref-reg-manual-hwbpEvgeniy Naydanov4-87/+131
target/riscv: manage triggers available to OpenOCD for internal use
12 daysMerge pull request #1125 from fk-sc/fk-sc/field-duplicationEvgeniy Naydanov5-20/+42
target/riscv: remove duplicate of progbufsize field
13 daystarget/riscv: manage triggers available to OpenOCD for internal useEvgeniy Naydanov4-87/+131
Before the change, if the user wrote to any `tdata*` register, OpenOCD would sometimes start to disable all the triggers (by writing zeroes to `tdata1`) and re-enable them again (by witing all trigger registers to the values read before for each `tselect` value), e.g. on `step` (see `disable/enable_triggers()`). There are a couple of issues with such approach: 1. RISC-V Debug Specification does not require custom register types to support re-enabling by such sequence of writes (e.g. some custom trigger type may require writing a custom CSR to enable it). 2. OpenOCD may still overwrite these triggers when a user asks to set a new WP. This commit introduces `riscv reserve_trigger ...` command to explicitly mark the triggers OpenOCD should not touch. Such approach allows to separate management of custom triggers and offload it onto the user (e.g. disable/enable such triggers by setting up an event handler on `step`-related events). Change-Id: I3339000445185ab221368442a070f412bf44bfab Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
13 daystarget/riscv: check `misa` value before reportingEvgeniy Naydanov1-8/+90
Currently, during register file examination: 1. A read of an XPR is attempted via 64-bit abstract access. 2. If such a read fails (e.g. connection unstable) XLEN is assumed to be 32. 3. Then `misa` is read. Since `misa` is a CSR and it may be only readable via program buffer, `s0` should be readable beforehand (at least some assumption about `xlen` should be made). 4. Before the commit, the `misa.mxl` field was not checked against `xlen`, therefore erroneous info may have been reported to the user. Moreover, the `examine()` would pass indicating no error at all. 5. After the commit, `misa.mxl` is checked against `xlen` value. Change-Id: I3fe5bd6742e564e6de782aad9ed10e65c0728923 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
14 daysMerge pull request #1115 from en-sc/en-sc/fixup-bscanEvgeniy Naydanov3-32/+36
target/riscv: restrict BSCAN-related commands to before-`init`
14 daystarget/riscv: remove duplicate progbufsize fieldFarid Khaydari5-20/+42
* removed `progbuf_size` field from `riscv_info`; added getter * moved `impebreak` field from `riscv_info` to `riscv013_info` as implementation dependent field; added getter Signed-off-by: Farid Khaydari <f.khaydari@syntacore.com>
2024-09-03Merge pull request #1109 from aap-sc/aap-sc/sbus_fixupAnatoly Parshintsev1-4/+7
target/riscv: sys bus v1 fix for sizes greater than 4
2024-08-30Merge pull request #1118 from aap-sc/aap-sc/fixup_hidecsr_warningsAnatoly Parshintsev1-1/+1
target/riscv: re-apply patch do stop avoid warnings when a non-existent CSR is hidden
2024-08-29Merge pull request #1116 from aap-sc/aap-sc/aug_upstream_syncAnatoly Parshintsev105-757/+1362
Merge up to ac63cd00d792331914db0b6edd3f427c30eec3fa from upstream
2024-08-21target/riscv: re-apply patch do stop avoid warnings when a non-existent CSR ↵Parshintsev Anatoly1-1/+1
is hidden the original fix was introduced in b201a5db23 but was lost in 3883b03a
2024-08-20fixed compilation failure due to signed/unsigned comparison warningParshintsev Anatoly1-1/+1
the warning is caused by b3d4c97b in upstream OpenOCD
2024-08-20Merge up to ac63cd00d792331914db0b6edd3f427c30eec3fa from upstreamParshintsev Anatoly105-756/+1361
- src/jtag/drivers/ftdi.c: ``` ++<<<<<<< HEAD + int i; + static const uint8_t zero; ++======= + uint8_t zero = 0; ++>>>>>>> ocd_upstream ``` Decided to choose the latter. - src/target/riscv/riscv-013.c: ``` ++<<<<<<< HEAD + int abs_chain_position; + /* The base address to access this DM on DMI */ + uint32_t base; ++======= + unsigned int abs_chain_position; + ++>>>>>>> ocd_upstream ``` Decided to choose the latter (abs_chain_position is unsigned now) - src/target/riscv/batch.c: ``` ++<<<<<<< HEAD ++======= + void dump_field(int idle, const struct scan_field *field) + { ... + } ++>>>>>>> ocd_upstream ``` dump_field function is not needed anymore Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
2024-08-16Merge pull request #1114 from en-sc/en-sc/dup-dtmcontrolEvgeniy Naydanov4-81/+19
target/riscv: remove duplicate `dtmcontrol_scan()`
2024-08-16Merge pull request #1101 from en-sc/en-sc/ref-reg-examineEvgeniy Naydanov7-122/+239
target/riscv: reg cache entry is initialized before access
2024-08-16tcl/interface/raspberrypi5-gpiod: fix string match pattern escapingTomas Vanek1-2/+1
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-15target/riscv: sys bus v1 fix for sizes greater than 4Parshintsev Anatoly1-4/+7
read_memory_bus_v1 incorrectly copied data to output buffer Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
2024-08-14target/riscv: restrict BSCAN-related commands to before-`init`Evgeniy Naydanov3-32/+36
Logically, BSCAN tunneling is used to establish a connection, therefore it should be set up before the communication starts (i.e. before `init`). Moreover, current implementation does not support changing `bscan_tunnel_ir_width` after `init`. This is evident by RISC-V handler of the `init` itself. Link: https://github.com/riscv-collab/riscv-openocd/blob/9a23c9e67978f77d9166102cefc7b537b714b561/src/target/riscv/riscv.c#L467-L481 Change-Id: I817c6a996f7f7171b2286e181daf1092bd358f69 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-08-14target/riscv: remove duplicate `dtmcontrol_scan()`Evgeniy Naydanov4-81/+19
Also avoid receiving data if the value is discarded on the call-site. Change-Id: Ied87b551536a00d9fad469b9843cccae1976e6b6 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-08-14target/riscv: reg cache entry is initialized before accessEvgeniy Naydanov7-122/+239
* Register file examination is separated. * Allow to access registers through cache as early as possible to re-use general register access interface and propely track state of the register. * Reduces the number of operations: S0 and S1 are saved/restored only when needed (targets without abstract CSR access). Change-Id: I2e205ae4e88733a5c792f8a35cf30325c68d96b2 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
2024-08-08Merge pull request #1104 from TommyMurphyTM1234/fix-include-guardsEvgeniy Naydanov12-26/+35
Align include guards with OpenOCD coding guidelines
2024-08-06server/telnet: Always allow 'exit' commandMarc Schink1-1/+1
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-02transport: Remove echo in transport selectionMarc Schink2-11/+7
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-02target/breakpoints: Fix 'orig_instr' outputMarc Schink1-1/+1
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-02doc: Add 'jlink targetpower' commandMarc Schink1-0/+5
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-02adapter/jlink: Allow to determine the target power stateMarc Schink1-2/+16
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-02adapter/jlink: Use COMMAND_PARSE_* instead of sscanf()Marc Schink1-52/+31
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-02jtag: Use 'unsigned int' data typeMarc Schink6-62/+60
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-02jtag: Use 'unsigned int' for 'scan_field.num_bits'Marc Schink10-21/+20
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-02target/avrt: Remove unused parameter 'rti'Marc Schink1-12/+12
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-02jtag/commands: Use 'unsigned int' data typeMarc Schink31-239/+201
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-02jtag: Use 'unsigned int' for 'ir_length'Marc Schink5-12/+12
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-02jtag: Use 'unsigned int' for 'abs_chain_position'Marc Schink5-8/+8
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-02jtag: Use bool data type for 'jtag_verify'Marc Schink1-1/+1
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-02uncrustify.cfg: add SPDX licenseAntonio Borneo1-0/+2
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-02doc: Makefile.am: add SPDX licenseAntonio Borneo1-0/+2
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-02tcl: fix minor typos and repeated wordsAntonio Borneo5-6/+6
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-02checkpatch: extend checks to TCL, Makefile.am and configure.ac filesAntonio Borneo1-0/+4
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-02tcl/target: add initial Bouffalo Lab BL702 chip series supportMarek Kraus1-0/+60
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-02configure: Use pkg-config for jimtclMarc Schink3-0/+16
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-07-28flash/startup.tcl: Tidy flash program preverify documentationGrant Ramsay1-3/+3
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-28jep106: update to revision JEP106BJ.01 July 2024Antonio Borneo1-6/+31
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-28doc: fix makeinfo warningAntonio Borneo1-1/+1
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: 44cfdef0a40d ("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>