You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: openocd-gerrit <ope...@us...> - 2025-05-17 08:42:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e30828a2769c294a9d2a36ed10f1f3516d82d1c1 (commit) from 744955e5b4f4f943c187622f4ae977bc4cd6fdb7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e30828a2769c294a9d2a36ed10f1f3516d82d1c1 Author: Walter Ji <wal...@os...> Date: Mon Mar 4 17:29:15 2024 +0800 helper: add bitfield helper macros This patch ports FIELD_{GET,PREP,FIT} macros and related macro from FreeBSD, referenced file: - `src/tree/sys/compat/linuxkpi/common/include/linux/bitfield.h` Checkpatch-ignore: MACRO_ARG_REUSE Change-Id: I6fdf4514d3f95d62fadf7654409a4878d470a600 Signed-off-by: Walter Ji <wal...@os...> Reviewed-on: https://review.openocd.org/c/openocd/+/8171 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index e0fa331ea..a17ada97d 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -19,6 +19,7 @@ noinst_LTLIBRARIES += %D%/libhelper.la %D%/nvp.c \ %D%/align.h \ %D%/binarybuffer.h \ + %D%/bitfield.h \ %D%/bits.h \ %D%/configuration.h \ %D%/list.h \ diff --git a/src/helper/bitfield.h b/src/helper/bitfield.h new file mode 100644 index 000000000..9f397282c --- /dev/null +++ b/src/helper/bitfield.h @@ -0,0 +1,60 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* +* Copyright (c) 2020-2024 The FreeBSD Foundation +* +* This software was developed by Björn Zeeb under sponsorship from +* the FreeBSD Foundation. +*/ + +#ifndef OPENOCD_HELPER_BITFIELD_H +#define OPENOCD_HELPER_BITFIELD_H + +/** + * These macros come from FreeBSD, check source on + * https://cgit.freebsd.org/src/tree/sys/compat/linuxkpi/common/include/linux/bitfield.h + * Which does not include example usages of them. + */ + +#define __bf_shf(x) (__builtin_ffsll(x) - 1) + +/** + * FIELD_FIT(_mask, _value) - Check if a value fits in the specified bitfield mask + * @_mask: Bitfield mask + * @_value: Value to check + * + * This macro checks whether a given value fits within the range defined by the + * specified bitfield mask. It ensures that no bits outside the mask are set. + * + * Return: true if the value fits, false otherwise. + */ +#define FIELD_FIT(_mask, _value) \ + (!(((typeof(_mask))(_value) << __bf_shf(_mask)) & ~(_mask))) + +/** + * FIELD_PREP(_mask, _value) - Prepare a value for insertion into a bitfield + * @_mask: Bitfield mask + * @_value: Value to insert + * + * This macro prepares a value for insertion into a bitfield by shifting the + * value into the position defined by the mask and applying the mask. + * + * Return: The prepared bitfield value. + */ +#define FIELD_PREP(_mask, _value) \ + (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask)) + +/** + * FIELD_GET(_mask, _value) - Extract a value from a bitfield + * @_mask: Bitfield mask + * @_value: Bitfield value to extract from + * + * This macro extracts a value from a bitfield by masking and shifting the + * relevant bits down to the least significant position. + * + * Return: The extracted value. + */ +#define FIELD_GET(_mask, _value) \ + ((typeof(_mask))(((_value) & (_mask)) >> __bf_shf(_mask))) + +#endif /* OPENOCD_HELPER_BITFIELD_H */ ----------------------------------------------------------------------- Summary of changes: src/helper/Makefile.am | 1 + src/helper/bitfield.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/helper/bitfield.h hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:14:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 744955e5b4f4f943c187622f4ae977bc4cd6fdb7 (commit) from 1b2a2b818573269e9704e1e117424210941de3c3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 744955e5b4f4f943c187622f4ae977bc4cd6fdb7 Author: Antonio Borneo <bor...@gm...> Date: Mon May 5 10:00:10 2025 +0200 LICENSES: add dual/CC-BY-4.0 The license CC-BY-4.0 is not compatible with GPLv2, but files can be dual licensed with a GPLv2 compatible license 'OR' CC-BY-4.0. This is the case for some file auto-generated by riscv project. Change-Id: I4313d85a569a5e6423392129a730d1e22ef17c51 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8894 Reviewed-by: Bernhard Rosenkraenzer <be...@ba...> Tested-by: jenkins diff --git a/LICENSES/dual/CC-BY-4.0 b/LICENSES/dual/CC-BY-4.0 new file mode 100644 index 000000000..e20b7a455 --- /dev/null +++ b/LICENSES/dual/CC-BY-4.0 @@ -0,0 +1,409 @@ +Valid-License-Identifier: CC-BY-4.0 +SPDX-URL: https://spdx.org/licenses/CC-BY-4.0 +Usage-Guide: + Do NOT use on OpenOCD code. This license is not GPL2 compatible. It may only + be used for dual-licensed files where the other license is GPL2 compatible. + If you end up using this it MUST be used together with a GPL2 compatible + license using "OR". + To use the Creative Commons Attribution 4.0 International license put + the following SPDX tag/value pair into a comment according to the + placement guidelines in the licensing rules documentation: + SPDX-License-Identifier: CC-BY-4.0 +License-Text: + +Creative Commons Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the "Licensor." The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/LICENSES/license-rules.txt b/LICENSES/license-rules.txt index ecc8e4db1..66aaaa5b4 100644 --- a/LICENSES/license-rules.txt +++ b/LICENSES/license-rules.txt @@ -187,7 +187,21 @@ OpenOCD, can be broken down into: License-Text: Full license text -2. Exceptions: +2. Dual Licensing Only: + + These licenses should only be used to dual license code with another + license in addition to a preferred license. These licenses are available + from the directory:: + + LICENSES/dual/ + + in the OpenOCD source tree. + + The files in this directory contain the full license text and + `Metatags`_. The file names are identical to the SPDX license + identifier which shall be used for the license in source files. + +3. Exceptions: Some licenses can be amended with exceptions which grant certain rights which the original license does not. These exceptions are available @@ -244,7 +258,7 @@ OpenOCD, can be broken down into: License-Text: Full license text -3. Stand-alone licenses: +4. Stand-alone licenses: These licenses should only be used for stand-alone applications that are distributed with OpenOCD but are not included in the OpenOCD binary. diff --git a/Makefile.am b/Makefile.am index 7fe137583..b2b6cef00 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,6 +70,7 @@ EXTRA_DIST += \ $(EXTRA_DIST_NEWS) \ Doxyfile.in \ LICENSES/license-rules.txt \ + LICENSES/dual/CC-BY-4.0 \ LICENSES/exceptions/eCos-exception-2.0 \ LICENSES/preferred/BSD-1-Clause \ LICENSES/preferred/BSD-2-Clause \ diff --git a/tools/scripts/spdxcheck.py b/tools/scripts/spdxcheck.py index f88294379..9180f61fa 100755 --- a/tools/scripts/spdxcheck.py +++ b/tools/scripts/spdxcheck.py @@ -50,7 +50,7 @@ def read_spdxdata(repo): # The subdirectories of LICENSES in the kernel source # Note: exceptions needs to be parsed as last directory. # OpenOCD specific: Begin - license_dirs = [ "preferred", "stand-alone", "exceptions" ] + license_dirs = [ "preferred", "dual", "exceptions", "stand-alone" ] # OpenOCD specific: End lictree = repo.head.commit.tree['LICENSES'] ----------------------------------------------------------------------- Summary of changes: LICENSES/dual/CC-BY-4.0 | 409 +++++++++++++++++++++++++++++++++++++++++++++ LICENSES/license-rules.txt | 18 +- Makefile.am | 1 + tools/scripts/spdxcheck.py | 2 +- 4 files changed, 427 insertions(+), 3 deletions(-) create mode 100644 LICENSES/dual/CC-BY-4.0 hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:13:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 1b2a2b818573269e9704e1e117424210941de3c3 (commit) from f42540cc90b874c7662c59b8e4ebef3f657717ad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1b2a2b818573269e9704e1e117424210941de3c3 Author: Evgeniy Naydanov <evg...@sy...> Date: Fri Nov 29 17:44:50 2024 +0300 testing/tcl_commands: test `target create`, `cget`, `configure` Introduce basic testing of error-handling in target configuration related commands. The tests can be run via `make check` when JTAG `dummy` adapter is enabled. Change-Id: Id0f382046dd70007d8e696d82d2396a7ccab7a33 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8644 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/Makefile.am b/Makefile.am index 271a2c165..7fe137583 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ AUTOMAKE_OPTIONS = gnu 1.6 AM_DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim # do not run Jim Tcl tests (esp. during distcheck) -check-recursive: SUBDIRS := +check-recursive: SUBDIRS := $(SUBDIRS:jimtcl=) nobase_dist_pkgdata_DATA = \ contrib/libdcc/dcc_stdio.c \ @@ -36,6 +36,9 @@ EXTRA_DIST += jimtcl/configure.gnu DISTCLEANFILES += jimtcl/jsmn/jsmn.o endif +SUBDIRS += testing +DIST_SUBDIRS += testing + # common flags used in openocd build AM_CFLAGS = $(GCC_WARNINGS) AM_LDFLAGS = diff --git a/configure.ac b/configure.ac index 9db378702..e48653b21 100644 --- a/configure.ac +++ b/configure.ac @@ -835,7 +835,9 @@ AS_IF([test "x$gcc_warnings" = "xyes"], [ AC_SUBST(EXTRA_DIST_NEWS, ["$(echo $srcdir/NEWS-*)"]) AC_CONFIG_FILES([ - Makefile + Makefile \ + testing/Makefile \ + testing/tcl_commands/Makefile ]) AC_OUTPUT diff --git a/testing/Makefile.am b/testing/Makefile.am new file mode 100644 index 000000000..22778a4c2 --- /dev/null +++ b/testing/Makefile.am @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +SUBDIRS = tcl_commands +DIST_SUBDIRS = tcl_commands diff --git a/testing/tcl_commands/Makefile.am b/testing/tcl_commands/Makefile.am new file mode 100644 index 000000000..fe8d15070 --- /dev/null +++ b/testing/tcl_commands/Makefile.am @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +TESTS = + +if DUMMY +TESTS += \ + test-target-create-command.cfg \ + test-target-configure-cget-command.cfg +endif + +EXTRA_DIST = utils.tcl $(TESTS) + +TEST_EXTENSIONS = .cfg +CFG_LOG_COMPILER = $(top_builddir)/src/openocd +AM_CFG_LOG_FLAGS = -f $(abs_srcdir)/utils.tcl -f diff --git a/testing/tcl_commands/test-target-configure-cget-command.cfg b/testing/tcl_commands/test-target-configure-cget-command.cfg new file mode 100644 index 000000000..2d546c83d --- /dev/null +++ b/testing/tcl_commands/test-target-configure-cget-command.cfg @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +namespace import testing_helpers::* +namespace import configure_testing::* + +adapter driver dummy +jtag newtap tap cpu -irlen 5 + +{*}[target_create_first_args] {*}[simple_configure_options] + +set target_name [lindex [target names] 0] + +check_matches testee {$target_name cget -type} + +foreach {opt arg} [simple_configure_options] { + check_syntax_err {$target_name cget $opt extra_arg} + check_matches [dict get [simple_configure_options] $opt] \ + {$target_name cget $opt} +} + +check_error_matches .*-event.* {$target_name cget -event} +$target_name cget -event examine-start +check_syntax_err {$target_name cget -event examine-start extra_arg} + +check_syntax_err {$target_name configure} + +foreach {opt arg} [simple_configure_options] { + $target_name configure $opt [$target_name cget $opt] +} + +shutdown diff --git a/testing/tcl_commands/test-target-create-command.cfg b/testing/tcl_commands/test-target-create-command.cfg new file mode 100644 index 000000000..11264316c --- /dev/null +++ b/testing/tcl_commands/test-target-create-command.cfg @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +namespace import testing_helpers::* +namespace import configure_testing::* + +adapter driver dummy +jtag newtap tap cpu -irlen 5 + +check_syntax_err {target create} +check_syntax_err {target create} +check_syntax_err {target create test.target} +check_error_matches -chain-position {target create test.target testee} + +{*}[target_create_first_args] {*}[simple_configure_options] + +foreach {opt arg} [simple_configure_options] { + check_error_matches ".*${opt}.*" {{*}[target_create_first_args] $opt} +} + +foreach {opt1 arg1} [simple_configure_options] { + foreach {opt2 arg2} [simple_configure_options] { + check_error_matches ".*${opt2}.*" \ + {{*}[target_create_first_args] $opt1 $arg1 $opt2} + check_error_matches {} \ + {{*}[target_create_first_args] $opt1 $opt2 $arg2} + } +} + +check_error_matches ".*-type.*" \ + {{*}[target_create_first_args] -type} + +check_error_matches ".*-type.*" \ + {{*}[target_create_first_args] {*}[simple_configure_options] -type} + +check_error_matches {.*-event [^ ]+ .*} \ + {{*}[target_create_first_args] -event} + +check_error_matches {.*not-an-event.*} \ + {{*}[target_create_first_args] -event not-an-event} + +check_error_matches {.*-event examine-start [^ ]+.*} \ + {{*}[target_create_first_args] -event examine-start} + +{*}[target_create_first_args] {*}[simple_configure_options] \ + -event examine-start body +{*}[target_create_first_args] {*}[simple_configure_options] \ + -event examine-start body \ + -event examine-end another-body \ + -event examine-start new-body +{*}[target_create_first_args] -event examine-start body {*}[simple_configure_options] + +{*}[target_create_first_args] {*}[simple_configure_options] -defer-examine + +shutdown diff --git a/testing/tcl_commands/utils.tcl b/testing/tcl_commands/utils.tcl new file mode 100644 index 000000000..dfc896661 --- /dev/null +++ b/testing/tcl_commands/utils.tcl @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +namespace eval testing_helpers { + + proc test_failure message { + echo $message + shutdown error + } + + proc check_for_error {expctd_code msg_ptrn script} { + set code [catch {uplevel $script} msg] + set expanded_script [uplevel subst \"$script\"] + if {!$code} { + test_failure \ + "'$expanded_script' finished successfully. \ + Was expecting an error." + } + if {$expctd_code ne "" && $code != $expctd_code} { + test_failure \ + "'$expanded_script' returned unexpected error code $code. \ + Was expecting $expctd_code. Error message: '$msg'" + } + if {$msg_ptrn ne "" && ![regexp -- $msg_ptrn $msg]} { + test_failure \ + "'$expanded_script' returned unexpected error message '$msg'. \ + Was expecting '$msg_ptrn'. Error code: $code" + } + } + + proc check_error_matches {pattern script} { + tailcall check_for_error {} $pattern $script + } + + proc check_syntax_err script { + tailcall check_for_error -601 {} $script + } + + proc check_matches {pattern script} { + set result [uplevel $script] + if {[regexp $pattern $result]} {return} + test_failure \ + "'$script' produced unexpected result '$result'. \ + Was expecting '$pattern'." + } + + namespace export check_error_matches check_syntax_err check_matches +} + +namespace eval configure_testing { + + variable target_idx 0 + + proc unique_tgt_name {} { + variable target_idx + incr target_idx + return test_target$target_idx + } + + proc target_create_first_args {} { + return "target create [unique_tgt_name] testee" + } + + proc simple_configure_options {} { + return { + -work-area-virt 0 + -work-area-phys 0 + -work-area-size 1 + -work-area-backup 0 + -endian little + -coreid 1 + -chain-position tap.cpu + -dbgbase 0 + -rtos hwthread + -gdb-port 0 + -gdb-max-connections 1 + } + } + + namespace export target_create_first_args simple_configure_options +} ----------------------------------------------------------------------- Summary of changes: Makefile.am | 5 +- configure.ac | 4 +- testing/Makefile.am | 4 ++ testing/tcl_commands/Makefile.am | 15 ++++ .../test-target-configure-cget-command.cfg | 31 +++++++++ .../tcl_commands/test-target-create-command.cfg | 54 +++++++++++++++ testing/tcl_commands/utils.tcl | 80 ++++++++++++++++++++++ 7 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 testing/Makefile.am create mode 100644 testing/tcl_commands/Makefile.am create mode 100644 testing/tcl_commands/test-target-configure-cget-command.cfg create mode 100644 testing/tcl_commands/test-target-create-command.cfg create mode 100644 testing/tcl_commands/utils.tcl hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:13:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f42540cc90b874c7662c59b8e4ebef3f657717ad (commit) from 8c09cc2c17547dca9783b596d43b735520f2e936 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f42540cc90b874c7662c59b8e4ebef3f657717ad Author: Evgeniy Naydanov <evg...@sy...> Date: Mon Apr 28 16:55:35 2025 +0300 target: improve error reporting for `-event` option `target create` calls can get quite long and an indication what is the option that caused the error can be helpful. Also, there can be multiple `-event` options for different events, therefore indicating which one is it is also helpful. Change-Id: I5ea61437ca9705e790ed8343183883a3fdfebc80 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8861 Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 6d2fc9506..6653c381c 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4926,7 +4926,8 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde case TCFG_EVENT: if (index == CMD_ARGC) { - command_print(CMD, "missing event-name"); + command_print(CMD, "expecting %s event-name event-body", + CMD_ARGV[index - 1]); return ERROR_COMMAND_ARGUMENT_INVALID; } @@ -4939,7 +4940,8 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde if (is_configure) { if (index == CMD_ARGC) { - command_print(CMD, "missing event-body"); + command_print(CMD, "expecting %s %s event-body", + CMD_ARGV[index - 2], CMD_ARGV[index - 1]); return ERROR_COMMAND_ARGUMENT_INVALID; } } ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:12:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8c09cc2c17547dca9783b596d43b735520f2e936 (commit) from d6c54b94941294628c5ebff5f9c776c4a7b2aebb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8c09cc2c17547dca9783b596d43b735520f2e936 Author: Evgeniy Naydanov <evg...@sy...> Date: Mon Apr 28 16:46:08 2025 +0300 target: improve error messaging in `target create` There are a couple of issues with the usage string for `target create`, namely: * `-chain-position` is allowed to be not the first option. * `-chain-position` should be ommited alltogether on ARM targets when DAP is specified. Before the patch: ``` > openocd -c 'target create name testee' ... target create name type '-chain-position' name [options ...] ``` After the patch: ``` > openocd -c 'target create name testee' ... -chain-position ?name? required when creating target > openocd -c 'target create' ... target create name type [options ...] ``` Change-Id: Ia21a99ce6a4086e2e0676f5ef4685da3514a4f69 Signed-off-by: Evgeniy Naydanov <evg...@sy...> Reviewed-on: https://review.openocd.org/c/openocd/+/8860 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index a85d3def8..6d2fc9506 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5706,7 +5706,7 @@ COMMAND_HANDLER(handle_target_create) int retval = ERROR_OK; int x; - if (CMD_ARGC < 4) + if (CMD_ARGC < 2) return ERROR_COMMAND_SYNTAX_ERROR; /* check if the target name clashes with an existing command name */ @@ -6051,7 +6051,7 @@ static const struct command_registration target_subcommand_handlers[] = { .name = "create", .mode = COMMAND_CONFIG, .handler = handle_target_create, - .usage = "name type '-chain-position' name [options ...]", + .usage = "name type [options ...]", .help = "Creates and selects a new target", }, { ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:11:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d6c54b94941294628c5ebff5f9c776c4a7b2aebb (commit) from 618e447278097e41daecf76f6a1e2005f9fc9450 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d6c54b94941294628c5ebff5f9c776c4a7b2aebb Author: Daniel Goehring <dgo...@os...> Date: Wed Apr 30 22:38:15 2025 -0400 target: cget command fix for result output Function target_configure() when processing a "cget" command needs to print the result to the console. Currently the result is only printed when an error occurs. To fix this, move the command print statement from the error handling section to the common code section. The code was tested by executing a "$target_name cget -dap" command and reviewing the result. Change-Id: Iff1999de8c8e9a837055ba95714137aa03e68d4b Signed-off-by: Daniel Goehring <dgo...@os...> Fixes: 61890e3dc320 ("target: rewrite function target_configure() as COMMAND_HELPER") Reviewed-on: https://review.openocd.org/c/openocd/+/8870 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/target.c b/src/target/target.c index 8ccab7e0a..a85d3def8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4889,16 +4889,18 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde goi.is_configure = is_configure; int e = (*target->type->target_jim_configure)(target, &goi); index = CMD_ARGC - goi.argc; + + int reslen; + const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); + if (reslen > 0) + command_print(CMD, "%s", result); + if (e == JIM_OK) { /* more? */ continue; } if (e == JIM_ERR) { /* An error */ - int reslen; - const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); - if (reslen > 0) - command_print(CMD, "%s", result); return ERROR_FAIL; } /* otherwise we 'continue' below */ ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:10:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 618e447278097e41daecf76f6a1e2005f9fc9450 (commit) from 00f5b7ece6f031ece824375007e825ffc113e72b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 618e447278097e41daecf76f6a1e2005f9fc9450 Author: Antonio Borneo <bor...@gm...> Date: Thu May 1 18:41:51 2025 +0200 tcl: board: convert transport select dapdirect_swd to swd Two new boards were added after the commit ad53fe659b46 ("tcl: convert transport select to jtag and swd") Align them too. Change-Id: I53e36a3a1a7730822521f0239922682c7b2fcef6 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8869 Tested-by: jenkins diff --git a/tcl/board/st/nucleo-u083rc.cfg b/tcl/board/st/nucleo-u083rc.cfg index 7b878adbc..03e956930 100644 --- a/tcl/board/st/nucleo-u083rc.cfg +++ b/tcl/board/st/nucleo-u083rc.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32u0x.cfg] diff --git a/tcl/board/st_nucleo_c0.cfg b/tcl/board/st_nucleo_c0.cfg index 7d0767592..845b7b50e 100644 --- a/tcl/board/st_nucleo_c0.cfg +++ b/tcl/board/st_nucleo_c0.cfg @@ -2,7 +2,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32c0x.cfg] ----------------------------------------------------------------------- Summary of changes: tcl/board/st/nucleo-u083rc.cfg | 2 +- tcl/board/st_nucleo_c0.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:10:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 00f5b7ece6f031ece824375007e825ffc113e72b (commit) from 06c827757b0c44bef5a15558a71ab666375cbb87 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 00f5b7ece6f031ece824375007e825ffc113e72b Author: Antonio Borneo <bor...@gm...> Date: Thu May 1 19:38:42 2025 +0200 transport: fix incorrect statement Commit 236208a5ff2d ("transport: use a bitmask for the transport") has an incorrect C statement in place of a return. The code is working thanks to the previous condition never true. The issue has been detected by clang scan-build in OpenOCD ACI since the missing return can make the following statement dereferencing a NULL pointer. Fix it! Change-Id: I3bbe04d99ad9b1288f55ba3c45e2e487aef9ae40 Signed-off-by: Antonio Borneo <bor...@gm...> Fixes: 236208a5ff2d ("transport: use a bitmask for the transport") Reviewed-on: https://review.openocd.org/c/openocd/+/8868 Tested-by: jenkins diff --git a/src/transport/transport.c b/src/transport/transport.c index ab5be490f..5323a7ca0 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -258,7 +258,7 @@ struct transport *get_current_transport(void) const char *get_current_transport_name(void) { if (!session || !is_transport_id_valid(session->id)) - NULL; + return NULL; return transport_full_name(session->id); } ----------------------------------------------------------------------- Summary of changes: src/transport/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:09:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 06c827757b0c44bef5a15558a71ab666375cbb87 (commit) via d71ed4f3bc58f97ec99f265e55faa1fed7e793ff (commit) from 3954896d6e41298efd74e8bb7af60ec49efae809 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 06c827757b0c44bef5a15558a71ab666375cbb87 Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 19 17:05:16 2025 +0200 target: armv7a: use proper type for struct armv7a_cache_common::outer_cache The field 'outer_cache' is always initialized and used as a pointer to 'struct armv7a_l2x_cache'. There is no reason for using type 'void *' for it. Change the type of 'outer_cache'. Drop the useless cast while reading 'outer_cache'. Change-Id: Iaea9d02e247da26e230f887c85fbf8e9d7be34d5 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8858 Tested-by: jenkins diff --git a/src/target/armv7a.c b/src/target/armv7a.c index fb8862611..4d353dec6 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -182,8 +182,7 @@ done: int armv7a_handle_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a_cache->outer_cache); + struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache; int cl; diff --git a/src/target/armv7a.h b/src/target/armv7a.h index 8943f1c69..2706c4629 100644 --- a/src/target/armv7a.h +++ b/src/target/armv7a.h @@ -66,7 +66,7 @@ struct armv7a_cache_common { int i_cache_enabled; int d_u_cache_enabled; /* outer unified cache if some */ - void *outer_cache; + struct armv7a_l2x_cache *outer_cache; int (*flush_all_data_cache)(struct target *target); }; diff --git a/src/target/armv7a_cache_l2x.c b/src/target/armv7a_cache_l2x.c index 39c503f09..bc60e6d19 100644 --- a/src/target/armv7a_cache_l2x.c +++ b/src/target/armv7a_cache_l2x.c @@ -21,8 +21,8 @@ static int arm7a_l2x_sanity_check(struct target *target) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; if (target->state != TARGET_HALTED) { LOG_ERROR("%s: target not halted", __func__); @@ -42,8 +42,8 @@ static int arm7a_l2x_sanity_check(struct target *target) int arm7a_l2x_flush_all_data(struct target *target) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; uint32_t l2_way_val; int retval; @@ -62,8 +62,8 @@ int armv7a_l2x_cache_flush_virt(struct target *target, target_addr_t virt, uint32_t size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen? */ uint32_t i, linelen = 32; int retval; @@ -97,8 +97,8 @@ static int armv7a_l2x_cache_inval_virt(struct target *target, target_addr_t virt uint32_t size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen */ uint32_t i, linelen = 32; int retval; @@ -132,8 +132,8 @@ static int armv7a_l2x_cache_clean_virt(struct target *target, target_addr_t virt unsigned int size) { struct armv7a_common *armv7a = target_to_armv7a(target); - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a->armv7a_mmu.armv7a_cache.outer_cache); + struct armv7a_l2x_cache *l2x_cache = + armv7a->armv7a_mmu.armv7a_cache.outer_cache; /* FIXME: different controllers have different linelen */ uint32_t i, linelen = 32; int retval; @@ -166,8 +166,7 @@ done: static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { - struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *) - (armv7a_cache->outer_cache); + struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache; if (armv7a_cache->info == -1) { command_print(cmd, "cache not yet identified"); commit d71ed4f3bc58f97ec99f265e55faa1fed7e793ff Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 19 16:28:50 2025 +0200 target: armv7a: drop command 'cache_config l2x' The command was already tagged as deprecated in 2015 with commit 0df557728216 ("armv7a: remove l1 flush all data handler") but has never been removed. An equivalent command 'cache l2x conf' was introduced at the same time in commit cd440bd32a12 ("add armv7a_cache handlers"). Drop it and deprecate it. Replace the old command in the Tcl script. Change-Id: Ie24eccc99a78786903704d10ee1d9f6c924529b5 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8857 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index e0bdd5ca0..ca357c780 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -10710,10 +10710,6 @@ Display/set the current core displayed in GDB Selects whether interrupts will be processed when single stepping @end deffn -@deffn {Command} {cache_config l2x} [base way] -configure l2x cache -@end deffn - @deffn {Command} {cortex_a mmu dump} [@option{0}|@option{1}|@option{addr} address [@option{num_entries}]] Dump the MMU translation table from TTB0 or TTB1 register, or from physical memory location @var{address}. When dumping the table from @var{address}, print at most diff --git a/src/target/armv7a.c b/src/target/armv7a.c index c14155e01..fb8862611 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -179,54 +179,6 @@ done: return retval; } -/* FIXME: remove it */ -static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way) -{ - struct armv7a_l2x_cache *l2x_cache; - struct target_list *head; - - struct armv7a_common *armv7a = target_to_armv7a(target); - l2x_cache = calloc(1, sizeof(struct armv7a_l2x_cache)); - l2x_cache->base = base; - l2x_cache->way = way; - /*LOG_INFO("cache l2 initialized base %x way %d", - l2x_cache->base,l2x_cache->way);*/ - if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) - LOG_INFO("outer cache already initialized\n"); - armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache; - /* initialize all target in this cluster (smp target) - * l2 cache must be configured after smp declaration */ - foreach_smp_target(head, target->smp_targets) { - struct target *curr = head->target; - if (curr != target) { - armv7a = target_to_armv7a(curr); - if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) - LOG_ERROR("smp target : outer cache already initialized\n"); - armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache; - } - } - return JIM_OK; -} - -/* FIXME: remove it */ -COMMAND_HANDLER(handle_cache_l2x) -{ - struct target *target = get_current_target(CMD_CTX); - uint32_t base, way; - - if (CMD_ARGC != 2) - return ERROR_COMMAND_SYNTAX_ERROR; - - /* command_print(CMD, "%s %s", CMD_ARGV[0], CMD_ARGV[1]); */ - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], base); - COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], way); - - /* AP address is in bits 31:24 of DP_SELECT */ - armv7a_l2x_cache_init(target, base, way); - - return ERROR_OK; -} - int armv7a_handle_cache_info_command(struct command_invocation *cmd, struct armv7a_cache_common *armv7a_cache) { @@ -561,33 +513,7 @@ int armv7a_arch_state(struct target *target) return ERROR_OK; } -static const struct command_registration l2_cache_commands[] = { - { - .name = "l2x", - .handler = handle_cache_l2x, - .mode = COMMAND_EXEC, - .help = "configure l2x cache", - .usage = "[base_addr] [number_of_way]", - }, - COMMAND_REGISTRATION_DONE - -}; - -static const struct command_registration l2x_cache_command_handlers[] = { - { - .name = "cache_config", - .mode = COMMAND_EXEC, - .help = "cache configuration for a target", - .usage = "", - .chain = l2_cache_commands, - }, - COMMAND_REGISTRATION_DONE -}; - const struct command_registration armv7a_command_handlers[] = { - { - .chain = l2x_cache_command_handlers, - }, { .chain = arm7a_cache_command_handlers, }, diff --git a/src/target/startup.tcl b/src/target/startup.tcl index e9646097f..1cc9bb7fd 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -316,3 +316,9 @@ proc _post_init_target_cortex_a_cache_auto {} { } } lappend post_init_commands _post_init_target_cortex_a_cache_auto + +lappend _telnet_autocomplete_skip "cache_config l2x" +proc "cache_config l2x" {args} { + echo "DEPRECATED! use 'cache l2x conf' not 'cache_config l2x'" + eval cache_config l2x $args +} diff --git a/tcl/target/u8500.cfg b/tcl/target/u8500.cfg index 1fdc11fe3..ea3c7218e 100644 --- a/tcl/target/u8500.cfg +++ b/tcl/target/u8500.cfg @@ -133,7 +133,7 @@ proc enable_apetap {} { set status [$_TARGETNAME_1 curstate] if {[string equal "unknown" $status]} { $_TARGETNAME_1 arp_examine - cache_config l2x 0xa0412000 8 + cache l2x conf 0xa0412000 8 } set status [$_TARGETNAME_2 curstate] ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 4 --- src/target/armv7a.c | 77 +------------------------------------------ src/target/armv7a.h | 2 +- src/target/armv7a_cache_l2x.c | 23 +++++++------ src/target/startup.tcl | 6 ++++ tcl/target/u8500.cfg | 2 +- 6 files changed, 20 insertions(+), 94 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:09:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3954896d6e41298efd74e8bb7af60ec49efae809 (commit) from 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3954896d6e41298efd74e8bb7af60ec49efae809 Author: Chien Wong <m...@xv...> Date: Tue Apr 8 20:33:56 2025 +0800 rtos/FreeRTOS: fix next pointer member offset in FreeRTOS lists Currently, we are using offset of xListEnd.pxPrevious in List_t for list_next_offset and offset of pxPrevious in ListItem_t for list_elem_next_offset. This is confusing. Fix this. As the related lists are doubly linked lists, only iteration order is changed without breaking functionality. Also document those offsets. Change-Id: I8beacc235ee781ab4e3b415fccad7b72ec55b098 Signed-off-by: Chien Wong <m...@xv...> Reviewed-on: https://review.openocd.org/c/openocd/+/8833 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/rtos/freertos.c b/src/rtos/freertos.c index bd7b4220e..5a9224ec0 100644 --- a/src/rtos/freertos.c +++ b/src/rtos/freertos.c @@ -30,12 +30,12 @@ struct freertos_params { const char *target_name; const unsigned char thread_count_width; const unsigned char pointer_width; - const unsigned char list_next_offset; - const unsigned char list_width; - const unsigned char list_elem_next_offset; - const unsigned char list_elem_content_offset; - const unsigned char thread_stack_offset; - const unsigned char thread_name_offset; + const unsigned char list_next_offset; /* offsetof(List_t, xListEnd.pxNext) */ + const unsigned char list_width; /* sizeof(List_t) */ + const unsigned char list_elem_next_offset; /* offsetof(ListItem_t, pxNext) */ + const unsigned char list_elem_content_offset; /* offsetof(ListItem_t, pvOwner) */ + const unsigned char thread_stack_offset; /* offsetof(TCB_t, pxTopOfStack) */ + const unsigned char thread_name_offset; /* offsetof(TCB_t, pcTaskName) */ const struct rtos_register_stacking *stacking_info_cm3; const struct rtos_register_stacking *stacking_info_cm4f; const struct rtos_register_stacking *stacking_info_cm4f_fpu; @@ -46,9 +46,9 @@ static const struct freertos_params freertos_params_list[] = { "cortex_m", /* target_name */ 4, /* thread_count_width; */ 4, /* pointer_width; */ - 16, /* list_next_offset; */ + 12, /* list_next_offset; */ 20, /* list_width; */ - 8, /* list_elem_next_offset; */ + 4, /* list_elem_next_offset; */ 12, /* list_elem_content_offset */ 0, /* thread_stack_offset; */ 52, /* thread_name_offset; */ @@ -60,9 +60,9 @@ static const struct freertos_params freertos_params_list[] = { "hla_target", /* target_name */ 4, /* thread_count_width; */ 4, /* pointer_width; */ - 16, /* list_next_offset; */ + 12, /* list_next_offset; */ 20, /* list_width; */ - 8, /* list_elem_next_offset; */ + 4, /* list_elem_next_offset; */ 12, /* list_elem_content_offset */ 0, /* thread_stack_offset; */ 52, /* thread_name_offset; */ ----------------------------------------------------------------------- Summary of changes: src/rtos/freertos.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:08:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85 (commit) from b3b790e4e01331f79b196f8312193ae0130d2394 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85 Author: Antonio Borneo <bor...@gm...> Date: Fri Apr 18 17:04:47 2025 +0200 rtos: rework rtos_types[] and rtos_try_next() Drop the NULL sentinel at the end of the array and use ARRAY_SIZE() to bound the loops. Adapt rtos_try_next() to use ARRAY_SIZE(). While there: - change to bool the return type of rtos_try_next(); - move rtos_try_next() to avoid the forward declaration. Change-Id: I1bee11db943b670789e62f1bebe2509bbef451a0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8855 Tested-by: jenkins diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 5cac316ed..216129b97 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -13,6 +13,7 @@ #include "target/target.h" #include "helper/log.h" #include "helper/binarybuffer.h" +#include "helper/types.h" #include "server/gdb_server.h" static const struct rtos_type *rtos_types[] = { @@ -31,11 +32,8 @@ static const struct rtos_type *rtos_types[] = { &rtkernel_rtos, /* keep this as last, as it always matches with rtos auto */ &hwthread_rtos, - NULL }; -static int rtos_try_next(struct target *target); - int rtos_smp_init(struct target *target) { if (target->rtos->type->smp_init) @@ -116,12 +114,12 @@ int rtos_create(struct command_invocation *cmd, struct target *target, return os_alloc(target, rtos_types[0]); } - for (int x = 0; rtos_types[x]; x++) + for (size_t x = 0; x < ARRAY_SIZE(rtos_types); x++) if (strcmp(rtos_name, rtos_types[x]->name) == 0) return os_alloc_create(target, rtos_types[x]); char *all = NULL; - for (int x = 0; rtos_types[x]; x++) { + for (size_t x = 0; x < ARRAY_SIZE(rtos_types); x++) { char *prev = all; if (all) all = alloc_printf("%s, %s", all, rtos_types[x]->name); @@ -155,6 +153,29 @@ int gdb_thread_packet(struct connection *connection, char const *packet, int pac return target->rtos->gdb_thread_packet(connection, packet, packet_size); } +static bool rtos_try_next(struct target *target) +{ + struct rtos *os = target->rtos; + + if (!os) + return false; + + for (size_t x = 0; x < ARRAY_SIZE(rtos_types) - 1; x++) { + if (os->type == rtos_types[x]) { + // Use next RTOS in the list + os->type = rtos_types[x + 1]; + + free(os->symbols); + os->symbols = NULL; + + return true; + } + } + + // No next RTOS to try + return false; +} + static struct symbol_table_elem *find_symbol(const struct rtos *os, const char *symbol) { struct symbol_table_elem *s; @@ -667,28 +688,6 @@ int rtos_generic_stack_read(struct target *target, return ERROR_OK; } -static int rtos_try_next(struct target *target) -{ - struct rtos *os = target->rtos; - const struct rtos_type **type = rtos_types; - - if (!os) - return 0; - - while (*type && os->type != *type) - type++; - - if (!*type || !*(++type)) - return 0; - - os->type = *type; - - free(os->symbols); - os->symbols = NULL; - - return 1; -} - int rtos_update_threads(struct target *target) { if ((target->rtos) && (target->rtos->type)) ----------------------------------------------------------------------- Summary of changes: src/rtos/rtos.c | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:07:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via b3b790e4e01331f79b196f8312193ae0130d2394 (commit) from afbd01b0a46f3a81fe6076c002ad66973dcfb64c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b3b790e4e01331f79b196f8312193ae0130d2394 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 3 22:54:51 2023 +0100 rtos: rework rtos_create() To simplify the caller of rtos_create(), convert the code from jimtcl oriented to OpenOCD commands. While there, fix inconsistencies in almost every rtos create() method and reset rtos_auto_detect to better cooperate on run-time rtos configuration. Change-Id: I59c443aaed77a48174facdfc86db75d6b28c8480 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8830 Tested-by: jenkins diff --git a/src/rtos/chibios.c b/src/rtos/chibios.c index af590c2cb..0cd99e472 100644 --- a/src/rtos/chibios.c +++ b/src/rtos/chibios.c @@ -515,10 +515,10 @@ static int chibios_create(struct target *target) for (unsigned int i = 0; i < ARRAY_SIZE(chibios_params_list); i++) if (strcmp(chibios_params_list[i].target_name, target_type_name(target)) == 0) { target->rtos->rtos_specific_params = (void *)&chibios_params_list[i]; - return 0; + return ERROR_OK; } LOG_WARNING("Could not find target \"%s\" in ChibiOS compatibility " "list", target_type_name(target)); - return -1; + return ERROR_FAIL; } diff --git a/src/rtos/ecos.c b/src/rtos/ecos.c index 7048b006e..a70084b4f 100644 --- a/src/rtos/ecos.c +++ b/src/rtos/ecos.c @@ -1213,12 +1213,12 @@ static int ecos_create(struct target *target) target->rtos->gdb_thread_packet = ecos_packet_hook; /* We do not currently use the target->rtos->gdb_target_for_threadid * hook. */ - return 0; + return ERROR_OK; } tnames++; } } LOG_ERROR("Could not find target in eCos compatibility list"); - return -1; + return ERROR_FAIL; } diff --git a/src/rtos/embkernel.c b/src/rtos/embkernel.c index 7e6de7902..7ad937be5 100644 --- a/src/rtos/embkernel.c +++ b/src/rtos/embkernel.c @@ -115,11 +115,11 @@ static int embkernel_create(struct target *target) if (i >= ARRAY_SIZE(embkernel_params_list)) { LOG_WARNING("Could not find target \"%s\" in embKernel compatibility " "list", target_type_name(target)); - return -1; + return ERROR_FAIL; } target->rtos->rtos_specific_params = (void *) &embkernel_params_list[i]; - return 0; + return ERROR_OK; } static int embkernel_get_tasks_details(struct rtos *rtos, int64_t iterable, const struct embkernel_params *param, diff --git a/src/rtos/freertos.c b/src/rtos/freertos.c index 20977e07e..bd7b4220e 100644 --- a/src/rtos/freertos.c +++ b/src/rtos/freertos.c @@ -534,9 +534,9 @@ static int freertos_create(struct target *target) for (unsigned int i = 0; i < ARRAY_SIZE(freertos_params_list); i++) if (strcmp(freertos_params_list[i].target_name, target_type_name(target)) == 0) { target->rtos->rtos_specific_params = (void *)&freertos_params_list[i]; - return 0; + return ERROR_OK; } LOG_ERROR("Could not find target in FreeRTOS compatibility list"); - return -1; + return ERROR_FAIL; } diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c index 6332bd8ad..76571c6b6 100644 --- a/src/rtos/hwthread.c +++ b/src/rtos/hwthread.c @@ -412,7 +412,7 @@ static int hwthread_create(struct target *target) target->rtos->thread_details = NULL; target->rtos->gdb_target_for_threadid = hwthread_target_for_threadid; target->rtos->gdb_thread_packet = hwthread_thread_packet; - return 0; + return ERROR_OK; } static int hwthread_read_buffer(struct rtos *rtos, target_addr_t address, diff --git a/src/rtos/linux.c b/src/rtos/linux.c index 5efdc9f60..4ca02605e 100644 --- a/src/rtos/linux.c +++ b/src/rtos/linux.c @@ -1424,7 +1424,7 @@ static int linux_os_create(struct target *target) /* initialize a default virt 2 phys translation */ os_linux->phys_mask = ~0xc0000000; os_linux->phys_base = 0x0; - return JIM_OK; + return ERROR_OK; } static char *linux_ps_command(struct target *target) diff --git a/src/rtos/mqx.c b/src/rtos/mqx.c index 017fd2b01..dbb48952f 100644 --- a/src/rtos/mqx.c +++ b/src/rtos/mqx.c @@ -251,11 +251,11 @@ static int mqx_create( if (strcmp(mqx_params_list[i].target_name, target_type_name(target)) == 0) { target->rtos->rtos_specific_params = (void *)&mqx_params_list[i]; /* LOG_DEBUG("MQX RTOS - valid architecture: %s", target_type_name(target)); */ - return 0; + return ERROR_OK; } } LOG_ERROR("MQX RTOS - could not find target \"%s\" in MQX compatibility list", target_type_name(target)); - return -1; + return ERROR_FAIL; } /* diff --git a/src/rtos/nuttx.c b/src/rtos/nuttx.c index 821e55088..27bf086c8 100644 --- a/src/rtos/nuttx.c +++ b/src/rtos/nuttx.c @@ -129,13 +129,13 @@ static int nuttx_create(struct target *target) if (i >= ARRAY_SIZE(nuttx_params_list)) { LOG_ERROR("Could not find \"%s\" target in NuttX compatibility list", target_type_name(target)); - return JIM_ERR; + return ERROR_FAIL; } /* We found a target in our list, copy its reference. */ target->rtos->rtos_specific_params = (void *)param; - return JIM_OK; + return ERROR_OK; } static int nuttx_smp_init(struct target *target) diff --git a/src/rtos/rtkernel.c b/src/rtos/rtkernel.c index aebbf3d94..2be1996fc 100644 --- a/src/rtos/rtkernel.c +++ b/src/rtos/rtkernel.c @@ -364,12 +364,12 @@ static int rtkernel_create(struct target *target) for (size_t i = 0; i < ARRAY_SIZE(rtkernel_params_list); i++) { if (strcmp(rtkernel_params_list[i].target_name, target_type_name(target)) == 0) { target->rtos->rtos_specific_params = (void *)&rtkernel_params_list[i]; - return 0; + return ERROR_OK; } } LOG_ERROR("Could not find target in rt-kernel compatibility list"); - return -1; + return ERROR_FAIL; } const struct rtos_type rtkernel_rtos = { diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 2c563d522..5cac316ed 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -57,7 +57,7 @@ static int os_alloc(struct target *target, const struct rtos_type *ostype) struct rtos *os = target->rtos = calloc(1, sizeof(struct rtos)); if (!os) - return JIM_ERR; + return ERROR_FAIL; os->type = ostype; os->current_threadid = -1; @@ -69,7 +69,7 @@ static int os_alloc(struct target *target, const struct rtos_type *ostype) os->gdb_thread_packet = rtos_thread_packet; os->gdb_target_for_threadid = rtos_target_for_threadid; - return JIM_OK; + return ERROR_OK; } static void os_free(struct target *target) @@ -86,38 +86,26 @@ static void os_free(struct target *target) static int os_alloc_create(struct target *target, const struct rtos_type *ostype) { int ret = os_alloc(target, ostype); + if (ret != ERROR_OK) + return ret; - if (ret == JIM_OK) { - ret = target->rtos->type->create(target); - if (ret != JIM_OK) - os_free(target); - } + ret = target->rtos->type->create(target); + if (ret != ERROR_OK) + os_free(target); return ret; } -int rtos_create(struct jim_getopt_info *goi, struct target *target) +int rtos_create(struct command_invocation *cmd, struct target *target, + const char *rtos_name) { - int x; - const char *cp; - Jim_Obj *res; - int e; - - if (!goi->is_configure && goi->argc != 0) { - Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "NO PARAMS"); - return JIM_ERR; - } - os_free(target); + target->rtos_auto_detect = false; - e = jim_getopt_string(goi, &cp, NULL); - if (e != JIM_OK) - return e; - - if (strcmp(cp, "none") == 0) - return JIM_OK; + if (strcmp(rtos_name, "none") == 0) + return ERROR_OK; - if (strcmp(cp, "auto") == 0) { + if (strcmp(rtos_name, "auto") == 0) { /* Auto detect tries to look up all symbols for each RTOS, * and runs the RTOS driver's _detect() function when GDB * finds all symbols for any RTOS. See rtos_qsymbol(). */ @@ -128,17 +116,29 @@ int rtos_create(struct jim_getopt_info *goi, struct target *target) return os_alloc(target, rtos_types[0]); } - for (x = 0; rtos_types[x]; x++) - if (strcmp(cp, rtos_types[x]->name) == 0) + for (int x = 0; rtos_types[x]; x++) + if (strcmp(rtos_name, rtos_types[x]->name) == 0) return os_alloc_create(target, rtos_types[x]); - Jim_SetResultFormatted(goi->interp, "Unknown RTOS type %s, try one of: ", cp); - res = Jim_GetResult(goi->interp); - for (x = 0; rtos_types[x]; x++) - Jim_AppendStrings(goi->interp, res, rtos_types[x]->name, ", ", NULL); - Jim_AppendStrings(goi->interp, res, ", auto or none", NULL); + char *all = NULL; + for (int x = 0; rtos_types[x]; x++) { + char *prev = all; + if (all) + all = alloc_printf("%s, %s", all, rtos_types[x]->name); + else + all = alloc_printf("%s", rtos_types[x]->name); + free(prev); + if (!all) { + LOG_ERROR("Out of memory"); + return ERROR_FAIL; + } + } + + command_print(cmd, "Unknown RTOS type %s, try one of: %s, auto or none", + rtos_name, all); + free(all); - return JIM_ERR; + return ERROR_COMMAND_ARGUMENT_INVALID; } void rtos_destroy(struct target *target) diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h index 5ba8b2694..05beab145 100644 --- a/src/rtos/rtos.h +++ b/src/rtos/rtos.h @@ -10,7 +10,6 @@ #include "server/server.h" #include "target/target.h" -#include <helper/jim-nvp.h> typedef int64_t threadid_t; typedef int64_t symbol_address_t; @@ -113,7 +112,8 @@ struct rtos_register_stacking { #define GDB_THREAD_PACKET_NOT_CONSUMED (-40) -int rtos_create(struct jim_getopt_info *goi, struct target *target); +int rtos_create(struct command_invocation *cmd, struct target *target, + const char *rtos_name); void rtos_destroy(struct target *target); int rtos_set_reg(struct connection *connection, int reg_num, uint8_t *reg_value); diff --git a/src/rtos/threadx.c b/src/rtos/threadx.c index 61c49264e..620f43cc8 100644 --- a/src/rtos/threadx.c +++ b/src/rtos/threadx.c @@ -611,9 +611,9 @@ static int threadx_create(struct target *target) target->rtos->rtos_specific_params = (void *)&threadx_params_list[i]; target->rtos->current_thread = 0; target->rtos->thread_details = NULL; - return 0; + return ERROR_OK; } LOG_ERROR("Could not find target in ThreadX compatibility list"); - return -1; + return ERROR_FAIL; } diff --git a/src/target/target.c b/src/target/target.c index 40c8d3ed3..8ccab7e0a 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5176,17 +5176,10 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde command_print(CMD, "missing argument to %s", CMD_ARGV[index - 1]); return ERROR_COMMAND_ARGUMENT_INVALID; } - struct jim_getopt_info goi; - jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - index, CMD_JIMTCL_ARGV + index); + retval = rtos_create(CMD, target, CMD_ARGV[index]); + if (retval != ERROR_OK) + return retval; index++; - goi.is_configure = true; - int resval = rtos_create(&goi, target); - int reslen; - const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); - if (reslen > 0) - command_print(CMD, "%s", result); - if (resval != JIM_OK) - return ERROR_FAIL; } else { if (index != CMD_ARGC) return ERROR_COMMAND_SYNTAX_ERROR; ----------------------------------------------------------------------- Summary of changes: src/rtos/chibios.c | 4 ++-- src/rtos/ecos.c | 4 ++-- src/rtos/embkernel.c | 4 ++-- src/rtos/freertos.c | 4 ++-- src/rtos/hwthread.c | 2 +- src/rtos/linux.c | 2 +- src/rtos/mqx.c | 4 ++-- src/rtos/nuttx.c | 4 ++-- src/rtos/rtkernel.c | 4 ++-- src/rtos/rtos.c | 66 ++++++++++++++++++++++++++-------------------------- src/rtos/rtos.h | 4 ++-- src/rtos/threadx.c | 4 ++-- src/target/target.c | 13 +++-------- 13 files changed, 56 insertions(+), 63 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:36:12
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via afbd01b0a46f3a81fe6076c002ad66973dcfb64c (commit) from d567824f2ac267f61944aa839911f0b5bee98c4a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit afbd01b0a46f3a81fe6076c002ad66973dcfb64c Author: Samuel Obuch <sam...@es...> Date: Thu Feb 13 14:28:27 2025 +0100 github/workflow: fix warnings for github actions - update runner to ubuntu-latest - pass GITHUB_TOKEN to delete-tag-and-release as input Change-Id: I83d69cfd7af7c44e67b1115ac843a0b41d6f87b9 Signed-off-by: Samuel Obuch <sam...@es...> Reviewed-on: https://review.openocd.org/c/openocd/+/8756 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 36b2f3bb3..755e8f4e1 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -8,7 +8,7 @@ name: OpenOCD Snapshot jobs: package: - runs-on: [ubuntu-20.04] + runs-on: [ubuntu-latest] env: DL_DIR: ../downloads BUILD_DIR: ../build @@ -102,8 +102,8 @@ jobs: # add missing dlls cd $HOST-root/usr cp `$HOST-gcc --print-file-name=libwinpthread-1.dll` ./bin/ - # required by libftdi1.dll. For the gcc-mingw-10.3.x or later "libgcc_s_dw2-1.dll" will need to be copied. - cp `$HOST-gcc --print-file-name=libgcc_s_sjlj-1.dll` ./bin/ + # required by libftdi1.dll + cp `$HOST-gcc --print-file-name=libgcc_s_dw2-1.dll` ./bin/ # prepare the artifact ARTIFACT="openocd-${OPENOCD_TAG}-${HOST}.tar.gz" tar -czf $ARTIFACT * @@ -119,8 +119,7 @@ jobs: with: delete_release: true tag_name: ${{ env.RELEASE_NAME }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} - name: Create Release uses: ncipollo/release-action@v1 with: ----------------------------------------------------------------------- Summary of changes: .github/workflows/snapshot.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:35:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d567824f2ac267f61944aa839911f0b5bee98c4a (commit) from efafdd3c552e004525b4515c70ac03765e9b6fd6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d567824f2ac267f61944aa839911f0b5bee98c4a Author: Marc Schink <de...@za...> Date: Sat Aug 17 12:35:30 2024 +0200 doc/manual: Add guideline for configuration files The goal of this guideline is to have consistent and well-structured configurations files. The focus of this patch is on filenames and directory structure. A guideline for the content of the files should be included in a subsequent patch. This patch addresses a long outstanding task listed in 'Pending and Open Tasks'. Change-Id: Ib32dd8b9ed15c3f647cd8d74cfc79edf0e79a3df Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8854 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/manual/config_files.txt b/doc/manual/config_files.txt new file mode 100644 index 000000000..db1cc1419 --- /dev/null +++ b/doc/manual/config_files.txt @@ -0,0 +1,117 @@ +/** @page config_files Configuration Files + +This page gives an overview of the different configuration files, what purpose they serve and how they are structured. +The goal of this guide is to ensure well-structured and consistent configuration files. + +All configuration files are stored in the @c tcl directory of the project directory. +These files must follow the @ref styletcl and @ref naming_convention. +There are different types of configuration files: + +- @ref interface_configs +- @ref target_configs +- @ref board_configs + +@note This guideline must be followed for new configuration files. +There may be configuration files that do not comply with this guide for legacy reasons. + + +@section interface_configs Interface + +This configuration file represents a debug (interface) adapter. +This is usually a USB device that provides an interface to one or more transports such as JTAG or SWD. +Other interfaces like ethernet or parallel port are also represented. + +A debug adapter configuration file must use the following scheme: + +@verbatim +tcl/interface/[vendor]/<adapter name>.cfg +@endverbatim + +The `vendor` directory for debug adapters is often omitted because multiple adapters from the same vendor can be represented by a common configuration file. +One counter example are FTDI-based debug adapters. +There are various devices, either standalone or development boards which use FTDI chips but use different chip models or settings. +Their corresponding configuration files are stored in the `ftdi` folder. + +The name of the `vendor` folder can also be a more generic term such as `parport` as it is used for parallel port based debug adapters. + +If it is foreseeable that new configuration files will be added in the future, create a `vendor` directory even if there is only a single file at the moment. +This prevents that files have to be moved in the future. + +@section target_configs Target + +This configuration file represents an actual chip. +For example, a microcontroller, FPGA, CPLD, or system on chip (SoC). +A target configuration file always represents an entire device series or family. + +A target configuration file must use the following scheme: + +@verbatim +tcl/target/<vendor>/<target name>.cfg +@endverbatim + +Use the device series or family as `target name`. +For example, the configuration file for the nRF54L series from Nordic Semiconductor is located here: + +@verbatim +tcl/target/nordic/nrf54l.cfg +@endverbatim + +If there are many similarities between different targets, use a common file to share large pieces of code. +Do not use a single file to represent multiple device series or families. + +@section board_configs Board + +This configuration file represents a circuit board, for example, a development board. +A board may also contain an on-board debug adapter. + +A board configuration file includes existing target and, if available, interface configuration files, since a target is used on many boards. + +Reuse existing target and interface configuration files whenever possible. +If a board needs an external debug adapter, do @b not write adapter specific configuration files. + + +A board configuration file must use the following scheme: + +@verbatim +tcl/board/<vendor>/<board name>[-suffix].cfg +@endverbatim + +For example, the board configuration file for the NUCLEO-U083RC from STMicroelectronics is located here: + +@verbatim +tcl/board/st/nucleo-u083rc.cfg +@endverbatim + +In case a board supports different features, a `suffix` can be used to indicate this. +Make sure that the suffix is short and meaningful. + +For example, the on-board debug adapter of the FRDM-KV11Z development board can be flashed with a SEGGER J-Link compatible firmware. +Hence, there is the following configuration file: + +@verbatim +tcl/board/nxp/frdm-kv11z-jlink.cfg +@endverbatim + +The use of a suffix should be chosen carefully. +In many cases it is sufficient to make a certain feature accessible via a variable. + +Use a single configuration file for each board. +If there are many similarities between different boards, use a common file to share large pieces of code. + + +@section naming_convention Naming Convention + + +The following naming conventions for configuration files and directories must be used: + +- Use only lower-case letters and digits for directory and filenames +- Use hyphen characters between consecutive words in identifiers (e.g. `more-than-one-word`) + +- Use a common abbreviation for the vendor name, such as + - @c ti for Texas Instruments + - @c st for STMicroelectronics + - @c silabs for Silicon Labs + +An extensive list of abbreviations for vendor names can be found [here](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/vendor-prefixes.yaml). + + */ diff --git a/doc/manual/main.txt b/doc/manual/main.txt index c28fbe228..9da546b6d 100644 --- a/doc/manual/main.txt +++ b/doc/manual/main.txt @@ -21,6 +21,8 @@ check the mailing list archives to find the status of your feature (or bug). - The @subpage releases page describes the project's release process. - The @subpage endianness provides hints about writing and testing endianness independent code for OpenOCD. +- The @subpage config_files page provides a guide for writing configuration files + for OpenOCD. @ref primer provide introductory materials for new developers on various specific topics. ----------------------------------------------------------------------- Summary of changes: doc/manual/config_files.txt | 117 ++++++++++++++++++++++++++++++++++++++++++++ doc/manual/main.txt | 2 + 2 files changed, 119 insertions(+) create mode 100644 doc/manual/config_files.txt hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:34:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via efafdd3c552e004525b4515c70ac03765e9b6fd6 (commit) via 98c95df228dd47ea736cea79a63f3302704cc669 (commit) from 639b7432b81b8851155ab0d539c74ac183bb9bfa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit efafdd3c552e004525b4515c70ac03765e9b6fd6 Author: Marc Schink <de...@za...> Date: Mon Apr 14 09:11:36 2025 +0200 doc/manual: Fix Tcl spelling Use 'Tcl' because it is the official spelling. While at it, fix some misspellings of 'Jim Tcl'. Change-Id: I2d96f63b0dbc96ae62fe00ae41d2eb16897250fb Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8853 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/README b/README index d9cc8f3eb..875c85de3 100644 --- a/README +++ b/README @@ -8,10 +8,10 @@ layered architecture of JTAG interface and TAP support including: - debug target support (e.g. ARM, MIPS): single-stepping, breakpoints/watchpoints, gprof profiling, etc; - flash chip drivers (e.g. CFI, NAND, internal flash); -- embedded TCL interpreter for easy scripting. +- embedded Tcl interpreter for easy scripting. Several network interfaces are available for interacting with OpenOCD: -telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a +telnet, Tcl, and GDB. The GDB server enables OpenOCD to function as a "remote target" for source-level debugging of embedded systems using the GNU GDB program (and the others who talk GDB protocol, e.g. IDA Pro). diff --git a/TODO b/TODO index 239b358f5..803692d58 100644 --- a/TODO +++ b/TODO @@ -12,14 +12,14 @@ may have evolved an idea since it was added here. Feel free to send patches to add or clarify items on this list, too. -@section thelisttcl TCL +@section thelisttcl Tcl -This section provides possible things to improve with OpenOCD's TCL support. +This section provides possible things to improve with OpenOCD's Tcl support. - Fix problem with incorrect line numbers reported for a syntax error in a reset init event. -- organize the TCL configurations: +- organize the Tcl configurations: - provide more directory structure for boards/targets? - factor configurations into layers (encapsulation and re-use) @@ -27,15 +27,15 @@ This section provides possible things to improve with OpenOCD's TCL support. parameters. Currently variables assigned through one such parameter command/script are unset before the next one is invoked. -- Isolate all TCL command support: +- Isolate all Tcl command support: - Pure C CLI implementations using --disable-builtin-tcl. - Allow developers to build new dongles using OpenOCD's JTAG core. - At first, provide only low-level JTAG support; target layer and above rely heavily on scripting event mechanisms. - - Allow full TCL support? add --with-tcl=/path/to/installed/tcl - - Move TCL support out of foo.[ch] and into foo_tcl.[ch] (other ideas?) + - Allow full Tcl support? add --with-tcl=/path/to/installed/tcl + - Move Tcl support out of foo.[ch] and into foo_tcl.[ch] (other ideas?) - See src/jtag/core.c and src/jtag/tcl.c for an example. - - allow some of these TCL command modules to be dynamically loadable? + - allow some of these Tcl command modules to be dynamically loadable? @section thelistadapter Adapter @@ -75,7 +75,7 @@ directly in minidriver API for better embedded host performance. The following tasks have been suggested for adding new core JTAG support: -- Improve autodetection of TAPs by supporting tcl escape procedures that +- Improve autodetection of TAPs by supporting Tcl escape procedures that can configure discovered TAPs based on IDCODE value ... they could: - Remove guessing for irlen - Allow non-default irmask/ircapture values @@ -133,7 +133,7 @@ TCP/IP packets handled by the server. - add BSDL support? A few possible options for the above: - -# Fake a TCL equivalent? + -# Fake a Tcl equivalent? -# Integrate an existing library? -# Write a new C implementation a la Jim? diff --git a/doc/manual/helper.txt b/doc/manual/helper.txt index b59fd664f..6cf3c977b 100644 --- a/doc/manual/helper.txt +++ b/doc/manual/helper.txt @@ -21,7 +21,7 @@ portability API. /** @page helperjim OpenOCD Jim API -The Jim API provides access to a small-footprint TCL implementation. +The Jim API provides access to a small-footprint Tcl implementation. Visit http://jim.tcl.tk/ for more information on Jim. diff --git a/doc/manual/jtag.txt b/doc/manual/jtag.txt index 2653fc78f..5eb945013 100644 --- a/doc/manual/jtag.txt +++ b/doc/manual/jtag.txt @@ -15,7 +15,7 @@ asynchronous transactions. - used by other modules - @subpage jtagtcl - - @b private TCL handling routines + - @b private Tcl handling routines - defined in @c src/jtag/tcl.c - registers and handles Jim commands that configure and use the JTAG core @@ -47,7 +47,7 @@ This section needs to be expanded. */ -/** @page jtagtcl JTAG TCL API +/** @page jtagtcl JTAG Tcl API This section needs to be expanded. diff --git a/doc/manual/primer/docs.txt b/doc/manual/primer/docs.txt index b1c053137..1aefa17e6 100644 --- a/doc/manual/primer/docs.txt +++ b/doc/manual/primer/docs.txt @@ -6,7 +6,7 @@ OpenOCD presently produces several kinds of documentation: - The User's Guide: - Focuses on using the OpenOCD software. - Details the installation, usage, and customization. - - Provides descriptions of public Jim/TCL script commands. + - Provides descriptions of public Jim Tcl script commands. - Written using GNU texinfo. - Created with 'make pdf' or 'make html'. - See @subpage primertexinfo and @ref styletexinfo. diff --git a/doc/manual/primer/tcl.txt b/doc/manual/primer/tcl.txt index eba2f552d..6874f5566 100644 --- a/doc/manual/primer/tcl.txt +++ b/doc/manual/primer/tcl.txt @@ -1,6 +1,6 @@ -/** @page primertcl OpenOCD TCL Primer +/** @page primertcl OpenOCD Tcl Primer -The @subpage scripting page provides additional TCL Primer material. +The @subpage scripting page provides additional Tcl Primer material. @verbatim @@ -8,15 +8,15 @@ The @subpage scripting page provides additional TCL Primer material. **************************************** This is a short introduction to 'un-scare' you about the language -known as TCL. It is structured as a guided tour through the files +known as Tcl. It is structured as a guided tour through the files written by me [Duane Ellis] - in early July 2008 for OpenOCD. Which uses the "JIM" embedded Tcl clone-ish language. -Thing described here are *totally* TCL generic... not Jim specific. +Thing described here are *totally* Tcl generic... not Jim specific. The goal of this document is to encourage you to add your own set of -chips to the TCL package - and most importantly you should know where +chips to the Tcl package - and most importantly you should know where you should put them - so they end up in an organized way. --Duane Ellis. @@ -57,14 +57,14 @@ Definition: Open: at91sam7x256.tcl === TCL TOUR === -A walk through --- For those who are new to TCL. +A walk through --- For those who are new to Tcl. Examine the file: at91sam7x256.tcl It starts with: source [find path/filename.tcl] -In TCL - this is very important. +In Tcl - this is very important. Rule #1 Everything is a string. Rule #2 If you think other wise See #1. @@ -130,7 +130,7 @@ First, there is a "for" loop - at level 0 This means it is evaluated when the file is parsed. == SIDEBAR: About The FOR command == -In TCL, "FOR" is a funny thing, it is not what you think it is. +In Tcl, "FOR" is a funny thing, it is not what you think it is. Syntactically - FOR is a just a command, it is not language construct like for(;;) in C... @@ -191,7 +191,7 @@ proc create_mask { MSB LSB } { Like "for" - PROC is really just a command that takes 3 parameters. The (1) NAME of the function, a (2) LIST of parameters, and a (3) BODY -Again, this is at "level 0" so it is a global function. (Yes, TCL +Again, this is at "level 0" so it is a global function. (Yes, Tcl supports local functions, you put them inside of a function} You'll see in some cases, I nest [brackets] a lot and in others I'm @@ -257,7 +257,7 @@ For example - 'show_mmr32_reg' is given the NAME of the register to display. The assumption is - the NAME is a global variable holding the address of that MMR. -The code does some tricks. The [set [set NAME]] is the TCL way +The code does some tricks. The [set [set NAME]] is the Tcl way of doing double variable interpolation - like makefiles... In a makefile or shell script you may have seen this: @@ -272,7 +272,7 @@ In a makefile or shell script you may have seen this: #BUILD = mac FOO = ${FOO_${BUILD}} -The "double [set] square bracket" thing is the TCL way, nothing more. +The "double [set] square bracket" thing is the Tcl way, nothing more. ---- @@ -352,7 +352,7 @@ tricks with interpretors. Function: show_mmr32_bits() -In this case, we use the special TCL command "upvar" which tcl's way +In this case, we use the special Tcl command "upvar" which is the Tcl way of passing things by reference. In this case, we want to reach up into the callers lexical scope and find the array named "NAMES" @@ -373,7 +373,7 @@ are basically identical... Second - there can be many of them. -In this case - I do some more TCL tricks to dynamically +In this case - I do some more Tcl tricks to dynamically create functions out of thin air. Some assumptions: @@ -409,7 +409,7 @@ And - declare that variable as GLOBAL so the world can find it. Then - we dynamically create a function - based on the register name. Look carefully at how that is done. You'll notice the FUNCTION BODY is -a string - not something in {braces}. Why? This is because we need TCL +a string - not something in {braces}. Why? This is because we need Tcl to evaluate the contents of that string "*NOW*" - when $vn exists not later, when the function "show_FOO" is invoked. diff --git a/doc/manual/scripting.txt b/doc/manual/scripting.txt index f8764e2d7..48ba99bda 100644 --- a/doc/manual/scripting.txt +++ b/doc/manual/scripting.txt @@ -4,11 +4,11 @@ The scripting support is intended for developers of OpenOCD. It is not the intention that normal OpenOCD users will -use tcl scripting extensively, write lots of clever scripts, +use Tcl scripting extensively, write lots of clever scripts, or contribute back to OpenOCD. Target scripts can contain new procedures that end users may -tinker to their needs without really understanding tcl. +tinker to their needs without really understanding Tcl. Since end users are not expected to mess with the scripting language, the choice of language is not terribly important @@ -38,16 +38,16 @@ Default implementation of procedures in tcl/procedures.tcl. and will have no externally visible consequences. Tcl has an advantage in that it's syntax is backwards compatible with the current OpenOCD syntax. -- external scripting. Low level tcl functions will be defined - that return machine readable output. These low level tcl - functions constitute the tcl api. flash_banks is such - a low level tcl proc. "flash banks" is an example of +- external scripting. Low level Tcl functions will be defined + that return machine readable output. These low level Tcl + functions constitute the Tcl api. flash_banks is such + a low level Tcl proc. "flash banks" is an example of a command that has human readable output. The human readable output is expected to change in between versions of OpenOCD. The output from flash_banks may not be in the preferred form for the client. The client then has two choices a) parse the output from flash_banks - or b) write a small piece of tcl to output the + or b) write a small piece of Tcl to output the flash_banks output to a more suitable form. The latter may be simpler. diff --git a/doc/manual/server.txt b/doc/manual/server.txt index 8041c3df3..20e48c1f4 100644 --- a/doc/manual/server.txt +++ b/doc/manual/server.txt @@ -43,7 +43,7 @@ with a script language: What follows hopefully shows how the plans to solve these problems materialized and help to explain the grand roadmap plan. -@subsection serverdocsjim Why JimTCL? The Internal Script Language +@subsection serverdocsjim Why Jim Tcl? The Internal Script Language At the time, the existing "command context schema" was proving itself insufficient. However, the problem was also considered from another @@ -57,14 +57,14 @@ OpenOCD. Yuck. OpenOCD already has a complex enough build system, why make it worse? The goal was to add a simple language that would be moderately easy to -work with and be self-contained. JimTCL is a single C and single H +work with and be self-contained. Jim Tcl is a single C and single H file, allowing OpenOCD to avoid the spider web of dependent packages. -@section serverdocstcl TCL Server Port +@section serverdocstcl Tcl Server Port -The TCL Server port was added in mid-2008. With embedded TCL, we can +The Tcl Server port was added in mid-2008. With embedded Tcl, we can write scripts internally to help things, or we can write "C" code that -interfaces well with TCL. +interfaces well with Tcl. From there, the developers wanted to create an external front-end that would be @a very usable and that @a any language could utilize, @@ -78,7 +78,7 @@ also support a high degree of interoperability with multiple systems. They are not human-centric protocols; more correctly, they are rigid, terse, simple ASCII protocols that are easily parsable by a script. -Thus, the TCL server -- a 'machine' type socket interface -- was added +Thus, the Tcl server -- a 'machine' type socket interface -- was added with the hope was it would output simple "name-value" pair type data. At the time, simple name/value pairs seemed reasonably easier to do at the time, though Maybe it should output JSON; @@ -107,7 +107,7 @@ What works easier and is less work is what is already present in every platform? The answer: A web browser. In other words, OpenOCD could serve out embedded web pages via "localhost" to your browser. -Long before OpenOCD had a TCL command line, Zylin AS built their ZY1000 +Long before OpenOCD had a Tcl command line, Zylin AS built their ZY1000 device with a built-in HTTP server. Later, they were willing to both contribute and integrate most of that work into the main tree. @@ -128,8 +128,8 @@ every language has it's own set of wack-ness, parameter marshaling is painful. What about "callbacks" and structures, and other mess. Imagine -debugging that system. When JimTCL was introduced Spencer Oliver had -quite a few well-put concerns (Summer 2008) about the idea of "TCL" +debugging that system. When Jim Tcl was introduced Spencer Oliver had +quite a few well-put concerns (Summer 2008) about the idea of "Tcl" taking over OpenOCD. His concern is and was: how do you debug something written in 2 different languages? A "SWIG" front-end is unlikely to help that situation. @@ -143,7 +143,7 @@ to Localhost or remote host, however one might want to make it work. A socket interface is very simple. One could write a Java application and serve it out via the embedded web server, could it - or something -like it talk to the built in TCL server? Yes, absolutely! We are on to +like it talk to the built in Tcl server? Yes, absolutely! We are on to something here. @subsection serverdocplatforms Platform Permutations @@ -167,9 +167,9 @@ the Socket Approach is used. @subsection serverdocfuture Development Scale Out -During 2008, Duane Ellis created some TCL scripts to display peripheral -register contents. For example, look at the sam7 TCL scripts, and the -stm32 TCL scripts. The hope was others would create more. +During 2008, Duane Ellis created some Tcl scripts to display peripheral +register contents. For example, look at the sam7 Tcl scripts, and the +stm32 Tcl scripts. The hope was others would create more. A good example of this is display/view the peripheral registers on @@ -208,7 +208,7 @@ upon it, sometimes that is the only scheme available. As a small group of developers, supporting all the platforms and targets in the debugger will be difficult, as there are enough problem with the plethora of Adapters, Chips, and different target boards. -Yes, the TCL interface might be suitable, but it has not received much +Yes, the Tcl interface might be suitable, but it has not received much love or attention. Perhaps it will after you read and understand this. One reason might be, this adds one more host side requirement to make @@ -247,8 +247,8 @@ Altogether, it provides a universally accessible GUI for OpenOCD. @section serverdocshtml Simple HTML Pages -There is (or could be) a simple "Jim TCL" function to read a memory -location. If that can be tied into a TCL script that can modify the +There is (or could be) a simple "Jim Tcl" function to read a memory +location. If that can be tied into a Tcl script that can modify the HTTP text, then we have a simple script-based web server with a JTAG engine under the hood. @@ -275,7 +275,7 @@ bit-banging JTAG Adapter serving web pages. @subsection serverdocshtmladv Advanced HTML Pages -Java or JavaScript could be used to talk back to the TCL port. One +Java or JavaScript could be used to talk back to the Tcl port. One could write a Java, AJAX, FLASH, or some other developer friendly toolbox and get a real cross-platform GUI interface. Sure, the interface is not native - but it is 100% cross-platform! diff --git a/doc/manual/style.txt b/doc/manual/style.txt index dc27e8767..f7a12988f 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -27,12 +27,12 @@ providing documentation, either as part of the C code or stand-alone. Feedback would be welcome to improve the OpenOCD guidelines. */ -/** @page styletcl TCL Style Guide +/** @page styletcl Tcl Style Guide -OpenOCD needs to expand its Jim/TCL Style Guide. +OpenOCD needs to expand its Jim Tcl Style Guide. Many of the guidelines listed on the @ref stylec page should apply to -OpenOCD's Jim/TCL code as well. +OpenOCD's Jim Tcl code as well. */ /** @page stylec C Style Guide commit 98c95df228dd47ea736cea79a63f3302704cc669 Author: Marc Schink <de...@za...> Date: Mon Apr 14 09:09:49 2025 +0200 doc/openocd: Fix Tcl spelling Use 'Tcl' because it is the official spelling. While at it, fix some misspellings of 'Jim Tcl'. Change-Id: I084541a1cc0276d15a263b843ba740da04efc30a Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8852 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/doc/openocd.texi b/doc/openocd.texi index cbe5e86da..e0bdd5ca0 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -62,7 +62,7 @@ Documentation License''. * About:: About OpenOCD * Developers:: OpenOCD Developer Resources * Debug Adapter Hardware:: Debug Adapter Hardware -* About Jim-Tcl:: About Jim-Tcl +* About Jim Tcl:: About Jim Tcl * Running:: Running OpenOCD * OpenOCD Project Setup:: OpenOCD Project Setup * Config File Guidelines:: Config File Guidelines @@ -629,43 +629,43 @@ This is deprecated from Linux v5.3; prefer using @b{linuxgpiod}. @end itemize -@node About Jim-Tcl -@chapter About Jim-Tcl -@cindex Jim-Tcl +@node About Jim Tcl +@chapter About Jim Tcl +@cindex Jim Tcl @cindex tcl -OpenOCD uses a small ``Tcl Interpreter'' known as Jim-Tcl. +OpenOCD uses a small ``Tcl Interpreter'' known as Jim Tcl. This programming language provides a simple and extensible command interpreter. -All commands presented in this Guide are extensions to Jim-Tcl. +All commands presented in this Guide are extensions to Jim Tcl. You can use them as simple commands, without needing to learn much of anything about Tcl. Alternatively, you can write Tcl programs with them. You can learn more about Jim at its website, @url{http://jim.tcl.tk}. There is an active and responsive community, get on the mailing list -if you have any questions. Jim-Tcl maintainers also lurk on the +if you have any questions. Jim Tcl maintainers also lurk on the OpenOCD mailing list. @itemize @bullet @item @b{Jim vs. Tcl} -@* Jim-Tcl is a stripped down version of the well known Tcl language, -which can be found here: @url{http://www.tcl.tk}. Jim-Tcl has far -fewer features. Jim-Tcl is several dozens of .C files and .H files and +@* Jim Tcl is a stripped down version of the well known Tcl language, +which can be found here: @url{http://www.tcl.tk}. Jim Tcl has far +fewer features. Jim Tcl is several dozens of .C files and .H files and implements the basic Tcl command set. In contrast: Tcl 8.6 is a 4.2 MB .zip file containing 1540 files. @item @b{Missing Features} @* Our practice has been: Add/clone the real Tcl feature if/when -needed. We welcome Jim-Tcl improvements, not bloat. Also there -are a large number of optional Jim-Tcl features that are not +needed. We welcome Jim Tcl improvements, not bloat. Also there +are a large number of optional Jim Tcl features that are not enabled in OpenOCD. @item @b{Scripts} -@* OpenOCD configuration scripts are Jim-Tcl Scripts. OpenOCD's +@* OpenOCD configuration scripts are Jim Tcl Scripts. OpenOCD's command interpreter today is a mixture of (newer) -Jim-Tcl commands, and the (older) original command interpreter. +Jim Tcl commands, and the (older) original command interpreter. @item @b{Commands} @* At the OpenOCD telnet command line (or via the GDB monitor command) one @@ -674,10 +674,10 @@ Some of the commands documented in this guide are implemented as Tcl scripts, from a @file{startup.tcl} file internal to the server. @item @b{Historical Note} -@* Jim-Tcl was introduced to OpenOCD in spring 2008. Fall 2010, -before OpenOCD 0.5 release, OpenOCD switched to using Jim-Tcl -as a Git submodule, which greatly simplified upgrading Jim-Tcl -to benefit from new features and bugfixes in Jim-Tcl. +@* Jim Tcl was introduced to OpenOCD in spring 2008. Fall 2010, +before OpenOCD 0.5 release, OpenOCD switched to using Jim Tcl +as a Git submodule, which greatly simplified upgrading Jim Tcl +to benefit from new features and bugfixes in Jim Tcl. @item @b{Need a crash course in Tcl?} @*@xref{Tcl Crash Course}. @@ -796,7 +796,7 @@ those channels. If you are having problems, you can enable internal debug messages via the @option{-d} option. -Also it is possible to interleave Jim-Tcl commands w/config scripts using the +Also it is possible to interleave Jim Tcl commands w/config scripts using the @option{-c} command line switch. To enable debug output (when reporting problems or working on OpenOCD @@ -962,7 +962,7 @@ that can be tested in a later script. @end quotation Here we will focus on the simpler solution: one user config -file, including basic configuration plus any TCL procedures +file, including basic configuration plus any Tcl procedures to simplify your work. @section User Config Files @@ -1432,7 +1432,7 @@ In addition to target-specific utility code, another way that board and target config files communicate is by following a convention on how to use certain variables. -The full Tcl/Tk language supports ``namespaces'', but Jim-Tcl does not. +The full Tcl/Tk language supports ``namespaces'', but Jim Tcl does not. Thus the rule we follow in OpenOCD is this: Variables that begin with a leading underscore are temporary in nature, and can be modified and used at will within a target configuration file. @@ -1552,7 +1552,7 @@ configuration files for other JTAG tools Some of this code could probably be shared between different boards. For example, setting up a DRAM controller often doesn't differ by much except the bus width (16 bits or 32?) and memory timings, so a -reusable TCL procedure loaded by the @file{target.cfg} file might take +reusable Tcl procedure loaded by the @file{target.cfg} file might take those as parameters. Similarly with oscillator, PLL, and clock setup; and disabling the watchdog. @@ -2137,7 +2137,7 @@ corresponding subsystems: @end deffn At last, @command{init} executes all the commands that are specified in -the TCL list @var{post_init_commands}. The commands are executed in the +the Tcl list @var{post_init_commands}. The commands are executed in the same order they occupy in the list. If one of the commands fails, then the error is propagated and OpenOCD fails too. @example @@ -2222,7 +2222,7 @@ cause initialization to fail with "Unknown remote qXfer reply: OK". @deffn {Config Command} {tcl port} [number] Specify or query the port used for a simplified RPC -connection that can be used by clients to issue TCL commands and get the +connection that can be used by clients to issue Tcl commands and get the output from the Tcl engine. Intended as a machine interface. When not specified during the configuration stage, @@ -2233,7 +2233,7 @@ When specified as "disabled", this service is not activated. @deffn {Config Command} {telnet port} [number] Specify or query the port on which to listen for incoming telnet connections. -This port is intended for interaction with one human through TCL commands. +This port is intended for interaction with one human through Tcl commands. When not specified during the configuration stage, the port @var{number} defaults to 4444. When specified as "disabled", this service is not activated. @@ -2304,7 +2304,7 @@ The file name is @i{target_name}.xml. Hardware debuggers are parts of asynchronous systems, where significant events can happen at any time. The OpenOCD server needs to detect some of these events, -so it can report them to through TCL command line +so it can report them to through Tcl command line or to GDB. Examples of such events include: @@ -2345,7 +2345,7 @@ specific information about the current state is printed. An optional parameter allows background polling to be enabled and disabled. -You could use this from the TCL command shell, or +You could use this from the Tcl command shell, or from GDB using @command{monitor poll} command. Leave background polling enabled while you're using GDB. @example @@ -4527,7 +4527,7 @@ mechanism for debugger targets.) See the next section for information about the available events. The @code{configure} subcommand assigns an event handler, -a TCL string which is evaluated when the event is triggered. +a Tcl string which is evaluated when the event is triggered. The @code{cget} subcommand returns that handler. @end deffn @@ -4786,7 +4786,7 @@ The instance number is in bits 28..31 of DLPIDR value. @deffn {Command} {dap names} This command returns a list of all registered DAP objects. It it useful mainly -for TCL scripting. +for Tcl scripting. @end deffn @deffn {Command} {dap info} [@var{num}|@option{root}] @@ -5775,7 +5775,7 @@ until the programming session is finished. If you use @ref{programmingusinggdb,,Programming using GDB}, the target is prepared automatically in the event gdb-flash-erase-start -The jimtcl script @command{program} calls @command{reset init} explicitly. +The Tcl script @command{program} calls @command{reset init} explicitly. @section Erasing, Reading, Writing to Flash @cindex flash erasing @@ -7462,18 +7462,18 @@ mspm0_board_reset @end itemize -@deffn {TCL proc} {mspm0_board_reset} +@deffn {Tcl proc} {mspm0_board_reset} Performs an nRST toggle on the device. @end deffn -@deffn {TCL proc} {mspm0_mass_erase} +@deffn {Tcl proc} {mspm0_mass_erase} Sends the mass erase command to the SEC-AP mailbox and then performs an nRST toggle. Once the command has been fully processed by the ROM, all MAIN memory will be erased. NOTE: This command is not supported on MSPM0C* family of devices. @end deffn -@deffn {TCL proc} {mspm0_factory_reset} +@deffn {Tcl proc} {mspm0_factory_reset} Sends the factory reset command to the SEC-AP mailbox and then performs an nRST toggle. Once the command has been fully processed by the ROM, all MAIN memory will be erased and NONMAIN will be reset to its default @@ -7772,7 +7772,7 @@ flash bank super_flash_toc2_cm4 psoc6 0x16007C00 0 0 0 \ psoc6-specific commands @deffn {Command} {psoc6 reset_halt} -Command can be used to simulate broken Vector Catch from gdbinit or tcl scripts. +Command can be used to simulate broken Vector Catch from gdbinit or Tcl scripts. When invoked for CM0+ target, it will set break point at application entry point and issue SYSRESETREQ. This will reset both cores and all peripherals. CM0+ will reset CM4 during boot anyway so this is safe. On CM4 target, VECTRESET is used @@ -8987,7 +8987,7 @@ OpenOCD implements numerous ways to program the target flash, whether internal o Programming can be achieved by either using @ref{programmingusinggdb,,Programming using GDB}, or using the commands given in @ref{flashprogrammingcommands,,Flash Programming Commands}. -@*To simplify using the flash commands directly a jimtcl script is available that handles the programming and verify stage. +@*To simplify using the flash commands directly a Tcl script is available that handles the programming and verify stage. OpenOCD will program/verify/reset the target and optionally shutdown. The script is executed as follows and by default the following actions will be performed. @@ -9269,7 +9269,7 @@ non-zero exit code to the parent process. If user types CTRL-C or kills OpenOCD, the command @command{shutdown} will be automatically executed to cause OpenOCD to exit. -It is possible to specify, in the TCL list @var{pre_shutdown_commands} , a +It is possible to specify, in the Tcl list @var{pre_shutdown_commands} , a set of commands to be automatically executed before @command{shutdown} , e.g.: @example lappend pre_shutdown_commands @{echo "Goodbye, my friend ..."@} @@ -9858,7 +9858,7 @@ Add or replace usage text on the given @var{command_name}. @deffn {Command} {ms} Returns current time since the Epoch in ms (See: @url{https://en.wikipedia.org/wiki/Epoch_(computing)}). -Useful to compute delays in TCL. +Useful to compute delays in Tcl. @end deffn @node Architecture and Core Commands @@ -10175,7 +10175,7 @@ of the CTI. @deffn {Command} {cti names} Prints a list of names of all CTI objects created. This command is mainly -useful in TCL scripting. +useful in Tcl scripting. @end deffn @section Generic ARM @@ -10819,7 +10819,7 @@ protocol used for trace data: @end itemize @item @code{-event} @var{event_name} @var{event_body} -- assigns an event handler, -a TCL string which is evaluated when the event is triggered. The events +a Tcl string which is evaluated when the event is triggered. The events @code{pre-enable}, @code{post-enable}, @code{pre-disable} and @code{post-disable} are defined for TPIU/SWO. A typical use case for the event @code{pre-enable} is to enable the trace clock @@ -11643,7 +11643,7 @@ capabilities than most of the other processors and in addition there is an extension interface that allows SoC designers to add custom registers and instructions. For the OpenOCD that mostly means that set of core and AUX registers in target will vary and is not fixed for a particular processor -model. To enable extensibility several TCL commands are provided that allow to +model. To enable extensibility several Tcl commands are provided that allow to describe those optional registers in OpenOCD configuration files. Moreover those commands allow for a dynamic target features discovery. @@ -11798,12 +11798,12 @@ configuration comprises two categories: @end enumerate All common Xtensa support is built into the OpenOCD Xtensa target layer and -is enabled through a combination of TCL scripts: the target-specific +is enabled through a combination of Tcl scripts: the target-specific @file{target/xtensa.cfg} and a board-specific @file{board/xtensa-*.cfg}, similar to other target architectures. Importantly, core-specific configuration information must be provided by -the user, and takes the form of an @file{xtensa-core-XXX.cfg} TCL script that +the user, and takes the form of an @file{xtensa-core-XXX.cfg} Tcl script that defines the core's configurable features through a series of Xtensa configuration commands (detailed below). @@ -13376,7 +13376,7 @@ learning Tcl, the intent of this chapter is to give you some idea of how the Tcl scripts work. This chapter is written with two audiences in mind. (1) OpenOCD users -who need to understand a bit more of how Jim-Tcl works so they can do +who need to understand a bit more of how Jim Tcl works so they can do something useful, and (2) those that want to add a new command to OpenOCD. @@ -13536,7 +13536,7 @@ Often many of those parameters are in @{curly-braces@} - thus the variables inside are not expanded or replaced until later. Remember that every Tcl command looks like the classic ``main( argc, -argv )'' function in C. In JimTCL - they actually look like this: +argv )'' function in C. In Jim Tcl - they actually look like this: @example int ----------------------------------------------------------------------- Summary of changes: README | 4 +-- TODO | 18 +++++----- doc/manual/helper.txt | 2 +- doc/manual/jtag.txt | 4 +-- doc/manual/primer/docs.txt | 2 +- doc/manual/primer/tcl.txt | 28 +++++++-------- doc/manual/scripting.txt | 14 ++++---- doc/manual/server.txt | 34 +++++++++--------- doc/manual/style.txt | 6 ++-- doc/openocd.texi | 88 +++++++++++++++++++++++----------------------- 10 files changed, 100 insertions(+), 100 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:34:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 639b7432b81b8851155ab0d539c74ac183bb9bfa (commit) from fdd76c899f423c09e4fb4311387eeebfc215650e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 639b7432b81b8851155ab0d539c74ac183bb9bfa Author: Marc Schink <de...@za...> Date: Fri Dec 13 07:34:38 2024 +0000 tcl/board: Add config for NUCLEO-U083RC Tested with NUCLEO-U083RC development board. Change-Id: I5e7ed1a9a19dbab70ee3155f92d67874c33b1ac2 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/8649 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/board/st/nucleo-u083rc.cfg b/tcl/board/st/nucleo-u083rc.cfg new file mode 100644 index 000000000..7b878adbc --- /dev/null +++ b/tcl/board/st/nucleo-u083rc.cfg @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# NUCLEO-U083RC +# https://www.st.com/en/evaluation-tools/nucleo-u083rc.html + +source [find interface/stlink.cfg] + +transport select dapdirect_swd + +source [find target/stm32u0x.cfg] + +reset_config srst_only ----------------------------------------------------------------------- Summary of changes: tcl/board/{st_nucleo_c0.cfg => st/nucleo-u083rc.cfg} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) copy tcl/board/{st_nucleo_c0.cfg => st/nucleo-u083rc.cfg} (55%) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:33:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via fdd76c899f423c09e4fb4311387eeebfc215650e (commit) via d8a2f6dbcf5f0554def22d02f503fb242a604f84 (commit) from 420f637cab324541230fbff0dea447cf40df3b0f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fdd76c899f423c09e4fb4311387eeebfc215650e Author: R. Diez <rdi...@rd...> Date: Thu Apr 10 20:57:49 2025 +0200 configure.ac: show the sysfsgpio adapter in the config summary Also enable this adapter by default (auto). Change-Id: I43b9f1a1873b381d015114da57efc1d78e6e7780 Signed-off-by: R. Diez <rdi...@rd...> Reviewed-on: https://review.openocd.org/c/openocd/+/8834 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/configure.ac b/configure.ac index 5c516efd1..9db378702 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,9 @@ m4_define([LIBFTDI_USB1_ADAPTERS], m4_define([LIBGPIOD_ADAPTERS], [[[linuxgpiod], [Linux GPIO bitbang through libgpiod], [LINUXGPIOD]]]) +m4_define([SYSFSGPIO_ADAPTER], + [[[sysfsgpio], [Linux GPIO bitbang through sysfs], [SYSFSGPIO]]]) + m4_define([REMOTE_BITBANG_ADAPTER], [[[remote_bitbang], [Remote Bitbang driver], [REMOTE_BITBANG]]]) @@ -315,6 +318,7 @@ AC_ARG_ADAPTERS([ LIBFTDI_ADAPTERS, LIBFTDI_USB1_ADAPTERS, LIBGPIOD_ADAPTERS, + SYSFSGPIO_ADAPTER, REMOTE_BITBANG_ADAPTER, LINUXSPIDEV_ADAPTER, SERIAL_PORT_ADAPTERS, @@ -379,10 +383,6 @@ AC_ARG_ENABLE([gw16012], AS_HELP_STRING([--enable-gw16012], [Enable building support for the Gateworks GW16012 JTAG Programmer]), [build_gw16012=$enableval], [build_gw16012=no]) -AC_ARG_ENABLE([sysfsgpio], - AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]), - [build_sysfsgpio=$enableval], [build_sysfsgpio=no]) - can_build_rshim=no AS_CASE([$host_os], @@ -391,10 +391,6 @@ AS_CASE([$host_os], can_build_rshim=yes ], [ - AS_IF([test "x$build_sysfsgpio" = "xyes"], [ - AC_MSG_ERROR([sysfsgpio is only available on linux]) - ]) - AS_CASE([$host_os], [freebsd*], [ can_build_rshim=yes ], @@ -604,13 +600,6 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [ ]) ]) -AS_IF([test "x$build_sysfsgpio" = "xyes"], [ - build_bitbang=yes - AC_DEFINE([BUILD_SYSFSGPIO], [1], [1 if you want the SysfsGPIO driver.]) -], [ - AC_DEFINE([BUILD_SYSFSGPIO], [0], [0 if you don't want SysfsGPIO driver.]) -]) - PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [ use_libusb1=yes AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x]) @@ -702,6 +691,7 @@ PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libu PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi]) PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x]) PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [Linux libgpiod]) +PROCESS_ADAPTERS([SYSFSGPIO_ADAPTER], ["x$is_linux" = "xyes"], [Linux sysfs]) PROCESS_ADAPTERS([REMOTE_BITBANG_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2]) PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build]) @@ -720,6 +710,10 @@ AS_IF([test "x$enable_linuxgpiod" != "xno"], [ build_bitbang=yes ]) +AS_IF([test "x$enable_sysfsgpio" != "xno"], [ + build_bitbang=yes +]) + AS_IF([test "x$enable_remote_bitbang" != "xno"], [ build_bitbang=yes ]) @@ -767,7 +761,6 @@ AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"]) AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"]) AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"]) AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"]) -AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"]) AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"]) AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"]) AM_CONDITIONAL([IS_MINGW], [test "x$is_mingw" = "xyes"]) @@ -864,6 +857,7 @@ m4_foreach([adapter], [USB1_ADAPTERS, HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS, LIBFTDI_USB1_ADAPTERS, LIBGPIOD_ADAPTERS, + SYSFSGPIO_ADAPTER, REMOTE_BITBANG_ADAPTER, LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS, LINUXSPIDEV_ADAPTER, commit d8a2f6dbcf5f0554def22d02f503fb242a604f84 Author: R. Diez <rdi...@rd...> Date: Fri Apr 11 15:30:22 2025 +0200 configure.ac: show the Amontec JTAG-Accelerator driver in the config summary Also enable this driver by default (auto). Change-Id: I7f592dd697c6ee150a81e151ff2333447cd9130d Signed-off-by: R. Diez <rdi...@rd...> Reviewed-on: https://review.openocd.org/c/openocd/+/8835 Tested-by: jenkins Reviewed-by: zapb <de...@za...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/configure.ac b/configure.ac index 84ca03bf0..5c516efd1 100644 --- a/configure.ac +++ b/configure.ac @@ -190,6 +190,9 @@ m4_define([JTAG_VPI_ADAPTER], m4_define([RSHIM_ADAPTER], [[[rshim], [BlueField SoC via rshim], [RSHIM]]]) +m4_define([AMTJTAGACCEL_ADAPTER], + [[[amtjtagaccel], [Amontec JTAG-Accelerator driver], [AMTJTAGACCEL]]]) + # The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter # because there is an M4 macro called 'adapter'. m4_define([DUMMY_ADAPTER], @@ -320,6 +323,7 @@ AC_ARG_ADAPTERS([ JTAG_DPI_ADAPTER, JTAG_VPI_ADAPTER, RSHIM_ADAPTER, + AMTJTAGACCEL_ADAPTER, PCIE_ADAPTERS, LIBJAYLINK_ADAPTERS ],[auto]) @@ -338,10 +342,6 @@ AC_ARG_ENABLE([parport_giveio], [Enable use of giveio for parport (for CygWin only)]), [parport_use_giveio=$enableval], [parport_use_giveio=]) -AC_ARG_ENABLE([amtjtagaccel], - AS_HELP_STRING([--enable-amtjtagaccel], [Enable building the Amontec JTAG-Accelerator driver]), - [build_amtjtagaccel=$enableval], [build_amtjtagaccel=no]) - AS_CASE(["${host_cpu}"], [arm*|aarch64], [ AC_ARG_ENABLE([bcm2835gpio], @@ -576,12 +576,6 @@ AS_IF([test "x$parport_use_giveio" = "xyes"], [ AC_DEFINE([PARPORT_USE_GIVEIO], [0], [0 if you don't want parport to use giveio.]) ]) -AS_IF([test "x$build_amtjtagaccel" = "xyes"], [ - AC_DEFINE([BUILD_AMTJTAGACCEL], [1], [1 if you want the Amontec JTAG-Accelerator driver.]) -], [ - AC_DEFINE([BUILD_AMTJTAGACCEL], [0], [0 if you don't want the Amontec JTAG-Accelerator driver.]) -]) - AS_IF([test "x$build_gw16012" = "xyes"], [ AC_DEFINE([BUILD_GW16012], [1], [1 if you want the Gateworks GW16012 driver.]) ], [ @@ -719,6 +713,7 @@ PROCESS_ADAPTERS([JTAG_DPI_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([JTAG_VPI_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([RSHIM_ADAPTER], ["x$can_build_rshim" = "xyes"], [internal error: validation should happen beforehand]) +PROCESS_ADAPTERS([AMTJTAGACCEL_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused]) AS_IF([test "x$enable_linuxgpiod" != "xno"], [ @@ -771,7 +766,6 @@ AM_CONDITIONAL([IMX_GPIO], [test "x$build_imx_gpio" = "xyes"]) AM_CONDITIONAL([AM335XGPIO], [test "x$build_am335xgpio" = "xyes"]) AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"]) AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"]) -AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"]) AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"]) AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"]) AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"]) @@ -877,6 +871,7 @@ m4_foreach([adapter], [USB1_ADAPTERS, JTAG_DPI_ADAPTER, JTAG_VPI_ADAPTER, RSHIM_ADAPTER, + AMTJTAGACCEL_ADAPTER, DUMMY_ADAPTER, OPTIONAL_LIBRARIES, COVERAGE], ----------------------------------------------------------------------- Summary of changes: configure.ac | 43 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 27 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:30:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 420f637cab324541230fbff0dea447cf40df3b0f (commit) from ad53fe659b46657ddf16a08f8dc4f4d0c5df8901 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 420f637cab324541230fbff0dea447cf40df3b0f Author: Antonio Borneo <bor...@gm...> Date: Mon Dec 23 20:20:08 2024 +0100 stlink: simplify the use of deprecated HLA transport Commit 34ec5536c0ba ("stlink: deprecate HLA support") makes hard to use the still functional HLA transport with the stlink listed in board config files. Now that the prefixes 'hla_' and 'dapdirect_' has been dropped from the transport name, allow overriding the transport by using the 'stlink-hla' script in front of the board file, e.g.: openocd -f interface/stlink-hla.cfg -f board/st_nucleo_f4.cfg Revert the documentation changes of the change above. Improve the documentation to explain how to use the compatibility HLA mode. Improve the error message in stlink driver to guide the user to update the stlink firmware and to use the compatibility HLA mode. Change-Id: I5d0bc7954511692cebe024bda2aaa72767b97681 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8679 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index f557a55fe..cbe5e86da 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2497,7 +2497,7 @@ This command is only available if your libusb1 is at least version 1.0.16. Specifies the @var{serial_string} of the adapter to use. If this command is not specified, serial strings are not checked. Only the following adapter drivers use the serial string from this command: -arm-jtag-ew, cmsis_dap, esp_usb_jtag, ft232r, ftdi, hla (ti-icdi), jlink, kitprog, opendus, +arm-jtag-ew, cmsis_dap, esp_usb_jtag, ft232r, ftdi, hla (stlink, ti-icdi), jlink, kitprog, opendus, openjtag, osbdm, presto, rlink, st-link, usb_blaster (ublast2), usbprog, vsllink, xds110. @end deffn @@ -3205,16 +3205,19 @@ that OpenOCD would normally use to access the target. Currently supported adapters include the STMicroelectronics ST-LINK, TI ICDI and Nuvoton Nu-Link. + ST-LINK firmware version >= V2.J21.S4 recommended due to issues with earlier versions of firmware where serial number is reset after first use. Suggest using ST firmware update utility to upgrade ST-LINK firmware even if current version reported is V2.J21.S4. +The ST-LINK firmware update utility is available for download from +@url{https://www.st.com/en/development-tools/stsw-link007.html, ST website}. @deffn {Config Command} {hla device_desc} description Currently Not Supported. @end deffn -@deffn {Config Command} {hla layout} (@option{icdi}|@option{nulink}) +@deffn {Config Command} {hla layout} (@option{stlink}|@option{icdi}|@option{nulink}) Specifies the adapter layout to use. @end deffn @@ -3222,6 +3225,15 @@ Specifies the adapter layout to use. Pairs of vendor IDs and product IDs of the device. @end deffn +@deffn {Config Command} {hla stlink_backend} (usb | tcp [port]) +@emph{ST-Link only:} Choose between 'exclusive' USB communication (the default backend) or +'shared' mode using ST-Link TCP server (the default port is 7184). + +@emph{Note:} ST-Link TCP server is a binary application provided by ST +available from @url{https://www.st.com/en/development-tools/st-link-server.html, +ST-LINK server software module}. +@end deffn + @deffn {Command} {hla command} command Execute a custom adapter-specific command. The @var{command} string is passed as is to the underlying adapter layout handler. @@ -3236,6 +3248,11 @@ directly access the arm ADIv5 DAP. The older API that requires HLA transport is deprecated and will be dropped from OpenOCD. In mean time it's still available by using @file{interface/stlink-hla.cfg}. +The HLA interface file can be put as first command line argument to +force using is in place of the default DAP API. +@example +openocd -f interface/stlink-hla.cfg -f board/st_nucleo_f4.cfg +@end example The new API provide access to multiple AP on the same DAP, but the maximum number of the AP port is limited by the specific firmware version diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index e018f71cd..5ee1f8526 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -5143,7 +5143,12 @@ static int stlink_dap_init(void) if ((mode != STLINK_MODE_DEBUG_SWIM) && !(stlink_dap_handle->version.flags & STLINK_F_HAS_DAP_REG)) { - LOG_ERROR("ST-Link version does not support DAP direct transport"); + LOG_ERROR("The firmware in the ST-Link adapter only supports deprecated HLA."); + LOG_ERROR("Please consider updating the ST-Link firmware with a version"); + LOG_ERROR("newer that V2J24 (2015), available for downloading on ST website:"); + LOG_ERROR(" https://www.st.com/en/development-tools/stsw-link007.html"); + LOG_ERROR("In mean time, you can re-run OpenOCD for ST-Link HLA as:"); + LOG_ERROR(" openocd -f interface/stlink-hla.cfg ..."); return ERROR_FAIL; } return ERROR_OK; diff --git a/tcl/interface/stlink.cfg b/tcl/interface/stlink.cfg index 962d192ec..48c565661 100644 --- a/tcl/interface/stlink.cfg +++ b/tcl/interface/stlink.cfg @@ -10,6 +10,12 @@ # SWIM transport is natively supported # +if { [adapter name] == "hla" } { + # Deprecated HLA adapter driver already selected. + # Quit silently, as the ST-LINK driver already complains. + return +} + adapter driver st-link st-link vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754 0x0483 0x3755 0x0483 0x3757 ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 21 +++++++++++++++++++-- src/jtag/drivers/stlink_usb.c | 7 ++++++- tcl/interface/stlink.cfg | 6 ++++++ 3 files changed, 31 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:29:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ad53fe659b46657ddf16a08f8dc4f4d0c5df8901 (commit) from c1c4d489df4bbbc2902c0e4ef744157994f1b22a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ad53fe659b46657ddf16a08f8dc4f4d0c5df8901 Author: Antonio Borneo <bor...@gm...> Date: Mon Dec 23 18:10:10 2024 +0100 tcl: convert transport select to jtag and swd Convert every transport select command: - hla_swd -> swd - dapdirect_swd -> swd - hla_jtag -> jtag - dapdirect_jtag -> jtag Change-Id: I81971e06f7aefd21a570a4e098cf3822a775464b Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8678 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/tcl/board/ek-lm4f120xl.cfg b/tcl/board/ek-lm4f120xl.cfg index db8b2010b..44b1b1ea1 100644 --- a/tcl/board/ek-lm4f120xl.cfg +++ b/tcl/board/ek-lm4f120xl.cfg @@ -12,7 +12,7 @@ # source [find interface/ti-icdi.cfg] -transport select hla_jtag +transport select jtag set WORKAREASIZE 0x8000 set CHIPNAME lm4f120h5qr diff --git a/tcl/board/ek-lm4f232.cfg b/tcl/board/ek-lm4f232.cfg index 89b2c3ce8..bb7f9ea5b 100644 --- a/tcl/board/ek-lm4f232.cfg +++ b/tcl/board/ek-lm4f232.cfg @@ -12,7 +12,7 @@ # source [find interface/ti-icdi.cfg] -transport select hla_jtag +transport select jtag set WORKAREASIZE 0x8000 set CHIPNAME lm4f23x diff --git a/tcl/board/st_b-l475e-iot01a.cfg b/tcl/board/st_b-l475e-iot01a.cfg index 3f3db125c..5bdbdb4a2 100644 --- a/tcl/board/st_b-l475e-iot01a.cfg +++ b/tcl/board/st_b-l475e-iot01a.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 96KB set WORKAREASIZE 0x18000 diff --git a/tcl/board/st_nucleo_f0.cfg b/tcl/board/st_nucleo_f0.cfg index 00c131fd6..4d8071127 100644 --- a/tcl/board/st_nucleo_f0.cfg +++ b/tcl/board/st_nucleo_f0.cfg @@ -10,7 +10,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f0x.cfg] diff --git a/tcl/board/st_nucleo_f103rb.cfg b/tcl/board/st_nucleo_f103rb.cfg index 892bdda99..1b440ed9e 100644 --- a/tcl/board/st_nucleo_f103rb.cfg +++ b/tcl/board/st_nucleo_f103rb.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f1x.cfg] diff --git a/tcl/board/st_nucleo_f3.cfg b/tcl/board/st_nucleo_f3.cfg index 38f49e3d5..8ff57eece 100644 --- a/tcl/board/st_nucleo_f3.cfg +++ b/tcl/board/st_nucleo_f3.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f3x.cfg] diff --git a/tcl/board/st_nucleo_f4.cfg b/tcl/board/st_nucleo_f4.cfg index 7617a1758..574417c96 100644 --- a/tcl/board/st_nucleo_f4.cfg +++ b/tcl/board/st_nucleo_f4.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f4x.cfg] diff --git a/tcl/board/st_nucleo_f7.cfg b/tcl/board/st_nucleo_f7.cfg index 41f8b2129..eaf79669c 100644 --- a/tcl/board/st_nucleo_f7.cfg +++ b/tcl/board/st_nucleo_f7.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f7x.cfg] diff --git a/tcl/board/st_nucleo_g0.cfg b/tcl/board/st_nucleo_g0.cfg index f22a7e397..c68d3d0e5 100644 --- a/tcl/board/st_nucleo_g0.cfg +++ b/tcl/board/st_nucleo_g0.cfg @@ -12,7 +12,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32g0x.cfg] diff --git a/tcl/board/st_nucleo_g4.cfg b/tcl/board/st_nucleo_g4.cfg index 309f7a4c8..3debdc381 100644 --- a/tcl/board/st_nucleo_g4.cfg +++ b/tcl/board/st_nucleo_g4.cfg @@ -12,7 +12,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32g4x.cfg] diff --git a/tcl/board/st_nucleo_h743zi.cfg b/tcl/board/st_nucleo_h743zi.cfg index be2d42fb8..a996d744b 100644 --- a/tcl/board/st_nucleo_h743zi.cfg +++ b/tcl/board/st_nucleo_h743zi.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32h7x_dual_bank.cfg] diff --git a/tcl/board/st_nucleo_h745zi.cfg b/tcl/board/st_nucleo_h745zi.cfg index 84865f422..697d1972a 100644 --- a/tcl/board/st_nucleo_h745zi.cfg +++ b/tcl/board/st_nucleo_h745zi.cfg @@ -3,7 +3,7 @@ # This is an ST NUCLEO-H745ZI-Q board with single STM32H745ZITx chip. source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # STM32H745xx devices are dual core (Cortex-M7 and Cortex-M4) set DUAL_CORE 1 diff --git a/tcl/board/st_nucleo_l073rz.cfg b/tcl/board/st_nucleo_l073rz.cfg index 317c86e21..d1a2e0768 100644 --- a/tcl/board/st_nucleo_l073rz.cfg +++ b/tcl/board/st_nucleo_l073rz.cfg @@ -4,7 +4,7 @@ # http://www.st.com/en/evaluation-tools/nucleo-l073rz.html source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set WORKAREASIZE 0x2000 diff --git a/tcl/board/st_nucleo_l1.cfg b/tcl/board/st_nucleo_l1.cfg index d7474d0fe..0ffc71dfe 100644 --- a/tcl/board/st_nucleo_l1.cfg +++ b/tcl/board/st_nucleo_l1.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32l1x_dual_bank.cfg] diff --git a/tcl/board/st_nucleo_l4.cfg b/tcl/board/st_nucleo_l4.cfg index b0a75afe0..dad3cc4b9 100644 --- a/tcl/board/st_nucleo_l4.cfg +++ b/tcl/board/st_nucleo_l4.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32l4x.cfg] diff --git a/tcl/board/st_nucleo_l5.cfg b/tcl/board/st_nucleo_l5.cfg index 626914aa7..f3cb680c2 100644 --- a/tcl/board/st_nucleo_l5.cfg +++ b/tcl/board/st_nucleo_l5.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32l5x.cfg] diff --git a/tcl/board/st_nucleo_wb55.cfg b/tcl/board/st_nucleo_wb55.cfg index ab7307c68..79ddb1ccd 100644 --- a/tcl/board/st_nucleo_wb55.cfg +++ b/tcl/board/st_nucleo_wb55.cfg @@ -6,7 +6,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32wbx.cfg] diff --git a/tcl/board/stm320518_eval_stlink.cfg b/tcl/board/stm320518_eval_stlink.cfg index 997bb4af9..8f4652eff 100644 --- a/tcl/board/stm320518_eval_stlink.cfg +++ b/tcl/board/stm320518_eval_stlink.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 8KB set WORKAREASIZE 0x2000 diff --git a/tcl/board/stm3220g_eval_stlink.cfg b/tcl/board/stm3220g_eval_stlink.cfg index 4233d04f1..d212bbc29 100644 --- a/tcl/board/stm3220g_eval_stlink.cfg +++ b/tcl/board/stm3220g_eval_stlink.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm3241g_eval_stlink.cfg b/tcl/board/stm3241g_eval_stlink.cfg index 3bccd2866..e1ab2026b 100644 --- a/tcl/board/stm3241g_eval_stlink.cfg +++ b/tcl/board/stm3241g_eval_stlink.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32429i_eval_stlink.cfg b/tcl/board/stm32429i_eval_stlink.cfg index 7d04aa7f3..ec7e10c43 100644 --- a/tcl/board/stm32429i_eval_stlink.cfg +++ b/tcl/board/stm32429i_eval_stlink.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32439i_eval_stlink.cfg b/tcl/board/stm32439i_eval_stlink.cfg index b9ea084df..bac64c81a 100644 --- a/tcl/board/stm32439i_eval_stlink.cfg +++ b/tcl/board/stm32439i_eval_stlink.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f0discovery.cfg b/tcl/board/stm32f0discovery.cfg index 398ecc103..9a8e92153 100644 --- a/tcl/board/stm32f0discovery.cfg +++ b/tcl/board/stm32f0discovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set WORKAREASIZE 0x2000 source [find target/stm32f0x.cfg] diff --git a/tcl/board/stm32f3discovery.cfg b/tcl/board/stm32f3discovery.cfg index 73c349a6e..661082acf 100644 --- a/tcl/board/stm32f3discovery.cfg +++ b/tcl/board/stm32f3discovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f3x.cfg] diff --git a/tcl/board/stm32f412g-disco.cfg b/tcl/board/stm32f412g-disco.cfg index 30a9537f0..e27806291 100644 --- a/tcl/board/stm32f412g-disco.cfg +++ b/tcl/board/stm32f412g-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f413h-disco.cfg b/tcl/board/stm32f413h-disco.cfg index c82d0d434..9a72c121c 100644 --- a/tcl/board/stm32f413h-disco.cfg +++ b/tcl/board/stm32f413h-disco.cfg @@ -10,7 +10,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f429disc1.cfg b/tcl/board/stm32f429disc1.cfg index 0a8e7ef4e..a5646c9ec 100644 --- a/tcl/board/stm32f429disc1.cfg +++ b/tcl/board/stm32f429disc1.cfg @@ -7,7 +7,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32f4x.cfg] diff --git a/tcl/board/stm32f429discovery.cfg b/tcl/board/stm32f429discovery.cfg index 865602ab6..735254e7f 100644 --- a/tcl/board/stm32f429discovery.cfg +++ b/tcl/board/stm32f429discovery.cfg @@ -7,7 +7,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f469discovery.cfg b/tcl/board/stm32f469discovery.cfg index c9acbbbd0..7d3992906 100644 --- a/tcl/board/stm32f469discovery.cfg +++ b/tcl/board/stm32f469discovery.cfg @@ -7,7 +7,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f469i-disco.cfg b/tcl/board/stm32f469i-disco.cfg index 63c42c64e..45ec9a269 100644 --- a/tcl/board/stm32f469i-disco.cfg +++ b/tcl/board/stm32f469i-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f4discovery.cfg b/tcl/board/stm32f4discovery.cfg index d96e2dbd3..73ede7ed7 100644 --- a/tcl/board/stm32f4discovery.cfg +++ b/tcl/board/stm32f4discovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 64KB set WORKAREASIZE 0x10000 diff --git a/tcl/board/stm32f723e-disco.cfg b/tcl/board/stm32f723e-disco.cfg index 020795620..8acefff4c 100644 --- a/tcl/board/stm32f723e-disco.cfg +++ b/tcl/board/stm32f723e-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 128KB set WORKAREASIZE 0x20000 diff --git a/tcl/board/stm32f746g-disco.cfg b/tcl/board/stm32f746g-disco.cfg index 75ff4ec1e..04ed72cc5 100644 --- a/tcl/board/stm32f746g-disco.cfg +++ b/tcl/board/stm32f746g-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 256KB set WORKAREASIZE 0x40000 diff --git a/tcl/board/stm32f769i-disco.cfg b/tcl/board/stm32f769i-disco.cfg index cd6383a70..89e197c52 100644 --- a/tcl/board/stm32f769i-disco.cfg +++ b/tcl/board/stm32f769i-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 256KB set WORKAREASIZE 0x40000 diff --git a/tcl/board/stm32f7discovery.cfg b/tcl/board/stm32f7discovery.cfg index 6fd6c64b3..3f3bceb84 100644 --- a/tcl/board/stm32f7discovery.cfg +++ b/tcl/board/stm32f7discovery.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK/V2-1 source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 256KB set WORKAREASIZE 0x40000 diff --git a/tcl/board/stm32h735g-disco.cfg b/tcl/board/stm32h735g-disco.cfg index 327a36418..e839c7a54 100644 --- a/tcl/board/stm32h735g-disco.cfg +++ b/tcl/board/stm32h735g-disco.cfg @@ -7,7 +7,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set CHIPNAME stm32h735igk6 diff --git a/tcl/board/stm32h745i-disco.cfg b/tcl/board/stm32h745i-disco.cfg index 9da1daefc..700f141d2 100644 --- a/tcl/board/stm32h745i-disco.cfg +++ b/tcl/board/stm32h745i-disco.cfg @@ -7,7 +7,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set CHIPNAME stm32h745xih6 diff --git a/tcl/board/stm32h747i-disco.cfg b/tcl/board/stm32h747i-disco.cfg index 7f8eda8c4..e95ad8a12 100644 --- a/tcl/board/stm32h747i-disco.cfg +++ b/tcl/board/stm32h747i-disco.cfg @@ -7,7 +7,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set CHIPNAME stm32h747xih6 diff --git a/tcl/board/stm32h750b-disco.cfg b/tcl/board/stm32h750b-disco.cfg index 8b254f21f..8f0f15b53 100644 --- a/tcl/board/stm32h750b-disco.cfg +++ b/tcl/board/stm32h750b-disco.cfg @@ -7,7 +7,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set CHIPNAME stm32h750xbh6 diff --git a/tcl/board/stm32h7b3i-disco.cfg b/tcl/board/stm32h7b3i-disco.cfg index df0d0a6f2..de009570f 100644 --- a/tcl/board/stm32h7b3i-disco.cfg +++ b/tcl/board/stm32h7b3i-disco.cfg @@ -7,7 +7,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set CHIPNAME stm32h7b3lih6q diff --git a/tcl/board/stm32h7x3i_eval.cfg b/tcl/board/stm32h7x3i_eval.cfg index 508f10d5d..1880bb871 100644 --- a/tcl/board/stm32h7x3i_eval.cfg +++ b/tcl/board/stm32h7x3i_eval.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32h7x_dual_bank.cfg] diff --git a/tcl/board/stm32l0discovery.cfg b/tcl/board/stm32l0discovery.cfg index 59aed3405..06d02ed02 100644 --- a/tcl/board/stm32l0discovery.cfg +++ b/tcl/board/stm32l0discovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set WORKAREASIZE 0x2000 source [find target/stm32l0.cfg] diff --git a/tcl/board/stm32l476g-disco.cfg b/tcl/board/stm32l476g-disco.cfg index fe33ffefb..e3d4de3c0 100644 --- a/tcl/board/stm32l476g-disco.cfg +++ b/tcl/board/stm32l476g-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 96KB set WORKAREASIZE 0x18000 diff --git a/tcl/board/stm32l496g-disco.cfg b/tcl/board/stm32l496g-disco.cfg index 823fa6e38..a715bb058 100644 --- a/tcl/board/stm32l496g-disco.cfg +++ b/tcl/board/stm32l496g-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 96KB set WORKAREASIZE 0x18000 diff --git a/tcl/board/stm32l4discovery.cfg b/tcl/board/stm32l4discovery.cfg index 64a456b61..7f724f9bd 100644 --- a/tcl/board/stm32l4discovery.cfg +++ b/tcl/board/stm32l4discovery.cfg @@ -8,7 +8,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32l4x.cfg] diff --git a/tcl/board/stm32l4p5g-disco.cfg b/tcl/board/stm32l4p5g-disco.cfg index 33bb9a766..86c05a18d 100644 --- a/tcl/board/stm32l4p5g-disco.cfg +++ b/tcl/board/stm32l4p5g-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 96KB set WORKAREASIZE 0x18000 diff --git a/tcl/board/stm32l4r9i-disco.cfg b/tcl/board/stm32l4r9i-disco.cfg index cbb86669f..de23cc1ae 100644 --- a/tcl/board/stm32l4r9i-disco.cfg +++ b/tcl/board/stm32l4r9i-disco.cfg @@ -6,7 +6,7 @@ # This is for using the onboard STLINK source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd # increase working area to 96KB set WORKAREASIZE 0x18000 diff --git a/tcl/board/stm32ldiscovery.cfg b/tcl/board/stm32ldiscovery.cfg index e39b52295..38b8a8bd0 100644 --- a/tcl/board/stm32ldiscovery.cfg +++ b/tcl/board/stm32ldiscovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set WORKAREASIZE 0x4000 source [find target/stm32l1.cfg] diff --git a/tcl/board/stm32mp13x_dk.cfg b/tcl/board/stm32mp13x_dk.cfg index 08377ca76..8ece24844 100644 --- a/tcl/board/stm32mp13x_dk.cfg +++ b/tcl/board/stm32mp13x_dk.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32mp13x.cfg] diff --git a/tcl/board/stm32mp15x_dk2.cfg b/tcl/board/stm32mp15x_dk2.cfg index 0e71e05ee..ba1c7f78a 100644 --- a/tcl/board/stm32mp15x_dk2.cfg +++ b/tcl/board/stm32mp15x_dk2.cfg @@ -6,7 +6,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd source [find target/stm32mp15x.cfg] diff --git a/tcl/board/stm32vldiscovery.cfg b/tcl/board/stm32vldiscovery.cfg index 57852bfd4..d79c62ea4 100644 --- a/tcl/board/stm32vldiscovery.cfg +++ b/tcl/board/stm32vldiscovery.cfg @@ -5,7 +5,7 @@ source [find interface/stlink.cfg] -transport select dapdirect_swd +transport select swd set WORKAREASIZE 0x2000 source [find target/stm32f1x.cfg] diff --git a/tcl/board/ti_dk-tm4c129.cfg b/tcl/board/ti_dk-tm4c129.cfg index d8210e32d..e0574fa87 100644 --- a/tcl/board/ti_dk-tm4c129.cfg +++ b/tcl/board/ti_dk-tm4c129.cfg @@ -8,7 +8,7 @@ source [find interface/ti-icdi.cfg] -transport select hla_jtag +transport select jtag set WORKAREASIZE 0x8000 set CHIPNAME tm4c129xnczad diff --git a/tcl/board/ti_ek-tm4c123gxl.cfg b/tcl/board/ti_ek-tm4c123gxl.cfg index 91390fa82..7b8fc267f 100644 --- a/tcl/board/ti_ek-tm4c123gxl.cfg +++ b/tcl/board/ti_ek-tm4c123gxl.cfg @@ -8,7 +8,7 @@ source [find interface/ti-icdi.cfg] -transport select hla_jtag +transport select jtag set WORKAREASIZE 0x8000 set CHIPNAME tm4c123gh6pm diff --git a/tcl/board/ti_ek-tm4c1294xl.cfg b/tcl/board/ti_ek-tm4c1294xl.cfg index 63612c686..8cceb49c9 100644 --- a/tcl/board/ti_ek-tm4c1294xl.cfg +++ b/tcl/board/ti_ek-tm4c1294xl.cfg @@ -8,7 +8,7 @@ source [find interface/ti-icdi.cfg] -transport select hla_jtag +transport select jtag set WORKAREASIZE 0x8000 set CHIPNAME tm4c1294ncpdt diff --git a/tcl/board/vd_a53x2_dap.cfg b/tcl/board/vd_a53x2_dap.cfg index bcf8b4409..3251afd06 100644 --- a/tcl/board/vd_a53x2_dap.cfg +++ b/tcl/board/vd_a53x2_dap.cfg @@ -13,7 +13,7 @@ set DBGBASE {0x80810000 0x80910000} set CTIBASE {0x80820000 0x80920000} # vdebug select transport -transport select dapdirect_swd +transport select swd # JTAG reset config, frequency and reset delay adapter speed 50000 diff --git a/tcl/board/vd_a75x4_dap.cfg b/tcl/board/vd_a75x4_dap.cfg index 5c2a2efe8..2f4406b03 100644 --- a/tcl/board/vd_a75x4_dap.cfg +++ b/tcl/board/vd_a75x4_dap.cfg @@ -13,7 +13,7 @@ set DBGBASE {0x01010000 0x01110000 0x01210000 0x01310000} set CTIBASE {0x01020000 0x01120000 0x01220000 0x01320000} # vdebug select transport -transport select dapdirect_swd +transport select swd # JTAG reset config, frequency and reset delay adapter speed 200000 diff --git a/tcl/board/vd_m4_dap.cfg b/tcl/board/vd_m4_dap.cfg index 5d3605aa3..f56334e83 100644 --- a/tcl/board/vd_m4_dap.cfg +++ b/tcl/board/vd_m4_dap.cfg @@ -9,7 +9,7 @@ set MEMSTART 0x00000000 set MEMSIZE 0x10000 # vdebug select transport -transport select dapdirect_swd +transport select swd adapter speed 25000 adapter srst delay 5 diff --git a/tcl/interface/nulink.cfg b/tcl/interface/nulink.cfg index 48dc20e24..be68347e7 100644 --- a/tcl/interface/nulink.cfg +++ b/tcl/interface/nulink.cfg @@ -10,4 +10,4 @@ hla device_desc "Nu-Link" hla vid_pid 0x0416 0x511b 0x0416 0x511c 0x0416 0x511d 0x0416 0x5200 0x0416 0x5201 # Only swd is supported -transport select hla_swd +transport select swd diff --git a/tcl/interface/rshim.cfg b/tcl/interface/rshim.cfg index 1d5da593e..327212f68 100644 --- a/tcl/interface/rshim.cfg +++ b/tcl/interface/rshim.cfg @@ -5,4 +5,4 @@ # adapter driver rshim -transport select dapdirect_swd +transport select swd diff --git a/tcl/interface/stlink.cfg b/tcl/interface/stlink.cfg index 99c81c180..962d192ec 100644 --- a/tcl/interface/stlink.cfg +++ b/tcl/interface/stlink.cfg @@ -13,8 +13,8 @@ adapter driver st-link st-link vid_pid 0x0483 0x3744 0x0483 0x3748 0x0483 0x374b 0x0483 0x374d 0x0483 0x374e 0x0483 0x374f 0x0483 0x3752 0x0483 0x3753 0x0483 0x3754 0x0483 0x3755 0x0483 0x3757 -# transport select dapdirect_jtag -# transport select dapdirect_swd +# transport select jtag +# transport select swd # transport select swim # Optionally specify the serial number of usb device ----------------------------------------------------------------------- Summary of changes: tcl/board/ek-lm4f120xl.cfg | 2 +- tcl/board/ek-lm4f232.cfg | 2 +- tcl/board/st_b-l475e-iot01a.cfg | 2 +- tcl/board/st_nucleo_f0.cfg | 2 +- tcl/board/st_nucleo_f103rb.cfg | 2 +- tcl/board/st_nucleo_f3.cfg | 2 +- tcl/board/st_nucleo_f4.cfg | 2 +- tcl/board/st_nucleo_f7.cfg | 2 +- tcl/board/st_nucleo_g0.cfg | 2 +- tcl/board/st_nucleo_g4.cfg | 2 +- tcl/board/st_nucleo_h743zi.cfg | 2 +- tcl/board/st_nucleo_h745zi.cfg | 2 +- tcl/board/st_nucleo_l073rz.cfg | 2 +- tcl/board/st_nucleo_l1.cfg | 2 +- tcl/board/st_nucleo_l4.cfg | 2 +- tcl/board/st_nucleo_l5.cfg | 2 +- tcl/board/st_nucleo_wb55.cfg | 2 +- tcl/board/stm320518_eval_stlink.cfg | 2 +- tcl/board/stm3220g_eval_stlink.cfg | 2 +- tcl/board/stm3241g_eval_stlink.cfg | 2 +- tcl/board/stm32429i_eval_stlink.cfg | 2 +- tcl/board/stm32439i_eval_stlink.cfg | 2 +- tcl/board/stm32f0discovery.cfg | 2 +- tcl/board/stm32f3discovery.cfg | 2 +- tcl/board/stm32f412g-disco.cfg | 2 +- tcl/board/stm32f413h-disco.cfg | 2 +- tcl/board/stm32f429disc1.cfg | 2 +- tcl/board/stm32f429discovery.cfg | 2 +- tcl/board/stm32f469discovery.cfg | 2 +- tcl/board/stm32f469i-disco.cfg | 2 +- tcl/board/stm32f4discovery.cfg | 2 +- tcl/board/stm32f723e-disco.cfg | 2 +- tcl/board/stm32f746g-disco.cfg | 2 +- tcl/board/stm32f769i-disco.cfg | 2 +- tcl/board/stm32f7discovery.cfg | 2 +- tcl/board/stm32h735g-disco.cfg | 2 +- tcl/board/stm32h745i-disco.cfg | 2 +- tcl/board/stm32h747i-disco.cfg | 2 +- tcl/board/stm32h750b-disco.cfg | 2 +- tcl/board/stm32h7b3i-disco.cfg | 2 +- tcl/board/stm32h7x3i_eval.cfg | 2 +- tcl/board/stm32l0discovery.cfg | 2 +- tcl/board/stm32l476g-disco.cfg | 2 +- tcl/board/stm32l496g-disco.cfg | 2 +- tcl/board/stm32l4discovery.cfg | 2 +- tcl/board/stm32l4p5g-disco.cfg | 2 +- tcl/board/stm32l4r9i-disco.cfg | 2 +- tcl/board/stm32ldiscovery.cfg | 2 +- tcl/board/stm32mp13x_dk.cfg | 2 +- tcl/board/stm32mp15x_dk2.cfg | 2 +- tcl/board/stm32vldiscovery.cfg | 2 +- tcl/board/ti_dk-tm4c129.cfg | 2 +- tcl/board/ti_ek-tm4c123gxl.cfg | 2 +- tcl/board/ti_ek-tm4c1294xl.cfg | 2 +- tcl/board/vd_a53x2_dap.cfg | 2 +- tcl/board/vd_a75x4_dap.cfg | 2 +- tcl/board/vd_m4_dap.cfg | 2 +- tcl/interface/nulink.cfg | 2 +- tcl/interface/rshim.cfg | 2 +- tcl/interface/stlink.cfg | 4 ++-- 60 files changed, 61 insertions(+), 61 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:29:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via c1c4d489df4bbbc2902c0e4ef744157994f1b22a (commit) from 98c09dc257739440f25f5cd23ca9bbd495e5742a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c1c4d489df4bbbc2902c0e4ef744157994f1b22a Author: Antonio Borneo <bor...@gm...> Date: Wed Feb 12 16:30:46 2025 +0100 transport: allow transport name jtag/swd for hla and dapdirect The transport used on adapter's wires is either 'jtag' or 'swd' but, depending on the adapter, in the command 'transport select' we have to use either 'jtag' or 'swd' or the similar 'hla_jtag', 'hla_swd', 'dapdirect_jtag' or 'dapdirect_swd'. This becomes cumbersome when we just want to change adapter and we get forced to modify the 'transport select' command too. There is no reason for an adapter driver to support two of the similar transports. In fact 'dapdirect' one is a superset of the 'hla', and the native 'jtag' or 'swd' is a superset of the 'dapdirect' one. While the adapter could support more than one similar transports, its adapter driver should only support the most complete of these similar transports. Modify the 'transport select' code to accept 'jtag' or 'swd' for the 'dapdirect' and the 'hla' adapters too. Issue a deprecated message for the old 'dapdirect' and 'hla' transport names. In command 'transport list', print only the transport names that can be selected through 'transport select' skipping information about 'dapdirect' and 'hla' versions and avoid duplicated entries. This improvement was listed in the TODO file. Update it! Change-Id: I626b50e7a94c141c042eab388cd1ffe77eb864c2 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8677 Tested-by: jenkins diff --git a/README b/README index fba758cfe..d9cc8f3eb 100644 --- a/README +++ b/README @@ -42,7 +42,7 @@ openocd -f interface/ftdi/jtagkey2.cfg -c "transport select jtag" \ ``` ``` -openocd -f interface/stlink.cfg -c "transport select hla_swd" \ +openocd -f interface/stlink.cfg -c "transport select swd" \ -f target/stm32l0.cfg ``` diff --git a/TODO b/TODO index e4dded0ce..239b358f5 100644 --- a/TODO +++ b/TODO @@ -60,8 +60,6 @@ changes pending in gerrit. to replicate it in the drivers, apart in case the driver sets TRST independently - add .hla_ops to "adapter" -- HLA is a API level (.hla_ops). Transport should simply be {jtag,swd}, - not {hla_jtag,hla_swd}. @subsection thelistadapterjtagcore JTAG Core diff --git a/doc/openocd.texi b/doc/openocd.texi index d85812824..f557a55fe 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3783,10 +3783,8 @@ JTAG supports both debugging and boundary scan testing. Flash programming support is built on top of debug support. JTAG transport is selected with the command @command{transport select -jtag}. Unless your adapter uses either @ref{hla_interface,the hla interface -driver} (in which case the command is @command{transport select hla_jtag}) -or @ref{st_link_dap_interface,the st-link interface driver} (in which case -the command is @command{transport select dapdirect_jtag}). +jtag}. This command has to be used also for @ref{hla_interface,the hla interface +driver} and @ref{st_link_dap_interface,the st-link interface driver}. @subsection SWD Transport @cindex SWD @@ -3799,10 +3797,8 @@ Flash programming support is built on top of debug support. (Some processors support both JTAG and SWD.) SWD transport is selected with the command @command{transport select -swd}. Unless your adapter uses either @ref{hla_interface,the hla interface -driver} (in which case the command is @command{transport select hla_swd}) -or @ref{st_link_dap_interface,the st-link interface driver} (in which case -the command is @command{transport select dapdirect_swd}). +swd}. This command has to be used also for @ref{hla_interface,the hla interface +driver} and @ref{st_link_dap_interface,the st-link interface driver}. @deffn {Config Command} {swd newdap} ... Declares a single DAP which uses SWD transport. @@ -10889,7 +10885,7 @@ baud with our custom divisor to get 12MHz) @item OpenOCD invocation line: @example openocd -f interface/stlink.cfg \ --c "transport select dapdirect_swd" \ +-c "transport select swd" \ -f target/stm32l1.cfg \ -c "stm32l1.tpiu configure -protocol uart" \ -c "stm32l1.tpiu configure -traceclk 24000000 -pin-freq 12000000" \ diff --git a/src/transport/transport.c b/src/transport/transport.c index 755e21054..ab5be490f 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -49,14 +49,16 @@ extern struct command_context *global_cmd_ctx; static const struct { unsigned int id; const char *name; + const char *full_name; + const char *deprecated_name; } transport_names[] = { - { TRANSPORT_JTAG, "jtag", }, - { TRANSPORT_SWD, "swd", }, - { TRANSPORT_HLA_JTAG, "hla_jtag", }, - { TRANSPORT_HLA_SWD, "hla_swd", }, - { TRANSPORT_DAPDIRECT_JTAG, "dapdirect_jtag", }, - { TRANSPORT_DAPDIRECT_SWD, "dapdirect_swd", }, - { TRANSPORT_SWIM, "swim", }, + { TRANSPORT_JTAG, "jtag", "jtag", NULL, }, + { TRANSPORT_SWD, "swd", "swd", NULL, }, + { TRANSPORT_HLA_JTAG, "jtag", "jtag (hla)", "hla_jtag", }, + { TRANSPORT_HLA_SWD, "swd", "swd (hla)", "hla_swd", }, + { TRANSPORT_DAPDIRECT_JTAG, "jtag", "jtag (dapdirect)", "dapdirect_jtag", }, + { TRANSPORT_DAPDIRECT_SWD, "swd", "swd (dapdirect)", "dapdirect_swd", }, + { TRANSPORT_SWIM, "swim", "swim", NULL, }, }; /** List of transports registered in OpenOCD, alphabetically sorted per name. */ @@ -90,18 +92,36 @@ const char *transport_name(unsigned int id) return NULL; } +static const char *transport_full_name(unsigned int id) +{ + for (unsigned int i = 0; i < ARRAY_SIZE(transport_names); i++) + if (id == transport_names[i].id) + return transport_names[i].full_name; + + return NULL; +} + +static const char *transport_deprecated_name(unsigned int id) +{ + for (unsigned int i = 0; i < ARRAY_SIZE(transport_names); i++) + if (id == transport_names[i].id) + return transport_names[i].deprecated_name; + + return NULL; +} + static bool is_transport_id_valid(unsigned int id) { return (id != 0) && ((id & ~TRANSPORT_VALID_MASK) == 0) && IS_PWR_OF_2(id); } -static int transport_select(struct command_context *ctx, const char *name) +static int transport_select(struct command_context *ctx, unsigned int transport_id) { /* name may only identify a known transport; * caller guarantees session's transport isn't yet set.*/ struct transport *t; list_for_each_entry(t, &transport_list, lh) { - if (!strcmp(transport_name(t->id), name)) { + if (t->id == transport_id) { int retval = t->select(ctx); /* select() registers commands specific to this * transport, and may also reset the link, e.g. @@ -110,12 +130,14 @@ static int transport_select(struct command_context *ctx, const char *name) if (retval == ERROR_OK) session = t; else - LOG_ERROR("Error selecting '%s' as transport", name); + LOG_ERROR("Error selecting '%s' as transport", + transport_full_name(transport_id)); return retval; } } - LOG_ERROR("No transport named '%s' is available.", name); + LOG_ERROR("No transport named '%s' is available.", + transport_full_name(transport_id)); return ERROR_FAIL; } @@ -165,7 +187,7 @@ int allow_transports(struct command_context *ctx, unsigned int transport_ids, if (IS_PWR_OF_2(transport_ids)) { LOG_DEBUG("only one transport option; autoselecting '%s'", transport_name(transport_ids)); transport_single_is_autoselected = true; - return transport_select(ctx, transport_name(transport_ids)); + return transport_select(ctx, transport_ids); } return ERROR_OK; @@ -205,7 +227,7 @@ int transport_register(struct transport *new_transport) if (!new_transport->select || !new_transport->init) LOG_ERROR("invalid transport %s", - transport_name(new_transport->id)); + transport_full_name(new_transport->id)); /* splice this into the list, sorted in alphabetic order */ list_for_each_entry(t, &transport_list, lh) { @@ -216,7 +238,7 @@ int transport_register(struct transport *new_transport) list_add_tail(&new_transport->lh, &t->lh); LOG_DEBUG("register '%s' (ID %d)", - transport_name(new_transport->id), new_transport->id); + transport_full_name(new_transport->id), new_transport->id); return ERROR_OK; } @@ -238,7 +260,7 @@ const char *get_current_transport_name(void) if (!session || !is_transport_id_valid(session->id)) NULL; - return transport_name(session->id); + return transport_full_name(session->id); } /*-----------------------------------------------------------------------*/ @@ -257,7 +279,7 @@ COMMAND_HANDLER(handle_transport_init) LOG_ERROR("Transports available:"); for (unsigned int i = BIT(0); i & TRANSPORT_VALID_MASK; i <<= 1) { if (i & allowed_transports) - LOG_ERROR("%s", transport_name(i)); + LOG_ERROR("%s", transport_full_name(i)); } return ERROR_FAIL; } @@ -265,7 +287,7 @@ COMMAND_HANDLER(handle_transport_init) if (transport_single_is_autoselected) LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " "Use 'transport select %s' to suppress this message.", - transport_name(session->id), transport_name(session->id)); + transport_full_name(session->id), transport_name(session->id)); return session->init(CMD_CTX); } @@ -278,8 +300,14 @@ COMMAND_HANDLER(handle_transport_list) command_print(CMD, "The following transports are available:"); struct transport *t; - list_for_each_entry(t, &transport_list, lh) - command_print(CMD, "\t%s", transport_name(t->id)); + const char *prev_name = NULL; + /* list is sorted, don't print duplicated transport names */ + list_for_each_entry(t, &transport_list, lh) { + const char *name = transport_name(t->id); + if (!prev_name || strcmp(prev_name, name)) + command_print(CMD, "\t%s", name); + prev_name = name; + } return ERROR_OK; } @@ -304,19 +332,21 @@ COMMAND_HANDLER(handle_transport_select) } LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " "Use 'transport select %s' to suppress this message.", - transport_name(preferred_transport), + transport_full_name(preferred_transport), transport_name(preferred_transport)); - int retval = transport_select(CMD_CTX, transport_name(preferred_transport)); + int retval = transport_select(CMD_CTX, preferred_transport); if (retval != ERROR_OK) return retval; } - command_print(CMD, "%s", transport_name(session->id)); + command_print(CMD, "%s", transport_full_name(session->id)); return ERROR_OK; } /* assign transport */ if (session) { - if (!strcmp(transport_name(session->id), CMD_ARGV[0])) { + if (!strcmp(transport_name(session->id), CMD_ARGV[0]) + || (transport_deprecated_name(session->id) + && !strcmp(transport_deprecated_name(session->id), CMD_ARGV[0]))) { if (transport_single_is_autoselected) { /* Nothing to do, but also nothing to complain */ transport_single_is_autoselected = false; @@ -341,12 +371,17 @@ COMMAND_HANDLER(handle_transport_select) } for (unsigned int i = BIT(0); i & TRANSPORT_VALID_MASK; i <<= 1) { - if ((i & allowed_transports) - && !strcmp(transport_name(i), CMD_ARGV[0])) { - int retval = transport_select(CMD_CTX, CMD_ARGV[0]); - if (retval != ERROR_OK) - return retval; - return ERROR_OK; + if (!(i & allowed_transports)) + continue; + + if (!strcmp(transport_name(i), CMD_ARGV[0])) + return transport_select(CMD_CTX, i); + + if (transport_deprecated_name(i) + && !strcmp(transport_deprecated_name(i), CMD_ARGV[0])) { + LOG_WARNING("DEPRECATED! use 'transport select %s', not 'transport select %s'", + transport_name(i), transport_deprecated_name(i)); + return transport_select(CMD_CTX, i); } } ----------------------------------------------------------------------- Summary of changes: README | 2 +- TODO | 2 - doc/openocd.texi | 14 +++---- src/transport/transport.c | 93 ++++++++++++++++++++++++++++++++--------------- 4 files changed, 70 insertions(+), 41 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:28:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 98c09dc257739440f25f5cd23ca9bbd495e5742a (commit) from 9643379d30fee381e92200ef9ed0caaeae580dad (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 98c09dc257739440f25f5cd23ca9bbd495e5742a Author: Antonio Borneo <bor...@gm...> Date: Tue Dec 31 17:01:41 2024 +0100 transport: store the transports sorted by alphabetic name order While this operation has no real interest so far, it will be used later to avoid listing twice protocols with the same name. Change-Id: I59f3634830f94dc992d28863cf29d5d869726918 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8685 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/transport/transport.c b/src/transport/transport.c index 8a210fe94..755e21054 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -59,7 +59,7 @@ static const struct { { TRANSPORT_SWIM, "swim", }, }; -/** List of transports registered in OpenOCD. */ +/** List of transports registered in OpenOCD, alphabetically sorted per name. */ static OOCD_LIST_HEAD(transport_list); /** @@ -207,8 +207,14 @@ int transport_register(struct transport *new_transport) LOG_ERROR("invalid transport %s", transport_name(new_transport->id)); - /* splice this into the list */ - list_add(&new_transport->lh, &transport_list); + /* splice this into the list, sorted in alphabetic order */ + list_for_each_entry(t, &transport_list, lh) { + if (strcmp(transport_name(t->id), + transport_name(new_transport->id)) >= 0) + break; + } + list_add_tail(&new_transport->lh, &t->lh); + LOG_DEBUG("register '%s' (ID %d)", transport_name(new_transport->id), new_transport->id); ----------------------------------------------------------------------- Summary of changes: src/transport/transport.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:27:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9643379d30fee381e92200ef9ed0caaeae580dad (commit) via 8485eb141554851d6cfcf6faf47c5934d13bf040 (commit) from a500b2ce67eb80870dfbd5d73118e822ac99ef88 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9643379d30fee381e92200ef9ed0caaeae580dad Author: Antonio Borneo <bor...@gm...> Date: Tue Dec 31 16:29:46 2024 +0100 transport: use helper/list.h for the list of transports No behavioral change, just use the list's helpers. Change-Id: I69712648ef77689bfe6acc4811adad7293fb9009 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8684 Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/transport/transport.c b/src/transport/transport.c index 59f76ad31..8a210fe94 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -32,6 +32,7 @@ #include <helper/align.h> #include <helper/bits.h> +#include <helper/list.h> #include <helper/log.h> #include <helper/replacements.h> #include <transport/transport.h> @@ -59,7 +60,7 @@ static const struct { }; /** List of transports registered in OpenOCD. */ -static struct transport *transport_list; +static OOCD_LIST_HEAD(transport_list); /** * Bitmask of transport IDs which the currently selected debug adapter supports. @@ -98,7 +99,8 @@ static int transport_select(struct command_context *ctx, const char *name) { /* name may only identify a known transport; * caller guarantees session's transport isn't yet set.*/ - for (struct transport *t = transport_list; t; t = t->next) { + struct transport *t; + list_for_each_entry(t, &transport_list, lh) { if (!strcmp(transport_name(t->id), name)) { int retval = t->select(ctx); /* select() registers commands specific to this @@ -193,7 +195,7 @@ int transport_register(struct transport *new_transport) return ERROR_FAIL; } - for (t = transport_list; t; t = t->next) { + list_for_each_entry(t, &transport_list, lh) { if (t->id == new_transport->id) { LOG_ERROR("transport '%s' already registered", transport_name(t->id)); @@ -206,8 +208,7 @@ int transport_register(struct transport *new_transport) transport_name(new_transport->id)); /* splice this into the list */ - new_transport->next = transport_list; - transport_list = new_transport; + list_add(&new_transport->lh, &transport_list); LOG_DEBUG("register '%s' (ID %d)", transport_name(new_transport->id), new_transport->id); @@ -270,7 +271,8 @@ COMMAND_HANDLER(handle_transport_list) command_print(CMD, "The following transports are available:"); - for (struct transport *t = transport_list; t; t = t->next) + struct transport *t; + list_for_each_entry(t, &transport_list, lh) command_print(CMD, "\t%s", transport_name(t->id)); return ERROR_OK; diff --git a/src/transport/transport.h b/src/transport/transport.h index f6f0f4f4d..5445bcf3b 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -14,6 +14,7 @@ #include "helper/bits.h" #include "helper/command.h" +#include "helper/list.h" #define TRANSPORT_JTAG BIT(0) #define TRANSPORT_SWD BIT(1) @@ -84,9 +85,9 @@ struct transport { int (*override_target)(const char **targetname); /** - * Transports are stored in a singly linked list. + * Transports are stored in a linked list. */ - struct transport *next; + struct list_head lh; }; int transport_register(struct transport *new_transport); commit 8485eb141554851d6cfcf6faf47c5934d13bf040 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 22 23:59:19 2024 +0100 transport: validate the transport id's from the driver Verify that it contains only valid transports. While JTAG and SWD are the more permissive transports, the respective 'dapdirect' versions are slightly limited, and the respective 'hla' versions are even more limited. A driver should not provide two version of the same transport. Verify that only one JTAG and only one SWD transport is present. Verify that the preferred transport is valid too. Change-Id: Iace2f881dd65fc763e81b33e6a7113961a7008af Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8676 Tested-by: jenkins Reviewed-by: zapb <de...@za...> Reviewed-by: Jan Matyas <jan...@co...> diff --git a/src/transport/transport.c b/src/transport/transport.c index b7a3913cc..59f76ad31 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -125,21 +125,37 @@ static int transport_select(struct command_context *ctx, const char *name) int allow_transports(struct command_context *ctx, unsigned int transport_ids, unsigned int transport_preferred_id) { - /* NOTE: caller is required to provide only a list - * of *valid* transports - * - * REVISIT should we validate that? and insist there's - * at least one valid element in that list? - * - * ... allow removals, e.g. external strapping prevents use - * of one transport; C code should be definitive about what - * can be used when all goes well. - */ if (allowed_transports || session) { LOG_ERROR("Can't modify the set of allowed transports."); return ERROR_FAIL; } + /* validate the values in transport_ids and transport_preferred_id */ + if (transport_ids == 0 || (transport_ids & ~TRANSPORT_VALID_MASK) != 0) { + LOG_ERROR("BUG: Unknown transport IDs %lu", transport_ids & ~TRANSPORT_VALID_MASK); + return ERROR_FAIL; + } + + if ((transport_ids & transport_preferred_id) == 0 + || !IS_PWR_OF_2(transport_preferred_id)) { + LOG_ERROR("BUG: Invalid adapter transport_preferred_id"); + return ERROR_FAIL; + } + + unsigned int mask = transport_ids & + (TRANSPORT_JTAG | TRANSPORT_HLA_JTAG | TRANSPORT_DAPDIRECT_JTAG); + if (mask && !IS_PWR_OF_2(mask)) { + LOG_ERROR("BUG: Multiple JTAG transports"); + return ERROR_FAIL; + } + + mask = transport_ids & + (TRANSPORT_SWD | TRANSPORT_HLA_SWD | TRANSPORT_DAPDIRECT_SWD); + if (mask && !IS_PWR_OF_2(mask)) { + LOG_ERROR("BUG: Multiple SWD transports"); + return ERROR_FAIL; + } + allowed_transports = transport_ids; preferred_transport = transport_preferred_id; ----------------------------------------------------------------------- Summary of changes: src/transport/transport.c | 50 ++++++++++++++++++++++++++++++++--------------- src/transport/transport.h | 5 +++-- 2 files changed, 37 insertions(+), 18 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:27:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a500b2ce67eb80870dfbd5d73118e822ac99ef88 (commit) via 236208a5ff2db5f502444b32da1df3fd17b692fb (commit) via 9a5de74423503d1bd16e16b77b4e0e6d19913057 (commit) from da50873d5ebe558ee545c1a00f31df9e23f45456 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a500b2ce67eb80870dfbd5d73118e822ac99ef88 Author: Antonio Borneo <bor...@gm...> Date: Wed Feb 12 16:39:18 2025 +0100 adapter: use bitmask for driver's transports In every driver, replace the array of strings with a bitmask that lists the supported transports. Add an extra field to carry the former first listed transport as a "preferred" transport. It would be used as default when no command 'transport select' is used. This keeps backward compatibility with scripts that do not define the transport, relying on such default. Change-Id: I4976583f1a38fdcc1f85045023dc7c629001f743 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8675 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 694721746..6785a74ef 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -16,6 +16,7 @@ #include "minidriver.h" #include "interface.h" #include "interfaces.h" +#include <helper/bits.h> #include <transport/transport.h> /** @@ -24,7 +25,6 @@ */ struct adapter_driver *adapter_driver; -const char * const jtag_only[] = { "jtag", NULL }; enum adapter_clk_mode { CLOCK_MODE_UNSELECTED = 0, @@ -402,11 +402,12 @@ COMMAND_HANDLER(dump_adapter_driver_list) for (unsigned int i = 0; adapter_drivers[i]; i++) { const char *name = adapter_drivers[i]->name; - const char * const *transports = adapter_drivers[i]->transports; + unsigned int transport_ids = adapter_drivers[i]->transport_ids; command_print_sameline(CMD, "%-*s {", max_len, name); - for (unsigned int j = 0; transports[j]; j++) - command_print_sameline(CMD, " %s", transports[j]); + for (unsigned int j = BIT(0); j & TRANSPORT_VALID_MASK; j <<= 1) + if (j & transport_ids) + command_print_sameline(CMD, " %s", transport_name(j)); command_print(CMD, " }"); } @@ -447,7 +448,8 @@ COMMAND_HANDLER(handle_adapter_driver_command) adapter_driver = adapter_drivers[i]; - return allow_transports(CMD_CTX, adapter_driver->transports); + return allow_transports(CMD_CTX, adapter_driver->transport_ids, + adapter_driver->transport_preferred_id); } /* no valid adapter driver was found (i.e. the configuration option, diff --git a/src/jtag/drivers/am335xgpio.c b/src/jtag/drivers/am335xgpio.c index cacf4e7c7..a4727cc89 100644 --- a/src/jtag/drivers/am335xgpio.c +++ b/src/jtag/drivers/am335xgpio.c @@ -350,8 +350,6 @@ static const struct command_registration am335xgpio_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const char * const am335xgpio_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface am335xgpio_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, @@ -494,7 +492,8 @@ static int am335xgpio_quit(void) struct adapter_driver am335xgpio_adapter_driver = { .name = "am335xgpio", - .transports = am335xgpio_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = am335xgpio_command_handlers, .init = am335xgpio_init, diff --git a/src/jtag/drivers/amt_jtagaccel.c b/src/jtag/drivers/amt_jtagaccel.c index 80254ff07..633c20413 100644 --- a/src/jtag/drivers/amt_jtagaccel.c +++ b/src/jtag/drivers/amt_jtagaccel.c @@ -579,7 +579,8 @@ static struct jtag_interface amt_jtagaccel_interface = { struct adapter_driver amt_jtagaccel_adapter_driver = { .name = "amt_jtagaccel", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = amtjtagaccel_command_handlers, .init = amt_jtagaccel_init, diff --git a/src/jtag/drivers/angie.c b/src/jtag/drivers/angie.c index 46a4c82e5..56a118eae 100644 --- a/src/jtag/drivers/angie.c +++ b/src/jtag/drivers/angie.c @@ -2388,7 +2388,8 @@ static struct jtag_interface angie_interface = { struct adapter_driver angie_adapter_driver = { .name = "angie", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = angie_init, .quit = angie_quit, diff --git a/src/jtag/drivers/arm-jtag-ew.c b/src/jtag/drivers/arm-jtag-ew.c index 45e03840e..9d8c592ed 100644 --- a/src/jtag/drivers/arm-jtag-ew.c +++ b/src/jtag/drivers/arm-jtag-ew.c @@ -486,7 +486,8 @@ static struct jtag_interface armjtagew_interface = { struct adapter_driver armjtagew_adapter_driver = { .name = "arm-jtag-ew", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = armjtagew_command_handlers, .init = armjtagew_init, diff --git a/src/jtag/drivers/at91rm9200.c b/src/jtag/drivers/at91rm9200.c index a77e29aa6..ddcf857a6 100644 --- a/src/jtag/drivers/at91rm9200.c +++ b/src/jtag/drivers/at91rm9200.c @@ -186,7 +186,8 @@ static struct jtag_interface at91rm9200_interface = { struct adapter_driver at91rm9200_adapter_driver = { .name = "at91rm9200", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = at91rm9200_command_handlers, .init = at91rm9200_init, diff --git a/src/jtag/drivers/bcm2835gpio.c b/src/jtag/drivers/bcm2835gpio.c index e8689aa03..1a105aac4 100644 --- a/src/jtag/drivers/bcm2835gpio.c +++ b/src/jtag/drivers/bcm2835gpio.c @@ -590,15 +590,14 @@ static int bcm2835gpio_quit(void) } -static const char * const bcm2835_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface bcm2835gpio_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, }; struct adapter_driver bcm2835gpio_adapter_driver = { .name = "bcm2835gpio", - .transports = bcm2835_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = bcm2835gpio_command_handlers, .init = bcm2835gpio_init, diff --git a/src/jtag/drivers/buspirate.c b/src/jtag/drivers/buspirate.c index 93f0ba383..4283616ad 100644 --- a/src/jtag/drivers/buspirate.c +++ b/src/jtag/drivers/buspirate.c @@ -534,15 +534,14 @@ static const struct swd_driver buspirate_swd = { .run = buspirate_swd_run_queue, }; -static const char * const buspirate_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface buspirate_interface = { .execute_queue = buspirate_execute_queue, }; struct adapter_driver buspirate_adapter_driver = { .name = "buspirate", - .transports = buspirate_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = buspirate_command_handlers, .init = buspirate_init, diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index be9ebaed5..2bfcfcc2b 100644 --- a/src/jtag/drivers/cmsis_dap.c +++ b/src/jtag/drivers/cmsis_dap.c @@ -2314,8 +2314,6 @@ static const struct swd_driver cmsis_dap_swd_driver = { .run = cmsis_dap_swd_run_queue, }; -static const char * const cmsis_dap_transport[] = { "swd", "jtag", NULL }; - static struct jtag_interface cmsis_dap_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = cmsis_dap_execute_queue, @@ -2323,7 +2321,8 @@ static struct jtag_interface cmsis_dap_interface = { struct adapter_driver cmsis_dap_adapter_driver = { .name = "cmsis-dap", - .transports = cmsis_dap_transport, + .transport_ids = TRANSPORT_SWD | TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_SWD, .commands = cmsis_dap_command_handlers, .init = cmsis_dap_init, diff --git a/src/jtag/drivers/dmem.c b/src/jtag/drivers/dmem.c index 4dc582115..e50e84aee 100644 --- a/src/jtag/drivers/dmem.c +++ b/src/jtag/drivers/dmem.c @@ -604,11 +604,10 @@ static const struct dap_ops dmem_dap_ops = { .run = dmem_dp_run, }; -static const char *const dmem_dap_transport[] = { "dapdirect_swd", NULL }; - struct adapter_driver dmem_dap_adapter_driver = { .name = "dmem", - .transports = dmem_dap_transport, + .transport_ids = TRANSPORT_DAPDIRECT_SWD, + .transport_preferred_id = TRANSPORT_DAPDIRECT_SWD, .commands = dmem_dap_command_handlers, .init = dmem_dap_init, diff --git a/src/jtag/drivers/dummy.c b/src/jtag/drivers/dummy.c index 79b29fbae..471668c3a 100644 --- a/src/jtag/drivers/dummy.c +++ b/src/jtag/drivers/dummy.c @@ -140,7 +140,8 @@ static struct jtag_interface dummy_interface = { struct adapter_driver dummy_adapter_driver = { .name = "dummy", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = dummy_command_handlers, .init = &dummy_init, diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c index ea9faf19b..f3e1676f9 100644 --- a/src/jtag/drivers/ep93xx.c +++ b/src/jtag/drivers/ep93xx.c @@ -46,7 +46,8 @@ static struct jtag_interface ep93xx_interface = { struct adapter_driver ep93xx_adapter_driver = { .name = "ep93xx", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = ep93xx_init, .quit = ep93xx_quit, diff --git a/src/jtag/drivers/esp_usb_jtag.c b/src/jtag/drivers/esp_usb_jtag.c index 950405954..a13303511 100644 --- a/src/jtag/drivers/esp_usb_jtag.c +++ b/src/jtag/drivers/esp_usb_jtag.c @@ -784,7 +784,8 @@ static struct jtag_interface esp_usb_jtag_interface = { struct adapter_driver esp_usb_adapter_driver = { .name = "esp_usb_jtag", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = esp_usb_jtag_commands, .init = esp_usb_jtag_init, diff --git a/src/jtag/drivers/ft232r.c b/src/jtag/drivers/ft232r.c index f4e5af4dd..f88e4b940 100644 --- a/src/jtag/drivers/ft232r.c +++ b/src/jtag/drivers/ft232r.c @@ -900,7 +900,8 @@ static struct jtag_interface ft232r_interface = { struct adapter_driver ft232r_adapter_driver = { .name = "ft232r", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = ft232r_command_handlers, .init = ft232r_init, diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index ec0ae4c00..a8f6f6015 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -1247,8 +1247,6 @@ static const struct swd_driver ftdi_swd = { .run = ftdi_swd_run_queue, }; -static const char * const ftdi_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface ftdi_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = ftdi_execute_queue, @@ -1256,7 +1254,8 @@ static struct jtag_interface ftdi_interface = { struct adapter_driver ftdi_adapter_driver = { .name = "ftdi", - .transports = ftdi_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = ftdi_command_handlers, .init = ftdi_initialize, diff --git a/src/jtag/drivers/gw16012.c b/src/jtag/drivers/gw16012.c index 7200e757c..805065f1f 100644 --- a/src/jtag/drivers/gw16012.c +++ b/src/jtag/drivers/gw16012.c @@ -514,7 +514,8 @@ static struct jtag_interface gw16012_interface = { struct adapter_driver gw16012_adapter_driver = { .name = "gw16012", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = gw16012_command_handlers, .init = gw16012_init, diff --git a/src/jtag/drivers/imx_gpio.c b/src/jtag/drivers/imx_gpio.c index 18dc2ddf6..a4a76ca5a 100644 --- a/src/jtag/drivers/imx_gpio.c +++ b/src/jtag/drivers/imx_gpio.c @@ -417,8 +417,6 @@ static const struct command_registration imx_gpio_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const char * const imx_gpio_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface imx_gpio_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, @@ -426,7 +424,8 @@ static struct jtag_interface imx_gpio_interface = { struct adapter_driver imx_gpio_adapter_driver = { .name = "imx_gpio", - .transports = imx_gpio_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = imx_gpio_command_handlers, .init = imx_gpio_init, diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index 4d15cf5e6..9caf37f6f 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -2264,15 +2264,14 @@ static const struct swd_driver jlink_swd = { .run = &jlink_swd_run_queue, }; -static const char * const jlink_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface jlink_interface = { .execute_queue = &jlink_execute_queue, }; struct adapter_driver jlink_adapter_driver = { .name = "jlink", - .transports = jlink_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = jlink_command_handlers, .init = &jlink_init, diff --git a/src/jtag/drivers/jtag_dpi.c b/src/jtag/drivers/jtag_dpi.c index 046186a61..d6418d39c 100644 --- a/src/jtag/drivers/jtag_dpi.c +++ b/src/jtag/drivers/jtag_dpi.c @@ -398,7 +398,8 @@ static struct jtag_interface jtag_dpi_interface = { struct adapter_driver jtag_dpi_adapter_driver = { .name = "jtag_dpi", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = jtag_dpi_command_handlers, .init = jtag_dpi_init, .quit = jtag_dpi_quit, diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index f6cb3de5d..fac27b306 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -666,7 +666,8 @@ static struct jtag_interface jtag_vpi_interface = { struct adapter_driver jtag_vpi_adapter_driver = { .name = "jtag_vpi", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = jtag_vpi_command_handlers, .init = jtag_vpi_init, diff --git a/src/jtag/drivers/kitprog.c b/src/jtag/drivers/kitprog.c index 98b0d1668..88e301ceb 100644 --- a/src/jtag/drivers/kitprog.c +++ b/src/jtag/drivers/kitprog.c @@ -908,11 +908,10 @@ static const struct swd_driver kitprog_swd = { .run = kitprog_swd_run_queue, }; -static const char * const kitprog_transports[] = { "swd", NULL }; - struct adapter_driver kitprog_adapter_driver = { .name = "kitprog", - .transports = kitprog_transports, + .transport_ids = TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_SWD, .commands = kitprog_command_handlers, .init = kitprog_init, diff --git a/src/jtag/drivers/linuxgpiod.c b/src/jtag/drivers/linuxgpiod.c index eda7b1a80..36c7e0493 100644 --- a/src/jtag/drivers/linuxgpiod.c +++ b/src/jtag/drivers/linuxgpiod.c @@ -425,8 +425,6 @@ out_error: return ERROR_JTAG_INIT_FAILED; } -static const char *const linuxgpiod_transport[] = { "swd", "jtag", NULL }; - static struct jtag_interface linuxgpiod_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, @@ -434,7 +432,8 @@ static struct jtag_interface linuxgpiod_interface = { struct adapter_driver linuxgpiod_adapter_driver = { .name = "linuxgpiod", - .transports = linuxgpiod_transport, + .transport_ids = TRANSPORT_SWD | TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_SWD, .init = linuxgpiod_init, .quit = linuxgpiod_quit, diff --git a/src/jtag/drivers/linuxspidev.c b/src/jtag/drivers/linuxspidev.c index 18abdc7db..396f1a19a 100644 --- a/src/jtag/drivers/linuxspidev.c +++ b/src/jtag/drivers/linuxspidev.c @@ -616,12 +616,10 @@ static const struct command_registration spidev_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -// Only SWD transport supported -static const char *const spidev_transports[] = { "swd", NULL }; - struct adapter_driver linuxspidev_adapter_driver = { .name = "linuxspidev", - .transports = spidev_transports, + .transport_ids = TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_SWD, .commands = spidev_command_handlers, .init = spidev_init, diff --git a/src/jtag/drivers/opendous.c b/src/jtag/drivers/opendous.c index 999afb3fc..04626cb1e 100644 --- a/src/jtag/drivers/opendous.c +++ b/src/jtag/drivers/opendous.c @@ -229,7 +229,8 @@ static struct jtag_interface opendous_interface = { struct adapter_driver opendous_adapter_driver = { .name = "opendous", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = opendous_command_handlers, .init = opendous_init, diff --git a/src/jtag/drivers/openjtag.c b/src/jtag/drivers/openjtag.c index 14bcc171e..943ad854e 100644 --- a/src/jtag/drivers/openjtag.c +++ b/src/jtag/drivers/openjtag.c @@ -931,7 +931,8 @@ static struct jtag_interface openjtag_interface = { struct adapter_driver openjtag_adapter_driver = { .name = "openjtag", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = openjtag_command_handlers, .init = openjtag_init, diff --git a/src/jtag/drivers/osbdm.c b/src/jtag/drivers/osbdm.c index 80f66d197..de2e1f8eb 100644 --- a/src/jtag/drivers/osbdm.c +++ b/src/jtag/drivers/osbdm.c @@ -684,7 +684,8 @@ static struct jtag_interface osbdm_interface = { struct adapter_driver osbdm_adapter_driver = { .name = "osbdm", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = osbdm_init, .quit = osbdm_quit, diff --git a/src/jtag/drivers/parport.c b/src/jtag/drivers/parport.c index 3b20fe247..143f3bde1 100644 --- a/src/jtag/drivers/parport.c +++ b/src/jtag/drivers/parport.c @@ -533,7 +533,8 @@ static struct jtag_interface parport_interface = { struct adapter_driver parport_adapter_driver = { .name = "parport", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = parport_command_handlers, .init = parport_init, diff --git a/src/jtag/drivers/presto.c b/src/jtag/drivers/presto.c index f6e13f7eb..84b881cdc 100644 --- a/src/jtag/drivers/presto.c +++ b/src/jtag/drivers/presto.c @@ -528,7 +528,8 @@ static struct jtag_interface presto_interface = { struct adapter_driver presto_adapter_driver = { .name = "presto", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = presto_jtag_init, .quit = presto_jtag_quit, diff --git a/src/jtag/drivers/remote_bitbang.c b/src/jtag/drivers/remote_bitbang.c index bb608ba0a..449c61654 100644 --- a/src/jtag/drivers/remote_bitbang.c +++ b/src/jtag/drivers/remote_bitbang.c @@ -412,8 +412,6 @@ COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_host_command) return ERROR_COMMAND_SYNTAX_ERROR; } -static const char * const remote_bitbang_transports[] = { "jtag", "swd", NULL }; - COMMAND_HANDLER(remote_bitbang_handle_remote_bitbang_use_remote_sleep_command) { if (CMD_ARGC != 1) @@ -484,7 +482,8 @@ static struct jtag_interface remote_bitbang_interface = { struct adapter_driver remote_bitbang_adapter_driver = { .name = "remote_bitbang", - .transports = remote_bitbang_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = remote_bitbang_command_handlers, .init = &remote_bitbang_init, diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c index 6ea3729a5..a81899625 100644 --- a/src/jtag/drivers/rlink.c +++ b/src/jtag/drivers/rlink.c @@ -1675,7 +1675,8 @@ static struct jtag_interface rlink_interface = { struct adapter_driver rlink_adapter_driver = { .name = "rlink", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = rlink_init, .quit = rlink_quit, diff --git a/src/jtag/drivers/rshim.c b/src/jtag/drivers/rshim.c index b37fe8c45..89bdadd69 100644 --- a/src/jtag/drivers/rshim.c +++ b/src/jtag/drivers/rshim.c @@ -508,11 +508,10 @@ static const struct dap_ops rshim_dap_ops = { .quit = rshim_disconnect, }; -static const char *const rshim_dap_transport[] = { "dapdirect_swd", NULL }; - struct adapter_driver rshim_dap_adapter_driver = { .name = "rshim", - .transports = rshim_dap_transport, + .transport_ids = TRANSPORT_DAPDIRECT_SWD, + .transport_preferred_id = TRANSPORT_DAPDIRECT_SWD, .commands = rshim_dap_command_handlers, .init = rshim_dap_init, diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index d77f28b0f..e018f71cd 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -5217,11 +5217,10 @@ static const struct swim_driver stlink_swim_ops = { .reconnect = stlink_swim_op_reconnect, }; -static const char *const stlink_dap_transport[] = { "dapdirect_swd", "dapdirect_jtag", "swim", NULL }; - struct adapter_driver stlink_dap_adapter_driver = { .name = "st-link", - .transports = stlink_dap_transport, + .transport_ids = TRANSPORT_DAPDIRECT_SWD | TRANSPORT_DAPDIRECT_JTAG | TRANSPORT_SWIM, + .transport_preferred_id = TRANSPORT_DAPDIRECT_SWD, .commands = stlink_dap_command_handlers, .init = stlink_dap_init, diff --git a/src/jtag/drivers/sysfsgpio.c b/src/jtag/drivers/sysfsgpio.c index ccd3974a4..279b35377 100644 --- a/src/jtag/drivers/sysfsgpio.c +++ b/src/jtag/drivers/sysfsgpio.c @@ -545,8 +545,6 @@ static const struct command_registration sysfsgpio_command_handlers[] = { static int sysfsgpio_init(void); static int sysfsgpio_quit(void); -static const char * const sysfsgpio_transports[] = { "jtag", "swd", NULL }; - static struct jtag_interface sysfsgpio_interface = { .supported = DEBUG_CAP_TMS_SEQ, .execute_queue = bitbang_execute_queue, @@ -554,7 +552,8 @@ static struct jtag_interface sysfsgpio_interface = { struct adapter_driver sysfsgpio_adapter_driver = { .name = "sysfsgpio", - .transports = sysfsgpio_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = sysfsgpio_command_handlers, .init = sysfsgpio_init, diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index 0a13bf6d4..417d560cd 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -2271,7 +2271,8 @@ static struct jtag_interface ulink_interface = { struct adapter_driver ulink_adapter_driver = { .name = "ulink", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = ulink_command_handlers, .init = ulink_init, diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c index 1782cc424..81344664e 100644 --- a/src/jtag/drivers/usb_blaster/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster/usb_blaster.c @@ -1057,7 +1057,8 @@ static struct jtag_interface usb_blaster_interface = { struct adapter_driver usb_blaster_adapter_driver = { .name = "usb_blaster", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .commands = ublast_command_handlers, .init = ublast_init, diff --git a/src/jtag/drivers/usbprog.c b/src/jtag/drivers/usbprog.c index 24407f003..264b45f72 100644 --- a/src/jtag/drivers/usbprog.c +++ b/src/jtag/drivers/usbprog.c @@ -590,7 +590,8 @@ static struct jtag_interface usbprog_interface = { struct adapter_driver usbprog_adapter_driver = { .name = "usbprog", - .transports = jtag_only, + .transport_ids = TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_JTAG, .init = usbprog_init, .quit = usbprog_quit, diff --git a/src/jtag/drivers/vdebug.c b/src/jtag/drivers/vdebug.c index fd1e6a7e7..38685950a 100644 --- a/src/jtag/drivers/vdebug.c +++ b/src/jtag/drivers/vdebug.c @@ -1342,11 +1342,10 @@ static const struct dap_ops vdebug_dap_ops = { .quit = NULL, /* optional */ }; -static const char *const vdebug_transports[] = { "jtag", "dapdirect_swd", NULL }; - struct adapter_driver vdebug_adapter_driver = { .name = "vdebug", - .transports = vdebug_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_DAPDIRECT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .speed = vdebug_jtag_speed, .khz = vdebug_jtag_khz, .speed_div = vdebug_jtag_div, diff --git a/src/jtag/drivers/vsllink.c b/src/jtag/drivers/vsllink.c index c10ed1380..145f0682a 100644 --- a/src/jtag/drivers/vsllink.c +++ b/src/jtag/drivers/vsllink.c @@ -913,8 +913,6 @@ static const struct command_registration vsllink_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static const char * const vsllink_transports[] = {"jtag", "swd", NULL}; - static const struct swd_driver vsllink_swd_driver = { .init = vsllink_swd_init, .switch_seq = vsllink_swd_switch_seq, @@ -930,7 +928,8 @@ static struct jtag_interface vsllink_interface = { struct adapter_driver vsllink_adapter_driver = { .name = "vsllink", - .transports = vsllink_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = vsllink_command_handlers, .init = vsllink_init, diff --git a/src/jtag/drivers/xds110.c b/src/jtag/drivers/xds110.c index c84371001..d1bb70590 100644 --- a/src/jtag/drivers/xds110.c +++ b/src/jtag/drivers/xds110.c @@ -2058,15 +2058,14 @@ static const struct swd_driver xds110_swd_driver = { .run = xds110_swd_run_queue, }; -static const char * const xds110_transport[] = { "swd", "jtag", NULL }; - static struct jtag_interface xds110_interface = { .execute_queue = xds110_execute_queue, }; struct adapter_driver xds110_adapter_driver = { .name = "xds110", - .transports = xds110_transport, + .transport_ids = TRANSPORT_SWD | TRANSPORT_JTAG, + .transport_preferred_id = TRANSPORT_SWD, .commands = xds110_command_handlers, .init = xds110_init, diff --git a/src/jtag/drivers/xlnx-pcie-xvc.c b/src/jtag/drivers/xlnx-pcie-xvc.c index 37c6777e4..3baa183d9 100644 --- a/src/jtag/drivers/xlnx-pcie-xvc.c +++ b/src/jtag/drivers/xlnx-pcie-xvc.c @@ -690,11 +690,10 @@ static const struct swd_driver xlnx_pcie_xvc_swd_ops = { .run = xlnx_pcie_xvc_swd_run_queue, }; -static const char * const xlnx_pcie_xvc_transports[] = { "jtag", "swd", NULL }; - struct adapter_driver xlnx_pcie_xvc_adapter_driver = { .name = "xlnx_pcie_xvc", - .transports = xlnx_pcie_xvc_transports, + .transport_ids = TRANSPORT_JTAG | TRANSPORT_SWD, + .transport_preferred_id = TRANSPORT_JTAG, .commands = xlnx_pcie_xvc_command_handlers, .init = &xlnx_pcie_xvc_init, diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c index 96862b0d0..a9d196cce 100644 --- a/src/jtag/hla/hla_interface.c +++ b/src/jtag/hla/hla_interface.c @@ -367,7 +367,8 @@ static const struct command_registration hl_interface_command_handlers[] = { struct adapter_driver hl_adapter_driver = { .name = "hla", - .transports = hl_transports, + .transport_ids = TRANSPORT_HLA_SWD | TRANSPORT_HLA_JTAG, + .transport_preferred_id = TRANSPORT_HLA_SWD, .commands = hl_interface_command_handlers, .init = hl_interface_init, diff --git a/src/jtag/hla/hla_interface.h b/src/jtag/hla/hla_interface.h index f1550d991..c0ee05498 100644 --- a/src/jtag/hla/hla_interface.h +++ b/src/jtag/hla/hla_interface.h @@ -15,8 +15,6 @@ struct target; /** */ enum e_hl_transports; -/** */ -extern const char *hl_transports[]; #define HLA_MAX_USB_IDS 16 diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index 333825eff..d8ece0776 100644 --- a/src/jtag/hla/hla_transport.c +++ b/src/jtag/hla/hla_transport.c @@ -231,8 +231,6 @@ static struct transport hl_jtag_transport = { .override_target = hl_interface_override_target, }; -const char *hl_transports[] = { "hla_swd", "hla_jtag", NULL }; - static void hl_constructor(void) __attribute__ ((constructor)); static void hl_constructor(void) { diff --git a/src/jtag/interface.h b/src/jtag/interface.h index b2d7123fd..475dbed36 100644 --- a/src/jtag/interface.h +++ b/src/jtag/interface.h @@ -17,6 +17,7 @@ #include <jtag/jtag.h> #include <jtag/swim.h> #include <target/arm_tpiu_swo.h> +#include <transport/transport.h> /* @file * The "Cable Helper API" is what the cable drivers can use to help @@ -208,8 +209,16 @@ struct adapter_driver { /** The name of the interface driver. */ const char * const name; - /** transports supported in C code (NULL terminated vector) */ - const char * const *transports; + /** + * Bitmask of transport IDs supported in C code. + */ + unsigned int transport_ids; + + /** + * ID of transport that gets auto-selected when not specified by the user. + * The auto-selection of transport is DEPRECATED. + */ + unsigned int transport_preferred_id; /** * The interface driver may register additional commands to expose @@ -354,8 +363,6 @@ struct adapter_driver { const struct swim_driver *swim_ops; }; -extern const char * const jtag_only[]; - int adapter_resets(int assert_trst, int assert_srst); int adapter_assert_reset(void); int adapter_deassert_reset(void); diff --git a/src/transport/transport.c b/src/transport/transport.c index 411b0a5e0..b7a3913cc 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -62,11 +62,15 @@ static const struct { static struct transport *transport_list; /** - * NULL-terminated Vector of names of transports which the - * currently selected debug adapter supports. This is declared - * by the time that adapter is fully set up. + * Bitmask of transport IDs which the currently selected debug adapter supports. + * This is declared by the time that adapter is fully set up. */ -static const char * const *allowed_transports; +static unsigned int allowed_transports; + +/** + * Transport ID auto-selected when not specified by the user. + */ +static unsigned int preferred_transport; /** * Adapter supports a single transport; it has been auto-selected @@ -76,7 +80,7 @@ static bool transport_single_is_autoselected; /** * The transport being used for the current OpenOCD session. */ static struct transport *session; -static const char *transport_name(unsigned int id) +const char *transport_name(unsigned int id) { for (unsigned int i = 0; i < ARRAY_SIZE(transport_names); i++) if (id == transport_names[i].id) @@ -118,13 +122,14 @@ static int transport_select(struct command_context *ctx, const char *name) * to declare the set of transports supported by an adapter. When * there is only one member of that set, it is automatically selected. */ -int allow_transports(struct command_context *ctx, const char * const *vector) +int allow_transports(struct command_context *ctx, unsigned int transport_ids, + unsigned int transport_preferred_id) { /* NOTE: caller is required to provide only a list - * of *valid* transport names + * of *valid* transports * * REVISIT should we validate that? and insist there's - * at least one non-NULL element in that list? + * at least one valid element in that list? * * ... allow removals, e.g. external strapping prevents use * of one transport; C code should be definitive about what @@ -135,13 +140,14 @@ int allow_transports(struct command_context *ctx, const char * const *vector) return ERROR_FAIL; } - allowed_transports = vector; + allowed_transports = transport_ids; + preferred_transport = transport_preferred_id; /* autoselect if there's no choice ... */ - if (!vector[1]) { - LOG_DEBUG("only one transport option; autoselecting '%s'", vector[0]); + if (IS_PWR_OF_2(transport_ids)) { + LOG_DEBUG("only one transport option; autoselecting '%s'", transport_name(transport_ids)); transport_single_is_autoselected = true; - return transport_select(ctx, vector[0]); + return transport_select(ctx, transport_name(transport_ids)); } return ERROR_OK; @@ -226,10 +232,9 @@ COMMAND_HANDLER(handle_transport_init) /* no session transport configured, print transports then fail */ LOG_ERROR("Transports available:"); - const char * const *vector = allowed_transports; - while (*vector) { - LOG_ERROR("%s", *vector); - vector++; + for (unsigned int i = BIT(0); i & TRANSPORT_VALID_MASK; i <<= 1) { + if (i & allowed_transports) + LOG_ERROR("%s", transport_name(i)); } return ERROR_FAIL; } @@ -275,8 +280,9 @@ COMMAND_HANDLER(handle_transport_select) } LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " "Use 'transport select %s' to suppress this message.", - allowed_transports[0], allowed_transports[0]); - int retval = transport_select(CMD_CTX, allowed_transports[0]); + transport_name(preferred_transport), + transport_name(preferred_transport)); + int retval = transport_select(CMD_CTX, transport_name(preferred_transport)); if (retval != ERROR_OK) return retval; } @@ -310,8 +316,9 @@ COMMAND_HANDLER(handle_transport_select) return ERROR_FAIL; } - for (unsigned int i = 0; allowed_transports[i]; i++) { - if (!strcmp(allowed_transports[i], CMD_ARGV[0])) { + for (unsigned int i = BIT(0); i & TRANSPORT_VALID_MASK; i <<= 1) { + if ((i & allowed_transports) + && !strcmp(transport_name(i), CMD_ARGV[0])) { int retval = transport_select(CMD_CTX, CMD_ARGV[0]); if (retval != ERROR_OK) return retval; diff --git a/src/transport/transport.h b/src/transport/transport.h index dde7c6ba7..f6f0f4f4d 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -95,9 +95,12 @@ struct transport *get_current_transport(void); const char *get_current_transport_name(void); +const char *transport_name(unsigned int id); + int transport_register_commands(struct command_context *ctx); -int allow_transports(struct command_context *ctx, const char * const *vector); +int allow_transports(struct command_context *ctx, unsigned int transport_ids, + unsigned int transport_preferred_id); bool transport_is_jtag(void); bool transport_is_swd(void); commit 236208a5ff2db5f502444b32da1df3fd17b692fb Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 22 17:06:12 2024 +0100 transport: use a bitmask for the transport Move the transport's names in a local array in the transport framework. Replace the string struct transport::name, that identifies the transport, with a bitmask where each bit corresponds to one of the available transports. Change-Id: I6bdf7264d5979c355299f63fcf80bf54dcd95cee Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8674 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/core.c b/src/jtag/core.c index 030c173be..6dd2144c6 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1823,7 +1823,7 @@ static int jtag_select(struct command_context *ctx) } static struct transport jtag_transport = { - .name = "jtag", + .id = TRANSPORT_JTAG, .select = jtag_select, .init = jtag_init, }; @@ -1868,7 +1868,7 @@ int adapter_resets(int trst, int srst) transport_is_swim()) { if (trst == TRST_ASSERT) { LOG_ERROR("transport %s has no trst signal", - get_current_transport()->name); + get_current_transport_name()); return ERROR_FAIL; } @@ -1884,7 +1884,7 @@ int adapter_resets(int trst, int srst) return ERROR_OK; LOG_ERROR("reset is not supported on transport %s", - get_current_transport()->name); + get_current_transport_name()); return ERROR_FAIL; } @@ -1903,7 +1903,7 @@ int adapter_assert_reset(void) return adapter_system_reset(1); else if (get_current_transport()) LOG_ERROR("reset is not supported on %s", - get_current_transport()->name); + get_current_transport_name()); else LOG_ERROR("transport is not selected"); return ERROR_FAIL; @@ -1920,7 +1920,7 @@ int adapter_deassert_reset(void) return adapter_system_reset(0); else if (get_current_transport()) LOG_ERROR("reset is not supported on %s", - get_current_transport()->name); + get_current_transport_name()); else LOG_ERROR("transport is not selected"); return ERROR_FAIL; diff --git a/src/jtag/hla/hla_transport.c b/src/jtag/hla/hla_transport.c index b826eb0fe..333825eff 100644 --- a/src/jtag/hla/hla_transport.c +++ b/src/jtag/hla/hla_transport.c @@ -177,15 +177,20 @@ static int hl_transport_init(struct command_context *cmd_ctx) return ERROR_FAIL; } - LOG_DEBUG("current transport %s", transport->name); + LOG_DEBUG("current transport %s", get_current_transport_name()); /* get selected transport as enum */ - tr = HL_TRANSPORT_UNKNOWN; - - if (strcmp(transport->name, "hla_swd") == 0) + switch (transport->id) { + case TRANSPORT_HLA_SWD: tr = HL_TRANSPORT_SWD; - else if (strcmp(transport->name, "hla_jtag") == 0) + break; + case TRANSPORT_HLA_JTAG: tr = HL_TRANSPORT_JTAG; + break; + default: + tr = HL_TRANSPORT_UNKNOWN; + break; + } int retval = hl_interface_open(tr); @@ -213,14 +218,14 @@ static int hl_swd_transport_select(struct command_context *cmd_ctx) } static struct transport hl_swd_transport = { - .name = "hla_swd", + .id = TRANSPORT_HLA_SWD, .select = hl_swd_transport_select, .init = hl_transport_init, .override_target = hl_interface_override_target, }; static struct transport hl_jtag_transport = { - .name = "hla_jtag", + .id = TRANSPORT_HLA_JTAG, .select = hl_jtag_transport_select, .init = hl_transport_init, .override_target = hl_interface_override_target, diff --git a/src/jtag/swim.c b/src/jtag/swim.c index de3e106a1..004a9fd4f 100644 --- a/src/jtag/swim.c +++ b/src/jtag/swim.c @@ -136,7 +136,7 @@ static int swim_transport_init(struct command_context *cmd_ctx) } static struct transport swim_transport = { - .name = "swim", + .id = TRANSPORT_SWIM, .select = swim_transport_select, .init = swim_transport_init, }; diff --git a/src/target/adi_v5_dapdirect.c b/src/target/adi_v5_dapdirect.c index d198dacf3..07ea313d1 100644 --- a/src/target/adi_v5_dapdirect.c +++ b/src/target/adi_v5_dapdirect.c @@ -207,13 +207,13 @@ static int dapdirect_init(struct command_context *ctx) } static struct transport dapdirect_jtag_transport = { - .name = "dapdirect_jtag", + .id = TRANSPORT_DAPDIRECT_JTAG, .select = dapdirect_jtag_select, .init = dapdirect_init, }; static struct transport dapdirect_swd_transport = { - .name = "dapdirect_swd", + .id = TRANSPORT_DAPDIRECT_SWD, .select = dapdirect_swd_select, .init = dapdirect_init, }; diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index e50f8f137..2d286136a 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -756,7 +756,7 @@ static int swd_init(struct command_context *ctx) } static struct transport swd_transport = { - .name = "swd", + .id = TRANSPORT_SWD, .select = swd_select, .init = swd_init, }; diff --git a/src/transport/transport.c b/src/transport/transport.c index 4a1f71d40..411b0a5e0 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -30,6 +30,8 @@ * messaging and error handling. */ +#include <helper/align.h> +#include <helper/bits.h> #include <helper/log.h> #include <helper/replacements.h> #include <transport/transport.h> @@ -43,6 +45,20 @@ extern struct command_context *global_cmd_ctx; */ /** List of transports known to OpenOCD. */ +static const struct { + unsigned int id; + const char *name; +} transport_names[] = { + { TRANSPORT_JTAG, "jtag", }, + { TRANSPORT_SWD, "swd", }, + { TRANSPORT_HLA_JTAG, "hla_jtag", }, + { TRANSPORT_HLA_SWD, "hla_swd", }, + { TRANSPORT_DAPDIRECT_JTAG, "dapdirect_jtag", }, + { TRANSPORT_DAPDIRECT_SWD, "dapdirect_swd", }, + { TRANSPORT_SWIM, "swim", }, +}; + +/** List of transports registered in OpenOCD. */ static struct transport *transport_list; /** @@ -60,12 +76,26 @@ static bool transport_single_is_autoselected; /** * The transport being used for the current OpenOCD session. */ static struct transport *session; +static const char *transport_name(unsigned int id) +{ + for (unsigned int i = 0; i < ARRAY_SIZE(transport_names); i++) + if (id == transport_names[i].id) + return transport_names[i].name; + + return NULL; +} + +static bool is_transport_id_valid(unsigned int id) +{ + return (id != 0) && ((id & ~TRANSPORT_VALID_MASK) == 0) && IS_PWR_OF_2(id); +} + static int transport_select(struct command_context *ctx, const char *name) { /* name may only identify a known transport; * caller guarantees session's transport isn't yet set.*/ for (struct transport *t = transport_list; t; t = t->next) { - if (strcmp(t->name, name) == 0) { + if (!strcmp(transport_name(t->id), name)) { int retval = t->select(ctx); /* select() registers commands specific to this * transport, and may also reset the link, e.g. @@ -74,7 +104,7 @@ static int transport_select(struct command_context *ctx, const char *name) if (retval == ERROR_OK) session = t; else - LOG_ERROR("Error selecting '%s' as transport", t->name); + LOG_ERROR("Error selecting '%s' as transport", name); return retval; } } @@ -136,20 +166,28 @@ int transport_register(struct transport *new_transport) { struct transport *t; + if (!is_transport_id_valid(new_transport->id)) { + LOG_ERROR("invalid transport ID 0x%x", new_transport->id); + return ERROR_FAIL; + } + for (t = transport_list; t; t = t->next) { - if (strcmp(t->name, new_transport->name) == 0) { - LOG_ERROR("transport name already used"); + if (t->id == new_transport->id) { + LOG_ERROR("transport '%s' already registered", + transport_name(t->id)); return ERROR_FAIL; } } if (!new_transport->select || !new_transport->init) - LOG_ERROR("invalid transport %s", new_transport->name); + LOG_ERROR("invalid transport %s", + transport_name(new_transport->id)); /* splice this into the list */ new_transport->next = transport_list; transport_list = new_transport; - LOG_DEBUG("register '%s'", new_transport->name); + LOG_DEBUG("register '%s' (ID %d)", + transport_name(new_transport->id), new_transport->id); return ERROR_OK; } @@ -166,6 +204,14 @@ struct transport *get_current_transport(void) return session; } +const char *get_current_transport_name(void) +{ + if (!session || !is_transport_id_valid(session->id)) + NULL; + + return transport_name(session->id); +} + /*-----------------------------------------------------------------------*/ /* @@ -191,7 +237,7 @@ COMMAND_HANDLER(handle_transport_init) if (transport_single_is_autoselected) LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " "Use 'transport select %s' to suppress this message.", - session->name, session->name); + transport_name(session->id), transport_name(session->id)); return session->init(CMD_CTX); } @@ -204,7 +250,7 @@ COMMAND_HANDLER(handle_transport_list) command_print(CMD, "The following transports are available:"); for (struct transport *t = transport_list; t; t = t->next) - command_print(CMD, "\t%s", t->name); + command_print(CMD, "\t%s", transport_name(t->id)); return ERROR_OK; } @@ -234,19 +280,19 @@ COMMAND_HANDLER(handle_transport_select) if (retval != ERROR_OK) return retval; } - command_print(CMD, "%s", session->name); + command_print(CMD, "%s", transport_name(session->id)); return ERROR_OK; } /* assign transport */ if (session) { - if (!strcmp(session->name, CMD_ARGV[0])) { + if (!strcmp(transport_name(session->id), CMD_ARGV[0])) { if (transport_single_is_autoselected) { /* Nothing to do, but also nothing to complain */ transport_single_is_autoselected = false; return ERROR_OK; } - LOG_WARNING("Transport \"%s\" was already selected", session->name); + LOG_WARNING("Transport \"%s\" was already selected", CMD_ARGV[0]); return ERROR_OK; } command_print(CMD, "Can't change session's transport after the initial selection was made"); diff --git a/src/transport/transport.h b/src/transport/transport.h index 2e3dcc61a..dde7c6ba7 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -12,8 +12,27 @@ #include "config.h" #endif +#include "helper/bits.h" #include "helper/command.h" +#define TRANSPORT_JTAG BIT(0) +#define TRANSPORT_SWD BIT(1) +#define TRANSPORT_HLA_JTAG BIT(2) +#define TRANSPORT_HLA_SWD BIT(3) +#define TRANSPORT_DAPDIRECT_JTAG BIT(4) +#define TRANSPORT_DAPDIRECT_SWD BIT(5) +#define TRANSPORT_SWIM BIT(6) + +/* mask for valid ID */ +#define TRANSPORT_VALID_MASK \ + (TRANSPORT_JTAG | \ + TRANSPORT_SWD | \ + TRANSPORT_HLA_JTAG | \ + TRANSPORT_HLA_SWD | \ + TRANSPORT_DAPDIRECT_JTAG | \ + TRANSPORT_DAPDIRECT_SWD | \ + TRANSPORT_SWIM) + /** * Wrapper for transport lifecycle operations. * @@ -34,11 +53,10 @@ */ struct transport { /** - * Each transport has a unique name, used to select it - * from among the alternatives. Examples might include - * "jtag", * "swd", "AVR_ISP" and more. + * Each transport has a unique ID, used to select it + * from among the alternatives. */ - const char *name; + unsigned int id; /** * When a transport is selected, this method registers @@ -75,6 +93,8 @@ int transport_register(struct transport *new_transport); struct transport *get_current_transport(void); +const char *get_current_transport_name(void); + int transport_register_commands(struct command_context *ctx); int allow_transports(struct command_context *ctx, const char * const *vector); commit 9a5de74423503d1bd16e16b77b4e0e6d19913057 Author: Antonio Borneo <bor...@gm...> Date: Sat Jan 4 16:54:14 2025 +0100 transport: deprecate auto-selection of transport Historically, if the user does not specify a transport, OpenOCD select automatically the first transport listed in the adapter driver. This auto-selection can behave differently by changing adapter, so the transport should be enforced in the configuration file. Deprecate the auto-selection and print a warning message when a transport gets auto-selected. There are two cases: - adapter offers one transport only. The code early auto-selects the transport but does not print anything. If later the user selects the transport then no deprecation will be printed during 'transport init'; - user runs 'transport select', e.g. in 'swj-dp' script, and this triggers the auto-selection and the deprecated message. Change-Id: I2e55b9dcc6da77ca937978fbfb36bc365b803f0d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8692 Reviewed-by: Jan Matyas <jan...@co...> Reviewed-by: zapb <de...@za...> Tested-by: jenkins diff --git a/src/transport/transport.c b/src/transport/transport.c index 0af136036..4a1f71d40 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -52,6 +52,11 @@ static struct transport *transport_list; */ static const char * const *allowed_transports; +/** + * Adapter supports a single transport; it has been auto-selected + */ +static bool transport_single_is_autoselected; + /** * The transport being used for the current OpenOCD session. */ static struct transport *session; @@ -104,7 +109,8 @@ int allow_transports(struct command_context *ctx, const char * const *vector) /* autoselect if there's no choice ... */ if (!vector[1]) { - LOG_INFO("only one transport option; autoselecting '%s'", vector[0]); + LOG_DEBUG("only one transport option; autoselecting '%s'", vector[0]); + transport_single_is_autoselected = true; return transport_select(ctx, vector[0]); } @@ -182,6 +188,11 @@ COMMAND_HANDLER(handle_transport_init) return ERROR_FAIL; } + if (transport_single_is_autoselected) + LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " + "Use 'transport select %s' to suppress this message.", + session->name, session->name); + return session->init(CMD_CTX); } @@ -216,8 +227,9 @@ COMMAND_HANDLER(handle_transport_select) command_print(CMD, "Debug adapter does not support any transports? Check config file order."); return ERROR_FAIL; } - LOG_INFO("auto-selecting first available session transport \"%s\". " - "To override use 'transport select <transport>'.", allowed_transports[0]); + LOG_WARNING("DEPRECATED: auto-selecting transport \"%s\". " + "Use 'transport select %s' to suppress this message.", + allowed_transports[0], allowed_transports[0]); int retval = transport_select(CMD_CTX, allowed_transports[0]); if (retval != ERROR_OK) return retval; @@ -229,6 +241,11 @@ COMMAND_HANDLER(handle_transport_select) /* assign transport */ if (session) { if (!strcmp(session->name, CMD_ARGV[0])) { + if (transport_single_is_autoselected) { + /* Nothing to do, but also nothing to complain */ + transport_single_is_autoselected = false; + return ERROR_OK; + } LOG_WARNING("Transport \"%s\" was already selected", session->name); return ERROR_OK; } ----------------------------------------------------------------------- Summary of changes: src/jtag/adapter.c | 12 +-- src/jtag/core.c | 10 +-- src/jtag/drivers/am335xgpio.c | 5 +- src/jtag/drivers/amt_jtagaccel.c | 3 +- src/jtag/drivers/angie.c | 3 +- src/jtag/drivers/arm-jtag-ew.c | 3 +- src/jtag/drivers/at91rm9200.c | 3 +- src/jtag/drivers/bcm2835gpio.c | 5 +- src/jtag/drivers/buspirate.c | 5 +- src/jtag/drivers/cmsis_dap.c | 5 +- src/jtag/drivers/dmem.c | 5 +- src/jtag/drivers/dummy.c | 3 +- src/jtag/drivers/ep93xx.c | 3 +- src/jtag/drivers/esp_usb_jtag.c | 3 +- src/jtag/drivers/ft232r.c | 3 +- src/jtag/drivers/ftdi.c | 5 +- src/jtag/drivers/gw16012.c | 3 +- src/jtag/drivers/imx_gpio.c | 5 +- src/jtag/drivers/jlink.c | 5 +- src/jtag/drivers/jtag_dpi.c | 3 +- src/jtag/drivers/jtag_vpi.c | 3 +- src/jtag/drivers/kitprog.c | 5 +- src/jtag/drivers/linuxgpiod.c | 5 +- src/jtag/drivers/linuxspidev.c | 6 +- src/jtag/drivers/opendous.c | 3 +- src/jtag/drivers/openjtag.c | 3 +- src/jtag/drivers/osbdm.c | 3 +- src/jtag/drivers/parport.c | 3 +- src/jtag/drivers/presto.c | 3 +- src/jtag/drivers/remote_bitbang.c | 5 +- src/jtag/drivers/rlink.c | 3 +- src/jtag/drivers/rshim.c | 5 +- src/jtag/drivers/stlink_usb.c | 5 +- src/jtag/drivers/sysfsgpio.c | 5 +- src/jtag/drivers/ulink.c | 3 +- src/jtag/drivers/usb_blaster/usb_blaster.c | 3 +- src/jtag/drivers/usbprog.c | 3 +- src/jtag/drivers/vdebug.c | 5 +- src/jtag/drivers/vsllink.c | 5 +- src/jtag/drivers/xds110.c | 5 +- src/jtag/drivers/xlnx-pcie-xvc.c | 5 +- src/jtag/hla/hla_interface.c | 3 +- src/jtag/hla/hla_interface.h | 2 - src/jtag/hla/hla_transport.c | 21 +++-- src/jtag/interface.h | 15 +++- src/jtag/swim.c | 2 +- src/target/adi_v5_dapdirect.c | 4 +- src/target/adi_v5_swd.c | 2 +- src/transport/transport.c | 130 ++++++++++++++++++++++------- src/transport/transport.h | 33 ++++++-- 50 files changed, 247 insertions(+), 143 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:26:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via da50873d5ebe558ee545c1a00f31df9e23f45456 (commit) from c3fae349692c7c2d0eac95a04da648ba95a558a0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit da50873d5ebe558ee545c1a00f31df9e23f45456 Author: Antonio Borneo <bor...@gm...> Date: Sat Jan 4 18:41:41 2025 +0100 adapter: list supported transports beside adapter name Modify the command 'adapter list' to output the list of transports supported by each adapter driver. Drop the line number, as there is no real interest on it. Format the output as a TCL dictionary indexed by the adapter name and containing the transports in a TCL list. E.g: dummy { jtag } ftdi { jtag swd } This format is easily handled by TCL scripts, e.g.: dict get [adapter list] ftdi Document the command output. Change-Id: I69f73b71da2f1756866a63bc2c0ba33459a29063 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8691 Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 32a2895ec..d85812824 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2414,6 +2414,17 @@ target. @deffn {Command} {adapter list} List the debug adapter drivers that have been built into the running copy of OpenOCD. + +The output is formatted as a Tcl dictionary indexed by the adapter name +and containing the transports in a Tcl list. +@example +dummy @{ jtag @} +ftdi @{ jtag swd @} +@end example +This format is easily handled by Tcl scripts: +@example +dict get [adapter list] ftdi +@end example @end deffn @anchor{adapter gpio} diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 0bdfe7b13..694721746 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -393,9 +393,21 @@ COMMAND_HANDLER(handle_adapter_name) COMMAND_HANDLER(dump_adapter_driver_list) { + int max_len = 0; + for (unsigned int i = 0; adapter_drivers[i]; i++) { + int len = strlen(adapter_drivers[i]->name); + if (max_len < len) + max_len = len; + } + for (unsigned int i = 0; adapter_drivers[i]; i++) { const char *name = adapter_drivers[i]->name; - command_print(CMD, "%u: %s", i + 1, name); + const char * const *transports = adapter_drivers[i]->transports; + + command_print_sameline(CMD, "%-*s {", max_len, name); + for (unsigned int j = 0; transports[j]; j++) + command_print_sameline(CMD, " %s", transports[j]); + command_print(CMD, " }"); } return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 11 +++++++++++ src/jtag/adapter.c | 14 +++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:25:14
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via c3fae349692c7c2d0eac95a04da648ba95a558a0 (commit) from cbd7987c7ca2656b60bc8964bb1d9b7819e66ccb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c3fae349692c7c2d0eac95a04da648ba95a558a0 Author: Antonio Borneo <bor...@gm...> Date: Sun Mar 16 14:31:01 2025 +0100 adapter: replace 'interface' with 'adapter driver' Comments and output strings still reference the term 'interface', while 'adapter driver' should be used. While there, drop the useless test if CMD_ARGV[0] is an empty string, as this is not possible when CMD_ARGC > 0. Change-Id: I7b46b5dd3cec53d8b5b7559d941ee9ae3bd1d89b Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8808 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 2fcbd609e..0bdfe7b13 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -187,7 +187,6 @@ int adapter_init(struct command_context *cmd_ctx) int adapter_quit(void) { if (is_adapter_initialized() && adapter_driver->quit) { - /* close the JTAG interface */ int result = adapter_driver->quit(); if (result != ERROR_OK) LOG_ERROR("failed: %d", result); @@ -380,7 +379,7 @@ done: COMMAND_HANDLER(handle_adapter_name) { - /* return the name of the interface */ + /* return the name of the adapter driver */ /* TCL code might need to know the exact type... */ /* FUTURE: we allow this as a means to "set" the interface. */ @@ -414,14 +413,14 @@ COMMAND_HANDLER(handle_adapter_driver_command) { int retval; - /* check whether the interface is already configured */ + /* check whether the adapter driver is already configured */ if (adapter_driver) { - LOG_WARNING("Interface already configured, ignoring"); + LOG_WARNING("Adapter driver already configured, ignoring"); return ERROR_OK; } - /* interface name is a mandatory argument */ - if (CMD_ARGC != 1 || CMD_ARGV[0][0] == '\0') + /* adapter driver name is a mandatory argument */ + if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; for (unsigned int i = 0; adapter_drivers[i]; i++) { @@ -439,10 +438,10 @@ COMMAND_HANDLER(handle_adapter_driver_command) return allow_transports(CMD_CTX, adapter_driver->transports); } - /* no valid interface was found (i.e. the configuration option, - * didn't match one of the compiled-in interfaces + /* no valid adapter driver was found (i.e. the configuration option, + * didn't match one of the compiled-in drivers */ - LOG_ERROR("The specified debug interface was not found (%s)", + LOG_ERROR("The specified adapter driver was not found (%s)", CMD_ARGV[0]); command_print(CMD, "The following adapter drivers are available:"); CALL_COMMAND_HANDLER(dump_adapter_driver_list); ----------------------------------------------------------------------- Summary of changes: src/jtag/adapter.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |