Commit Graph

9777 Commits

Author SHA1 Message Date
Antonio Borneo 1c1fd1a71a 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
2022-09-18 08:20:23 +00:00
Antonio Borneo bb1411e598 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
2022-09-18 08:20:08 +00:00
Antonio Borneo 8b4d9503d8 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
2022-09-18 08:19:47 +00:00
Antonio Borneo b0c36e0457 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
2022-09-18 08:19:28 +00:00
Paul Fertser 7d1e08456c checkpatch: fix check for the FSF address
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
2022-09-18 08:19:12 +00:00
Antonio Borneo 772d8b42b6 checkpatch: don't spell-check the spelling file
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-18 08:18:53 +00:00
Antony Pavlov 20d4a58bd9 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 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
2022-09-18 08:18:37 +00:00
Paul Fertser ccdc51e2de checkpatch: correct false positives reporting instructions
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
2022-09-18 08:18:23 +00:00
Paul Fertser c893a26a00 checkpatch: treat jenkins as valid email
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
2022-09-18 08:18:09 +00:00
Paul Fertser 7bf39f64f6 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 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
2022-09-18 08:17:40 +00:00
Antonio Borneo 9c6c5b61b3 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
2022-09-18 08:17:23 +00:00
Antonio Borneo 85a918b44d checkpatch: add OpenOCD specific config flags
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
2022-09-18 08:17:08 +00:00
Antonio Borneo 8d395421ab 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 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
2022-09-18 08:16:40 +00:00
Ian Thompson 61d0757acf target/xtensa: invalidate register cache on reset
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-18 08:12:02 +00:00
Ian Thompson 27e7f5df5f target/xtensa: fix clang analyzer warning
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-18 08:05:47 +00:00
Marc Schink 9f024dbedc flash/nor/stm32lx: Add revision 'X' for Cat.4/3 devices
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-17 21:16:48 +00:00
Tim Nordell f9837d1807 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>
2022-09-17 20:58:55 +00:00
Tim Nordell 68fe396b79 rtos: Fold is_symbol_mandatory into rtos_qsymbol(..)
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-17 20:58:37 +00:00
Tim Nordell 9f5a74c228 rtos: Create a new helper function find_symbol(...)
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-17 20:58:16 +00:00
Ian Thompson 4279b23fca target/xtensa: populate PS correctly during fetch
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-17 20:57:26 +00:00
Toms Stūrmanis 9464c801b9 flash/nor/rsl10: Check return value
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-17 20:56:46 +00:00
Frank Dischner 219cb9598a 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>
2022-09-13 22:20:04 +00:00
Antonio Borneo cec3b62328 mips64: remove empty mips_mips64_soft_reset_halt()
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-13 22:19:13 +00:00
Ian Thompson 58bd387219 target/xtensa: fully initialize buffers for PWRSTAT read
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-13 22:18:57 +00:00
Paul Fertser 16cbddf1ce tcl: board: mini2440: fix to work with the current version
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-13 22:18:14 +00:00
Steve Marple fed16496ab drivers/bcm2835gpio: Fully restore GPIOs after use
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-13 22:17:41 +00:00
Steve Marple 24e801d5d6 drivers/bcm2835gpio: Add support for activity LED
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-13 22:17:23 +00:00
Steve Marple 0dd969d83b drivers/bcm2835gpio: Migrate to adapter gpio commands
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-13 22:17:14 +00:00
Steve Marple e643a494d4 drivers/bcm2835gpio: Release resources on error and when quitting
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-13 22:16:59 +00:00
Antonio Borneo ce217538bc tcl/interface: replace last deprecated commands
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-13 22:16:37 +00:00
Antonio Borneo b8594026e4 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>
2022-09-13 22:16:07 +00:00
Antonio Borneo e5c103a8d3 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
2022-09-13 22:15:12 +00:00
Antonio Borneo 320043c054 openocd: fix for polling during "expr" computation
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>
2022-09-13 22:14:28 +00:00
Antonio Borneo 5d6be673c3 target: don't export local symbols
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-13 22:13:58 +00:00
Antonio Borneo efa2068f1a flash/nor: move variable's declaration in C file
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-13 22:13:50 +00:00
Antonio Borneo a79927dd92 usbprog: remove unused variable
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-13 22:12:44 +00:00
Antonio Borneo 933cbd9156 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
2022-09-13 22:12:29 +00:00
Antonio Borneo d112a1282e flash/nor/npcx: make local symbols static
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-13 22:11:54 +00:00
Antonio Borneo 07d84bca32 target: make local symbols static
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-13 22:11:46 +00:00
Antonio Borneo a21489e9b9 xtensa: make local symbols static
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-13 22:10:57 +00:00
Antonio Borneo 8310a238dc riscv: make local symbols static
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-13 22:10:42 +00:00
Antonio Borneo 8f725fea25 jtag: make local symbols static
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-13 22:10:33 +00:00
Antonio Borneo bf74007d37 log: remove unused set_log_output()
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
2022-09-13 22:10:19 +00:00
Erhan Kurubas 97f47e8c94 tcl/board: add ESP32-S3 config for ESP USB Bridge board
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>
2022-09-13 22:09:53 +00:00
Erhan Kurubas 35b20195b8 tcl/board: add ESP32 config for ESP USB Bridge board
Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Ie1a56a398052f6f0e0eb2fe96777effeb59918f6
Reviewed-on: https://review.openocd.org/c/openocd/+/7076
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-13 22:09:27 +00:00
Ian Thompson abe5f015c5 target/xtensa: fix step state transition
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>
2022-09-13 22:09:02 +00:00
Ian Thompson 34a6a64920 target/xtensa: DAP-based Xtensa config files
- 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>
2022-09-13 22:08:34 +00:00
Ian Thompson b2b514be5b target/xtensa: enable DAP/SWD for generic xtensa
- 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>
2022-09-13 22:08:14 +00:00
Toms Stūrmanis ca52cfb2b3 src/flash/nor: flash driver for RSL10
Add new flash driver for internal flash of onsemi RSL10 device.

Valgrind-clean. Clang AddressSanitizer shows no errors.

Signed-off-by: Toms Stūrmanis <toms.sturmanis@gmail.com>
Change-Id: I8030542cb9805e94f56d7a69404cef5d88d6dd5a
Reviewed-on: https://review.openocd.org/c/openocd/+/7115
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-13 22:07:43 +00:00
Antonio Borneo 7dff68f65d .gitignore: remove cross-compile *-libtool
This reverts commit dac90163a2 (".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.

Revert patch [1].

Change-Id: I75793fce82a5297d74af72e620c4e63cd5b15f90
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: https://review.openocd.org/6960 [1]
Fixes: dac90163a2 (".gitignore: add cross-compile *-libtool")
Link: https://git.openembedded.org/openembedded-core/commit/?id=4b308773eca7 [2]
Reviewed-on: https://review.openocd.org/c/openocd/+/7161
Tested-by: jenkins
2022-09-13 22:07:21 +00:00