aboutsummaryrefslogtreecommitdiff
path: root/src/target/avrt.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/target: 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: I255ad17235ff1e01bf0aa4deed4d944e1d693ddb Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7071 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
2020-07-26target: fix minor typos and duplicated wordsAntonio Borneo1-2/+2
Change-Id: I8deb0017dc66a243e3dd51e285aa086db500decd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5766 Tested-by: jenkins
2020-02-24coding style: fix space around pointer's asteriskAntonio Borneo1-1/+1
The script checkpatch available in new Linux kernel offers an experimental feature for automatically fix the code in place. While still experimental, the feature works quite well for simple fixes, like spacing. This patch has been created automatically with the script under review for inclusion in OpenOCD, using the command find src/ -type f -exec ./tools/scripts/checkpatch.pl \ -q --types POINTER_LOCATION --fix-inplace -f {} \; then manually reviewed. OpenOCD coding style does not mention the space around pointer's asterisk, so no check is enforced. This patch only makes the style uniform across the files. The patch only changes amount and position of whitespace, thus the following commands show empty diff git diff -w git log -w -p git log -w --stat Change-Id: Iefb4998e69bebdfe0d1ae65cadfc8d2c4f166d13 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5197 Tested-by: jenkins
2017-02-10target: Add 64-bit target address supportDongxue Zhang1-4/+4
Define a target_addr_t type to support 32-bit and 64-bit addresses at the same time. Also define matching TARGET_PRI*ADDR format macros as well as a convenient TARGET_ADDR_FMT. In targets that are 32-bit (avr32, nds32, arm7/9/11, fm4, xmc1000) be least invasive by leaving the formatting unchanged apart from the type; for generic code adopt TARGET_ADDR_FMT as unified address format. Don't silently change gdb formatting here, leave that to later. Add COMMAND_PARSE_ADDRESS() macro to abstract the address type. Implement it using its own parse_target_addr() function, in the hopes of catching pointer type mismatches better. Add '--disable-target64' configure option to revert to previous 32-bit target address behavior. Change-Id: I2e91d205862ceb14f94b3e72a7e99ee0373a85d5 Signed-off-by: Dongxue Zhang <elta.era@gmail.com> Signed-off-by: David Ung <david.ung.42@gmail.com> [AF: Default to enabling (Paul Fertser), rename macros, simplify] Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.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-09-08target: remove unimplemented target_request_data implementationsSpencer Oliver1-2/+0
Change-Id: Ia9afa83752d17f0f56bdf3bd81f5c69d108aa5e9 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1537 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-09-08target: remove unimplemented soft_reset_halt implementationsSpencer Oliver1-8/+0
Let the default handler issue an unsupported warning rather than using empty handler routines that may/may not issue a unsupported warning. Change-Id: Iafe3e45146981a4cfae39771c3ab7370ac86da48 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1535 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Hsiangkai Wang <hsiangkai@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>
2012-02-06build: cleanup src/target directorySpencer Oliver1-27/+21
Change-Id: Ia055b6d2b5f6449a38afd0539a8c66e7d7e0c059 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/430 Tested-by: jenkins
2010-06-21target/avrt: review unused symbolsAntonio Borneo1-56/+0
Remove unused functions: - mcu_write_dr_u16 - mcu_write_dr_u8 - mcu_write_ir_u16 - mcu_write_ir_u32 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-21target/avr: review scope of symbolsAntonio Borneo1-33/+35
Add "static" qualifier to private functions. Move duplicated global declarations from "target/avrt.c" and "nor/avrf.c" to "target/avrt.h". Remove unused declarations form "nor/avrf.c". Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-03-18jtag: cut down on usage of unintended modification of global end stateØyvind Harboe1-3/+2
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: simplify jtag_add_plain_ir/dr_scanØyvind Harboe1-12/+3
These fn's now clearly just clock out/in bits. No mystical fields are involved. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: retire tap fieldØyvind Harboe1-2/+0
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>
2009-11-25use ARRAY_SIZE macroZachary T Welch1-2/+2
Search and destroy lingering cases where the ARRAY_SIZE macro should be used to convey more intrinsic meaning in the OpenOCD code.
2009-11-24remove target_type register_command callbackZachary T Welch1-10/+0
Uses chaining of command_registration structures to eliminate all target_type register_callback routines. Exports the command_handler registration arrays for those target types that are used by others.
2009-11-13command_context_t -> struct command_contextZachary T Welch1-4/+4
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13target_t -> struct targetZachary T Welch1-20/+20
Remove misleading typedef and redundant suffix from struct target.
2009-11-13target_type_t -> struct target_typeZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct target_type.
2009-11-13avr_common_t -> struct avr_commonZachary T Welch1-1/+1
Remove misleading typedef and redundant suffix from struct avr_common.
2009-11-13scan_field_t -> struct scan_fieldZachary T Welch1-2/+2
Remove useless structure typedef.
2009-11-13jtag_tap_t -> struct jtag_tapZachary T Welch1-21/+21
Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
2009-11-10Target: minor cleanupDavid Brownell1-4/+0
- improve some names -- a "default" prefix is not descriptive - add doxygen @todo entries for some issues - avr8 isn't ever going to need those MMU hooks Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-05target: remove unused interface fn that clutters codeØyvind Harboe1-8/+0
The quit entry point was not being invoked. Just a source of confusion at this point. XScale ran 100x reset upon quit, but that code made no sense, wasn't commented and never invoke. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-06-18Transform 'u32' to 'uint32_t' in src/targetzwelch1-10/+10
- Replace '\([^_]\)u32' with '\1uint32_t'. - Replace '^u32' with 'uint32_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2279 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u16' to 'uint16_t'zwelch1-4/+4
- Replace '\([^_]\)u16' with '\1uint16_t'. - Replace '^u16' with 'uint16_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18Transform 'u8' to 'uint8_t' in src/targetzwelch1-14/+14
- Replace '\([^_]\)u8' with '\1uint8_t'. - Replace '^u8' with 'uint8_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04Rename jtag_add_end_state to jtag_set_end_state since "add" implies thatoharboe1-2/+2
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_IDLE. Same must be done ↵oharboe1-2/+2
for TAP_DRPAUSE git-svn-id: svn://svn.berlios.de/openocd/trunk@2044 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31Final step in isolating target_type_s structure:zwelch1-1/+1
- Move definition of 'struct target_type_s' into new 'target_type.h' file. - Forward delclaration remains in target.h, with comment pointing to new file. - Replaces #define with #include in source files. git-svn-id: svn://svn.berlios.de/openocd/trunk@1971 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31First step in hiding target_type_s from public interface:zwelch1-0/+1
- Add DEFINE_TARGET_TYPE_S symbol in files that need it defined. - Forward declare 'struct target_type_s' only, unless that symbol is defined. git-svn-id: svn://svn.berlios.de/openocd/trunk@1969 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Audit and eliminate redundant #include directives in other target files.zwelch1-16/+1
git-svn-id: svn://svn.berlios.de/openocd/trunk@1715 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11Remove redundant sys/types.h #include directives (now in types.h).zwelch1-1/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1700 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-08in_handler in_check_mask and in_check_value now removed from field. Last big ↵oharboe1-31/+23
patch in the series of JTAG API cleanup. git-svn-id: svn://svn.berlios.de/openocd/trunk@1672 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-06retire out_mask - not used anywhereoharboe1-2/+0
git-svn-id: svn://svn.berlios.de/openocd/trunk@1608 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-03Piotr Esden-Tempski <piotr@esden.net> Mac OS X compile fixesoharboe1-11/+11
git-svn-id: svn://svn.berlios.de/openocd/trunk@1594 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27SimonQian <simonqian@simonqian.com> fix warnings(which stops compilation) ↵oharboe1-354/+354
and some bugs git-svn-id: svn://svn.berlios.de/openocd/trunk@1548 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27SimonQian <simonqian@simonqian.com> AVR wipoharboe1-0/+354
git-svn-id: svn://svn.berlios.de/openocd/trunk@1540 b42882b7-edfa-0310-969c-e2dbd0fdcd60