aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-18openocd: fix SPDX tag format for files .cAntonio Borneo366-366/+366
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
2022-09-18HACKING: add chapter on checkpatchAntonio Borneo1-1/+64
Include hints on how to skip some of the tests in some really exceptional case. Note: the file includes an example of commit message with a signed off tag that triggers a checkpatch error. Let checkpatch to ignore BAD_SIGN_OFF error. Checkpatch-ignore: BAD_SIGN_OFF Change-Id: I05bf0ab8008649f3f9b38452e056dc3df83a1a4f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5609 Tested-by: jenkins
2022-09-18checkpatch: fix path of documentationAntonio Borneo1-0/+5
In OpenOCD documentation is in folder "doc". Fix search path of 'checkpatch.rst'. This file is used to provide verbose explanation of failing checks while using command line flag '-v'. Change-Id: Id864369d371cbd5a24e76bf90c54ff03159051c3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7022 Tested-by: jenkins
2022-09-18checkpatch: extend check for camel[0-9_]*CASEAntonio Borneo1-0/+24
Linux has some automatically generated macros that can trigger camelCASE check. This forces checkpatch to only detect the pattern [A-Z][a-z]|[a-z][A-Z] for adjacent case transition. In OpenOCD we do not have such case, so extend the check to [A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z] and remove the detection of Linux special cases. Change-Id: I82cb6dc668edbb093f68991337da1f4b933f1fac Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7152 Tested-by: jenkins
2022-09-18checkpatch: enable CAMELCASE testAntonio Borneo4-1/+251
OpenOCD has to deal with CamelCase API, mainly from inttypes.h, jimtcl, libusb and Windows. Modify checkpatch script to load from a file the list of allowed CamelCase symbols. Populate the file 'camelcase.txt' with the symbols that OpenOCD has to get from external library, plus some of the symbols that should be fixed later. Enable CAMELCASE test in configuration script. Add generated files to .gitignore. Remove the check for 'known' CamelCase symbols from include folder as this will not work on OpenOCD Jenkins, as it run checkpatch on already patched code. Change-Id: I0415af673ed9f985394405ff8f1eeec81135410a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6170 Tested-by: jenkins
2022-09-18checkpatch: add commit-message field to ignore some checkAntonio Borneo1-0/+7
The script 'checkpatch.pl' is part of the automatic tests used by Linux Maintainers and developers to test new patches. The Linux development process is e-mail base. An error reported by checkpatch is not a blocking point; the developer can explain in the e-mail why he is submitting a patch that fails at checkpatch or that is in violation of the coding style. It's up to the maintainer to decide to accept or reject the explanation and then the patch. The OpenOCD development process relies on Gerrit and Jenkins as front-end tools. Jenkins tests every new patch with checkpatch and then builds the new code. If checkpatch fails, Jenkins adds a failure label to the patch; this often causes the patch to get ignored by maintainers that considers it as 'not ready'. Checkpatch can be instrumented to ignore some test, but this has to be specified in the command line or in the configuration file. Let checkpatch extract from the patch's commit message the new field 'Checkpatch-ignore:' that lists the additional tests that has to be ignored for that patch only. The developer that detects as error or a limitation in checkpatch can add the field and the problematic test in the commit message and re-push the patch. The maintainer should check the list of tests and decide how to proceed. Change-Id: Iafc1b2893a07c7b3fc7e3ad15bd694aba9bd8519 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6169 Tested-by: jenkins
2022-09-18checkpatch: increase the max indentation levelAntonio Borneo1-1/+3
OpenOCD uses longer lines (120 char vs 100) and smaller tab size (4 char vs 8) wrt Linux kernel coding style. Clearly deep level of indentation is bad for code readability, but let's be more permissive on the indentation level. Change-Id: I16cf0b761145ec6072509dc26bb09c693e89e608 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6167 Tested-by: jenkins
2022-09-18checkpatch: adapt shell script to the tool's new versionAntonio Borneo1-2/+2
With the new checkpatch it's not possible to send in one shot a set of patches through stdin because the Signed-off-by tag present in each patch will trigger the error of duplicated Signed-off-by. Use the new command-line flag '--git' to let checkpatch to extract the patches from git and analyse them one-by-one. While there, add the SPDX tag to the script. Change-Id: I74791b627b8cd68f2d49146d15ae35bbc610e64e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6166 Tested-by: jenkins
2022-09-18checkpatch: check for SPDX tags of licenses in useAntonio Borneo3-4/+11
Fix the patch of the external helper spdxcheck.py accordingly to OpenOCD folder structure. List only the current LICENSES subfolders in spdxcheck.py . Enable the check for SPDX headers. Extend the check for TCL and Makefile.am files. Change-Id: I0a40da0127746217ee0ac416058d5ceb922428ff Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5608 Tested-by: jenkins
2022-09-18checkpatch: add list of typedef used in OpenOCDAntonio Borneo2-0/+10
The new checkpatch from Linux kernel does not recognizes the specific types used in OpenOCD, e.g. "fd_set" and "Jim_Obj". As consequence, it consider "fd_set" as the name of a variable, then misinterpret the asterisk for the pointer "fd_set *" as a multiplication, thus suggest to add a space after the asterisk and replace "fd_set *x" with "fd_set * x". Let checkpatch recognize the typedef used in OpenOCD. Change-Id: Ibc295e6a8b47ffa88b50a6d510b7970760e5199d Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5607 Tested-by: jenkins
2022-09-18checkpatch: fix check for the FSF addressPaul Fertser1-1/+1
Replace s/Linux/OpenOCD/ in the message about FSF address. This is part of the old commit a9a5c17cf5e1 ("checkpatch: fix check for the FSF address"). Change-Id: I79b79769ef723f86690862277612ea8ab7855c07 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5128 Tested-by: jenkins
2022-09-18checkpatch: don't spell-check the spelling fileAntonio Borneo2-3/+3
Prevent checkpatch to complain for commits that add new entries in the dictionary of misspelled words. Remove the ignore flag TYPO_SPELLING from .checkpatch.conf, now spelling is functional. Change-Id: I911dedafc243e34f753d2be687977066719ff2eb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5123 Tested-by: jenkins
2022-09-18checkpatch: check for OpenOCD tree, not for kernel treeAntony Pavlov2-5/+14
checkpatch.pl looks for Linux kernel specific paths and files to check source tree. As openocd misses kernel files it ends with this error message: Must be run from the top-level dir. of a kernel tree This patch also renames 'kernel' -> 'openocd' in source tree-related messages. This is the old commit c5d89883165e ("checkpatch.pl: check for openocd tree, not for kernel tree") re-applied. Also remove the flag "--no-tree" from .checkpatch.conf, not required anymore. Change-Id: I336a66558c75494b7ae339ea63559c31f23aad84 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5122 Tested-by: jenkins
2022-09-18checkpatch: correct false positives reporting instructionsPaul Fertser1-0/+10
This is the old commit 75b4cbe35646 ("checkpatch: correct false positives reporting instructions") re-applied. Change-Id: I348ae549e9d2587093b0fb6652aadf34724f0aab Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5121 Tested-by: jenkins
2022-09-18checkpatch: treat jenkins as valid emailPaul Fertser2-1/+4
This is needed to avoid checkpatch barking on already committed patches. This is the old commit cadd51971535 ("checkpatch: treat jenkins as valid email") re-applied. Remove the flag BAD_SIGN_OFF, not anymore needed. Change-Id: I6744f80de982f7934f3a5197ac2df1c29962cbd0 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5120 Tested-by: jenkins
2022-09-18checkpatch: add logging functionsPaul Fertser1-0/+7
It's commonly considered that user-visible strings should not be split to different lines in the sources to ease grepping for them. Hence, checkpatch traditionally makes an exception for logging functions, lines having them can be of arbitrary length. OpenOCD uses different (from Linux, the kernel) names, so they need to be added to avoid false positives. This is the old commit bb3cd6ec438d ("checkpatch: add logging functions") re-applied and updated. Change-Id: Ib18e4532cf7e1f79821b74c9bb6134a8a4e8be1b Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5119 Tested-by: jenkins
2022-09-18checkpatch: add variable $OpenOCDAntonio Borneo1-0/+13
The script checkpatch.pl require some adaptation for OpenOCD that cannot be achieved through the config file .checkpatch.conf; the script's code has to be modified. To merge new version of the script from Linux kernel it becomes relevant highlighting the changes, while minimizing the diff wrt the initial script. Add the perl variable '$OpenOCD' and suggest how to highlight changes. Change-Id: Ia8d26426850008f0465858a1d84cc774bc1146ed Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7021 Tested-by: jenkins
2022-09-18checkpatch: add OpenOCD specific config flagsAntonio Borneo1-0/+25
This initial setup covers the old commits: commit 09571d62bc1e ("checkpatch: disable extern and switch indent checks") commit 2f6f7c442d24 ("checkpatch: remove typedef check") commit 9ad57e96b3c1 ("checkpatch: remove volatile check") commit 3da783f62854 ("checkpatch: increase line length to 120") commit 2af5b97ba31f ("checkpatch: remove __packed and __aligned checks") commit 164450a01576 ("Change checkpatch.pl tab expanding to 4 characters.") It also skips the check for SPDX_LICENSE_TAG, not implemented in OpenOCD yet. Extend to the check in 'strict' mode and skip all the check that cannot apply on OpenOCD project. Change-Id: I6c3bdf27465dc563464fbc8fafbaec696e287624 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5117 Tested-by: jenkins
2022-09-18checkpatch: import new script version from kernel v6.0-rc3Antonio Borneo7-747/+8344
Replace existing checkpatch script with the one available in the latest Linux kernel. Add also from the same kernel version the spelling database and the script spdxcheck.py, even if the script cannot be found by checkpatch in the current path. Add an empty "const_structs.checkpatch" file and an initial "spdxexclude" file. The script as is doesn't work properly in OpenOCD project. Further patches in this series are required. Gerrit will use the checkpatch in this commit to test/build the commit itself. A minimal configuration file is then required to avoid a failure in the test/build process. This commit includes the OpenOCD commits: commit 164450a01576 ("Change checkpatch.pl tab expanding to 4 characters.") commit 667d510dabd5 ("checkpatch: fix false indent trigger") already merged in upstream checkpatch in kernel v6.0-rc3. Change-Id: Ic9cdecff2df0a1e23cdb01d10f14c5988480b8d6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/5116 Tested-by: jenkins
2022-09-18target/xtensa: invalidate register cache on resetIan Thompson1-2/+5
Resolves issues where registers are accessed when poll() logic is inactive or has not yet been triggered. Signed-off-by: Ian Thompson <ianst@cadence.com> Change-Id: If7a4d00938fb188b008325249627f7773c3484c5 Reviewed-on: https://review.openocd.org/c/openocd/+/7197 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-18target/xtensa: fix clang analyzer warningIan Thompson1-9/+12
Reworked xtensa_queue_exec_ins_wide() logic to properly handle endian issues while executing arbitrary instructions. Signed-off-by: Ian Thompson <ianst@cadence.com> Change-Id: I5752dd254ce8b8822886ffc7edecaa242a93cce8 Reviewed-on: https://review.openocd.org/c/openocd/+/7198 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17flash/nor/stm32lx: Add revision 'X' for Cat.4/3 devicesMarc Schink1-1/+1
Change-Id: I18c62ddb3963c357c7ce5dfc067c8d63fbc82b99 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/7196 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17rtos: Support looking up .lto_priv.0 appended to symbol nameTim Nordell1-8/+47
When FreeRTOS (at least) is compiled with -flto, this leaves certain static symbols with .lto_priv.0 appended to their name. Arguably this could be considered to be a gdb or gcc bug, but one place to resolve it for OpenOCD usage is here at symbol lookup time. Note that the ".0" is for the first such instance of the variable as a static; additional ones would end up as ".1", ".2", etc, and are not considered here. Signed-off-by: Tim Nordell <tnordell@airgain.com> Change-Id: I03580b45e8ea364392ef4e05c96276416b390cb0 Reviewed-on: https://review.openocd.org/c/openocd/+/7179 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17rtos: Fold is_symbol_mandatory into rtos_qsymbol(..)Tim Nordell1-20/+15
This is in preparation for a future commit that looks for an optional suffix of .lto_priv.0 on the symbol name. Signed-off-by: Tim Nordell <tnordell@airgain.com> Change-Id: If803332373825b73bc986bd4ea7dfaee9c625c0a Reviewed-on: https://review.openocd.org/c/openocd/+/7178 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17rtos: Create a new helper function find_symbol(...)Tim Nordell1-13/+18
This will be utilized for an upcoming refactorization to support -flto compiled programs. Signed-off-by: Tim Nordell <tnordell@airgain.com> Change-Id: Id523c0b3ac2dad8b248ea0d2cac7b4dd2f83d293 Reviewed-on: https://review.openocd.org/c/openocd/+/7177 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17target/xtensa: populate PS correctly during fetchIan Thompson1-0/+3
Read PS from EPS[debuglevel] during fetch such that it reflects the correct value when read via telnet (not just via gdb_server). Signed-off-by: Ian Thompson <ianst@cadence.com> Change-Id: I8504f68989bc6d5fe451a8cb69d01c86f4ec0100 Reviewed-on: https://review.openocd.org/c/openocd/+/7195 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-17flash/nor/rsl10: Check return valueToms Stūrmanis1-0/+2
Change-Id: Id1ad72e74d6a1bddc4dfe46dcf715ef74e19a27f Signed-off-by: Toms Stūrmanis <toms.sturmanis@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7194 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13FreeRTOS: Fix thread reg list for Cortex-M7Frank Dischner1-1/+2
This updates the FreeRTOS module to use the M4F FPU stacking also for the FPV5_SP and FPV5_DP FPUs, which are found on the Cortex-M7. The FPUs are in fact different than the FPV4_SP found on the M4, but the register stacking is the same. Signed-off-by: Frank Dischner <frank.dischner@gmail.com> Change-Id: I74c45d2cfb55f55e6c557f2450068ad3c2fe9497 Reviewed-on: https://review.openocd.org/c/openocd/+/6939 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13mips64: remove empty mips_mips64_soft_reset_halt()Antonio Borneo1-7/+1
The method soft_reset_halt is optional; no need to add an empty function. Remove mips_mips64_soft_reset_halt() and move the TODO comment in struct target_type. Change-Id: Id541a75e7a08645568961d59b73a120c2238701f Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7184 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13target/xtensa: fully initialize buffers for PWRSTAT readIan Thompson1-2/+2
Read buffer is sized for 32-bit APB version of PWRSTAT/PWRCTL registers. Initialize to zero so 8-bit JTAG register mirrors are accurate. Signed-off-by: Ian Thompson <ianst@cadence.com> Change-Id: I81310649fa7180893d0188aab3c8a14315aaea0a Reviewed-on: https://review.openocd.org/c/openocd/+/7183 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13tcl: board: mini2440: fix to work with the current versionPaul Fertser1-1/+0
Change-Id: I5cf3ab09dbf100d40ce40a4599cd8d2af18a5567 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/4574 Tested-by: jenkins
2022-09-13drivers/bcm2835gpio: Fully restore GPIOs after useSteve Marple1-5/+21
Restore outputs to their initial output level. Signed-off-by: Steve Marple <stevemarple@googlemail.com> Change-Id: I82402fd7b59d944f81c0ea7859ac499943901f82 Reviewed-on: https://review.openocd.org/c/openocd/+/7125 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13drivers/bcm2835gpio: Add support for activity LEDSteve Marple1-1/+11
Signed-off-by: Steve Marple <stevemarple@googlemail.com> Change-Id: I472385753507167c93328b9b4dc62d5d61c86f74 Reviewed-on: https://review.openocd.org/c/openocd/+/7124 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13drivers/bcm2835gpio: Migrate to adapter gpio commandsSteve Marple7-457/+460
Use the new "adapter gpio" commands to configure the GPIOs used by the bcm2835gpio driver. The driver supports only 1 chip (gpiochip0). The reset function now honours the srst_open_drain and trst_open_drain options. Signed-off-by: Steve Marple <stevemarple@googlemail.com> Change-Id: I5b6c68b16362000cf5141a83394549d2bf3af108 Reviewed-on: https://review.openocd.org/c/openocd/+/7123 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13drivers/bcm2835gpio: Release resources on error and when quittingSteve Marple1-2/+20
The /dev/mem file descriptor can be closed without invalidating the mappings so close as soon as possible. munmap() all memory, either on error or from quit. Signed-off-by: Steve Marple <stevemarple@googlemail.com> Change-Id: I2b6a8365f554e332520fa77ccf076188083a932f Reviewed-on: https://review.openocd.org/c/openocd/+/7122 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13tcl/interface: replace last deprecated commandsAntonio Borneo4-16/+16
Still some config file uses deprecated commands. Replace them with the new commands. Change-Id: I6ccbfb832e0ad2012e9af160bd2d92ad104af2bb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7181 Tested-by: jenkins
2022-09-13src/jtag/drivers/ep93xx: fix GCC 12 warningAntonio Borneo1-8/+5
New GCC reports 5 warning: src/jtag/drivers/ep93xx.c: In function 'set_gonk_mode': src/jtag/drivers/ep93xx.c:123:47: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 123 | devicecfg = *((volatile int *)(syscon + 0x80)); | ^ src/jtag/drivers/ep93xx.c:124:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 124 | *((volatile int *)(syscon + 0xc0)) = 0xaa; | ^ src/jtag/drivers/ep93xx.c:125:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 125 | *((volatile int *)(syscon + 0x80)) = devicecfg | 0x08000000; | ^ src/jtag/drivers/ep93xx.c: In function 'ep93xx_init': src/jtag/drivers/ep93xx.c:182:46: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 182 | gpio_data_register = gpio_controller + 0x08; | ^ src/jtag/drivers/ep93xx.c:183:56: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] 183 | gpio_data_direction_register = gpio_controller + 0x18; | ^ Change pointer type to allow pointer arithmetic. Change-Id: Idd78a7156bdf99df2624043e924b8e54a0588ace Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7180 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13configure.ac: drop unneeded dependency checkAntonio Borneo1-4/+1
The script configure.ac checks for the presence of system include files required to build OpenOCD. It incorrectly check for: dirent.h pthread.h ifaddrs.h net/if.h that are never included by OpenOCD source code, plus the generated macros: HAVE_DIRENT_H HAVE_PTHREAD_H HAVE_IFADDRS_H HAVE_NET_IF_H are never used in OpenOCD source code. It also checks for the system function: vasprintf() that is never called by OpenOCD source code, plus the generated macro: HAVE_VASPRINTF is never used in OpenOCD source code. Drop the checks for the unused system include files and the unused system function. Change-Id: I68c1b1a1be268a830247fc489f210877c32d7d23 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7175 Tested-by: jenkins
2022-09-13openocd: fix for polling during "expr" computationAntonio Borneo1-1/+13
Commit c7eaaf620488 ("openocd: prepare for jimtcl 0.81 'expr' syntax change") replaces the jimtcl command "expr" with an openocd version that detects the TCL syntax change and prints a warning. The openocd "expr" command will be dropped after v0.12.0, One side effect is that openocd invokes polling the target after every openocd command, causing scripts that use several "expr" commands to run much slower; see [1]. The proper fix would require openocd to invoke polling only at the time period deadline, instead of at each command. Such fix is too risky to be applied now, due to short time before v0.12.0-rc1. As a temporarily workaround, let openocd to detect the "expr" command and skip the polling. This will be dropped together with the openocd "expr" command. Change-Id: I8151aa28694817001046165a15475d64896f985e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: https://sourceforge.net/p/openocd/tickets/362/ [1] Fixes: c7eaaf620488 ("openocd: prepare for jimtcl 0.81 'expr' syntax change") Reviewed-on: https://review.openocd.org/c/openocd/+/7174 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13target: don't export local symbolsAntonio Borneo10-25/+9
Symbols that are not used outside the file should not be exported and should be declared as static. Change-Id: Icbe7f7bce287b903edec9dc9db3370722c51fbd5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7173 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13flash/nor: move variable's declaration in C fileAntonio Borneo6-30/+30
Variables should not be declared in the include file, otherwise multiple include will cause multiple instances. Move the declaration in the C file and make it static. Change-Id: I8b4884cba643a792a78df4e123aa324b19d92279 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7172 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2022-09-13usbprog: remove unused variableAntonio Borneo1-2/+0
Change-Id: I96b2c0ad36073f7e5bed37b96e0244f1760472bc Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7171 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13riscv: don't export local symbolsAntonio Borneo2-42/+22
Symbols that are not used outside the file should not be exported and should be declared as static. Move the existing comments to the static declarations. Change-Id: Idf208e3fda4b3f8df789553cf03ebf5f20d811bb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7170 Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Tim Newsome <tim@sifive.com> Tested-by: jenkins
2022-09-13flash/nor/npcx: make local symbols staticAntonio Borneo1-1/+1
Symbols that are not exported should be declared as static. Change-Id: I6a059080bbba9b3559d26c641b217be8be3b199e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7169 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2022-09-13target: make local symbols staticAntonio Borneo6-15/+15
Symbols that are not exported should be declared as static. Change-Id: I2475524f4c14520e3163572560f4a9f276356ed5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7168 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13xtensa: make local symbols staticAntonio Borneo6-12/+12
Symbols that are not exported should be declared as static. Change-Id: Ieb627f7f896e4663b0d5b18c4ab1853b39d23d03 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7167 Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com> Reviewed-by: Ian Thompson <ianst@cadence.com> Tested-by: jenkins
2022-09-13riscv: make local symbols staticAntonio Borneo3-33/+33
Symbols that are not exported should be declared as static. Change-Id: Ie3bd17535c8cb2a0fec5d3bedfe7de3e0a702613 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7166 Tested-by: jenkins Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Jan Matyas <matyas@codasip.com>
2022-09-13jtag: make local symbols staticAntonio Borneo2-2/+2
Symbols that are not exported should be declared as static. Change-Id: I6224ae89ebda3230dfee2413e3823be9b8716bba Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7165 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13log: remove unused set_log_output()Antonio Borneo2-7/+0
The function set_log_output() has never been used after the drop of eCos build with commit 39650e2273bc ("ecosboard: delete bit-rotted eCos code") in 2012. Drop it! Change-Id: I070b688061776c7ced5db18f738d78a4a7623726 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7164 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
2022-09-13tcl/board: add ESP32-S3 config for ESP USB Bridge boardErhan Kurubas1-0/+15
Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I97d0f01f342dddb31b2d454858fe854f002cf567 Reviewed-on: https://review.openocd.org/c/openocd/+/7077 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>