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 79fdeb37f4 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 56d163ce79
("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: 56d163ce79 ("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 68e204f1e9 ("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: 68e204f1e9 ("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 ab90b87778 ("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: ab90b87778 ("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 895d4a5995 ("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 c41db358a0 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>
This commit is contained in:
Tim Newsome 2021-02-11 11:27:18 -08:00 committed by GitHub
parent 3b5ba4d1db
commit d57ab0b632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 507 additions and 459 deletions

View File

@ -600,7 +600,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
EXCLUDE = @srcdir@/src/jtag/drivers/libjaylink
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
@ -1234,7 +1234,7 @@ SEARCH_INCLUDES = YES
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
INCLUDE_PATH = @builddir@/src
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the

View File

@ -6,8 +6,7 @@ AUTOMAKE_OPTIONS = gnu 1.6
DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
# do not run Jim Tcl tests (esp. during distcheck)
check-recursive:
@true
check-recursive: SUBDIRS :=
nobase_dist_pkgdata_DATA = \
contrib/libdcc/dcc_stdio.c \
@ -49,7 +48,7 @@ EXTRA_DIST += \
HACKING \
NEWTAPS \
README.Windows \
README.OSX \
README.macOS \
$(EXTRA_DIST_NEWS) \
Doxyfile.in \
tools/logger.pl \

2
NEWS
View File

@ -227,7 +227,7 @@ This release also contains a number of other important functional and
cosmetic bugfixes. For more details about what has changed since the
last release, see the git repository history:
http://sourceforge.net/p/openocd/code/ci/v0.11.0-rc1/log/?path=
http://sourceforge.net/p/openocd/code/ci/v0.11.0-rc2/log/?path=
For older NEWS, see the NEWS files associated with each release

48
README
View File

@ -101,34 +101,40 @@ Supported hardware
JTAG adapters
-------------
AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432,
BCM2835, Bus Blaster, Buspirate, Chameleon, CMSIS-DAP, Cortino, DENX,
Digilent JTAG-SMT2, DLC 5, DLP-USB1232H, embedded projects, eStick,
FlashLINK, FlossJTAG, Flyswatter, Flyswatter2, Gateworks, Hoegl, ICDI,
ICEBear, J-Link, JTAG VPI, JTAGkey, JTAGkey2, JTAG-lock-pick, KT-Link,
Lisa/L, LPC1768-Stick, MiniModule, NGX, NXHX, OOCDLink, Opendous,
OpenJTAG, Openmoko, OpenRD, OSBDM, Presto, Redbee, RLink, SheevaPlug
devkit, Stellaris evkits, ST-LINK (SWO tracing supported),
STM32-PerformanceStick, STR9-comStick, sysfsgpio, TUMPA, Turtelizer,
ULINK, USB-A9260, USB-Blaster, USB-JTAG, USBprog, VPACLink, VSLLink,
Wiggler, XDS100v2, Xverve.
AICE, ARM-JTAG-EW, ARM-USB-OCD, ARM-USB-TINY, AT91RM9200, axm0432, BCM2835,
Bus Blaster, Buspirate, Cadence DPI, Chameleon, CMSIS-DAP, Cortino,
Cypress KitProg, DENX, Digilent JTAG-SMT2, DLC 5, DLP-USB1232H,
embedded projects, eStick, FlashLINK, FlossJTAG, Flyswatter, Flyswatter2,
FTDI FT232R, Gateworks, Hoegl, ICDI, ICEBear, J-Link, JTAG VPI, JTAGkey,
JTAGkey2, JTAG-lock-pick, KT-Link, Linux GPIOD, Lisa/L, LPC1768-Stick,
Mellanox rshim, MiniModule, NGX, Nuvoton Nu-Link, Nu-Link2, NXHX, NXP IMX GPIO,
OOCDLink, Opendous, OpenJTAG, Openmoko, OpenRD, OSBDM, Presto, Redbee,
Remote Bitbang, RLink, SheevaPlug devkit, Stellaris evkits,
ST-LINK (SWO tracing supported), STM32-PerformanceStick, STR9-comStick,
sysfsgpio, TI XDS110, TUMPA, Turtelizer, ULINK, USB-A9260, USB-Blaster,
USB-JTAG, USBprog, VPACLink, VSLLink, Wiggler, XDS100v2, Xilinx XVC/PCIe,
Xverve.
Debug targets
-------------
ARM11, ARM7, ARM9, AVR32, Cortex-A, Cortex-R, Cortex-M, LS102x-SAP,
Feroceon/Dragonite, DSP563xx, DSP5680xx, EnSilica eSi-RISC, FA526, MIPS
EJTAG, NDS32, RISC-V, XScale, Intel Quark.
ARM: AArch64, ARM11, ARM7, ARM9, Cortex-A/R (v7-A/R), Cortex-M (ARMv{6/7/8}-M),
FA526, Feroceon/Dragonite, XScale.
ARCv2, AVR32, DSP563xx, DSP5680xx, EnSilica eSi-RISC, EJTAG (MIPS32, MIPS64),
Intel Quark, LS102x-SAP, NDS32, RISC-V, ST STM8.
Flash drivers
-------------
ADUC702x, AT91SAM, ATH79, AVR, CFI, DSP5680xx, EFM32, EM357, eSi-TSMC, FM3,
FM4, Freedom E SPI, GD32VF103, Kinetis, LPC8xx/LPC1xxx/LPC2xxx/LPC541xx,
LPC2900, LPCSPIFI, Marvell QSPI, Milandr, NIIET, NuMicro, PIC32mx, PSoC4,
PSoC5LP, SiM3x, Stellaris, STM32, STMSMI, STR7x, STR9x, nRF51; NAND controllers
of AT91SAM9, LPC3180, LPC32xx, i.MX31, MXC, NUC910, Orion/Kirkwood, S3C24xx,
S3C6400, XMC1xxx, XMC4xxx.
ADUC702x, AT91SAM, AT91SAM9 (NAND), ATH79, ATmega128RFA1, Atmel SAM, AVR, CFI,
DSP5680xx, EFM32, EM357, eSi-RISC, eSi-TSMC, EZR32HG, FM3, FM4, Freedom E SPI,
i.MX31, Kinetis, LPC8xx/LPC1xxx/LPC2xxx/LPC541xx, LPC2900, LPC3180, LPC32xx,
LPCSPIFI, Marvell QSPI, MAX32, Milandr, MXC, NIIET, nRF51, nRF52 , NuMicro,
NUC910, Orion/Kirkwood, PIC32mx, PSoC4/5LP/6, Renesas RPC HF and SH QSPI,
S3C24xx, S3C6400, SiM3x, SiFive Freedom E, Stellaris, ST BlueNRG, STM32,
STM32 QUAD/OCTO-SPI for Flash/FRAM/EEPROM, STMSMI, STR7x, STR9x, SWM050,
TI CC13xx, TI CC26xx, TI CC32xx, TI MSP432, Winner Micro w600, Xilinx XCF,
XMC1xxx, XMC4xxx.
==================
@ -216,7 +222,7 @@ Additionally, for building from git:
- autoconf >= 2.64
- automake >= 1.14
- texinfo
- texinfo >= 5.0
USB-based adapters depend on libusb-1.0 and some older drivers require
libusb-0.1 or libusb-compat-0.1. A compatible implementation, such as

View File

@ -1,10 +1,10 @@
Building OpenOCD for OSX
------------------------
Building OpenOCD for macOS
--------------------------
There are a few prerequisites you will need first:
- Xcode 5 (install from the AppStore)
- Command Line Tools (install from Xcode 5 -> Preferences -> Downloads)
- Xcode (install from the AppStore)
- Command Line Tools (install from Xcode -> Preferences -> Downloads)
- Gentoo Prefix (http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap.xml)
or
- Homebrew (http://mxcl.github.io/homebrew/)
@ -12,6 +12,11 @@ There are a few prerequisites you will need first:
- MacPorts (http://www.macports.org/install.php)
If you're building manually you need Texinfo version 5.0 or later. The
simplest way to get it is to use Homebrew (brew install texinfo) and
then ``export PATH=/usr/local/opt/texinfo/bin:$PATH``.
With Gentoo Prefix you can build the release version or the latest
devel version (-9999) the usual way described in the Gentoo
documentation. Alternatively, install the prerequisites and build

View File

@ -1,5 +1,5 @@
AC_PREREQ(2.64)
AC_INIT([openocd], [0.11.0-rc1+dev],
AC_INIT([openocd], [0.11.0-rc2+dev],
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
AC_CONFIG_SRCDIR([src/openocd.c])
AC_CONFIG_AUX_DIR([.])
@ -25,7 +25,8 @@ AH_BOTTOM([
AC_LANG([C])
AC_PROG_CC
AC_PROG_CC_C99
# autoconf 2.70 obsoletes AC_PROG_CC_C99 and includes it in AC_PROG_CC
m4_version_prereq([2.70],[],[AC_PROG_CC_C99])
AM_PROG_CC_C_O
AC_PROG_RANLIB
PKG_PROG_PKG_CONFIG([0.23])
@ -80,7 +81,6 @@ AC_CHECK_HEADERS([arpa/inet.h ifaddrs.h netinet/in.h netinet/tcp.h net/if.h], []
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_C_BIGENDIAN
@ -139,8 +139,10 @@ m4_define([HIDAPI_USB1_ADAPTERS],
m4_define([LIBFTDI_ADAPTERS],
[[[usb_blaster], [Altera USB-Blaster Compatible], [USB_BLASTER]],
[[presto], [ASIX Presto Adapter], [PRESTO]],
[[openjtag], [OpenJTAG Adapter], [OPENJTAG]]])
[[presto], [ASIX Presto Adapter], [PRESTO]]])
m4_define([LIBFTDI_USB1_ADAPTERS],
[[[openjtag], [OpenJTAG Adapter], [OPENJTAG]]])
m4_define([LIBGPIOD_ADAPTERS],
[[[linuxgpiod], [Linux GPIO bitbang through libgpiod], [LINUXGPIOD]]])
@ -151,6 +153,8 @@ m4_define([LIBJAYLINK_ADAPTERS],
m4_define([PCIE_ADAPTERS],
[[[xlnx_pcie_xvc], [Xilinx XVC/PCIe], [XLNX_PCIE_XVC]]])
m4_define([OPTIONAL_LIBRARIES],
[[[capstone], [Use Capstone disassembly framework], []]])
AC_ARG_ENABLE([doxygen-html],
AS_HELP_STRING([--disable-doxygen-html],
@ -249,6 +253,7 @@ AC_ARG_ADAPTERS([
HIDAPI_ADAPTERS,
HIDAPI_USB1_ADAPTERS,
LIBFTDI_ADAPTERS,
LIBFTDI_USB1_ADAPTERS
LIBGPIOD_ADAPTERS,
LIBJAYLINK_ADAPTERS
],[auto])
@ -654,13 +659,24 @@ PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no])
PKG_CHECK_MODULES([CAPSTONE], [capstone], [have_capstone=yes],
[have_capstone=no])
AS_IF([test "x$have_capstone" = "xyes"], [
AC_DEFINE([HAVE_CAPSTONE], [1], [1 if you have captone disassembly framework.])
AC_ARG_WITH([capstone],
AS_HELP_STRING([--with-capstone], [Use Capstone disassembly library (default=auto)])
, [
enable_capstone=$withval
], [
AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have captone disassembly framework.])
enable_capstone=auto
])
AS_IF([test "x$enable_capstone" != xno], [
PKG_CHECK_MODULES([CAPSTONE], [capstone], [
AC_DEFINE([HAVE_CAPSTONE], [1], [1 if you have Capstone disassembly framework.])
], [
AC_DEFINE([HAVE_CAPSTONE], [0], [0 if you don't have Capstone disassembly framework.])
if test "x$enable_capstone" != xauto; then
AC_MSG_ERROR([--with-capstone was given, but test for Capstone failed])
fi
enable_capstone=no
])
])
for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
@ -711,16 +727,10 @@ PROCESS_ADAPTERS([USB0_ADAPTERS], ["x$use_libusb0" = "xyes"], [libusb-0.1])
PROCESS_ADAPTERS([HIDAPI_ADAPTERS], ["x$use_hidapi" = "xyes"], [hidapi])
PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libusb1" = "xyes"], [hidapi and libusb-1.x])
PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi])
PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x])
PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [libgpiod])
PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2])
AS_IF([test "x$build_openjtag" = "xyes"], [
AS_IF([test "x$use_libusb1" != "xyes" -a "x$use_libusb0" != "xyes"], [
AC_MSG_ERROR([libusb-1.x or libusb-0.1 is required for the OpenJTAG Programmer])
build_openjtag=no
])
])
AS_IF([test "x$enable_linuxgpiod" != "xno"], [
build_bitbang=yes
])
@ -786,7 +796,7 @@ AM_CONDITIONAL([USE_LIBGPIOD], [test "x$use_libgpiod" = "xyes"])
AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"])
AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"])
AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"])
AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$have_capstone" = "xyes"])
AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
AM_CONDITIONAL([MINIDRIVER], [test "x$build_minidriver" = "xyes"])
AM_CONDITIONAL([MINIDRIVER_DUMMY], [test "x$build_minidriver_dummy" = "xyes"])
@ -856,8 +866,10 @@ echo OpenOCD configuration summary
echo --------------------------------------------------
m4_foreach([adapter], [USB1_ADAPTERS, USB0_ADAPTERS,
HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS,
LIBFTDI_USB1_ADAPTERS,
LIBGPIOD_ADAPTERS,
LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS],
LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS,
OPTIONAL_LIBRARIES],
[s=m4_format(["%-40s"], ADAPTER_DESC([adapter]))
AS_CASE([$ADAPTER_VAR([adapter])],
[auto], [

View File

@ -81,6 +81,9 @@ ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374e", MODE="660", GROUP="plugdev",
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374f", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3753", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Cypress SuperSpeed Explorer Kit
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="0007", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Cypress KitProg in KitProg mode
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f139", MODE="660", GROUP="plugdev", TAG+="uaccess"
@ -158,9 +161,9 @@ ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="02a5", MODE="660", GROUP="plugdev",
ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00ff", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Ambiq Micro EVK and Debug boards.
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="664", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Marvell Sheevaplug
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"

View File

@ -16,13 +16,11 @@
module Main where
import Prelude
import Control.Applicative
import Network.Socket
import System.IO.Streams.Core hiding (connect)
import System.IO.Streams.Network
import System.IO.Streams.Attoparsec
import Data.Attoparsec.ByteString.Char8
import Data.Attoparsec.Combinator
import Data.ByteString.Char8 hiding (putStrLn, concat, map)
import Text.Printf
@ -38,15 +36,14 @@ mdwParser = (manyTill anyChar (string ": ") *>
`sepBy` string " \n"
ocdMdw :: (InputStream ByteString, OutputStream ByteString) -> Integer -> Integer -> IO [Integer]
ocdMdw s start count = do
s <- ocdExec s $ "mdw " ++ show start ++ " " ++ show count
case parseOnly mdwParser (pack s) of
ocdMdw s start qnt = do
res <- ocdExec s $ "mdw " ++ show start ++ " " ++ show qnt
case parseOnly mdwParser (pack res) of
Right r -> return $ concat r
main = do
osock <- socket AF_INET Stream defaultProtocol
haddr <- inet_addr "127.0.0.1"
connect osock (SockAddrInet 6666 haddr)
connect osock (SockAddrInet 6666 $ tupleToHostAddress (127,0,0,1))
ostreams <- socketToStreams osock
putStrLn "Halting the target, full log output captured:"
ocdExec ostreams "capture \"halt\"" >>= putStrLn

View File

@ -89,7 +89,7 @@ mode(s) of execution, and strings that provide usage and help text.
A single handler may be registered using multiple names, but any name
may have only one handler associated with it.
The @c register_commands() and @c register_commands() functions provide
The @c register_command() and @c register_commands() functions provide
registration, while the @c unregister_command() and
@c unregister_all_commands() functions will remove existing commands.
These may be called at any time, allowing the command set to change in

View File

@ -9,7 +9,7 @@ and processes that have been developed by and for the OpenOCD community.
Developers that want to contribute to OpenOCD should read the following
sections before starting work:
- The List of @subpage thelist enumerates opportunities for improving or
- @subpage thelist enumerates opportunities for improving or
extending the OpenOCD platform. If your ideas are on The List, you might
check the mailing list archives to find the status of your feature (or bug).
- The @subpage styleguide provides rules that developers should

View File

@ -15,9 +15,6 @@ autotools in the correct sequence.
When run after a fresh checkout, this script generates the build files
required to compile the project, producing the project configure script.
After running @c configure, the @ref primermaintainermode settings will
handle most situations that require running these tools again. In some
cases, a fresh bootstrap may be still required.
@subsection primerbootstrapcures Problems Solved By Bootstrap

View File

@ -104,7 +104,7 @@ target chips and work out what the various instruction registers/data
registers do, so you can actually do something useful. That's where it
gets interesting. But in and of itself, JTAG is actually very simple.
@section primerjtag More Reading
@section primerjtagmore More Reading
A separate primer contains information about @subpage primerjtagbs for
developers that want to extend OpenOCD for such purposes.

View File

@ -186,9 +186,9 @@ comments.
"empty" lines should be removed from the block.
-# Only single spaces should be used; do @b not add mid-line indentation.
-# If the total line length will be less than 72-80 columns, then
- The @c /**< form can be used on the same line.
- The @c /\**< form can be used on the same line.
- This style should be used sparingly; the best use is for fields:
@code int field; /**< field description */ @endcode
@verbatim int field; /**< field description */ @endverbatim
@section styledoxyall Doxygen Style Guide

View File

@ -834,7 +834,7 @@ using Eclipse or some other GUI.
Today's most common case is a dongle with a JTAG cable on one side
(such as a ribbon cable with a 10-pin or 20-pin IDC connector)
and a USB cable on the other.
Instead of USB, some cables use Ethernet;
Instead of USB, some dongles use Ethernet;
older ones may use a PC parallel port, or even a serial port.
@enumerate
@ -4547,8 +4547,10 @@ The current implementation supports three JTAG TAP cores:
@end itemize
And two debug interfaces cores:
@itemize @minus
@item @code{Advanced debug interface} (See: @url{http://opencores.org/project@comma{}adv_debug_sys})
@item @code{SoC Debug Interface} (See: @url{http://opencores.org/project@comma{}dbg_interface})
@item @code{Advanced debug interface}
@*(See: @url{http://opencores.org/project@comma{}adv_debug_sys})
@item @code{SoC Debug Interface}
@*(See: @url{http://opencores.org/project@comma{}dbg_interface})
@end itemize
@item @code{quark_d20xx} -- an Intel Quark D20xx core.
@item @code{quark_x10xx} -- an Intel Quark X10xx core.
@ -5616,8 +5618,10 @@ is attempted. If this fails or gives inappropriate results, manual setting is
required (see 'set' command).
@example
flash bank $_FLASHNAME stmqspi 0x90000000 0 0 0 $_TARGETNAME 0xA0001000
flash bank $_FLASHNAME stmqspi 0x70000000 0 0 0 $_TARGETNAME 0xA0001400
flash bank $_FLASHNAME stmqspi 0x90000000 0 0 0 \
$_TARGETNAME 0xA0001000
flash bank $_FLASHNAME stmqspi 0x70000000 0 0 0 \
$_TARGETNAME 0xA0001400
@end example
There are three specific commands
@ -5655,11 +5659,13 @@ Note the hardware dictated subtle difference of those two cases in dual-flash mo
To check basic communication settings, issue
@example
stmqspi cmd bank_id 0 0x04; stmqspi cmd bank_id 1 0x05; stmqspi cmd bank_id 0 0x06; stmqspi cmd bank_id 1 0x05
stmqspi cmd bank_id 0 0x04; stmqspi cmd bank_id 1 0x05
stmqspi cmd bank_id 0 0x06; stmqspi cmd bank_id 1 0x05
@end example
for single flash mode or
@example
stmqspi cmd bank_id 0 0x04; stmqspi cmd bank_id 2 0x05; stmqspi cmd bank_id 0 0x06; stmqspi cmd bank_id 2 0x05
stmqspi cmd bank_id 0 0x04; stmqspi cmd bank_id 2 0x05
stmqspi cmd bank_id 0 0x06; stmqspi cmd bank_id 2 0x05
@end example
for dual flash mode. This should return the status register contents.
@ -5717,9 +5723,9 @@ CS1/CS2 is routed to on the given SoC.
@example
flash bank $_FLASHNAME ath79 0xbf000000 0 0 0 $_TARGETNAME
# When using multiple chipselects the base should be different for each,
# otherwise the write_image command is not able to distinguish the
# banks.
# When using multiple chipselects the base should be different
# for each, otherwise the write_image command is not able to
# distinguish the banks.
flash bank flash0 ath79 0xbf000000 0 0 0 $_TARGETNAME cs0
flash bank flash1 ath79 0x10000000 0 0 0 $_TARGETNAME cs1
flash bank flash2 ath79 0x20000000 0 0 0 $_TARGETNAME cs2
@ -5880,7 +5886,8 @@ reserved-bits are masked out and cannot be changed.
NVMUSERROW: 0xFFFFFC5DD8E0C788
# Write 0xFFFFFC5DD8E0C788 to user row
>at91samd nvmuserrow 0xFFFFFC5DD8E0C788
# Write 0x12300 to user row but leave other bits and low byte unchanged
# Write 0x12300 to user row but leave other bits and low
# byte unchanged
>at91samd nvmuserrow 0x12345 0xFFF00
@end example
@end deffn
@ -6028,8 +6035,9 @@ The reserved fields are always masked out and cannot be changed.
USER PAGE: 0xAEECFF80FE9A9239
# Write
>atsame5 userpage 0xAEECFF80FE9A9239
# Write 2 to SEESBLK and 4 to SEEPSZ fields but leave other bits unchanged
# (setup SmartEEPROM of virtual size 8192 bytes)
# Write 2 to SEESBLK and 4 to SEEPSZ fields but leave other
# bits unchanged (setup SmartEEPROM of virtual size 8192
# bytes)
>atsame5 userpage 0x4200000000 0x7f00000000
@end example
@end deffn
@ -6788,7 +6796,8 @@ The driver probes for a number of these chips and autoconfigures itself,
apart from the base address.
@example
flash bank $_CHIPNAME.eeprom psoc5lp_eeprom 0x40008000 0 0 0 $_TARGETNAME
flash bank $_CHIPNAME.eeprom psoc5lp_eeprom 0x40008000 0 0 0 \
$_TARGETNAME
@end example
@end deffn
@ -6842,19 +6851,31 @@ automatically by parsing data in SPCIF_GEOMETRY register.
PSoC6 is equipped with NOR Flash so erased Flash reads as 0x00.
@example
flash bank main_flash_cm0 psoc6 0x10000000 0 0 0 $@{TARGET@}.cm0
flash bank work_flash_cm0 psoc6 0x14000000 0 0 0 $@{TARGET@}.cm0
flash bank super_flash_user_cm0 psoc6 0x16000800 0 0 0 $@{TARGET@}.cm0
flash bank super_flash_nar_cm0 psoc6 0x16001A00 0 0 0 $@{TARGET@}.cm0
flash bank super_flash_key_cm0 psoc6 0x16005A00 0 0 0 $@{TARGET@}.cm0
flash bank super_flash_toc2_cm0 psoc6 0x16007C00 0 0 0 $@{TARGET@}.cm0
flash bank main_flash_cm0 psoc6 0x10000000 0 0 0 \
$@{TARGET@}.cm0
flash bank work_flash_cm0 psoc6 0x14000000 0 0 0 \
$@{TARGET@}.cm0
flash bank super_flash_user_cm0 psoc6 0x16000800 0 0 0 \
$@{TARGET@}.cm0
flash bank super_flash_nar_cm0 psoc6 0x16001A00 0 0 0 \
$@{TARGET@}.cm0
flash bank super_flash_key_cm0 psoc6 0x16005A00 0 0 0 \
$@{TARGET@}.cm0
flash bank super_flash_toc2_cm0 psoc6 0x16007C00 0 0 0 \
$@{TARGET@}.cm0
flash bank main_flash_cm4 psoc6 0x10000000 0 0 0 $@{TARGET@}.cm4
flash bank work_flash_cm4 psoc6 0x14000000 0 0 0 $@{TARGET@}.cm4
flash bank super_flash_user_cm4 psoc6 0x16000800 0 0 0 $@{TARGET@}.cm4
flash bank super_flash_nar_cm4 psoc6 0x16001A00 0 0 0 $@{TARGET@}.cm4
flash bank super_flash_key_cm4 psoc6 0x16005A00 0 0 0 $@{TARGET@}.cm4
flash bank super_flash_toc2_cm4 psoc6 0x16007C00 0 0 0 $@{TARGET@}.cm4
flash bank main_flash_cm4 psoc6 0x10000000 0 0 0 \
$@{TARGET@}.cm4
flash bank work_flash_cm4 psoc6 0x14000000 0 0 0 \
$@{TARGET@}.cm4
flash bank super_flash_user_cm4 psoc6 0x16000800 0 0 0 \
$@{TARGET@}.cm4
flash bank super_flash_nar_cm4 psoc6 0x16001A00 0 0 0 \
$@{TARGET@}.cm4
flash bank super_flash_key_cm4 psoc6 0x16005A00 0 0 0 \
$@{TARGET@}.cm4
flash bank super_flash_toc2_cm4 psoc6 0x16007C00 0 0 0 \
$@{TARGET@}.cm4
@end example
psoc6-specific commands
@ -7110,7 +7131,8 @@ will be touched).
Example usage:
@example
# swap bank 1 and bank 2 in dual bank devices, by setting SWAP_BANK_OPT bit in OPTSR_PRG
# swap bank 1 and bank 2 in dual bank devices
# by setting SWAP_BANK_OPT bit in OPTSR_PRG
stm32h7x option_write 0 0x20 0x8000000 0x8000000
@end example
@end deffn
@ -10164,7 +10186,7 @@ Perform a 32-bit DMI write of value at address.
Synopsys DesignWare ARC Processors are a family of 32-bit CPUs that SoC
designers can optimize for a wide range of uses, from deeply embedded to
high-performance host applications in a variety of market segments. See more
at: http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx.
at: @url{http://www.synopsys.com/IP/ProcessorIP/ARCProcessors/Pages/default.aspx}.
OpenOCD currently supports ARC EM processors.
There is a set ARC-specific OpenOCD commands that allow low-level
access to the core and provide necessary support for ARC extensibility and
@ -10776,7 +10798,8 @@ target remote localhost:3333
@item
A pipe connection is typically started as follows:
@example
target extended-remote | openocd -c "gdb_port pipe; log_output openocd.log"
target extended-remote | \
openocd -c "gdb_port pipe; log_output openocd.log"
@end example
This would cause GDB to run OpenOCD and communicate using pipes (stdin/stdout).
Using this method has the advantage of GDB starting/stopping OpenOCD for the debug
@ -10990,17 +11013,11 @@ Cyg_Thread::thread_list, Cyg_Scheduler_Base::current_thread.
@item ThreadX symbols
_tx_thread_current_ptr, _tx_thread_created_ptr, _tx_thread_created_count.
@item FreeRTOS symbols
@c The following is taken from recent texinfo to provide compatibility
@c with ancient versions that do not support @raggedright
@tex
\begingroup
\rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
@raggedright
pxCurrentTCB, pxReadyTasksLists, xDelayedTaskList1, xDelayedTaskList2,
pxDelayedTaskList, pxOverflowDelayedTaskList, xPendingReadyList,
uxCurrentNumberOfTasks, uxTopUsedPriority.
\par
\endgroup
@end tex
@end raggedright
@item linux symbols
init_task.
@item ChibiOS symbols
@ -11011,11 +11028,14 @@ Rtos::sListSuspended, Rtos::sMaxPriorities, Rtos::sCurrentTaskCount.
@item mqx symbols
_mqx_kernel_data, MQX_init_struct.
@item uC/OS-III symbols
OSRunning, OSTCBCurPtr, OSTaskDbgListPtr, OSTaskQty
OSRunning, OSTCBCurPtr, OSTaskDbgListPtr, OSTaskQty.
@item nuttx symbols
g_readytorun, g_tasklisttable
g_readytorun, g_tasklisttable.
@item RIOT symbols
sched_threads, sched_num_threads, sched_active_pid, max_threads, _tcb_name_offset
@raggedright
sched_threads, sched_num_threads, sched_active_pid, max_threads,
_tcb_name_offset.
@end raggedright
@end table
For most RTOS supported the above symbols will be exported by default. However for

View File

@ -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)

View File

@ -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,

View File

@ -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);

View File

@ -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

View File

@ -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)
{

View File

@ -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]

View File

@ -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)

View File

@ -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;

View File

@ -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)
{

View File

@ -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; \

View File

@ -28,19 +28,11 @@
#include <assert.h>
#include <ctype.h>
#include <errno.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
#endif
/* --- AC_HEADER_TIME --- */
/* +++ platform specific headers +++ */
#ifdef _WIN32

View File

@ -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
#endif
int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y);

View File

@ -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)
{

View File

@ -589,6 +589,7 @@ static int ftdi_reset(int trst, int srst)
LOG_DEBUG_IO("reset trst: %i srst %i", trst, srst);
if (!swd_mode) {
if (trst == 1) {
if (sig_ntrst)
ftdi_set_signal(sig_ntrst, '0');
@ -601,6 +602,7 @@ static int ftdi_reset(int trst, int srst)
else
ftdi_set_signal(sig_ntrst, '1');
}
}
if (srst == 1) {
if (sig_nsrst)
@ -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)

View File

@ -553,20 +553,96 @@ static bool jlink_usb_location_equal(struct jaylink_device *dev)
}
static int jlink_open_device(uint32_t ifaces, bool *found_device)
{
int ret = jaylink_discovery_scan(jayctx, ifaces);
if (ret != JAYLINK_OK) {
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) {
LOG_ERROR("jaylink_get_devices() failed: %s.", jaylink_strerror(ret));
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
use_usb_location = (jtag_usb_get_location() != NULL);
if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) {
LOG_ERROR("Multiple devices found, specify the desired device.");
jaylink_free_devices(devs, true);
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
*found_device = false;
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) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_serial_number() failed: %s.",
jaylink_strerror(ret));
continue;
}
if (serial_number != tmp)
continue;
}
if (use_usb_address) {
enum jaylink_usb_address address;
ret = jaylink_device_get_usb_address(dev, &address);
if (ret == JAYLINK_ERR_NOT_SUPPORTED) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_usb_address() failed: %s.",
jaylink_strerror(ret));
continue;
}
if (usb_address != address)
continue;
}
if (use_usb_location && !jlink_usb_location_equal(dev))
continue;
ret = jaylink_open(dev, &devh);
if (ret == JAYLINK_OK) {
*found_device = true;
break;
}
LOG_ERROR("Failed to open device: %s.", jaylink_strerror(ret));
}
jaylink_free_devices(devs, true);
return ERROR_OK;
}
static int jlink_init(void)
{
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);
@ -592,87 +668,17 @@ static int jlink_init(void)
return ERROR_JTAG_INIT_FAILED;
}
host_interfaces = JAYLINK_HIF_USB;
bool found_device;
ret = jlink_open_device(JAYLINK_HIF_USB, &found_device);
if (ret != ERROR_OK)
return ret;
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));
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
if (!found_device && use_serial_number) {
ret = jlink_open_device(JAYLINK_HIF_TCP, &found_device);
if (ret != ERROR_OK)
return ret;
}
ret = jaylink_get_devices(jayctx, &devs, &num_devices);
if (ret != JAYLINK_OK) {
LOG_ERROR("jaylink_get_devices() failed: %s.", jaylink_strerror(ret));
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
use_usb_location = (jtag_usb_get_location() != NULL);
if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) {
LOG_ERROR("Multiple devices found, specify the desired device.");
jaylink_free_devices(devs, true);
jaylink_exit(jayctx);
return ERROR_JTAG_INIT_FAILED;
}
found_device = false;
for (i = 0; devs[i]; i++) {
struct jaylink_device *dev = devs[i];
if (use_serial_number) {
ret = jaylink_device_get_serial_number(dev, &tmp);
if (ret == JAYLINK_ERR_NOT_AVAILABLE) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_serial_number() failed: %s.",
jaylink_strerror(ret));
continue;
}
if (serial_number != tmp)
continue;
}
if (use_usb_address) {
ret = jaylink_device_get_usb_address(dev, &address);
if (ret == JAYLINK_ERR_NOT_SUPPORTED) {
continue;
} else if (ret != JAYLINK_OK) {
LOG_WARNING("jaylink_device_get_usb_address() failed: %s.",
jaylink_strerror(ret));
continue;
}
if (usb_address != address)
continue;
}
if (use_usb_location && !jlink_usb_location_equal(dev))
continue;
ret = jaylink_open(dev, &devh);
if (ret == JAYLINK_OK) {
found_device = true;
break;
}
LOG_ERROR("Failed to open device: %s.", jaylink_strerror(ret));
}
jaylink_free_devices(devs, true);
if (!found_device) {
LOG_ERROR("No J-Link device found.");
jaylink_exit(jayctx);

View File

@ -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)
{

View File

@ -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
*

View File

@ -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

View File

@ -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
*

View File

@ -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.

View File

@ -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.
*/

View File

@ -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)

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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,

View File

@ -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)

0
tcl/interface/ftdi/steppenprobe.cfg Executable file → Normal file
View File