diff options
author | Tim Newsome <tim@sifive.com> | 2021-02-11 11:27:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 11:27:18 -0800 |
commit | d57ab0b6321a024c3a83e0acb33eeab3b461b607 (patch) | |
tree | 103d0fbb3df9bceb89091985dc31bc43cde91488 /src | |
parent | 3b5ba4d1db0d8939d26388405e845ff03db0aedb (diff) | |
download | riscv-openocd-d57ab0b6321a024c3a83e0acb33eeab3b461b607.zip riscv-openocd-d57ab0b6321a024c3a83e0acb33eeab3b461b607.tar.gz riscv-openocd-d57ab0b6321a024c3a83e0acb33eeab3b461b607.tar.bz2 |
From upstream (#580)
* configure: do not make Capstone dependency automagic
This adds regular ./configure options to control dependency on the
Capstone disassembly engine. See [0] for the rationale.
[0] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
Change-Id: I3e16dc5255d650aa1949ccf896b26dc96e522a75
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/5985
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* configure.ac: fix build with libusb0 and without libusb1
Driver 'openjtag' requires both libftdi and libusb1.
The current check is incorrect and the driver is built when
libftdi is present with libusb0 and without libusb1, which causes
the linker to fail resolving the required libusb1 symbols.
Remove the check for libusb0 on driver 'openjtag'.
Create a new adapters group LIBFTDI_USB1_ADAPTERS to hold the
driver 'openjtag'.
Change-Id: I1f5e554b519e51c829d116ede894639cb55a26aa
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5989
Tested-by: jenkins
* doc: fix over/underfull hboxes in PDF
This adds some cosmetic changes to make the PDF User Manual look
proper.
Building it now requires Texinfo 5.0 which shouldn't be problematic
according to [0]. Commit 79fdeb37f486f74658f1eaf658abac8efb3eba6a is
effectively reverted.
[0] https://repology.org/project/texinfo/versions
Change-Id: I990bc23bdb53d24c302b26d74fd770ea738e4096
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/5995
Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* contrib: rpc_examples: haskell: fix ftbs with current libraries
And get rid of some warnings along the way.
Change-Id: I8fdbe1fa304276be6b0f25249b902b3576aa3793
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/5987
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* Makefile.am: fix override of target 'check-recursive'
To prevent executing the Jim Tcl tests, the makefile's target
'check-recursive' has been overridden in commit 56d163ce7951
("jimtcl: update to 0.77, the current version, enable only
specific modules").
This causes a runtime warning during build:
Makefile:6332: warning: overriding recipe for target 'check-recursive'
Makefile:5098: warning: ignoring old recipe for target 'check-recursive'
Instead of override the makefile's target 'check-recursive',
prevent the recursion by re-assigning as empty the variable
SUBDIRS for this specific target only.
Change-Id: I03d1c467eba42316a59aeed4612d6bdbe6211282
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 56d163ce7951 ("jimtcl: update to 0.77, the current version, enable only specific modules")
Reviewed-on: http://openocd.zylin.com/5986
Tested-by: jenkins
* contrib: udev file for Cypress SuperSpeed Explorer kit
lsusb output:
Bus 003 Device 011: ID 04b4:0007 Cypress Semiconductor Corp.
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x04b4 Cypress Semiconductor Corp.
idProduct 0x0007
bcdDevice 0.00
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 114
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 2 Abstract (modem)
bFunctionProtocol 1 AT-commands (v.25ter)
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x02
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 4
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 10
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 5
bInterfaceProtocol 0
iInterface 0
Change-Id: I62f0300199da3551c8774a4a5a4cd106a3ab2904
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-on: http://openocd.zylin.com/3611
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* target: fix memory leak on multiple '-gdb-port' flag
In the odd case of multiple flags '-gdb-port' during 'target
create' or following 'configure', the new strdup()'ed value will
replace the old one without freeing it.
Free the old value (if it exists) before replacing it.
Change-Id: I1673346613ce7023880046e3a9ba473e75f18b8a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6005
Tested-by: jenkins
* udev: fix permission for Ambiq Micro EVK's
Commit 68e204f1e91a ("udev: Add rules for Ambiq Micro EVK's.") was
initially proposed as http://openocd.zylin.com/3429/ then replaced
by http://openocd.zylin.com/3980/
The initial proposal was for file '99-openocd.rules', in which
MODE="664" was the norm.
After merge of http://openocd.zylin.com/2804/ the new udev rules
in '60-openocd.rules' switched to MODE="660", but the evolution of
the above patch missed this change.
Switch udev rules of Ambiq Micro EVK's to MODE="660" and uniform
them to the rest of the file.
Change-Id: I4b4eea535184ee8569da3264bff4f1fafb5bce4d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: 68e204f1e91a ("udev: Add rules for Ambiq Micro EVK's.")
Reviewed-on: http://openocd.zylin.com/6004
Tested-by: jenkins
* doc/style: fix doxygen error
Doxygen complains about non-closed nested comments:
doc/manual/style.txt:423: warning: Reached end of file
while still inside a (nested) comment. Nesting level 1
(probable line reference: 149)
This is caused by the string '/**' that is interpreted as the
beginning of a comment.
Escape the string to not let doxygen consider it as a comment
While there, replace @code/@endcode with @verbatim/@endverbatim to
properly render the line.
Change-Id: If2a27c4cf659326e317cc4ac8c0b313e97e40432
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5996
Tested-by: jenkins
* flash/nor/max32xxx: fix path of include file
The relative path should have three times '..'.
Issue identified by doxygen:
src/flash/nor/max32xxx.c:85: warning: include file
../../contrib/loaders/flash/max32xxx/max32xxx.inc not
found, perhaps you forgot to add its directory to
INCLUDE_PATH?
Change-Id: Ie7b4948c6770b8acb9eff26e08eea32945ebb219
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5997
Tested-by: jenkins
* Doxyfile.in: fix build out-of-tree
When doxygen is built out-of-tree, it fails to find the generated
file startup_tcl.inc:
src/openocd.c:59: warning: include file startup_tcl.inc
not found, perhaps you forgot to add its directory to
INCLUDE_PATH?
Add '@builddir@/src' to INCLUDE_PATH.
Change-Id: I51f2f6fe7224bba0f8b3db7219f9831de4e67139
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5998
Tested-by: jenkins
* doc/manual/primer/jtag.txt: remove duplicated section name
The section name 'primerjtag' is used twice, causing doxygen to
complain:
warning: multiple use of section label 'primerjtag',
(first occurrence: doc/manual/primer/jtag.txt, line 107)
Rename one of them.
Change-Id: Id307915dbc51a7f647fab4fb28ab431e65344d61
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5999
Tested-by: jenkins
* Doxyfile.in: exclude libjaylink from doxygen
When build using libjaylink as git submodule, doxygen includes the
libjaylink files and complains for multiple 'mainpage' comment
block, one in OpenOCD and the other in libjaylink:
src/jtag/drivers/libjaylink/libjaylink/core.c:37: warning:
found more than one \mainpage comment block! (first
occurrence: doc/manual/main.txt, line 1), Skipping current
block!
Exclude libjaylink submodule from doxygen.
Change-Id: I5e856817344c9f21f8c26f077a23c00b83cfbcb5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6000
Tested-by: jenkins
* openocd: fix incorrect doxygen comments
Use '@param' in front of function's parameters and '@a' when the
parameter is recalled in the description.
This fixes doxygen complains:
warning: Found unknown command '@buff16'
While there, fix a minor typo s/occured/occurred/ in a comment and
the typo s/@apram/@param/ in a doxygen comment.
Change-Id: I5cd86a80adef552331310a21c55ec5d11354be21
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6001
Tested-by: jenkins
* openocd: fix doxygen parameters of functions
Add to doxygen comment the missing parameters.
Remove from doxygen comment any non-existing parameter.
Fix the parameter names in doxygen comment to match the one in the
function prototype.
Where the parameter name in the doxygen description seems better
than the one in the code, change the code.
Escape the character '<' to prevent doxygen to interpret it as an
xml tag.
Change-Id: I22da723339ac7d7a7a64ac4c1cc4336e2416c2cc
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6002
Tested-by: jenkins
* doc/manual/primer/autotools.txt: fix doxygen warning
Commit ab90b8777855 ("configure: remove AM_MAINTAINER_MODE,
effectively always enabling all the rules") removes the configure
flag '--enable-maintainer-mode' and its documentation, but have
left a reference to the removed subsection 'primermaintainermode'
and this triggers a warning in doxygen:
doc/manual/primer/autotools.txt:21: warning: unable to
resolve reference to 'primermaintainermode' for \ref
command
Remove the obsoleted paragraph.
Change-Id: I56e69ef033d546d159745bed1b47c6105827e7ae
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: ab90b8777855 ("configure: remove AM_MAINTAINER_MODE, effectively always enabling all the rules")
Reviewed-on: http://openocd.zylin.com/6003
Tested-by: jenkins
* flash/stmqspi: fix build error with -Werror=maybe-uninitialized
using gcc 9.3 on ubuntu focal fossa with -Werror=maybe-uninitialized
we get this error:
/src/flash/nor/stmqspi.c: In function ‘read_flash_id’:
/src/flash/nor/stmqspi.c:1948:6: error: ‘retval’ may be used uninitialized
Change-Id: Ifd8ae60df847fc61e22ca100c008e3914c9af79b
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6012
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* target/riscv: fix build error with -Werror=maybe-uninitialized
using gcc 9.3 on ubuntu focal fossa with -Werror=maybe-uninitialized
we get this error:
/src/target/riscv/riscv.c: In function ‘riscv_address_translate’:
/src/target/riscv/riscv.c:1536:13: error: ‘pte’ may be used uninitialized
Change-Id: I51e180b43f9b6996e4e4058db49c179b9f81bcdc
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6013
Tested-by: jenkins
Reviewed-by: Tim Newsome <tim@sifive.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* cortex_m: [FIX] ARMv8-M does not support VECTRESET
ref: Arm®v8-M Architecture Reference Manual (DDI0553B.m)
D1.2.3: AIRCR, Application Interrupt and Reset Control Register
Bit [0] is RES0
Change-Id: I6ef451b2c114487e2732852a60e86c292ffa6a50
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6014
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* driver/ftdi: skip trst in swd mode
When using the adapter olimex arm-jtag-swd (to convert to SWD a
JTAG-only FTDI adapter), the pin trst on JTAG side is re-used to
control the direction of pin SWDIO on SWD side.
There is a single reset API at adapter driver to assert/deassert
either srst and/or trst. A request to assert/deassert srst can
cause also trst to change value, hanging the SWD communication.
In SWD mode, ignore the value passed to trst.
Change-Id: I5fe1eed851177d405d77ae6079da9642dc1a08f1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6006
Tested-by: jenkins
* configure.ac: drop macro 'AC_PROG_CC_C99' from autoconf 2.70
The macro AC_PROG_CC_C99 has been obsoleted by autoconf 2.70 and
triggers a set of warnings from both 'aclocal' and 'autoconf'.
The test of AC_PROG_CC_C99 is now included in AC_PROG_CC.
For autoconf 2.69 and earlier the macro is still required, so
cannot be simply dropped.
Use a conditional test to avoid the warning on autoconf 2.70 but
still use AC_PROG_CC_C99 on older autoconf.
Change-Id: I5e8437f5a826fb63be6d07bcb5bb824f94683020
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6009
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
* configure: drop macro 'AC_HEADER_TIME'
The macro AC_HEADER_TIME has been obsoleted by autoconf 2.70.
Not all systems provide 'sys/time.h', plus some old system didn't
allowed to include both 'time.h' and 'sys/time.h' because 'time.h'
was included by 'sys/time.h' and was not properly protected to
allow multiple inclusion.
The macro AC_HEADER_TIME helps to detect such odd case.
Nowadays all the systems properly protect 'time.h', so its safe to
unconditionally include 'time.h', even if it is also included by
'sys/time.h'.
The case of systems without 'sys/time.h' is already covered by
configure.ac through the directive
AC_CHECK_HEADERS([sys/time.h])
Remove the obsoleted autoconf macro and simplify the code by
including 'time.h' unconditionally and check HAVE_SYS_TIME_H to
include 'sys/time.h'.
Change-Id: Iddb3f3f1d90c22668b97f8e756e1b4f733367a7d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6010
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
* README.macOS: explain how to install suitable Texinfo
Change-Id: Ic5906111f412eebd906a9be3fd0e133484def3eb
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/6026
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* jlink: fix device discovery when network is off
If user specifies a serial number for the jlink device, openocd
extends the search to network jlink devices too, without checking
if the host has a valid and functional network connection. If the
network is not functional, libjaylink returns error. This error
invalidates the discovery on USB, even if it was successful.
Factor-out parts of the jlink_init into separate jlink_open_device
function, use that function to firstly discover and match USB
devices and, if matching device was not found on the USB bus and
serial number was specified, repeat discovery and matching via TCP.
Fixes: https://sourceforge.net/p/openocd/tickets/294/
Change-Id: Iea0de1640d4e5b21ecc7e9c1dd6d36f214d647c2
Signed-off-by: Bohdan Tymkiv <bohdan200@gmail.com>
Reviewed-on: http://openocd.zylin.com/6025
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
* README: add missing items for 0.11
JTAG adapters
Cadence DPI, Cypress Kitpro, FTDI FT232R, Linux GPIOD, Mellanox rshim,
Nuvoton Nu-Link, Nu-Link2, NXP IMX GPIO, Remote Bitbang, TI XDS110,
Xilinx XVC/PCIe
Debug targets
AArch64, Cortex-M (ARMv8-M), ARCv2, MIPS64, RISC-V, ST-STM8
Flash Drivers
ATmega128RFA1, Atmel SAM, eSi-RISC, EZR32HG, MAX32, MXC, nRF52, PSoC6,
Renesas RPC HF and SH QSPI, SiFive Freedom E, ST BlueNRG,
STM32 QUAD/OCTO-SPI for Flash/FRAM/EEPROM, SWM050, TI CC13xx, TI CC26xx,
TI CC32xx, TI MSP432, Winner Micro w600, Xilinx XCF
Change-Id: I341618ac5d7189e4f98268cecd66c99447b72af8
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Reviewed-on: http://openocd.zylin.com/6027
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
* The openocd-0.11.0-rc2 release candidate
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
* Restore +dev suffix
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
* steppenprobe: fix file permission
Commit 895d4a599585 ("tcl/interface/ftdi: Add Steppenprobe open
hardware interface") erroneously set the execution permission to
the configuration file.
Strip the execution permission.
Change-Id: I556451d5e6fee4aee385451e8c90216a25b6ef46
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Fixes: http://openocd.zylin.com/5653
Reviewed-on: http://openocd.zylin.com/6038
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: Paul Fertser <fercerpav@gmail.com>
* github: fix github wokflow while pushing a tag
this fix permits to add correctly the generated artifact (windows binaries)
into the release section.
Change-Id: Ia982370d3a1e08c623ebcabb5ac97e9fb49d00e0
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: http://openocd.zylin.com/6047
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* doc: Fix type in Hooking up the JTAG Adapter
We are talking about adapter connectivity in this chapter. It should
be "dongles" instead of "cables".
Change-Id: I7bd4307765517375caa2af86dfc929d0ef66c3e6
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Reviewed-on: http://openocd.zylin.com/6040
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
* doc/manual: Fix @subpage handling
The subpage "thelist" used to have a title "Pending and Open Tasks"
but the commit c41db358a0100ab changed it to "The List". With
@subpage, it now renders:
"The List of The List enumerates opportunities for"
instead of
"The List of Pending and Open Tasks enumerates opportunities for"
This commit fix it to
"The List enumerates opportunities for"
Change-Id: Ifee0dcd9b3c9f7e651a8748a7afda99eedea3c5c
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Reviewed-on: http://openocd.zylin.com/6041
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
* doc/manual: Fix function name typo
We have both the singular form, register_command(), and the plural form
register_commands().
Change-Id: I905ea83988b8ac70dd809b02d53b646aa4d66697
Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
Reviewed-on: http://openocd.zylin.com/6042
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Co-authored-by: Paul Fertser <fercerpav@gmail.com>
Co-authored-by: Antonio Borneo <borneo.antonio@gmail.com>
Co-authored-by: Jiri Kastner <cz172638@gmail.com>
Co-authored-by: Tarek BOCHKATI <tarek.bouchkati@st.com>
Co-authored-by: Bohdan Tymkiv <bohdan200@gmail.com>
Co-authored-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Co-authored-by: Yasushi SHOJI <yashi@spacecubics.com>
Diffstat (limited to 'src')
29 files changed, 324 insertions, 315 deletions
diff --git a/src/flash/nand/at91sam9.c b/src/flash/nand/at91sam9.c index 47c0505..234dd70 100644 --- a/src/flash/nand/at91sam9.c +++ b/src/flash/nand/at91sam9.c @@ -105,7 +105,7 @@ static int at91sam9_init(struct nand_device *nand) /** * Enable NAND device attached to a controller. * - * @param info NAND controller information for controlling NAND device. + * @param nand NAND controller information for controlling NAND device. * @return Success or failure of the enabling. */ static int at91sam9_enable(struct nand_device *nand) @@ -119,7 +119,7 @@ static int at91sam9_enable(struct nand_device *nand) /** * Disable NAND device attached to a controller. * - * @param info NAND controller information for controlling NAND device. + * @param nand NAND controller information for controlling NAND device. * @return Success or failure of the disabling. */ static int at91sam9_disable(struct nand_device *nand) diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c index 86abf70..d4326e4 100644 --- a/src/flash/nor/at91sam4.c +++ b/src/flash/nor/at91sam4.c @@ -1709,6 +1709,9 @@ static int FLASHD_EraseEntireBank(struct sam4_bank_private *pPrivate) /** * Erases the entire flash. * @param pPrivate - the info about the bank. + * @param firstPage + * @param numPages + * @param status */ static int FLASHD_ErasePages(struct sam4_bank_private *pPrivate, int firstPage, diff --git a/src/flash/nor/core.h b/src/flash/nor/core.h index 107a1c5..97a368e 100644 --- a/src/flash/nor/core.h +++ b/src/flash/nor/core.h @@ -276,7 +276,8 @@ struct flash_bank *get_flash_bank_by_num_noprobe(unsigned int num); * @param target The target, presumed to contain one or more banks. * @param addr An address that is within the range of the bank. * @param check return ERROR_OK and result_bank NULL if the bank does not exist - * @returns The struct flash_bank located at @a addr, or NULL. + * @param result_bank The struct flash_bank located at @a addr, or NULL. + * @returns ERROR_OK on success, or an error indicating the problem. */ int get_flash_bank_by_addr(struct target *target, target_addr_t addr, bool check, struct flash_bank **result_bank); diff --git a/src/flash/nor/dsp5680xx_flash.c b/src/flash/nor/dsp5680xx_flash.c index 6f1eccf..4902282 100644 --- a/src/flash/nor/dsp5680xx_flash.c +++ b/src/flash/nor/dsp5680xx_flash.c @@ -193,8 +193,8 @@ static int dsp5680xx_probe(struct flash_bank *bank) /** * The flash module (FM) on the dsp5680xx supports both individual sector * and mass erase of the flash memory. - * If this function is called with @first == @last == 0 or if @first is the - * first sector (#0) and @last is the last sector then the mass erase command + * If this function is called with @a first == @a last == 0 or if @a first is the + * first sector (#0) and @a last is the last sector then the mass erase command * is executed (much faster than erasing each sector individually). * * @param bank diff --git a/src/flash/nor/lpc2900.c b/src/flash/nor/lpc2900.c index 6596cde..4d3d7f7 100644 --- a/src/flash/nor/lpc2900.c +++ b/src/flash/nor/lpc2900.c @@ -453,8 +453,8 @@ static int lpc2900_write_index_page(struct flash_bank *bank, /** * Calculate FPTR.TR register value for desired program/erase time. * - * @param clock System clock in Hz - * @param time Program/erase time in µs + * @param clock_var System clock in Hz + * @param time_var Program/erase time in µs */ static uint32_t lpc2900_calc_tr(uint32_t clock_var, uint32_t time_var) { diff --git a/src/flash/nor/max32xxx.c b/src/flash/nor/max32xxx.c index 9a5e83f..586a73b 100644 --- a/src/flash/nor/max32xxx.c +++ b/src/flash/nor/max32xxx.c @@ -82,7 +82,7 @@ struct max32xxx_flash_bank { /* see contrib/loaders/flash/max32xxx/max32xxx.s for src */ static const uint8_t write_code[] = { -#include "../../contrib/loaders/flash/max32xxx/max32xxx.inc" +#include "../../../contrib/loaders/flash/max32xxx/max32xxx.inc" }; /* Config Command: flash bank name driver base size chip_width bus_width target [driver_option] diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index 931404e..9c834fd 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -873,7 +873,6 @@ exit: /** *********************************************************************************************** * @brief Performs Mass Erase operation - * @param bank flash bank index to erase * @return ERROR_OK in case of success, ERROR_XXX code otherwise *************************************************************************************************/ COMMAND_HANDLER(psoc6_handle_mass_erase_command) diff --git a/src/flash/nor/stmqspi.c b/src/flash/nor/stmqspi.c index f54e497..a013336 100644 --- a/src/flash/nor/stmqspi.c +++ b/src/flash/nor/stmqspi.c @@ -1945,7 +1945,7 @@ static int read_flash_id(struct flash_bank *bank, uint32_t *id1, uint32_t *id2) uint32_t io_base = stmqspi_info->io_base; uint8_t byte; unsigned int type, count, len1, len2; - int retval; + int retval = ERROR_OK; /* invalidate both ids */ *id1 = 0; diff --git a/src/helper/bits.h b/src/helper/bits.h index 464584d..cdcac9e 100644 --- a/src/helper/bits.h +++ b/src/helper/bits.h @@ -36,8 +36,8 @@ /** * bitmap_zero - Clears all the bits in memory - * @dst: the address of the bitmap - * @nbits: the number of bits to clear + * @param dst the address of the bitmap + * @param nbits the number of bits to clear */ static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) { @@ -47,8 +47,8 @@ static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) /** * clear_bit - Clear a bit in memory - * @nr: the bit to set - * @addr: the address to start counting from + * @param nr the bit to set + * @param addr the address to start counting from */ static inline void clear_bit(unsigned int nr, volatile unsigned long *addr) { @@ -60,8 +60,8 @@ static inline void clear_bit(unsigned int nr, volatile unsigned long *addr) /** * set_bit - Set a bit in memory - * @nr: the bit to set - * @addr: the address to start counting from + * @param nr the bit to set + * @param addr the address to start counting from */ static inline void set_bit(unsigned int nr, volatile unsigned long *addr) { @@ -73,8 +73,8 @@ static inline void set_bit(unsigned int nr, volatile unsigned long *addr) /** * test_bit - Determine whether a bit is set - * @nr: bit number to test - * @addr: Address to start counting from + * @param nr bit number to test + * @param addr Address to start counting from */ static inline int test_bit(unsigned int nr, const volatile unsigned long *addr) { diff --git a/src/helper/list.h b/src/helper/list.h index 6fd0e7c..7f60464 100644 --- a/src/helper/list.h +++ b/src/helper/list.h @@ -64,8 +64,8 @@ extern void __list_add(struct list_head *new, /** * list_add - add a new entry - * @new: new entry to be added - * @head: list head to add it after + * @param new new entry to be added + * @param head list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. @@ -78,8 +78,8 @@ static inline void list_add(struct list_head *new, struct list_head *head) /** * list_add_tail - add a new entry - * @new: new entry to be added - * @head: list head to add it before + * @param new new entry to be added + * @param head list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. @@ -104,7 +104,7 @@ static inline void __list_del(struct list_head *prev, struct list_head *next) /** * list_del - deletes entry from list. - * @entry: the element to delete from the list. + * @param entry the element to delete from the list. * Note: list_empty() on entry does not return true after this, the entry is * in an undefined state. */ @@ -127,10 +127,10 @@ extern void list_del(struct list_head *entry); /** * list_replace - replace old entry by new one - * @old : the element to be replaced - * @new : the new element to insert + * @param old the element to be replaced + * @param new the new element to insert * - * If @old was empty, it will be overwritten. + * If @a old was empty, it will be overwritten. */ static inline void list_replace(struct list_head *old, struct list_head *new) @@ -150,7 +150,7 @@ static inline void list_replace_init(struct list_head *old, /** * list_del_init - deletes entry from list and reinitialize it. - * @entry: the element to delete from the list. + * @param entry the element to delete from the list. */ static inline void list_del_init(struct list_head *entry) { @@ -160,8 +160,8 @@ static inline void list_del_init(struct list_head *entry) /** * list_move - delete from one list and add as another's head - * @list: the entry to move - * @head: the head that will precede our entry + * @param list the entry to move + * @param head the head that will precede our entry */ static inline void list_move(struct list_head *list, struct list_head *head) { @@ -171,8 +171,8 @@ static inline void list_move(struct list_head *list, struct list_head *head) /** * list_move_tail - delete from one list and add as another's tail - * @list: the entry to move - * @head: the head that will follow our entry + * @param list the entry to move + * @param head the head that will follow our entry */ static inline void list_move_tail(struct list_head *list, struct list_head *head) @@ -182,9 +182,9 @@ static inline void list_move_tail(struct list_head *list, } /** - * list_is_last - tests whether @list is the last entry in list @head - * @list: the entry to test - * @head: the head of the list + * list_is_last - tests whether @a list is the last entry in list @a head + * @param list the entry to test + * @param head the head of the list */ static inline int list_is_last(const struct list_head *list, const struct list_head *head) @@ -194,7 +194,7 @@ static inline int list_is_last(const struct list_head *list, /** * list_empty - tests whether a list is empty - * @head: the list to test. + * @param head the list to test. */ static inline int list_empty(const struct list_head *head) { @@ -203,7 +203,7 @@ static inline int list_empty(const struct list_head *head) /** * list_empty_careful - tests whether a list is empty and not being modified - * @head: the list to test + * @param head the list to test * * Description: * tests whether a list is empty _and_ checks that no other CPU might be @@ -222,7 +222,7 @@ static inline int list_empty_careful(const struct list_head *head) /** * list_rotate_left - rotate the list to the left - * @head: the head of the list + * @param head the head of the list */ static inline void list_rotate_left(struct list_head *head) { @@ -236,7 +236,7 @@ static inline void list_rotate_left(struct list_head *head) /** * list_is_singular - tests whether a list has just one entry. - * @head: the list to test. + * @param head the list to test. */ static inline int list_is_singular(const struct list_head *head) { @@ -257,14 +257,14 @@ static inline void __list_cut_position(struct list_head *list, /** * list_cut_position - cut a list into two - * @list: a new list to add all removed entries - * @head: a list with entries - * @entry: an entry within head, could be the head itself + * @param list a new list to add all removed entries + * @param head a list with entries + * @param entry an entry within head, could be the head itself * and if so we won't cut the list * - * This helper moves the initial part of @head, up to and - * including @entry, from @head to @list. You should - * pass on @entry an element you know is on @head. @list + * This helper moves the initial part of @a head, up to and + * including @a entry, from @a head to @a list. You should + * pass on @a entry an element you know is on @a head. @a list * should be an empty list or a list you do not care about * losing its data. * @@ -299,8 +299,8 @@ static inline void __list_splice(const struct list_head *list, /** * list_splice - join two lists, this is designed for stacks - * @list: the new list to add. - * @head: the place to add it in the first list. + * @param list the new list to add. + * @param head the place to add it in the first list. */ static inline void list_splice(const struct list_head *list, struct list_head *head) @@ -311,8 +311,8 @@ static inline void list_splice(const struct list_head *list, /** * list_splice_tail - join two lists, each list being a queue - * @list: the new list to add. - * @head: the place to add it in the first list. + * @param list the new list to add. + * @param head the place to add it in the first list. */ static inline void list_splice_tail(struct list_head *list, struct list_head *head) @@ -323,10 +323,10 @@ static inline void list_splice_tail(struct list_head *list, /** * list_splice_init - join two lists and reinitialise the emptied list. - * @list: the new list to add. - * @head: the place to add it in the first list. + * @param list the new list to add. + * @param head the place to add it in the first list. * - * The list at @list is reinitialised + * The list at @a list is reinitialised */ static inline void list_splice_init(struct list_head *list, struct list_head *head) @@ -339,11 +339,11 @@ static inline void list_splice_init(struct list_head *list, /** * list_splice_tail_init - join two lists and reinitialise the emptied list - * @list: the new list to add. - * @head: the place to add it in the first list. + * @param list the new list to add. + * @param head the place to add it in the first list. * * Each of the lists is a queue. - * The list at @list is reinitialised + * The list at @a list is reinitialised */ static inline void list_splice_tail_init(struct list_head *list, struct list_head *head) @@ -356,18 +356,18 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_entry - get the struct for this entry - * @ptr: the &struct list_head pointer. - * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. + * @param ptr the &struct list_head pointer. + * @param type the type of the struct this is embedded in. + * @param member the name of the list_struct within the struct. */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) /** * list_first_entry - get the first element from a list - * @ptr: the list head to take the element from. - * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. + * @param ptr the list head to take the element from. + * @param type the type of the struct this is embedded in. + * @param member the name of the list_struct within the struct. * * Note, that list is expected to be not empty. */ @@ -376,8 +376,8 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop cursor. - * @head: the head for your list. + * @param pos the &struct list_head to use as a loop cursor. + * @param head the head for your list. */ #define list_for_each(pos, head) \ for (pos = (head)->next; prefetch(pos->next), pos != (head); \ @@ -385,8 +385,8 @@ static inline void list_splice_tail_init(struct list_head *list, /** * __list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop cursor. - * @head: the head for your list. + * @param pos the &struct list_head to use as a loop cursor. + * @param head the head for your list. * * This variant differs from list_for_each() in that it's the * simplest possible list iteration code, no prefetching is done. @@ -398,8 +398,8 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_prev - iterate over a list backwards - * @pos: the &struct list_head to use as a loop cursor. - * @head: the head for your list. + * @param pos the &struct list_head to use as a loop cursor. + * @param head the head for your list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ @@ -407,9 +407,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_safe - iterate over a list safe against removal of list entry - * @pos: the &struct list_head to use as a loop cursor. - * @n: another &struct list_head to use as temporary storage - * @head: the head for your list. + * @param pos the &struct list_head to use as a loop cursor. + * @param n another &struct list_head to use as temporary storage + * @param head the head for your list. */ #define list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ @@ -417,9 +417,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry - * @pos: the &struct list_head to use as a loop cursor. - * @n: another &struct list_head to use as temporary storage - * @head: the head for your list. + * @param pos the &struct list_head to use as a loop cursor. + * @param n another &struct list_head to use as temporary storage + * @param head the head for your list. */ #define list_for_each_prev_safe(pos, n, head) \ for (pos = (head)->prev, n = pos->prev; \ @@ -428,9 +428,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry - iterate over list of given type - * @pos: the type * to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ @@ -439,9 +439,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_reverse - iterate backwards over list of given type. - * @pos: the type * to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the list_struct within the struct. */ #define list_for_each_entry_reverse(pos, head, member) \ for (pos = list_entry((head)->prev, typeof(*pos), member); \ @@ -450,9 +450,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() - * @pos: the type * to use as a start point - * @head: the head of the list - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a start point + * @param head the head of the list + * @param member the name of the list_struct within the struct. * * Prepares a pos entry for use as a start point in list_for_each_entry_continue(). */ @@ -461,9 +461,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_continue - continue iteration over list of given type - * @pos: the type * to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Continue to iterate over list of given type, continuing after * the current position. @@ -475,9 +475,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_continue_reverse - iterate backwards from the given point - * @pos: the type * to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Start to iterate over list of given type backwards, continuing after * the current position. @@ -489,9 +489,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_from - iterate over list of given type from the current point - * @pos: the type * to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Iterate over list of given type, continuing from current position. */ @@ -501,10 +501,10 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param n another type * to use as temporary storage + * @param head the head for your list. + * @param member the name of the list_struct within the struct. */ #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ @@ -514,10 +514,10 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_safe_continue - continue list iteration safe against removal - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param n another type * to use as temporary storage + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Iterate over list of given type, continuing after current point, * safe against removal of list entry. @@ -530,10 +530,10 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_safe_from - iterate over list from current point safe against removal - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param n another type * to use as temporary storage + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Iterate over list of given type from current point, safe against * removal of list entry. @@ -545,10 +545,10 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal - * @pos: the type * to use as a loop cursor. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. + * @param pos the type * to use as a loop cursor. + * @param n another type * to use as temporary storage + * @param head the head for your list. + * @param member the name of the list_struct within the struct. * * Iterate backwards over list of given type, safe against removal * of list entry. @@ -561,9 +561,9 @@ static inline void list_splice_tail_init(struct list_head *list, /** * list_safe_reset_next - reset a stale list_for_each_entry_safe loop - * @pos: the loop cursor used in the list_for_each_entry_safe loop - * @n: temporary storage used in list_for_each_entry_safe - * @member: the name of the list_struct within the struct. + * @param pos the loop cursor used in the list_for_each_entry_safe loop + * @param n temporary storage used in list_for_each_entry_safe + * @param member the name of the list_struct within the struct. * * list_safe_reset_next is not safe to use in general if the list may be * modified concurrently (eg. the lock is dropped in the loop body). An @@ -686,10 +686,10 @@ static inline void hlist_move_list(struct hlist_head *old, /** * hlist_for_each_entry - iterate over list of given type - * @tpos: the type * to use as a loop cursor. - * @pos: the &struct hlist_node to use as a loop cursor. - * @head: the head for your list. - * @member: the name of the hlist_node within the struct. + * @param tpos the type * to use as a loop cursor. + * @param pos the &struct hlist_node to use as a loop cursor. + * @param head the head for your list. + * @param member the name of the hlist_node within the struct. */ #define hlist_for_each_entry(tpos, pos, head, member) \ for (pos = (head)->first; \ @@ -699,9 +699,9 @@ static inline void hlist_move_list(struct hlist_head *old, /** * hlist_for_each_entry_continue - iterate over a hlist continuing after current point - * @tpos: the type * to use as a loop cursor. - * @pos: the &struct hlist_node to use as a loop cursor. - * @member: the name of the hlist_node within the struct. + * @param tpos the type * to use as a loop cursor. + * @param pos the &struct hlist_node to use as a loop cursor. + * @param member the name of the hlist_node within the struct. */ #define hlist_for_each_entry_continue(tpos, pos, member) \ for (pos = (pos)->next; \ @@ -711,9 +711,9 @@ static inline void hlist_move_list(struct hlist_head *old, /** * hlist_for_each_entry_from - iterate over a hlist continuing from current point - * @tpos: the type * to use as a loop cursor. - * @pos: the &struct hlist_node to use as a loop cursor. - * @member: the name of the hlist_node within the struct. + * @param tpos the type * to use as a loop cursor. + * @param pos the &struct hlist_node to use as a loop cursor. + * @param member the name of the hlist_node within the struct. */ #define hlist_for_each_entry_from(tpos, pos, member) \ for (; pos && ({ prefetch(pos->next); 1; }) && \ @@ -722,11 +722,11 @@ static inline void hlist_move_list(struct hlist_head *old, /** * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry - * @tpos: the type * to use as a loop cursor. - * @pos: the &struct hlist_node to use as a loop cursor. - * @n: another &struct hlist_node to use as temporary storage - * @head: the head for your list. - * @member: the name of the hlist_node within the struct. + * @param tpos the type * to use as a loop cursor. + * @param pos the &struct hlist_node to use as a loop cursor. + * @param n another &struct hlist_node to use as temporary storage + * @param head the head for your list. + * @param member the name of the hlist_node within the struct. */ #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ for (pos = (head)->first; \ diff --git a/src/helper/system.h b/src/helper/system.h index 97b3443..1aaca3b 100644 --- a/src/helper/system.h +++ b/src/helper/system.h @@ -28,19 +28,11 @@ #include <assert.h> #include <ctype.h> #include <errno.h> +#include <time.h> -/* +++ AC_HEADER_TIME +++ */ -#ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -#else -# ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> #endif -/* --- AC_HEADER_TIME --- */ /* +++ platform specific headers +++ */ #ifdef _WIN32 diff --git a/src/helper/time_support.h b/src/helper/time_support.h index 7abbdb2..a9f2dff 100644 --- a/src/helper/time_support.h +++ b/src/helper/time_support.h @@ -25,15 +25,10 @@ #ifndef OPENOCD_HELPER_TIME_SUPPORT_H #define OPENOCD_HELPER_TIME_SUPPORT_H -#ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -#else -# ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif +#include <time.h> + +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> #endif int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y); diff --git a/src/jtag/drivers/OpenULINK/src/jtag.c b/src/jtag/drivers/OpenULINK/src/jtag.c index ecf98a0..c76f034 100644 --- a/src/jtag/drivers/OpenULINK/src/jtag.c +++ b/src/jtag/drivers/OpenULINK/src/jtag.c @@ -48,6 +48,7 @@ uint8_t delay_tms; * Maximum achievable TCK frequency is 182 kHz for ULINK clocked at 24 MHz. * * @param out_offset offset in OUT2BUF where payload data starts + * @param in_offset */ void jtag_scan_in(uint8_t out_offset, uint8_t in_offset) { @@ -125,6 +126,7 @@ void jtag_scan_in(uint8_t out_offset, uint8_t in_offset) * Maximum achievable TCK frequency is 113 kHz for ULINK clocked at 24 MHz. * * @param out_offset offset in OUT2BUF where payload data starts + * @param in_offset */ void jtag_slow_scan_in(uint8_t out_offset, uint8_t in_offset) { @@ -373,6 +375,7 @@ void jtag_slow_scan_out(uint8_t out_offset) * Maximum achievable TCK frequency is 100 kHz for ULINK clocked at 24 MHz. * * @param out_offset offset in OUT2BUF where payload data starts + * @param in_offset */ void jtag_scan_io(uint8_t out_offset, uint8_t in_offset) { @@ -465,6 +468,7 @@ void jtag_scan_io(uint8_t out_offset, uint8_t in_offset) * Maximum achievable TCK frequency is 78 kHz for ULINK clocked at 24 MHz. * * @param out_offset offset in OUT2BUF where payload data starts + * @param in_offset */ void jtag_slow_scan_io(uint8_t out_offset, uint8_t in_offset) { diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index a92f166..11d46f2 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -589,17 +589,19 @@ static int ftdi_reset(int trst, int srst) LOG_DEBUG_IO("reset trst: %i srst %i", trst, srst); - if (trst == 1) { - if (sig_ntrst) - ftdi_set_signal(sig_ntrst, '0'); - else - LOG_ERROR("Can't assert TRST: nTRST signal is not defined"); - } else if (sig_ntrst && jtag_get_reset_config() & RESET_HAS_TRST && - trst == 0) { - if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) - ftdi_set_signal(sig_ntrst, 'z'); - else - ftdi_set_signal(sig_ntrst, '1'); + if (!swd_mode) { + if (trst == 1) { + if (sig_ntrst) + ftdi_set_signal(sig_ntrst, '0'); + else + LOG_ERROR("Can't assert TRST: nTRST signal is not defined"); + } else if (sig_ntrst && jtag_get_reset_config() & RESET_HAS_TRST && + trst == 0) { + if (jtag_get_reset_config() & RESET_TRST_OPEN_DRAIN) + ftdi_set_signal(sig_ntrst, 'z'); + else + ftdi_set_signal(sig_ntrst, '1'); + } } if (srst == 1) { @@ -1417,7 +1419,6 @@ static void ftdi_swd_swdio_en(bool enable) /** * Flush the MPSSE queue and process the SWD transaction queue - * @param dap * @return */ static int ftdi_swd_run_queue(void) diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index b915707..15d252c 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -553,59 +553,17 @@ static bool jlink_usb_location_equal(struct jaylink_device *dev) } -static int jlink_init(void) +static int jlink_open_device(uint32_t ifaces, bool *found_device) { - int ret; - struct jaylink_device **devs; - unsigned int i; - bool found_device; - uint32_t tmp; - char *firmware_version; - struct jaylink_hardware_version hwver; - struct jaylink_hardware_status hwstatus; - enum jaylink_usb_address address; - size_t length; - size_t num_devices; - uint32_t host_interfaces; - - LOG_DEBUG("Using libjaylink %s (compiled with %s).", - jaylink_version_package_get_string(), JAYLINK_VERSION_PACKAGE_STRING); - - if (!jaylink_library_has_cap(JAYLINK_CAP_HIF_USB) && use_usb_address) { - LOG_ERROR("J-Link driver does not support USB devices."); - return ERROR_JTAG_INIT_FAILED; - } - - ret = jaylink_init(&jayctx); - + int ret = jaylink_discovery_scan(jayctx, ifaces); if (ret != JAYLINK_OK) { - LOG_ERROR("jaylink_init() failed: %s.", jaylink_strerror(ret)); - return ERROR_JTAG_INIT_FAILED; - } - - ret = jaylink_log_set_callback(jayctx, &jaylink_log_handler, NULL); - - if (ret != JAYLINK_OK) { - LOG_ERROR("jaylink_log_set_callback() failed: %s.", - jaylink_strerror(ret)); - jaylink_exit(jayctx); - return ERROR_JTAG_INIT_FAILED; - } - - host_interfaces = JAYLINK_HIF_USB; - - if (use_serial_number) - host_interfaces |= JAYLINK_HIF_TCP; - - ret = jaylink_discovery_scan(jayctx, host_interfaces); - - if (ret != JAYLINK_OK) { - LOG_ERROR("jaylink_discovery_scan() failed: %s.", - jaylink_strerror(ret)); + LOG_ERROR("jaylink_discovery_scan() failed: %s.", jaylink_strerror(ret)); jaylink_exit(jayctx); return ERROR_JTAG_INIT_FAILED; } + size_t num_devices; + struct jaylink_device **devs; ret = jaylink_get_devices(jayctx, &devs, &num_devices); if (ret != JAYLINK_OK) { @@ -623,12 +581,13 @@ static int jlink_init(void) return ERROR_JTAG_INIT_FAILED; } - found_device = false; + *found_device = false; - for (i = 0; devs[i]; i++) { + for (size_t i = 0; devs[i]; i++) { struct jaylink_device *dev = devs[i]; if (use_serial_number) { + uint32_t tmp; ret = jaylink_device_get_serial_number(dev, &tmp); if (ret == JAYLINK_ERR_NOT_AVAILABLE) { @@ -644,6 +603,7 @@ static int jlink_init(void) } if (use_usb_address) { + enum jaylink_usb_address address; ret = jaylink_device_get_usb_address(dev, &address); if (ret == JAYLINK_ERR_NOT_SUPPORTED) { @@ -664,7 +624,7 @@ static int jlink_init(void) ret = jaylink_open(dev, &devh); if (ret == JAYLINK_OK) { - found_device = true; + *found_device = true; break; } @@ -672,6 +632,52 @@ static int jlink_init(void) } jaylink_free_devices(devs, true); + return ERROR_OK; +} + + +static int jlink_init(void) +{ + int ret; + char *firmware_version; + struct jaylink_hardware_version hwver; + struct jaylink_hardware_status hwstatus; + size_t length; + + LOG_DEBUG("Using libjaylink %s (compiled with %s).", + jaylink_version_package_get_string(), JAYLINK_VERSION_PACKAGE_STRING); + + if (!jaylink_library_has_cap(JAYLINK_CAP_HIF_USB) && use_usb_address) { + LOG_ERROR("J-Link driver does not support USB devices."); + return ERROR_JTAG_INIT_FAILED; + } + + ret = jaylink_init(&jayctx); + + if (ret != JAYLINK_OK) { + LOG_ERROR("jaylink_init() failed: %s.", jaylink_strerror(ret)); + return ERROR_JTAG_INIT_FAILED; + } + + ret = jaylink_log_set_callback(jayctx, &jaylink_log_handler, NULL); + + if (ret != JAYLINK_OK) { + LOG_ERROR("jaylink_log_set_callback() failed: %s.", + jaylink_strerror(ret)); + jaylink_exit(jayctx); + return ERROR_JTAG_INIT_FAILED; + } + + bool found_device; + ret = jlink_open_device(JAYLINK_HIF_USB, &found_device); + if (ret != ERROR_OK) + return ret; + + if (!found_device && use_serial_number) { + ret = jlink_open_device(JAYLINK_HIF_TCP, &found_device); + if (ret != ERROR_OK) + return ret; + } if (!found_device) { LOG_ERROR("No J-Link device found."); diff --git a/src/jtag/drivers/jtag_dpi.c b/src/jtag/drivers/jtag_dpi.c index 575c6bc..7cac200 100644 --- a/src/jtag/drivers/jtag_dpi.c +++ b/src/jtag/drivers/jtag_dpi.c @@ -79,8 +79,8 @@ static int read_sock(char *buf, size_t len) /** * jtag_dpi_reset - ask to reset the JTAG device - * @trst: 1 if TRST is to be asserted - * @srst: 1 if SRST is to be asserted + * @param trst 1 if TRST is to be asserted + * @param srst 1 if SRST is to be asserted */ static int jtag_dpi_reset(int trst, int srst) { @@ -109,11 +109,11 @@ static int jtag_dpi_reset(int trst, int srst) /** * jtag_dpi_scan - launches a DR-scan or IR-scan - * @cmd: the command to launch + * @param cmd the command to launch * * Launch a JTAG IR-scan or DR-scan * - * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occured. + * Returns ERROR_OK if OK, ERROR_xxx if a read/write error occurred. */ static int jtag_dpi_scan(struct scan_command *cmd) { diff --git a/src/jtag/drivers/jtag_vpi.c b/src/jtag/drivers/jtag_vpi.c index 32a43f8..c5ffe83 100644 --- a/src/jtag/drivers/jtag_vpi.c +++ b/src/jtag/drivers/jtag_vpi.c @@ -208,8 +208,8 @@ static int jtag_vpi_receive_cmd(struct vpi_cmd *vpi) /** * jtag_vpi_reset - ask to reset the JTAG device - * @trst: 1 if TRST is to be asserted - * @srst: 1 if SRST is to be asserted + * @param trst 1 if TRST is to be asserted + * @param srst 1 if SRST is to be asserted */ static int jtag_vpi_reset(int trst, int srst) { @@ -223,12 +223,12 @@ static int jtag_vpi_reset(int trst, int srst) /** * jtag_vpi_tms_seq - ask a TMS sequence transition to JTAG - * @bits: TMS bits to be written (bit0, bit1 .. bitN) - * @nb_bits: number of TMS bits (between 1 and 8) + * @param bits TMS bits to be written (bit0, bit1 .. bitN) + * @param nb_bits number of TMS bits (between 1 and 8) * * Write a series of TMS transitions, where each transition consists in : - * - writing out TCK=0, TMS=<new_state>, TDI=<???> - * - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition + * - writing out TCK=0, TMS=\<new_state>, TDI=\<???> + * - writing out TCK=1, TMS=\<new_state>, TDI=\<???> which triggers the transition * The function ensures that at the end of the sequence, the clock (TCK) is put * low. */ @@ -250,11 +250,11 @@ static int jtag_vpi_tms_seq(const uint8_t *bits, int nb_bits) /** * jtag_vpi_path_move - ask a TMS sequence transition to JTAG - * @cmd: path transition + * @param cmd path transition * * Write a series of TMS transitions, where each transition consists in : - * - writing out TCK=0, TMS=<new_state>, TDI=<???> - * - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition + * - writing out TCK=0, TMS=\<new_state>, TDI=\<???> + * - writing out TCK=1, TMS=\<new_state>, TDI=\<???> which triggers the transition * The function ensures that at the end of the sequence, the clock (TCK) is put * low. */ @@ -276,7 +276,7 @@ static int jtag_vpi_path_move(struct pathmove_command *cmd) /** * jtag_vpi_tms - ask a tms command - * @cmd: tms command + * @param cmd tms command */ static int jtag_vpi_tms(struct tms_command *cmd) { @@ -342,8 +342,9 @@ static int jtag_vpi_queue_tdi_xfer(uint8_t *bits, int nb_bits, int tap_shift) /** * jtag_vpi_queue_tdi - short description - * @bits: bits to be queued on TDI (or NULL if 0 are to be queued) - * @nb_bits: number of bits + * @param bits bits to be queued on TDI (or NULL if 0 are to be queued) + * @param nb_bits number of bits + * @param tap_shift */ static int jtag_vpi_queue_tdi(uint8_t *bits, int nb_bits, int tap_shift) { @@ -372,7 +373,7 @@ static int jtag_vpi_queue_tdi(uint8_t *bits, int nb_bits, int tap_shift) /** * jtag_vpi_clock_tms - clock a TMS transition - * @tms: the TMS to be sent + * @param tms the TMS to be sent * * Triggers a TMS transition (ie. one JTAG TAP state move). */ @@ -386,7 +387,7 @@ static int jtag_vpi_clock_tms(int tms) /** * jtag_vpi_scan - launches a DR-scan or IR-scan - * @cmd: the command to launch + * @param cmd the command to launch * * Launch a JTAG IR-scan or DR-scan * diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index f473ce3..ccc023f 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -696,6 +696,7 @@ static int ulink_append_queue(struct ulink *device, struct ulink_cmd *ulink_cmd) * Sends all queued OpenULINK commands to the ULINK for execution. * * @param device pointer to struct ulink identifying ULINK driver instance. + * @param timeout * @return on success: ERROR_OK * @return on failure: ERROR_FAIL */ @@ -1682,6 +1683,7 @@ static int ulink_queue_runtest(struct ulink *device, struct jtag_command *cmd) /** * Execute a JTAG_RESET command * + * @param device * @param cmd pointer to the command that shall be executed. * @return on success: ERROR_OK * @return on failure: ERROR_FAIL diff --git a/src/jtag/drivers/usb_blaster/usb_blaster.c b/src/jtag/drivers/usb_blaster/usb_blaster.c index de3b5d5..5002a5f 100644 --- a/src/jtag/drivers/usb_blaster/usb_blaster.c +++ b/src/jtag/drivers/usb_blaster/usb_blaster.c @@ -253,7 +253,7 @@ static void ublast_flush_buffer(void) /** * ublast_queue_byte - queue one 'bitbang mode' byte for USB Blaster - * @abyte: the byte to queue + * @param abyte the byte to queue * * Queues one byte in 'bitbang mode' to the USB Blaster. The byte is not * actually sent, but stored in a buffer. The write is performed once @@ -271,7 +271,7 @@ static void ublast_queue_byte(uint8_t abyte) /** * ublast_compute_pin - compute if gpio should be asserted - * @steer: control (ie. TRST driven, SRST driven, of fixed) + * @param steer control (ie. TRST driven, SRST driven, of fixed) * * Returns pin value (1 means driven high, 0 mean driven low) */ @@ -293,7 +293,7 @@ static bool ublast_compute_pin(enum gpio_steer steer) /** * ublast_build_out - build bitbang mode output byte - * @type: says if reading back TDO is required + * @param type says if reading back TDO is required * * Returns the compute bitbang mode byte */ @@ -313,8 +313,8 @@ static uint8_t ublast_build_out(enum scan_type type) /** * ublast_reset - reset the JTAG device is possible - * @trst: 1 if TRST is to be asserted - * @srst: 1 if SRST is to be asserted + * @param trst 1 if TRST is to be asserted + * @param srst 1 if SRST is to be asserted */ static void ublast_reset(int trst, int srst) { @@ -329,7 +329,7 @@ static void ublast_reset(int trst, int srst) /** * ublast_clock_tms - clock a TMS transition - * @tms: the TMS to be sent + * @param tms the TMS to be sent * * Triggers a TMS transition (ie. one JTAG TAP state move). */ @@ -360,12 +360,12 @@ static void ublast_idle_clock(void) /** * ublast_clock_tdi - Output a TDI with bitbang mode - * @tdi: the TDI bit to be shifted out - * @type: scan type (ie. does a readback of TDO is required) + * @param tdi the TDI bit to be shifted out + * @param type scan type (ie. does a readback of TDO is required) * * Output a TDI bit and assert clock to push it into the JTAG device : - * - writing out TCK=0, TMS=<old_state>=0, TDI=<tdi> - * - writing out TCK=1, TMS=<new_state>, TDI=<tdi> which triggers the JTAG + * - writing out TCK=0, TMS=\<old_state>=0, TDI=\<tdi> + * - writing out TCK=1, TMS=\<new_state>, TDI=\<tdi> which triggers the JTAG * device acquiring the data. * * If a TDO is to be read back, the required read is requested (bitbang mode), @@ -387,8 +387,8 @@ static void ublast_clock_tdi(int tdi, enum scan_type type) /** * ublast_clock_tdi_flip_tms - Output a TDI with bitbang mode, change JTAG state - * @tdi: the TDI bit to be shifted out - * @type: scan type (ie. does a readback of TDO is required) + * @param tdi the TDI bit to be shifted out + * @param type scan type (ie. does a readback of TDO is required) * * This function is the same as ublast_clock_tdi(), but it changes also the TMS * while output the TDI. This should be the last TDI output of a TDI @@ -416,8 +416,8 @@ static void ublast_clock_tdi_flip_tms(int tdi, enum scan_type type) /** * ublast_queue_bytes - queue bytes for the USB Blaster - * @bytes: byte array - * @nb_bytes: number of bytes + * @param bytes byte array + * @param nb_bytes number of bytes * * Queues bytes to be sent to the USB Blaster. The bytes are not * actually sent, but stored in a buffer. The write is performed once @@ -443,13 +443,13 @@ static void ublast_queue_bytes(uint8_t *bytes, int nb_bytes) /** * ublast_tms_seq - write a TMS sequence transition to JTAG - * @bits: TMS bits to be written (bit0, bit1 .. bitN) - * @nb_bits: number of TMS bits (between 1 and 8) - * @skip: number of TMS bits to skip at the beginning of the series + * @param bits TMS bits to be written (bit0, bit1 .. bitN) + * @param nb_bits number of TMS bits (between 1 and 8) + * @param skip number of TMS bits to skip at the beginning of the series * * Write a series of TMS transitions, where each transition consists in : - * - writing out TCK=0, TMS=<new_state>, TDI=<???> - * - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition + * - writing out TCK=0, TMS=\<new_state>, TDI=\<???> + * - writing out TCK=1, TMS=\<new_state>, TDI=\<???> which triggers the transition * The function ensures that at the end of the sequence, the clock (TCK) is put * low. */ @@ -465,7 +465,7 @@ static void ublast_tms_seq(const uint8_t *bits, int nb_bits, int skip) /** * ublast_tms - write a tms command - * @cmd: tms command + * @param cmd tms command */ static void ublast_tms(struct tms_command *cmd) { @@ -475,11 +475,11 @@ static void ublast_tms(struct tms_command *cmd) /** * ublast_path_move - write a TMS sequence transition to JTAG - * @cmd: path transition + * @param cmd path transition * * Write a series of TMS transitions, where each transition consists in : - * - writing out TCK=0, TMS=<new_state>, TDI=<???> - * - writing out TCK=1, TMS=<new_state>, TDI=<???> which triggers the transition + * - writing out TCK=0, TMS=\<new_state>, TDI=\<???> + * - writing out TCK=1, TMS=\<new_state>, TDI=\<???> which triggers the transition * The function ensures that at the end of the sequence, the clock (TCK) is put * low. */ @@ -501,8 +501,8 @@ static void ublast_path_move(struct pathmove_command *cmd) /** * ublast_state_move - move JTAG state to the target state - * @state: the target state - * @skip: number of bits to skip at the beginning of the path + * @param state the target state + * @param skip number of bits to skip at the beginning of the path * * Input the correct TMS sequence to the JTAG TAP so that we end up in the * target state. This assumes the current state (tap_get_state()) is correct. @@ -524,8 +524,8 @@ static void ublast_state_move(tap_state_t state, int skip) /** * ublast_read_byteshifted_tdos - read TDO of byteshift writes - * @buf: the buffer to store the bits - * @nb_bits: the number of bits + * @param buf the buffer to store the bits + * @param nb_bytes the number of bytes * * Reads back from USB Blaster TDO bits, triggered by a 'byteshift write', ie. eight * bits per received byte from USB interface, and store them in buffer. @@ -552,8 +552,8 @@ static int ublast_read_byteshifted_tdos(uint8_t *buf, int nb_bytes) /** * ublast_read_bitbang_tdos - read TDO of bitbang writes - * @buf: the buffer to store the bits - * @nb_bits: the number of bits + * @param buf the buffer to store the bits + * @param nb_bits the number of bits * * Reads back from USB Blaster TDO bits, triggered by a 'bitbang write', ie. one * bit per received byte from USB interface, and store them in buffer, where : @@ -592,9 +592,9 @@ static int ublast_read_bitbang_tdos(uint8_t *buf, int nb_bits) /** * ublast_queue_tdi - short description - * @bits: bits to be queued on TDI (or NULL if 0 are to be queued) - * @nb_bits: number of bits - * @scan: scan type (ie. if TDO read back is required or not) + * @param bits bits to be queued on TDI (or NULL if 0 are to be queued) + * @param nb_bits number of bits + * @param scan scan type (ie. if TDO read back is required or not) * * Outputs a series of TDI bits on TDI. * As a side effect, the last TDI bit is sent along a TMS=1, and triggers a JTAG @@ -703,7 +703,7 @@ static void ublast_stableclocks(int cycles) /** * ublast_scan - launches a DR-scan or IR-scan - * @cmd: the command to launch + * @param cmd the command to launch * * Launch a JTAG IR-scan or DR-scan * diff --git a/src/rtt/rtt.h b/src/rtt/rtt.h index 597c838..bc21bd0 100644 --- a/src/rtt/rtt.h +++ b/src/rtt/rtt.h @@ -237,7 +237,7 @@ const struct rtt_control *rtt_get_control(void); * Read channel information. * * @param[in] channel_index Channel index. - * @param[in] channel_type Channel type. + * @param[in] type Channel type. * @param[out] info Channel information. * * @returns ERROR_OK on success, an error code on failure. diff --git a/src/target/arc.c b/src/target/arc.c index ffe9745..8e56845 100644 --- a/src/target/arc.c +++ b/src/target/arc.c @@ -924,6 +924,7 @@ exit: * Finds an actionpoint that triggered last actionpoint event, as specified by * DEBUG.ASR. * + * @param target * @param actionpoint Pointer to be set to last active actionpoint. Pointer * will be set to NULL if DEBUG.AH is 0. */ diff --git a/src/target/arc_jtag.c b/src/target/arc_jtag.c index fd77b37..ca1a096 100644 --- a/src/target/arc_jtag.c +++ b/src/target/arc_jtag.c @@ -237,7 +237,7 @@ static void arc_jtag_enque_register_rw(struct arc_jtag *jtag_info, uint32_t *add * @param type Type of registers to write: core or aux. * @param addr Array of registers numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ static int arc_jtag_write_registers(struct arc_jtag *jtag_info, uint32_t type, uint32_t *addr, uint32_t count, const uint32_t *buffer) @@ -272,7 +272,7 @@ static int arc_jtag_write_registers(struct arc_jtag *jtag_info, uint32_t type, * @param type Type of registers to read: core or aux. * @param addr Array of registers numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ static int arc_jtag_read_registers(struct arc_jtag *jtag_info, uint32_t type, uint32_t *addr, uint32_t count, uint32_t *buffer) @@ -337,7 +337,7 @@ int arc_jtag_write_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr, * @param jtag_info * @param addr Array of registers numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ int arc_jtag_write_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer) @@ -361,7 +361,7 @@ int arc_jtag_read_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr, * @param jtag_info * @param addr Array of core register numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ int arc_jtag_read_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer) @@ -385,7 +385,7 @@ int arc_jtag_write_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, * @param jtag_info * @param addr Array of registers numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ int arc_jtag_write_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer) @@ -409,7 +409,7 @@ int arc_jtag_read_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, * @param jtag_info * @param addr Array of AUX register numbers. * @param count Amount of registers in arrays. - * @param values Array of register values. + * @param buffer Array of register values. */ int arc_jtag_read_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer) diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 59bb186..8f5ad59 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -450,7 +450,7 @@ static int mem_ap_write(struct adiv5_ap *ap, const uint8_t *buffer, uint32_t siz * @param buffer The data buffer to receive the data. No particular alignment is assumed. * @param size Which access size to use, in bytes. 1, 2 or 4. * @param count The number of reads to do (in size units, not bytes). - * @param address Address to be read; it must be readable by the currently selected MEM-AP. + * @param adr Address to be read; it must be readable by the currently selected MEM-AP. * @param addrinc Whether the target address should be increased after each read or not. This * should normally be true, except when reading from e.g. a FIFO. * @return ERROR_OK on success, otherwise an error code. diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index ac308b4..ce2c426 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2011,8 +2011,8 @@ int cortex_m_examine(struct target *target) } LOG_DEBUG("cpuid: 0x%8.8" PRIx32 "", cpuid); - /* VECTRESET is not supported on Cortex-M0, M0+ and M1 */ - cortex_m->vectreset_supported = i > 1; + /* VECTRESET is supported only on ARMv7-M cores */ + cortex_m->vectreset_supported = !armv7m->arm.is_armv8m && !armv7m->arm.is_armv6m; if (i == 4) { target_read_u32(target, MVFR0, &mvfr0); diff --git a/src/target/dsp5680xx.c b/src/target/dsp5680xx.c index ee26d24..62844ea 100644 --- a/src/target/dsp5680xx.c +++ b/src/target/dsp5680xx.c @@ -117,7 +117,7 @@ static int dsp5680xx_drscan(struct target *target, uint8_t *d_in, * @param target * @param d_in This is the data that will be shifted into the JTAG IR reg. * @param d_out The data that will be shifted out of the JTAG IR reg will be stored here. - * @apram ir_len Length of the data to be shifted to JTAG IR. + * @param ir_len Length of the data to be shifted to JTAG IR. * */ static int dsp5680xx_irscan(struct target *target, uint32_t *d_in, @@ -1070,8 +1070,8 @@ static int dsp5680xx_resume(struct target *target, int current, } /** - * The value of @address determines if it corresponds to P: (program) or X: (dat) memory. - * If the address is over 0x200000 then it is considered X: memory, and @pmem = 0. + * The value of @a address determines if it corresponds to P: (program) or X: (dat) memory. + * If the address is over 0x200000 then it is considered X: memory, and @a pmem = 0. * The special case of 0xFFXXXX is not modified, since it allows to read out the * memory mapped EOnCE registers. * @@ -1405,32 +1405,26 @@ static int dsp5680xx_write_32(struct target *t, uint32_t a, uint32_t c, } /** - * Writes @buffer to memory. - * The parameter @address determines whether @buffer should be written to + * Writes @a buffer to memory. + * The parameter @a address determines whether @a buffer should be written to * P: (program) memory or X: (dat) memory. * * @param target - * @param address + * @param a address * @param size Bytes (1), Half words (2), Words (4). * @param count In bytes. - * @param buffer + * @param b buffer * * @return */ -static int dsp5680xx_write(struct target *t, target_addr_t a, uint32_t s, uint32_t c, +static int dsp5680xx_write(struct target *target, target_addr_t a, uint32_t size, uint32_t count, const uint8_t *b) { /* TODO Cannot write 32bit to odd address, will write 0x12345678 as 0x5678 0x0012 */ - struct target *target = t; - uint32_t address = a; - uint32_t count = c; - uint8_t const *buffer = b; - uint32_t size = s; - check_halt_and_debug(target); int retval = 0; @@ -1479,12 +1473,12 @@ static int dsp5680xx_write_buffer(struct target *t, target_addr_t a, uint32_t si * * @return */ -static int dsp5680xx_read_buffer(struct target *t, target_addr_t a, uint32_t size, - uint8_t *buf) +static int dsp5680xx_read_buffer(struct target *target, target_addr_t address, uint32_t size, + uint8_t *buffer) { - check_halt_and_debug(t); + check_halt_and_debug(target); /* The "/2" solves the byte/word addressing issue.*/ - return dsp5680xx_read(t, a, 2, size / 2, buf); + return dsp5680xx_read(target, address, 2, size / 2, buffer); } /** @@ -1499,19 +1493,19 @@ static int dsp5680xx_read_buffer(struct target *t, target_addr_t a, uint32_t siz * * @return */ -static int dsp5680xx_checksum_memory(struct target *t, target_addr_t a, uint32_t s, +static int dsp5680xx_checksum_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t *checksum) { return ERROR_FAIL; } /** - * Calculates a signature over @word_count words in the data from @buff16. - * The algorithm used is the same the FM uses, so the @return may be used to compare + * Calculates a signature over @a word_count words in the data from @a buff8. + * The algorithm used is the same the FM uses, so the @a return may be used to compare * with the one generated by the FM module, and check if flashing was successful. * This algorithm is based on the perl script available from the Freescale website at FAQ 25630. * - * @param buff16 + * @param buff8 * @param word_count * * @return @@ -1606,32 +1600,21 @@ int dsp5680xx_f_protect_check(struct target *target, uint16_t *protected) /** * Executes a command on the FM module. - * Some commands use the parameters @address and @data, others ignore them. + * Some commands use the parameters @a address and @a data, others ignore them. * * @param target - * @param command Command to execute. + * @param c Command to execute. * @param address Command parameter. * @param data Command parameter. * @param hfm_ustat FM status register. - * @param pmem Address is P: (program) memory (@pmem == 1) or X: (dat) memory (@pmem == 0) + * @param pmem Address is P: (program) memory (@a pmem == 1) or X: (dat) memory (@a pmem == 0) * * @return */ -static int dsp5680xx_f_ex(struct target *t, uint16_t c, uint32_t a, uint32_t d, - uint16_t *h, int p) +static int dsp5680xx_f_ex(struct target *target, uint16_t c, uint32_t address, uint32_t data, + uint16_t *hfm_ustat, int pmem) { - struct target *target = t; - uint32_t command = c; - - uint32_t address = a; - - uint32_t data = d; - - uint16_t *hfm_ustat = h; - - int pmem = p; - int retval; retval = core_load_TX_RX_high_addr_to_r0(target); @@ -1787,9 +1770,9 @@ static int set_fm_ck_div(struct target *target) /** * Executes the FM calculate signature command. The FM will calculate over the - * data from @address to @address + @words -1. The result is written to a - * register, then read out by this function and returned in @signature. The - * value @signature may be compared to the one returned by perl_crc to + * data from @a address to @a address + @a words -1. The result is written to a + * register, then read out by this function and returned in @a signature. The + * value @a signature may be compared to the one returned by perl_crc to * verify the flash was written correctly. * * @param target @@ -1799,13 +1782,9 @@ static int set_fm_ck_div(struct target *target) * * @return */ -static int dsp5680xx_f_signature(struct target *t, uint32_t a, uint32_t words, +static int dsp5680xx_f_signature(struct target *target, uint32_t address, uint32_t words, uint16_t *signature) { - struct target *target = t; - - uint32_t address = a; - int retval; uint16_t hfm_ustat; diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 87aff06..3fa9fff 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -550,13 +550,15 @@ static dmi_status_t dmi_scan(struct target *target, uint32_t *address_in, } /** + * @param target * @param data_in The data we received from the target. - * @param dmi_op The operation to perform (read/write/nop). * @param dmi_busy_encountered * If non-NULL, will be updated to reflect whether DMI busy was * encountered while executing this operation or not. + * @param dmi_op The operation to perform (read/write/nop). * @param address The address argument to that operation. * @param data_out The data to send to the target. + * @param timeout_sec * @param exec When true, this scan will execute something, so extra RTI * cycles may be added. * @param ensure_success diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 7542a91..ef05118 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1511,7 +1511,7 @@ static int riscv_address_translate(struct target *target, uint64_t ppn_value; target_addr_t table_address; const virt2phys_info_t *info; - uint64_t pte; + uint64_t pte = 0; int i; int result = riscv_get_register(target, &satp_value, GDB_REGNO_SATP); diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c index 9650556..61a69d1 100644 --- a/src/target/semihosting_common.c +++ b/src/target/semihosting_common.c @@ -89,6 +89,8 @@ extern int gdb_actual_connections; * Initialize common semihosting support. * * @param target Pointer to the target to initialize. + * @param setup + * @param post_result * @return An error status if there is a problem during initialization. */ int semihosting_common_init(struct target *target, void *setup, diff --git a/src/target/target.c b/src/target/target.c index 4ea6aca..86178a0 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -803,6 +803,13 @@ static int target_soft_reset_halt(struct target *target) * algorithm. * * @param target used to run the algorithm + * @param num_mem_params + * @param mem_params + * @param num_reg_params + * @param reg_param + * @param entry_point + * @param exit_point + * @param timeout_ms * @param arch_info target-specific description of the algorithm. */ int target_run_algorithm(struct target *target, @@ -838,6 +845,12 @@ done: * Executes a target-specific native code algorithm and leaves it running. * * @param target used to run the algorithm + * @param num_mem_params + * @param mem_params + * @param num_reg_params + * @param reg_params + * @param entry_point + * @param exit_point * @param arch_info target-specific description of the algorithm. */ int target_start_algorithm(struct target *target, @@ -876,6 +889,12 @@ done: * Waits for an algorithm started with target_start_algorithm() to complete. * * @param target used to run the algorithm + * @param num_mem_params + * @param mem_params + * @param num_reg_params + * @param reg_params + * @param exit_point + * @param timeout_ms * @param arch_info target-specific description of the algorithm. */ int target_wait_algorithm(struct target *target, @@ -947,6 +966,7 @@ done: * @param entry_point address on the target to execute to start the algorithm * @param exit_point address at which to set a breakpoint to catch the * end of the algorithm; can be 0 if target triggers a breakpoint itself + * @param arch_info */ int target_run_flash_async_algorithm(struct target *target, @@ -5155,6 +5175,7 @@ no_params: e = Jim_GetOpt_String(goi, &s, NULL); if (e != JIM_OK) return e; + free(target->gdb_port_override); target->gdb_port_override = strdup(s); } else { if (goi->argc != 0) |