aboutsummaryrefslogtreecommitdiff
path: root/src/pld/virtex2.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: 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: I30cd66ac7d737f1973c68fdbb841ffcf00e917c4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7072 Tested-by: jenkins
2021-07-24openocd: fix simple cases of NULL comparisonAntonio Borneo1-2/+2
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
2019-05-14helper/command: change prototype of command_print/command_print_samelineAntonio Borneo1-3/+3
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
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-08-06cpld/virtex2: allow JSTART to be disabledRobert Jordens1-5/+11
This adds an option to disable the use of the JSTART instruction when loading bitstreams to xilinx fpgas. JSTART apparently prevents configuration if the startup clock is not set to the jtag clock in the bitstream. xc3sprog is omitting JSTART for all devices. Problems with loading a bitstream that does not have StartupClk:JTAGClk are described here: http://www.xilinx.com/support/answers/56151.html Change-Id: I8137c0bae05a8c3c6f8e2611869f70a770d1651d Signed-off-by: Robert Jordens <jordens@gmail.com> Reviewed-on: http://openocd.zylin.com/2860 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/pld directorySpencer Oliver1-37/+31
Change-Id: I9edb027c76e5d7fe21d557a11e6a9691fa581e86 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/408 Tested-by: jenkins
2012-01-18cmd: add missing usage varsSpencer Oliver1-0/+1
we should have caught them all - hopefully. Change-Id: I35435317fccaf5ad0216244d69f76db6857bb582 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/381 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-04Change return value on error.Mathias K1-4/+2
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-06-04Fix "unused variable" warnings (errors) detected with GCC 4.7.0 - trivial fixesFreddie Chopin1-3/+0
2010-09-20warnings: fix alignment warningsØyvind Harboe1-1/+1
These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-20jtag: move towards making out_value constØyvind Harboe1-3/+4
These were relatively straightforward fixes which are backwards compatible. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-19jtag: retire jtag_get/set_end_state()Øyvind Harboe1-2/+0
Voila! This get rids of mysteries about what what state the TAP is in. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-18jtag: cut down on usage of unintended modification of global end stateØyvind Harboe1-6/+6
jtag_get/set_end_state() is now deprecated. There were lots of places in the code where the end state was unintentionally modified. The big Q is whether there were any places where the intention was to modify the end state. 0.5 is a long way off, so we'll get a fair amount of testing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: jtag_add_ir_scan() now takes a single fieldØyvind Harboe1-1/+1
In the code a single field was all that was ever used. Makes jtag_add_ir_scan() simpler and leaves more complicated stuff to jtag_add_plain_ir_scan(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: retire tap fieldØyvind Harboe1-8/+4
jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-01-08PLD: usage/help updatesDavid Brownell1-2/+2
Make "usage" messages use the same EBNF as the User's Guide; no angle brackets. Improve and correct various helptexts. Don't use "&function"; a function's name is its address. Remove a couple instances of pointless whitespace, shrink a few overlong lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24pld: use static registration instead of callbackZachary T Welch1-6/+1
Remove register_callbacks from pld_device structure, using an array of command_registration records instead.
2009-11-24pld: use register_commands()Zachary T Welch1-8/+21
Updates core PLD and virtex2 commands to use register_commands().
2009-11-24use COMMAND_REGISTER macroZachary T Welch1-2/+2
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch1-4/+4
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch1-4/+4
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch1-2/+2
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16rename CEIL as DIV_ROUND_UPZachary T Welch1-1/+1
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-13command_t -> struct commandZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct command.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13pld_device_t -> struct pld_deviceZachary T Welch1-5/+5
Remove misleading typedef and redundant suffix from struct pld_device.
2009-11-13virtex2_pld_device_t -> struct virtex2_pld_deviceZachary T Welch1-6/+6
Remove misleading typedef and redundant suffix from struct virtex2_pld_device.
2009-11-13xilinx_bit_file_t -> struct xilinx_bit_fileZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct xilinx_bit_file.
2009-11-13pld_driver_t -> struct pld_driverZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct pld_driver.
2009-11-13scan_field_t -> struct scan_fieldZachary T Welch1-4/+4
Remove useless structure typedef.
2009-11-13jtag_tap_t -> struct jtag_tapZachary T Welch1-2/+2
Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
2009-11-13add PLD_DEVICE_COMMAND_HANDLER macroZachary T Welch1-3/+3
Update virtex module to use abstracted PLD command handling.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch1-2/+1
2009-11-11remove more useless declarationsZachary T Welch1-22/+19
Removes forward declarations by moving command registration after defintion of the command handlers.
2009-11-11add const keyword to some APIsZachary T Welch1-1/+1
Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch.
2009-11-05Improve pld command argument parsing.Zachary T Welch1-1/+3
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-23Remove whitespace that occurs after '('.zwelch1-1/+1
- Replace '([ \t]*' with '('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 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-21C99 printf() -Werror fixesduane1-2/+2
git-svn-id: svn://svn.berlios.de/openocd/trunk@2297 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-19fix jtag_add_callback() args. The first argument is nothing special, it's ↵oharboe1-2/+3
just another generic argument. git-svn-id: svn://svn.berlios.de/openocd/trunk@2290 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Finish transforming 'u32' to 'uint32_t'.zwelch1-7/+7
- Replace '\([^_]\)u32' with '\1uint32_t'. - Replace '^u32' with 'uint32_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2281 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u8' to 'uint8_t'zwelch1-4/+4
- 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-18David Brownell <david-b@pacbell.net>:zwelch1-27/+20
Clean up the PLD files: - Get rid of some extraneous whitespace - Make various functions static - Wrap overlong lines git-svn-id: svn://svn.berlios.de/openocd/trunk@2272 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-05Eliminate MixedCaps symbol from public JTAG TAP API:zwelch1-1/+1
- Purely mechanical transformations to the source files. - Rename 'jtag_TapByString' as 'jtag_tap_by_string.' git-svn-id: svn://svn.berlios.de/openocd/trunk@2065 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04Rename jtag_add_end_state to jtag_set_end_state since "add" implies thatoharboe1-8/+8
this fn has something to do with the queue, which it does not as such. git-svn-id: svn://svn.berlios.de/openocd/trunk@2050 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04no longer use jtag_add_xxx() to set end state to TAP_DRPAUSEoharboe1-3/+3
git-svn-id: svn://svn.berlios.de/openocd/trunk@2045 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04no longer use jtag_add_xxx() to set end state to TAP_IDLE. Same must be done ↵oharboe1-3/+3
for TAP_DRPAUSE git-svn-id: svn://svn.berlios.de/openocd/trunk@2044 b42882b7-edfa-0310-969c-e2dbd0fdcd60