aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/commands.c
AgeCommit message (Collapse)AuthorFilesLines
2022-09-18openocd: fix SPDX tag format for files .cAntonio Borneo1-1/+1
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
2022-07-23openocd: src/jtag: replace the GPL-2.0-or-later license tagAntonio Borneo1-13/+2
Replace the FSF 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: Ie873d12bb0fb838d0d6252e6b9ca3c2118853e9a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7069 Tested-by: jenkins
2021-07-24openocd: remove NULL comparisons with checkpatch [2/2]Antonio Borneo1-1/+1
Patch generated automatically through a modified checkpatch that detects the patterns if (NULL == symbol) if (NULL != symbol) and through flags "--types COMPARISON_TO_NULL --fix-inplace". The unmodified checkpatch detects this pattern as Yoda condition, but it's odd fixing it as Yoda condition and then again as NULL comparison. This triggered the modification to the script. Change-Id: I5fe984a85e9c4fc799f049211797aef891ebce18 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6352 Tested-by: jenkins
2021-07-24openocd: fix simple cases of NULL comparisonAntonio Borneo1-1/+1
There are more than 1000 NULL comparisons to be aligned to the coding style. For recurrent NULL comparison it's preferable using trivial scripts in order to minimize the review effort. Patch generated automatically with the command: sed -i PATTERN $(find src/ -type f) where PATTERN is in the list: 's/(\([a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(\1)/g' Change-Id: Ida103e325d6d0600fb69c0b7a1557ee969db4417 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6350 Tested-by: jenkins
2020-09-05Fix debug prints when loading to flashSamuel Obuch1-4/+4
While loading to flash with debug level at least 3, OpenOCD tries to print the whole loaded bitstream. This will be very-very-slow due to implementation of conversion from buffer to string. * fix condition on selected debug level in jtag/core.c * replace slow buf_to_str function from helper/binarybuffer.c with faster but_to_hex_str function Change-Id: I3dc01d5846941ca80736f2ed12e3a54114d2b6dd Signed-off-by: Samuel Obuch <sobuch@codasip.com> Reviewed-on: http://openocd.zylin.com/5800 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-01-14jtag: print an errmsg on using jtag API for non jtag transportAntonio Borneo1-0/+14
After the cleanup of swd and hla, there should be no more calls to jtag_execute_queue() or to queue jtag commands if current transport is not jtag. Thus we can start removing the jtag specific code from adapters that do not support jtag. To prevent some remaining call to jtag_execute_queue() to crash openocd, verify the transport, print an error message if the transport is not jtag, call the adapter's jtag_execute_queue() only if it exist. To identify code that still add commands in the jtag queue even if transport is not jtag, print an error message in the function jtag_queue_command(). For the moment, still queue the message, even if will cause a memory leak if there is no following call to jtag_execute_queue(); the target is to identify the issue and cleanup the code, thus solving also the leak. Change-Id: I8fc85f754aa057aad1df05ff0448c8619897da23 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4897 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-06-04Convert DEBUG_JTAG_IO to LOG_DEBUG_IOAndreas Fritiofson1-21/+21
Change-Id: Ifee9723a57fea93a7022be3299f69680860f236b Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3910 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-10-16jtag: make cmd_queue_scan_field_clone publicSteven Stallion1-0/+12
This patch makes the cmd_queue_scan_field_clone function public. This permits targets to insert fields without affecting the submitted scan_field list. This will be used in an upcoming target implementation that needs to insert additional padding bits. Change-Id: I8fbd3b9b4e413432471f4f1444048932c8fa189e Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/4082 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2016-05-24Remove FSF address from GPL noticesMarc Schink1-3/+1
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-11-23jtag: commands: save a pointer to list tailFelipe Balbi1-3/+5
By saving a pointer to the tail of the list, we don't need to traverse the entire command queue before we're able to append an item to it. With this patch, I see a 10% improvement when using the embedded XDS100v2 on AM437x IDK board to load a 4MiB binary (linux zImage) to DDR with load_image. IOW, we went from ~305kB/sec to ~336kb/sec. Change-Id: Idb55d49f0d0106043374ab520b2f3b6b32f2c50f Signed-off-by: Felipe Balbi <balbi@ti.com> Reviewed-on: http://openocd.zylin.com/2709 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Daniele Emancipato <daniele12457@hotmail.com> Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-11-06jtag: fix support for really long scansPaul Fertser1-1/+3
When programming large FPGAs the generated SVF files might contain really long SDR scans. They won't fit in the 1MiB jtag scan page at all, so in this case the allocated page needs to be bigger. The current code was silently corrupting memory. One particular example was sent by Volter targetting XC3S4000. It has an SDR 11316992 bits long, that is 1414624 bytes. Change-Id: I39f18d7e0654f2dbdf37df58c837c9ec1fb2aa2a Reported-by: "Voltner, Jiří" <j.voltner@era.aero> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1792 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31Remove unnecessary castsAndreas Fritiofson1-1/+1
Change-Id: Ia97283707282ccccdc707c969f59337313b4e291 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1767 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-02-06build: cleanup src/jtag directorySpencer Oliver1-35/+21
Change-Id: I7caf57ca3d9dfbe152504472a6bb26c2a28b92e8 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/423 Tested-by: jenkins
2010-04-10JTAG/COMMANDS: review scope of functionsAntonio Borneo1-1/+1
Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2009-12-08minidriver: fix inline capability of minidriverØyvind Harboe1-0/+1
Low latency low CPU processing power systems(embedded) will benefit greatly from being able to inline certain jtag_add_xxx() fn's. The trick is that this has to be done in such a way as to allow implementing an OpenOCD API with a shared library(eventually) on a PC hosted OpenOCD. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-16rename CEIL as DIV_ROUND_UPZachary T Welch1-2/+2
Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
2009-11-13jtag_command_t -> struct jtag_commandZachary T Welch1-4/+4
Remove useless typedef from struct jtag_command.
2009-11-13cmd_queue_page_t -> struct cmd_queue_pageZachary T Welch1-9/+8
Remove misleading typedef from struct cmd_queue_page.
2009-11-13scan_command_t -> struct scan_commandZachary T Welch1-4/+4
Remove misleading typedef on struct scan_command.
2009-10-07Remove much #ifdeffery around _DEBUG_JTAG_IO_ usage.dbrownell1-16/+22
Have DEBUG_JTAG_IO() always trigger necessary warnings. git-svn-id: svn://svn.berlios.de/openocd/trunk@2822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23Remove whitespace that occurs before ')'.zwelch1-1/+1
- Replace '[ \t]*[)]' with ')'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23- Fixes '=' whitespacezwelch1-1/+1
- Replace ')\(=\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(=\)(' with '\1 \2 ('. - Replace '\(\w\)\(=\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2372 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u8' to 'uint8_t'zwelch1-5/+5
- Replace '\([^_]\)u8' with '\1uint8_t'. - Replace '^u8' with 'uint8_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2276 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-03Move JTAG command handling implementation into its own source file.zwelch1-0/+259
git-svn-id: svn://svn.berlios.de/openocd/trunk@2030 b42882b7-edfa-0310-969c-e2dbd0fdcd60