Keith Packard [Wed, 28 Sep 2022 21:02:52 +0000 (14:02 -0700)]
flash/nor/at91samd: Use 32-bit register writes for ST-Link compat
ST-Link v2 dongles can be used with many cortex-m parts, but they have
one limitation -- they can only perform 8-bit and 32-bit writes to the
target. 16-bit writes are done using a pair of 8-bit writes. While not
usually an issue, in the case of the at91samd flash driver, the 16-bit
'command' register must have both halves written in the same
operation.
Fortunately, this register has two pad bytes above it in the address
space, making it safe to always access with 32-bit operations.
Change-Id: I44b0db9406982a8db5818c0533d3101618741db2 Signed-off-by: Keith Packard <keithp@keithp.com>
Tomas Vanek [Wed, 21 Sep 2022 05:49:00 +0000 (07:49 +0200)]
flash/nor/rp2040: remove new line from error message
Change-Id: Idf3bce842b4507c1f12692b5fbcd6730637de9db Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7216 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Tested-by: jenkins
Tomas Vanek [Wed, 21 Sep 2022 05:46:15 +0000 (07:46 +0200)]
flash/nor/rp2040: check target halted before flash operation
Flash read_id/erase/write operation on running target failed
in target_run_algorithm() anyway. It generated lot of error messages.
Check the target state and bail out early if target is running.
Change-Id: I903f5f38c8e61016e5002b235e5f07803bd2ec4e Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7215 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tomas Vanek [Wed, 21 Sep 2022 04:32:21 +0000 (06:32 +0200)]
flash/nor/rp2040: fix flash erase timeout
SPI flash erase often takes longer than the fixed timeout 3 seconds.
Introduce a configurable timeout_ms parameter to rp2040_call_rom_func().
Compute the erase timeout from the number of blocks to be erased.
While on it make the timeouts shorter for connect flash, flush cache and
enter/exit xip (1 second is enough).
Change-Id: I552bfa317ee17064de3a54ec2f0c63e84ba87222 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7214 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Tomas Vanek [Sun, 11 Sep 2022 10:11:31 +0000 (12:11 +0200)]
flash/nor/rp2040: fix size of flash write buffer
The size of the flash write buffer should be rounded
down to the multiply of flash page size.
Using write chunks of unadjusted size results in write of chunks
unaligned to flash pages.
Change-Id: If7931362ee193dff4dc2df7ec78f13530658cf08 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7187 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tomas Vanek [Wed, 21 Sep 2022 11:54:01 +0000 (13:54 +0200)]
target/adi_v5_swd: suppress reconnect in swd_multidrop_select()
swd_multidrop_select() uses its own retry loop.
If select fails, do_reconnect flag remains set on exit and causes
useless reconnect.
Clear do_reconnect flag in retry loop.
Change-Id: Ie06d6967d7f4a977774c8530bb8d4b3e5ab4f62c Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7217 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com> Tested-by: jenkins
Tomas Vanek [Tue, 20 Sep 2022 16:55:51 +0000 (18:55 +0200)]
target/adi_v5_swd: fix SWD multidrop
Implementation of ADI v6 introduced banking of DP reg 0.
The accompanying change preventing DP SELECT write before
DP IDR read during connect was added to swd_connect_single() only.
Unchanged swd_connect_multidrop() / swd_multidrop_select_inner()
was broken as it emited DP SELECT and put DP to protocol error state.
Copy dap->select handling to swd_multidrop_select_inner().
Fixes: 72fb88613f02 (adiv6: add low level swd transport)
Change-Id: I514cd6d9ae2ba97ce3657b459df22638c278a0b1 Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7213 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
Antonio Borneo [Mon, 19 Sep 2022 13:39:50 +0000 (15:39 +0200)]
target/riscv: fix use of uninitialized value
Scan-build reports:
Logic error: Uninitialized argument value
riscv.c:2688 2nd function call argument is an uninitialized value
This is a real error cause by running the command "riscv
authdata_write" without arguments. In such case 'value' is not
initialized and is passed to and used by r->authdata_write().
Reorganize the code to:
- detect the correct amount or command's arguments;
- drop the LOG_ERROR() on ERROR_COMMAND_SYNTAX_ERROR;
- drop the 'else' after 'return'.
Change-Id: I62e031220593b8308bc674b753e15d16d4c5c9ac Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7210 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Tim Newsome <tim@sifive.com>
Antonio Borneo [Mon, 19 Sep 2022 13:28:15 +0000 (15:28 +0200)]
target/riscv: fix undefined operation
Scan-build reports:
Logic error: Result of operation is garbage or undefined
riscv.c:1614 The result of the left shift is undefined due
to shifting by '4294967281', which is greater or
equal to the width of type 'target_addr_t'
This is a false warning due to clang that considers the impossible
case of 32 bits hart (xlen = 32) in SATP_MODE_SV48 mode
(info->va_bits = 48).
Under such case:
riscv.c:1614 ... ((target_addr_t)1 << (xlen - (info->va_bits - 1))) ...
the shift amount wraps around the unsigned type and assumes the
value 4294967281 (0xfffffff1).
Use assert() to prevent clang from complaining.
Change-Id: I08fdd2a806c350d061641e28cf15a51b397db099 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7209 Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Jan Matyas <matyas@codasip.com> Tested-by: jenkins
Antonio Borneo [Mon, 19 Sep 2022 13:02:36 +0000 (15:02 +0200)]
target/riscv: fix dead assignment
Scan-build reports:
Unused code: Dead nested assignment
riscv.c:459 Although the value stored to 'ir_user4_raw' is
used in the enclosing expression, the value is
never actually read from 'ir_user4_raw'
This is caused by the value reassigned in 'ir_user4_raw':
riscv.c:459 ir_user4[3] = (uint8_t)(ir_user4_raw >>= 8);
but never used.
Drop the DIY conversion in favor of h_u32_to_le() that does not
reassign the input value.
Change-Id: Ifad29f4c46d4a2d0a2f5a5c4104d768cc3db2794 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7208 Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Jan Matyas <matyas@codasip.com> Tested-by: jenkins
Antonio Borneo [Mon, 19 Sep 2022 12:37:24 +0000 (14:37 +0200)]
target/riscv-013: fix unchecked return code
Scan-build complains about variable 'sbcs_orig' that can be used
not initialized.
Logic error: Assigned value is garbage or undefined
riscv-013.c:4468 Assigned value is garbage or undefined
This is caused by not checking the return value of the call
riscv-013.c:4466 dmi_read(target, &sbcs_orig, DM_SBCS);
In fact when dmi_read() returns error, the variable 'sbcs_orig' is
not assigned.
Check the returned value.
Change-Id: Ia9032a0229aa243138f95f4e13f765726a4ceae9 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7205 Reviewed-by: Tim Newsome <tim@sifive.com> Reviewed-by: Jan Matyas <matyas@codasip.com> Tested-by: jenkins
Antonio Borneo [Mon, 19 Sep 2022 09:36:06 +0000 (11:36 +0200)]
target/dsp563xx: fix scan-build warning
Scan-build triggers a warning:
Unix API: Allocator sizeof operand mismatch
dsp563xx.c:2143 Result of 'calloc' is converted to a pointer
of type 'uint8_t', which is incompatible with sizeof
operand type 'uint32_t'
It's a false positive because calloc() is properly used in this
case, as the uint8_t array is used in blocks of 4 elements to read
or write uint32_t values.
Either
calloc(sizeof(uint32_t), count);
and
malloc(count * sizeof(uint32_t));
keep triggering the same warning.
Drop the warning by using the constant '4' as size of uint32_t, as
already used few lines below.
Change-Id: I5bb1ece177774eefdc5d9cd049338f8f2be87cd7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7203 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Antonio Borneo [Tue, 30 Aug 2022 15:01:12 +0000 (17:01 +0200)]
openocd: fix SPDX tag format for files .c
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
Antonio Borneo [Sat, 4 May 2019 15:01:23 +0000 (17:01 +0200)]
HACKING: add chapter on checkpatch
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.
Antonio Borneo [Sun, 12 Jun 2022 12:36:35 +0000 (14:36 +0200)]
checkpatch: fix path of documentation
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
Antonio Borneo [Tue, 30 Aug 2022 13:28:56 +0000 (15:28 +0200)]
checkpatch: extend check for camel[0-9_]*CASE
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
Antonio Borneo [Sat, 17 Apr 2021 20:37:12 +0000 (22:37 +0200)]
checkpatch: enable CAMELCASE test
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
Antonio Borneo [Fri, 16 Apr 2021 21:57:06 +0000 (23:57 +0200)]
checkpatch: add commit-message field to ignore some check
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
Antonio Borneo [Mon, 6 May 2019 13:30:54 +0000 (15:30 +0200)]
checkpatch: increase the max indentation level
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
Antonio Borneo [Wed, 27 Jan 2021 18:00:38 +0000 (19:00 +0100)]
checkpatch: adapt shell script to the tool's new version
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
Antonio Borneo [Sun, 26 Apr 2020 14:03:45 +0000 (16:03 +0200)]
checkpatch: check for SPDX tags of licenses in use
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
Antonio Borneo [Mon, 6 May 2019 08:24:52 +0000 (10:24 +0200)]
checkpatch: add list of typedef used in OpenOCD
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
checkpatch: check for OpenOCD tree, not for kernel tree
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.
Paul Fertser [Mon, 14 Oct 2013 06:03:00 +0000 (10:03 +0400)]
checkpatch: add logging functions
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
Antonio Borneo [Sat, 11 Jun 2022 20:41:17 +0000 (22:41 +0200)]
checkpatch: add variable $OpenOCD
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
Antonio Borneo [Wed, 17 Apr 2019 07:50:27 +0000 (09:50 +0200)]
checkpatch: add OpenOCD specific config flags
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
Antonio Borneo [Tue, 16 Apr 2019 21:10:45 +0000 (23:10 +0200)]
checkpatch: import new script version from kernel v6.0-rc3
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
Tim Nordell [Wed, 7 Sep 2022 16:59:47 +0000 (11:59 -0500)]
rtos: Support looking up .lto_priv.0 appended to symbol name
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>
Frank Dischner [Thu, 21 Apr 2022 02:49:44 +0000 (21:49 -0500)]
FreeRTOS: Fix thread reg list for Cortex-M7
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>
Antonio Borneo [Thu, 8 Sep 2022 12:37:55 +0000 (14:37 +0200)]
src/jtag/drivers/ep93xx: fix GCC 12 warning
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>
Antonio Borneo [Tue, 6 Sep 2022 15:55:44 +0000 (17:55 +0200)]
configure.ac: drop unneeded dependency check
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
Antonio Borneo [Tue, 6 Sep 2022 12:44:57 +0000 (14:44 +0200)]
openocd: fix for polling during "expr" computation
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>
Antonio Borneo [Mon, 5 Sep 2022 22:20:41 +0000 (00:20 +0200)]
riscv: don't export local symbols
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
Antonio Borneo [Mon, 5 Sep 2022 22:24:39 +0000 (00:24 +0200)]
log: remove unused set_log_output()
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
Antonio Borneo [Sun, 4 Sep 2022 09:38:07 +0000 (11:38 +0200)]
.gitignore: remove cross-compile *-libtool
This reverts commit dac90163a287 (".gitignore: add cross-compile
*-libtool") [1] merged in May 2022.
The old build system of OpenEmbedded used to rebuild and rename
plenty of tools to discriminate between host's and target's tools.
This creates, among others, the odd file "$CROSS_COMPILE-libtool"
that was addressed by the patch [1].
OpenEmbedded has dropped this odd behavior with patch [2], present
in OpenEmbedded 4.0 "kirkstone" tagged on April 2022.
In current situation:
- old OpenEmbedded use OpenOCD v0.11.0 or older, so will not use
the patch [1];
- new OpenEmbedded has [2] applied, so will never take benefit
from the patch [1].
As consequence, patch [1] is completely useless and keeping it in
OpenOCD can even be misleading.
Antonio Borneo [Tue, 30 Aug 2022 22:20:16 +0000 (00:20 +0200)]
contrib: add GPL license tag on files that miss it
Some file miss completely the license tag.
Add the SPDX tag, using the same GPL-2.0-or-later license of the
OpenOCD project.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I24bd362eeb6b74f09aceb9b757d45cbfa4afe334 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7160 Tested-by: jenkins
Antonio Borneo [Tue, 30 Aug 2022 20:18:31 +0000 (22:18 +0200)]
contrib: replace the GPLv2-or-later license tag
Replace the GPLv2-or-later boilerplate with the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I380d552940f1c405309a3346454251c0e80b5a45 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7159 Tested-by: jenkins
Antonio Borneo [Tue, 30 Aug 2022 21:21:52 +0000 (23:21 +0200)]
contrib: replace the BSD-3-Clause license tag
Replace the BSD-3-Clause boilerplate with the SPDX tag.
Add the SPDX tag and the copyright to two makefiles that were
added by TI with the other files in their respective folder.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I3ad1b2dbdb6054b74dcc26e394c9223ba0427caf Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7158 Tested-by: jenkins
Antonio Borneo [Tue, 30 Aug 2022 15:25:24 +0000 (17:25 +0200)]
contrib: replace the GPLv3-or-later license tag
These files are not built in OpenOCD and are not in conflict with
OpenOCD license.
Replace the GPL boilerplate with the SPDX tag.
Add the SPDX tag.
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: I934e4add24098f0e8574120b3bc32e9bcf166abd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7157 Tested-by: jenkins
Antonio Borneo [Tue, 30 Aug 2022 15:15:32 +0000 (17:15 +0200)]
openocd: fix syntax of SPDX tags
Put the SPDX tag alone in a comment in the first line of the file.
Replace the obsolete GPL-2.0+ tag
The SPDX tag on files *.c is incorrect, as it should use the C99
single line comment using '//'. But current checkpatch doesn't
allow C99 comments, so keep using standard C comments, by now.
Change-Id: Ia91b0f7da42c439b6340bbe81983b86b68f6d65c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7156 Tested-by: jenkins
Antonio Borneo [Tue, 30 Aug 2022 14:10:19 +0000 (16:10 +0200)]
openocd: remove CamelCase symbols *xPSR*
We have left the camelcase symbols *xPSR* for some time, to avoid
any conflict with possibly pending patches in gerrit.
With the approaching v0.12.0-rc1, it's time to revisit it.
The patches in gerrit that conflict with this rename are all not
merge-able due to conflicts or due to negative review.
Drop these CamelCase symbols.
Change-Id: Ifbac4c1df9cc55994e024971a2aaebeed2ea4ed3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7155 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Antonio Borneo [Sat, 27 Aug 2022 16:58:42 +0000 (18:58 +0200)]
jep106: add SPDX tag and JEDEC copyright
As a follow-up of talks between JEDEC and STMicroelectronics,
JEDEC agrees to let OpenOCD project including the manufacturer's
identification code list extracted from JEDEC JEP106 document and
to let OpenOCD being updated regularly using the future JEDEC
JEP106 document versions. JEDEC requires OpenOCD to report the
origin of the JEDEC JEP106 manufacturer's identification code list
together with the JEDEC copyright.
As agreed with JEDEC, add in the file jep106.inc:
- the SPDX tag with the GPL license of the OpenOCD project;
- the JEDEC copyright;
- the text provided by JEDEC reporting the origin of the JEDEC
JEP106 manufacturer's identification code list.
While there:
- add a line reporting the version of the JEP106 document that was
used for the current code list extraction;
- remove the obsolete comment, as the script for extraction is not
working anymore; keep the script as example.
Change-Id: Iaa76716db14e15ffca04fcf7d8c27bb85a27ba10 Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7147 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Erhan Kurubas [Thu, 25 Aug 2022 14:06:40 +0000 (17:06 +0300)]
server: add function to get openocd shutdown status
In the app-trace module we are polling the target in the while loops
outside of the server.c
In that loops, we need to catch ctrl+c signal by checking shutdown_openocd
status
Tim Newsome [Fri, 8 Jul 2022 20:02:13 +0000 (13:02 -0700)]
target/riscv: Update with latest encoding from riscv-opcodes
This gets us a clearly labeled BSD-3-Clause header, which should be
compatible with OpenOCD and Fedora, and also make it clear what the
license actually is.
See https://github.com/riscv/riscv-openocd/pull/710,
https://github.com/riscv/riscv-openocd/pull/713, and
https://github.com/riscv/riscv-openocd/pull/717.
Change-Id: I992b4f3bb230edb9f281e2278dd41c712098ed4c Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7084 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>