aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/drivers/ep93xx.c
AgeCommit message (Collapse)AuthorFilesLines
2023-05-05jtag: drivers: with pointers, use NULL instead of 0Antonio Borneo1-1/+1
Don't compare pointers with 0, use NULL when needed. Don't assign pointer to 0, use NULL. Don't pass 0 ad pointer argument, pass NULL. While there, check for return value from malloc(), replace an assert() with a LOG_ERROR(), drop a useless cast. Detected through 'sparse' tool. Change-Id: Ia7cf52221b12198aba1a07ebdfaf57ce341d5699 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7592 Tested-by: jenkins
2023-05-05jtag: drivers: add static to local symbolsAntonio Borneo1-1/+1
Add static type to symbols that are not used elsewhere. Detected through 'sparse' tool. Change-Id: I00e151d2466868a5dce028444d326defb80d4826 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7591 Tested-by: jenkins
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-09-13src/jtag/drivers/ep93xx: fix GCC 12 warningAntonio Borneo1-8/+5
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-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
2020-07-14jtag/drivers: replace perror() with LOG_ERROR()Antonio Borneo1-3/+3
The function perror() sends the output to stderr, but OpenOCD cannot intercept such output to send it to the log. Replace all occurrences of perror() with LOG_ERROR(), but keeping the same output format of perror(). The replacement is done automatically through: sed -i 's/perror("\([^":]*\)[: ]*")/LOG_ERROR("\1: %s", strerror(errno))/' src/jtag/drivers/*.c Change-Id: I4c140bdb09235d56cfd8bef75da9b56fbe7c2aec Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5728 Tested-by: jenkins
2020-01-14adapter: switch from struct jtag_interface to adapter_driverAntonio Borneo1-3/+7
To reorganize the adapters code, introduce an adapter_driver struct that contains all the adapter generic part, while keeping in two separate struct the specific API jtag_ops and swd_ops. Move the allocation of *adapter_driver from the JTAG-specific file core.c to the more adapter-specific file adapter.c While splitting the old jtag_interface for every driver, put the fields in the same order as in the struct declaration so we keep a consistent code across all the drivers. While other transport specific API could/would be added as separate ops, nothing is done here for HLA. Change-Id: I2d60f97ac514c0dd2d93a6ec9be66fd9d388dad5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4900 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2020-01-14bitbang: jtag-only drivers: switch to new reset APIAntonio Borneo1-1/+1
Remove the JTAG_RESET command from the bitbang execute queue now that all bitbang drivers have moved away from old reset method. Remove also the internal reset API in struct bitbang_interface. Tested parport only. Change-Id: I12b157ef442f4c9912406b19b7a4d32ba6ec0b53 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5300 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-06-06jtag: set default "jtag_only" to uninitialized transportsAntonio Borneo1-0/+1
For legacy support, drivers that do not define a list of transports get identified as jtag_only. Cleanup this old crust and initialize properly the transports field in the jtag_interface for all the drivers. Change-Id: I9c86064e5d05bd0212bc18f4424414e615e617fe Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4893 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-01-25Add read buffer to bitbang, improving performance.Tim Newsome1-7/+11
Previously for every bit scanned OpenOCD would write the bit, wait for that bit to be scanned, and then read the result. This involves at least 2 context switches. Most of the time the next bit scanned does not depend on the last bit we read, so with a buffer we now write a bunch of bits to be scanned all at once, and then we wait for them all to be scanned and have a result. This reduces the time for one testcase where OpenOCD connects to a simulator from 12.30s to 5.35s! Running all our tests went from 13m13s to 3m55s. Change-Id: Ie9fcea043ac1d7877a521125334ed47d4b3e1615 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/4312 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
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>
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>
2013-02-08jtag_interface: .speed can be NULL when not neededFranck Jullien1-8/+0
adapter_init (core.c) won't check speed configuration of the selected interface if it's not needed (.speed = NULL). When it's not needed, we can now omit adapter_khz in init scripts and we don't have to implement dummy handlers for speed_div and khz functions. It also removes calls to adapter_khz in interface configuration files when not used anymore. Change-Id: I6eb1894385503fede542a368f297cec6565eed44 Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Reviewed-on: http://openocd.zylin.com/1131 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2012-02-06build: cleanup src/jtag/drivers directorySpencer Oliver1-5/+4
Change-Id: I99c08ec0132d5a15250050e718310f1ddd9fe546 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/425 Tested-by: jenkins
2011-01-09nit: more LOG_* \n fixesEric Wetzel1-2/+2
Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages Remove LOG_INFO_N LOG_INFO_N was only used once and had a \n at the end Change LOG_USER_N calls that end with \n to LOG_USER
2010-09-30Update ep93xx and at91rm9200 driversLuca Bruno1-8/+0
ep93xx and at91rm9200 are conditionally built only on arm and were not updated to reflect changes in command registration handler. This patch makes them properly compile again, fixing a build failure experienced on Debian armel. Signed-off-by: Luca Bruno <lucab@debian.org> Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
2010-03-16bitbang: add jtag_add_tms_seq supportØyvind Harboe1-0/+1
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-03change #include "interface.h" to <jtag/interface.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "interface.h" the following form should be used. #include <jtag/interface.h> The exception is from .c files in the same directory.
2009-12-02move jtag drivers to src/jtag/driversZachary T Welch1-0/+230
Moves JTAG interface drivers to src/jtag/drivers/, Adds src/jtag/drivers/Makefile.am. Builds libocdjtagdrivers.la. Flattens the rlink driver files into the drivers/ directory, adding the 'rlink_' prefix or '.rlink' suffix as appropriate.