Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From upstream #935

Merged
merged 51 commits into from
Oct 23, 2023
Merged

From upstream #935

merged 51 commits into from
Oct 23, 2023

Conversation

timsifive
Copy link
Collaborator

@timsifive timsifive commented Oct 16, 2023

Merge down up to 0384fe5 from upstream.

checkpatch has complaints, but I'm going to override them because they came from upstream code.

erhankur and others added 30 commits March 25, 2023 18:06
The value returned by target_get_gdb_arch() is something specific for GDB.
There could be several variants of the same CPU.
If we start implementing all the variants, checking the string value,
could become incorrect.
It's better to check for xtensa->common_magic == XTENSA_COMMON_MAGIC

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I20f3fdced176c3b9ab00f889743161ecad7280f9
Reviewed-on: https://review.openocd.org/c/openocd/+/7536
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The multidrop SWD is also supported.

Change-Id: I9fefc54fc9d40a75194285cd6e0f10c5c347d9b6
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7537
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The code for JTAG WAIT recovery did not handle DP_SELECT
endianness.

While on it, mark missing ADIv6 DP SELECT1 handling as TODO.

Change-Id: I44f3bc8fc9fd2483c0293b6d4f2c51a60ca01873
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7540
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The file descriptor svf_fd is not closed on command error, thus
leaking memory.

Close svf_fd on errors.
While there, properly initialize svf_fd using NULL instead of 0.

Change-Id: I5efe9ce576a3a50588b30000222665e26161dfdc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7532
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: <kai.schmitz@advantest.com>
If svf_set_padding() returns error, jump to free_all label to
prevent any memory leak.
Propagate the error reported by svf_set_padding() instead of
overwriting it.
Use command_print() instead of LOG_ERROR() for command output.

Change-Id: I61fd89cad10652f2f9ef1f9d48a040e35253c3d4
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7533
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
The command 'svf' is the only command in OpenOCD that accepts
options in both forms 'option' and '-option'.

Deprecate the option format without the leading '-'.
Update the documentation and fix the on-line help.
While there:
- switch to use the new nvp.h helper;
- return ERROR_COMMAND_ARGUMENT_INVALID on invalid command args;
- fix some minor coding style rule.

Change-Id: I5b944403d92a3fa1e12d5faafc1d2a139bc16a7d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7534
Tested-by: jenkins
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'ocd_find' as OpenOCD command.

Change-Id: Id775bccc12840bcf95d8c19787beda5e7c3107fc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7484
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'transport select' as OpenOCD command.
This fixes and incorrect check for the return value of function
transport_select(); it returns ERROR_yy but the check is on JIM_xx.
While there, fix the coding style.

Change-Id: I9f3e8394c1a0cc0312b414c58275e1220217bbed
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7485
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
The mixed use of jim commands and OpenOCD commands is error prone
due to handling of errors through JIM_xx and ERROR_yy.

Rewrite the jim command 'flash list' as OpenOCD command.
While there:
- format in a human readable way the output dictionary list, while
  preserving the structure of its TCL data;
- add the mandatory 'usage' field.

Change-Id: I1ee69870d3ab3c1cfc46cd2b8ec03de6b2300bd6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7486
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Use full 64 bits in output; no reason to truncate at 32 bits.

Change-Id: I433815a381e147731ff0da2c805170649a9bcf38
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7487
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Trivial change.
While there:
- add the mandatory 'usage' field;
- document the optional parameter 'git';
- reword the documentation.

Change-Id: I6be4d4423128fa026a62e2ef355f77b69d50397e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7488
Tested-by: jenkins
This also fixes a mistake of the jim command returning ERROR_xx
when function rtt_read_channel_info() returns error.
While there:
- format in a human readable way the output dictionary list, while
  preserving the structure of its TCL data;
- add check for the number of parameters.

Change-Id: Ica2b623699d3a606d3992975c836dae96f74b26d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7489
Tested-by: jenkins
This also fixes an incorrect return ERROR_TARGET_NOT_HALTED from a
jim command.

Change-Id: I99a02a21bedb64e60944e295c7cf24356e07be60
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7490
Tested-by: jenkins
While there, add a check for target halted and check the number of
parameters accordingly to the command name.

Change-Id: I9e8bb109c35039561997d14782fac682267aee65
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7491
Tested-by: jenkins
While there, format in a human readable way the output list by
using one line per cti name.

Change-Id: I6d4870ee512fe7e6935d73355c2377ad805ccc3b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7492
Tested-by: jenkins
Trivial change.
Add the mandatory 'usage' field.

Change-Id: Id92af5cd873fb86f5de79f785f156d1ef734b005
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7493
Tested-by: jenkins
While there:
- format in a human readable way the output list by using one line
  per tap name;
- add the mandatory 'usage' field.

Change-Id: I295449220c78fac8973478b265413342ea832f61
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7494
Tested-by: jenkins
While there add the mandatory 'usage' field.

Change-Id: I3491ed79d11c5a3e81cc9afd2423da14b8df72ff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7495
Tested-by: jenkins
While there add the mandatory 'usage' field.

Change-Id: I316fb31e24e94985dcc724e428b0384be7ef5bdd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7496
Tested-by: jenkins
While there:
- check the number of command parameters;
- add the mandatory 'usage' field.

Change-Id: I7cd16f049753caedf19f313f7dc84be98efdba42
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7497
Tested-by: jenkins
While there, format in a human readable way the output list by
using one line per dap name.

Change-Id: I24a47350105b90db15808c61790f05d807120739
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7498
Tested-by: jenkins
Change-Id: I689482f898bde2afa2881b2f311676a6b98abb9a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7499
Tested-by: jenkins
Change-Id: Ia600948b99a229ef0490b7f576df62f880db8546
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7500
Tested-by: jenkins
While there, format in a human readable way the output list by
using one line per tpiu name.

Change-Id: I937c92b6c1e92509cf8aa96be1517a51bc363600
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7501
Tested-by: jenkins
Change-Id: Iaaccfc62dd85267066a152c434f254d1b9a0c4f1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7502
Tested-by: jenkins
While there, fix typo on 'exceeds'.
In a following patch, the output could be formatted and split in N
values per line to make it easier to read by humans.

Change-Id: I295111a80934393011e46311f6cf6c13f2bdc0a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7503
Tested-by: jenkins
While there, add the mandatory 'usage' field.

Change-Id: Ibfda6f56a1450e2eb9ad3092d756de0778f4a092
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7504
Tested-by: jenkins
Check for empty command line, add the mandatory 'usage' field.

Change-Id: I3f59448458fe01268bf5f4293aea5adcbd6d8279
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7505
Tested-by: jenkins
Check for empty command line, add the mandatory 'usage' field.

Change-Id: I9c3606242ec3dda9026fe19222162a110e618bff
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7506
Tested-by: jenkins
While there add the mandatory 'usage' field.

Change-Id: I5389881dac25877dc32930ec36ee546e48ecc14d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7507
Tested-by: jenkins
borneoa and others added 21 commits March 25, 2023 18:15
While there add the mandatory 'usage' field.

Change-Id: I3e5b826ca58f7ade30a443ada0cb4a9cd9ea35c2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7508
Tested-by: jenkins
Print one entry per line.
While there add the mandatory 'usage' field.

Change-Id: I135556e12154e33fdbd0f71d89f6fe37c69813b7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7509
Tested-by: jenkins
Print one entry per line.
While there add the mandatory 'usage' field.

Change-Id: Ia832684817f3bdbfa4cb943cd97e3f9fb2605902
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7510
Tested-by: jenkins
This also fixes an incorrect return ERROR_xx from a jim command,
propagated from return value of rtos_smp_init().

Change-Id: Icf4893c00aabd8fadd60077c5e8a2e926f687518
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7511
Tested-by: jenkins
The old configuration files did not work because of a missing
'at91sam9260minimal.cfg' file. Also, the config files were placed
wrongly. Update them, put them to the proper location, merge the two
supported boards into one, remove now superfluous include, remove
defunct web page, etc.. Tested with a Calao USB-A9G20 and a hacked
'device_desc' to match. Native support for it will come next.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: Iec578c8777c5a6134e132dbac17c2988c7634742
Reviewed-on: https://review.openocd.org/c/openocd/+/7522
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Add a basic config.

Signed-off-by: Wolfram Sang <wsa@kernel.org>
Change-Id: Ie68e5fbb26b1c2f3028e561af0255fa71ec61828
Reviewed-on: https://review.openocd.org/c/openocd/+/7524
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
If the file read abnormally, need to close it which was opened before.

Signed-off-by: panciyan <panciyan@eswincomputing.com>
Change-Id: I6142f154741dcd38088b7add2793219ee4dd2ae9
Reviewed-on: https://review.openocd.org/c/openocd/+/7546
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
During setup job in the GH actions, GH tries to resolve
all actions before starting to run the scripts.
It can not find 0.2.0 version inside
'dev-drprasad/delete-tag-and-release 'repo and action fails.

This patch fixes that error.
Also, switched to the latest ubuntu image
Hidapi version updated to 0.13.1

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I02af41f6189d5a28f874c9b008073d74de46b4ca
Reviewed-on: https://review.openocd.org/c/openocd/+/7551
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Libjaylink submodule disabled by default at
https://review.openocd.org/c/openocd/+/7129

--enable-internal-libjaylink config option will be deprecated soon.

So, building the source is a permanent solution.

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: Id06654d806a3a49f35e3ba41e9e4cc58c1a0d388
Reviewed-on: https://review.openocd.org/c/openocd/+/7552
Tested-by: jenkins
Reviewed-by: zapb <dev@zapb.de>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
1.
update the rtos->thread_count in time, to make sure the allocated
thread_name_str and extra_info_str could be freed by
rtos_free_threadlist(). Otherwise the abnormal return may cause a
memory leak.
2.
remove a redundant assignment to threadid.

Signed-off-by: Chao Du <duchao@eswincomputing.com>
Change-Id: Ifabc59d501c925b3d6aec8b04b2856d2c31cc4e2
Reviewed-on: https://review.openocd.org/c/openocd/+/7549
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The condition to check if the workspace area (used by actual MIPS code
executed on target) and data area (sandbox to put data to be read/written
to/from flash) is wrong, thus preventing the use of FAST_* commands to
program/verify FLASH.

Signed-off-by: François LEGAL <devel@thom.fr.eu.org>
Change-Id: Ic68424b7f42d44e550433a120093db5e7980fd56
Reviewed-on: https://review.openocd.org/c/openocd/+/7563
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Add the fast read method to speed up flash verification
after programming. Works the same as fast write already
implemented.

Signed-off-by: François LEGAL <devel@thom.fr.eu.org>
Change-Id: I74611a3542a88212f0483ec8ee368aba3d1f03c7
Reviewed-on: https://review.openocd.org/c/openocd/+/7564
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
The file list.h is taken from Linux and includes two similar
implementation of double linked lists:
- with single linked list's head (hlist_*), and
- with double linked list's head (list_*).
While the former offers a minor memory footprint improvement,
keeping two implementations makes harder for newbie developers
to approach them.

So far only the latter implementation has been used and no new
patches in gerrit is going to change that.

Drop the support for lists with single linked head.
It can be easily taken back from git history, if needed.

Change-Id: I420e5de38ab755fdfbeb2115538c61818308ec2b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7567
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Minor changes due to kernel switch to 100 char/line.
Added four new functions.

Silent checkpatch; we don't want to diverge from Linux reference
code.
Checkpatch-ignore: MACRO_ARG_REUSE, UNNECESSARY_PARENTHESES
Checkpatch-ignore: MACRO_ARG_PRECEDENCE

Change-Id: I1d2ff25bf3bab8cd0f5c9be55c7501795490ea75
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7568
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I9294c551cf2e795ad5e3e92dc3926c564424e067
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7399
Tested-by: jenkins
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
On MacOS libc includes files from MacOSX.sdk that define the macro
	#define __nonnull
without arguments, causing compile error.

Extend the existing check for clang on MacOS and undefine the
macro for gcc too.

Change-Id: Ic99de78348c6aa86561212a3aded9342e5d32e02
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reported-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7571
Reviewed-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Tested-by: jenkins
Add missing ID codes and ignore the version in the ID.

Change-Id: Idd2d3a5eddb6995f3af1c45afd2adf76ce3442bf
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7386
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
They have an ir length of 22, 24 or 38 bit and different command codes.

Change-Id: I488e8613f1c4d017e1590111f60b2725ec62964b
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Reviewed-on: https://review.openocd.org/c/openocd/+/7387
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Checkpatch-ignore: GIT_COMMIT_ID

Waiting for running state was removed from handle_resume_command()
in commit a92d27a ("very long and bad structured commit msg
without anything relevant to resume") around year 2008.
Update the doc accordingly.

Silent checkpatch or we have to copy 10 or more lines
of the old commit msg.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I3296cb2c29cf80aeed63eddd8fbf352edec778c1
Reviewed-on: https://review.openocd.org/c/openocd/+/7579
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
…tream

Conflicts:
      .github/workflows/snapshot.yml
      src/rtos/FreeRTOS.c

Change-Id: I4c9ff887b69140e0f61cb3f75a2f2c1a12071320
At change 0384fe5.

Change-Id: I1081e09f1014c5d240988fc25feba04fc2bb21ef
Signed-off-by: Tim Newsome <tim@sifive.com>
@timsifive timsifive marked this pull request as ready for review October 16, 2023 20:06
Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the differences, looks fine to me.

Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarekVCodasip has done the bulk of this review and has checked the differences.

We have also skimmed through the differences together and it looks fine to me as well.

@timsifive timsifive merged commit 3b0561d into riscv Oct 23, 2023
4 of 5 checks passed
@timsifive timsifive deleted the from_upstream branch October 23, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants