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
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
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
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
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
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
Replace s/Linux/OpenOCD/ in the message about FSF address.
This is part of the old commit a9a5c17cf5 ("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
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
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 c5d8988316 ("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
This is the old commit 75b4cbe356 ("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
This is needed to avoid checkpatch barking on already committed patches.
This is the old commit cadd519715 ("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
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 bb3cd6ec43 ("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
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
This initial setup covers the old commits:
commit 09571d62bc ("checkpatch: disable extern and switch indent checks")
commit 2f6f7c442d ("checkpatch: remove typedef check")
commit 9ad57e96b3 ("checkpatch: remove volatile check")
commit 3da783f628 ("checkpatch: increase line length to 120")
commit 2af5b97ba3 ("checkpatch: remove __packed and __aligned checks")
commit 164450a015 ("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
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 164450a015 ("Change checkpatch.pl tab expanding to 4 characters.")
commit 667d510dab ("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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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
Commit c7eaaf6204 ("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: c7eaaf6204 ("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>
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>
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
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
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
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>
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
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>
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>
The function set_log_output() has never been used after the drop
of eCos build with commit 39650e2273 ("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
For some configurations, notably on DAP systems, resolve issue where single-stepping does not always transition into the HALTED state.
Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I053f4eaffad8c3228878ba87580ada640e4bd2fe
Reviewed-on: https://review.openocd.org/c/openocd/+/7150
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
- Config files for DAP/JTAG and DAP/SWD systems
- Xtensa core config definitions for NXP RT685 with Xtensa HiFi DSP
Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I9c3280052073d86e09c7553de661eb8662a95c4a
Reviewed-on: https://review.openocd.org/c/openocd/+/7145
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
- Enable ADIv5 DAP systems via JTAG or SWD transport
- Select correct PWRCTL/PWRSTAT bits for XDM/APB
Signed-off-by: Ian Thompson <ianst@cadence.com>
Change-Id: I5894210c804f85075da868d0cfc6fb20b589d99f
Reviewed-on: https://review.openocd.org/c/openocd/+/7144
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>