openocd.git
7 years agoflash/nor/spi: use only lower case hex numbers 50/3350/3
Robert Jordens [Mon, 22 Feb 2016 17:01:34 +0000 (18:01 +0100)]
flash/nor/spi: use only lower case hex numbers

Change-Id: I21ad0d3a73a60d22cb98a0350098baf8af96bebf
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/3350
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoflash/nor/spi: fix macronix 25l1005 chip erase 49/3349/2
Robert Jordens [Mon, 22 Feb 2016 17:00:38 +0000 (18:00 +0100)]
flash/nor/spi: fix macronix 25l1005 chip erase

Change-Id: Ibc445bbe9360d0f1f41e71af8b990b96e0ae5d1f
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/3349
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agocortex_a: fix cortex_a_assert_reset() if srst_gates_jtag 56/3356/3
Matthias Welwarsky [Tue, 9 Feb 2016 13:49:20 +0000 (14:49 +0100)]
cortex_a: fix cortex_a_assert_reset() if srst_gates_jtag

The cortex_a specific assert_reset function must only apply nSRST if
the reset configuration states that JTAG can be used while nSRST is
asserted.

Change-Id: If604a65fdea5bcb46ec723ada547a4e8d6fa8c59
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3356
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostlink: Decode more errors. 73/3373/3
Uwe Bonnes [Wed, 2 Mar 2016 11:54:07 +0000 (12:54 +0100)]
stlink: Decode more errors.

For STLINK_SWD_AP_FAULT git://git.ac6.fr/openocd commit 657e3e885b9ee10
returns ERROR_OK with the comment:
Change in error status when reading outside RAM.
This fix allows CDT plugin to visualize memory.

Change-Id: Id8e220961b748ef9467fd84de62b1dc84ace63f8
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3373
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoCortex-M7: Give user a hint about single stepping problem up to r0p1. 67/3467/3
Uwe Bonnes [Thu, 5 May 2016 20:13:19 +0000 (22:13 +0200)]
Cortex-M7: Give user a hint about single stepping problem up to r0p1.

http://www.keil.com/support/docs/3778.htm

Change-Id: I452f76726f3bb269fa14cc785f329bfba5189489
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3467
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
7 years agoSupport for debug interface lock of EFM32 controllers 89/3389/8
Lieven Hollevoet [Fri, 25 Mar 2016 14:05:35 +0000 (15:05 +0100)]
Support for debug interface lock of EFM32 controllers

The capability to lock the debug interface on EFM32
controllers was lacking in OpenOCD.
After receiving some pointers by zapb_ and PaulFertser
on IRC (thanks guys!) I have added this capability.

This works by writing the required bits in the debug
lock word to '0'.

Note: there is currently no way to re-enable the debug
interface from OpenOCD as doing this requires specific
pin wiggling that is currently not implemented yet.

However: having the capability to lock the debug interface
is useful when building a volume programming jig.
You can flash the program code, verify and then
lock the debug interface so that the device cannot
be read when it is deployed in the field.

Change-Id: If2d562dfdb4b95519785a4395f755d9ae3d0cf12
Signed-off-by: Lieven Hollevoet <hollie@lika.be>
Reviewed-on: http://openocd.zylin.com/3389
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoAdd Altera USB Blaster udev rule. 23/3423/2
Christopher Head [Thu, 21 Apr 2016 00:31:12 +0000 (17:31 -0700)]
Add Altera USB Blaster udev rule.

This udev rule makes the Altera USB Blaster clone I have on my desk
accessible to the plugdev group.

Change-Id: Ic5e8052c66a270b6a6f89e29de49d9785f18fc1e
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/3423
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoxmc4xxx: Fix error propagation for erase_check callback 25/3425/2
Andreas Färber [Sun, 24 Apr 2016 03:05:33 +0000 (05:05 +0200)]
xmc4xxx: Fix error propagation for erase_check callback

If an error occurs during xmc4xxx_blank_check_memory() aka .erase_check,
it would break out of the loop over flash sectors and return ERROR_OK.

Instead return the error code so that tcl.c can notify the user.

Change-Id: Ie2c1b7933eef2b240b28f8a292634fbbf5b31706
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3425
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agofm4: Set read callback 31/3431/2
Andreas Färber [Fri, 29 Apr 2016 20:46:06 +0000 (22:46 +0200)]
fm4: Set read callback

Fix a segfault for flash read_bank by adopting the default read
implementation.

Change-Id: I09e030d9a7669b848a1743aaba03875bf408c7ee
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3431
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoftdi: make ftdi_location command depend on libusb1 version 96/3396/5
Matthias Welwarsky [Wed, 6 Apr 2016 08:35:13 +0000 (10:35 +0200)]
ftdi: make ftdi_location command depend on libusb1 version

The function libusb_get_port_numbers(), required for the command
ftdi_location, is only available in recent version of libusb1.
Compilation will break if the function is not available. This patch
enables the command only if libusb1 contains the necessary function.

Change-Id: I091e72dafa4ed22eea51692751d43246a8152987
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3396
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agocheckpatch.pl: fix unescaped left brace warnings 28/3228/2
Paul Fertser [Sat, 6 Feb 2016 13:30:10 +0000 (16:30 +0300)]
checkpatch.pl: fix unescaped left brace warnings

Basically, same as upstream 4e5d56bdf892e18832a6540b63ebf709966bce2a.

Unescaped left brace in string literals is deprecated since
perl v5.21.1.

Change-Id: I0e5f23bef821d2dca6ff4909ddbb06f4992718d4
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3228
Tested-by: jenkins
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
7 years agoat91samd: Add additional "B Variant" parts from SAMD21 family 24/3424/3
Peter D. Gray [Thu, 21 Apr 2016 13:10:44 +0000 (09:10 -0400)]
at91samd: Add additional "B Variant" parts from SAMD21 family

The parts are listed in Rev I of the Datasheet

Change-Id: Icdd9108a0f1f19f666fce79de7f25df9f46de866
Signed-off-by: Peter D. Gray <peter@conalgo.com>
Reviewed-on: http://openocd.zylin.com/3424
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoMIPS32 Fix typos 71/2271/3
Salvador Arroyo [Sun, 24 Aug 2014 18:56:05 +0000 (20:56 +0200)]
MIPS32 Fix typos

I suppose 0xff300008 is the correct value for EJTAG_V20_DBS.
20 miliseconds is too much for scan delay, 2ms is enough in mips_m4k scan_delay handler.
mips32 scan_delay has the correct value.

Change-Id: Ie9dc650065a58e845687058a4c930f85909beec9
Signed-off-by: Salvador Arroyo <sarroyofdez@yahoo.es>
Reviewed-on: http://openocd.zylin.com/2271
Tested-by: jenkins
Reviewed-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoFix for BMIPS 70/2270/3
Salvador Arroyo [Sun, 24 Aug 2014 17:34:08 +0000 (19:34 +0200)]
Fix for BMIPS

BMIPS always needs 2 additional instructions to reach the core.
Seems there is a 2 instructions fifo between the tap and the core, or it behaves in this way.
No idea of the purpose of this fifo, I can only guess.
Of course function mips32_pracc_clean_text_jump() must add this additional instructions (NOPs).
Only tested on bcm3348..

Change-Id: I3183d3ce865d469d7262ba4b15446e5743a5f1df
Signed-off-by: Salvador Arroyo <salvador@telecable.es>
Reviewed-on: http://openocd.zylin.com/2270
Tested-by: jenkins
Reviewed-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agoflash/nor: Add Infineon XMC1000 flash driver 18/3418/8
Andreas Färber [Sun, 17 Apr 2016 17:26:30 +0000 (19:26 +0200)]
flash/nor: Add Infineon XMC1000 flash driver

The XMC1000 family uses a very different flash interface from XMC4000.

Tested on XMC 2Go and XMC1100 Boot Kit.

Change-Id: I3edaed420ef1c0fb89fdf221022c8b04163d41b3
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3418
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoat91samd: Atmel SAML22 (segment LCD) family added 26/3426/2
Tomas Vanek [Mon, 25 Apr 2016 15:30:28 +0000 (17:30 +0200)]
at91samd: Atmel SAML22 (segment LCD) family added

Part IDs taken from
Atmel-42402C-SAM L22_Datasheet_Complete-01/2016
(revision C)

Change-Id: I1eb76a92097a8327da10faa0551e7fc962a549f8
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3426
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agotarget: improve robustness of reset command 06/2606/6
Tomas Vanek [Sun, 15 Mar 2015 18:09:15 +0000 (19:09 +0100)]
target: improve robustness of reset command

Before this change jim_target_reset() checked examined state of a target
and failed without calling .assert_reset in particular target layer
(and without comprehensible warning to user).
Cortex-M target (which refuses access to DP under active SRST):
If connection is lost then reset process fails before asserting SRST
and connection with MCU is not restored.
This resulted in:
1) A lot of Cortex-M MCUs required use of reset button or cycling power
after firmware blocked SWD access somehow (sleep, misconfigured clock etc).
If firmware blocks SWD access early during initialization, a MCU could
become completely inaccessible by SWD.
2) If OpenOCD is (re)started and a MCU is in a broken state unresponsive
to SWD, reset command does not work even if it could help to restore communication.
Hopefully this scenario is not possible under full JTAG.

jim_target_reset() in target.c now does not check examined state
and delegates this task to a particular target. All targets have been checked
and xx_assert_reset() (or xx_deassert_reset()) procedures were changed
to check examined state if needed. Targets except arm11, cortex_a and cortex_m
just fail if target is not examined although it may be possible to use
at least hw reset. Left as TODO for developers familiar with these targets.

cortex_m_assert_reset(): memory access errors are stored
instead of immediate returning them to a higher level.
Errors from less important reads/writes are ignored.
Requested reset always leads to a configured action.

arm11_assert_reset() just asserts hw reset in case of not examined target.
cortex_a_assert_reset() works as usual in case of not examined target.

Change-Id: I84fa869f4f58e2fa83b6ea75de84440d9dc3d929
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2606
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
7 years agoflash Kinetis: new KVx family added 35/3235/2
Tomas Vanek [Sat, 19 Dec 2015 11:34:31 +0000 (12:34 +0100)]
flash Kinetis: new KVx family added

Cortex-M0+ and M4 motor control MCUs KV10, KV11, KV30, KV31,
KV42, KV44 and KV46 added to SDID identification.
Watchdog disable code changed to work on Cortex-M0+ (KV1x)
Protection size set to 1K for 16K flash devices (KV10Z16)
- cherry picked from Andrey Smirnov's change #2051

Change-Id: Ia6f4868eaf7e2cb6ad6a736210c703a67e0027be
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3235
Tested-by: jenkins
Reviewed-by: Kyle Manna <kyle.manna@fuel7.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoAdd support for Atmel AT91SAMD21E16B (B variant) and a spelling mistake. 22/3422/2
Peter D. Gray [Wed, 20 Apr 2016 17:02:48 +0000 (13:02 -0400)]
Add support for Atmel AT91SAMD21E16B (B variant) and a spelling mistake.

Change-Id: I55ab830aed34a02c53f3419facc81c7354368e30
Signed-off-by: Peter D. Gray <peter@conalgo.com>
Reviewed-on: http://openocd.zylin.com/3422
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Andreas Färber <afaerber@suse.de>
7 years agoflash/nor: Reorder drivers alphabetically 17/3417/3
Andreas Färber [Sun, 17 Apr 2016 15:36:25 +0000 (17:36 +0200)]
flash/nor: Reorder drivers alphabetically

To avoid conflicts between flash drivers being added, consistently use
an alphabetical sort order for the three places new drivers get added:

* Makefile.am NOR_DRIVERS (note: automake disallows a trailing backslash)
* drivers.c struct flash_driver forward declarations
* drivers.c flash_drivers array

Change-Id: Idcd6a8e12821ef10958a6b3ad7bac0dc63cadd08
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3417
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32lx: Add support for lock/unlock (RDP Level 0<->1) 34/3234/2
Andreas Fritiofson [Tue, 9 Feb 2016 16:50:47 +0000 (17:50 +0100)]
stm32lx: Add support for lock/unlock (RDP Level 0<->1)

Change-Id: Iecc356373e084056d048d92820062483cac3c8ec
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3234
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agostm32f2x.c: Add more F4 devices. 75/3375/2
Uwe Bonnes [Wed, 2 Mar 2016 12:11:48 +0000 (13:11 +0100)]
stm32f2x.c: Add more F4 devices.

Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072
STM32F446 (0x434) now is's own case.

Change-Id: I5061db7102b4c923c9f39d3d2f0cc69d29fca0a4
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3375
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years agosrc/flash/nor/stm32f2x.c: Really erase second bank if requested. 74/3374/3
Uwe Bonnes [Wed, 2 Mar 2016 12:17:04 +0000 (13:17 +0100)]
src/flash/nor/stm32f2x.c: Really erase second bank if requested.

Taken from git://git.ac6.fr/openocd commit e8ed67c42227b7072

Change-Id: Ic7f529aecd1603b8c083c3c9ce96a0f13dd604e0
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3374
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
7 years ago stm32l4x.c: Correct waiting for data. 40/3140/2
Uwe Bonnes [Mon, 30 Nov 2015 11:21:12 +0000 (12:21 +0100)]
 stm32l4x.c: Correct waiting for data.

Old code waited only for 7 bytes and didn't handle buffer wrap-around, but
was functional despite.

Change-Id: Iceaf7be1e51368b2ec0a8722cc9ac16d12f9aa63
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3140
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
7 years agostm32l4x.c: Use explicit 64-bit flash access as reference manual implies. 39/3139/3
Uwe Bonnes [Mon, 30 Nov 2015 11:12:42 +0000 (12:12 +0100)]
stm32l4x.c: Use explicit 64-bit flash access as reference manual implies.

Change-Id: I87b540c1ee7158a9d697e9fbc845a603c6bbe74d
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3139
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Tested-by: jenkins
7 years agoserver/telnet: Check malloc() return values 12/3412/2
Marc Schink [Wed, 13 Apr 2016 08:29:50 +0000 (10:29 +0200)]
server/telnet: Check malloc() return values

Change-Id: I598bd2dd5a65c0d1a8745bde41763057c4427a31
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3412
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoRTOS support: Correction of out of bound access of thread array 00/3400/4
Jonathan Dumaresq [Fri, 8 Apr 2016 14:38:00 +0000 (10:38 -0400)]
RTOS support: Correction of out of bound access of thread array

FreeRTOS use an array to store ready task. The array size is
configMAX_PRIORITIES. In the current implementation, the code try to access 1 more priority if the helper from freeRTOS contrib is used.
This has effect of detecting bad thread. This patch correct this and have been tested on
a code with more than 12 task.

Change-Id: Id229f0b2c4bf1aab87a2a69be174cc9b6dda00cb
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3400
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agoRTOS support: Add FPU support for FreeRTOS 97/3397/5
Jonathan Dumaresq [Wed, 6 Apr 2016 20:00:06 +0000 (16:00 -0400)]
RTOS support: Add FPU support for FreeRTOS

Add new structure for for working with FPU thread in thread view.
This modification support both stacking.
When FPU is activated, LR must be validated to check if the FPU
register are push on the stack. This is mandatory to find the correct
stack pointer position.

the modified code was inspired and adapted from

https://github.com/TauLabs/TauLabs/commit/88d2003bb83a6b72c796274c889e307f96645966

Change-Id: I6641926aa14e7216cacb399cbc8bb0db324cc9fc
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3397
Tested-by: jenkins
Reviewed-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Reviewed-by: Harry Zhurov <harry.zhurov@gmail.com>
Reviewed-by: Anton Gusev
Reviewed-by: Михаил Цивинский <mtsivinsky@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
7 years agoflash: Added support for Freescale Kinetis KE family. 80/3380/4
Ivan Meleca [Sat, 5 Mar 2016 18:14:52 +0000 (19:14 +0100)]
flash: Added support for Freescale Kinetis KE family.

Tested with MKE04Z8VTG4, MKE02Z64VLC4 and MKE02Z64VLD2.

Change-Id: I606e32a2746a3b96d3e50f3656ba78d40c41c1ea
Signed-off-by: Ivan Meleca <ivan@artekit.eu>
Reviewed-on: http://openocd.zylin.com/3380
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
7 years agostm32l4x.c: Free r6/7 for 64-bit operations. 38/3138/3
Uwe Bonnes [Mon, 30 Nov 2015 11:05:43 +0000 (12:05 +0100)]
stm32l4x.c: Free r6/7 for 64-bit operations.

Use r5 instead of r7.

Change-Id: I350d00eeabe9446d64dba8f1dbffb5d4beab7dd6
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3138
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agointerface/jlink: Fix comment about serial number 01/3401/2
Marc Schink [Fri, 8 Apr 2016 08:57:11 +0000 (10:57 +0200)]
interface/jlink: Fix comment about serial number

Leading zeros for the serial number are not necessary anymore.

Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Change-Id: Ie4ff47b9cda7ccf314c6fda9a2784947db5ee4d9
Reviewed-on: http://openocd.zylin.com/3401
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoflash Kinetis: remove TARGET_HALTED halted check from probe 82/3382/2
Tomas Vanek [Thu, 10 Mar 2016 17:24:45 +0000 (18:24 +0100)]
flash Kinetis: remove TARGET_HALTED halted check from probe

There is no reason why not probe running target.
Initial gdb connect to running target is now possible without
halt in gdb-attach event.

Change-Id: Iacc4a231587d378168b18db871582f1086504831
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3382
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agocortex_a: allow physical memory access through AHB-AP again 59/3359/4
Matthias Welwarsky [Mon, 22 Feb 2016 14:23:10 +0000 (15:23 +0100)]
cortex_a: allow physical memory access through AHB-AP again

This feature is required for boards that use a programmatical way
to reset the cpu, like the TI Pandaboard with OMAP4. The board only
has a 14 pin JTAG header that doesn't feature SRST and is reset by
direct write to the PRM_RSTCTL register.

iMX6 can be reset through triggering the on-chip watchdog, but for these
methods to work reliably, access through the AHB-AP without interaction
with the CPU core is necessary.

Change-Id: I9a07a536adda83cc2f93e504384c8c7f0306220b
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3359
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoftdi: allow selecting device by usb bus location 51/3351/2
Matthias Welwarsky [Tue, 2 Feb 2016 16:03:08 +0000 (17:03 +0100)]
ftdi: allow selecting device by usb bus location

This patch adds a 'ftdi_location' command to select an adapter by usb
bus number and port path.

This is helpful if you have a rack full of adapters in a testing or
manufacturing setup where the only constant is the physical usb bus
location of the adapter you want to address. Vid:Pid are not unique,
serial number _may_ be unique (and maybe not with embedded adapters) but
will change when a new target is plugged.

Specifying a location allows to understand instantly which board failed
bringup or testing.

Change-Id: I403c7c6c8e34fe42041b3f967db80f3160a4f1a3
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/3351
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agohelper/fileio: Remove nested struct 22/3222/2
Marc Schink [Sun, 4 Oct 2015 15:18:40 +0000 (17:18 +0200)]
helper/fileio: Remove nested struct

Change-Id: I1a3afbddcf950689da58e0df8850a05f558d7879
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3222
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agojim-nvp: Make Jim_GetOpt_String const-correct 78/3178/2
Andreas Fritiofson [Sun, 13 Dec 2015 21:18:14 +0000 (22:18 +0100)]
jim-nvp: Make Jim_GetOpt_String const-correct

Change-Id: Iae9824f6ff47a1944e674e59bfaa970904645082
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3178
Tested-by: jenkins
8 years agoCortex-A/R: Fix Mask-ISR parsing 95/3195/4
Evan Hunter [Mon, 11 Jan 2016 11:04:19 +0000 (11:04 +0000)]
Cortex-A/R: Fix Mask-ISR parsing

Remove needless error when not halted with wrong return.
Allow usage in any mode
Add error message for incorrect arguments

Change-Id: I3e94e159609351e503ed3f35760503079e3aa53c
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/3195
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoCortex-A/R: Add missing timeout for loop polling DSCR & fix timeout types 01/3201/3
Evan Hunter [Tue, 12 Jan 2016 18:13:27 +0000 (18:13 +0000)]
Cortex-A/R: Add missing timeout for loop polling DSCR & fix timeout types

Change-Id: I345658cfdc8a34a98418727423ac6bd562e980f3
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/3201
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agofm4: Add support for S6E2DH family 58/3158/3
Andreas Färber [Sun, 6 Dec 2015 18:43:52 +0000 (19:43 +0100)]
fm4: Add support for S6E2DH family

Add support for S6E2DH MainFlash. VFlash is not implemented.

Briefly tested with SK-FM4-176L-S6E2DH V110 board.

Change-Id: If7c523d8c75307bc1494bbf4cca3eed0272e8e01
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3158
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agofm4: Add support for MB9BFx64/x65 57/3157/4
Andreas Färber [Sun, 6 Dec 2015 16:51:49 +0000 (17:51 +0100)]
fm4: Add support for MB9BFx64/x65

These appear to be just additional flash size configurations.
Entirely based on manual, untested.

Change-Id: I4460dc1a588335df8fc0a385d24513a4e35b6951
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3157
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoarmv4_5: support weirdo ARMv6 secure monitor mode 96/3196/2
Linus Walleij [Tue, 12 Jan 2016 09:46:07 +0000 (10:46 +0100)]
armv4_5: support weirdo ARMv6 secure monitor mode

On the ARM PB1176JZF-S the system comes up in secure monitor
mode after reset. However the modebits in CPSR form the value
28 (0x1c) and CPSR is 0x800001dc deeming it UNRECOGNIZED.
Define this mode to be synonymous to mode 22 (MON) and things
start to work like a charm.

Change-Id: I001f7773ee1076202c0c633e466d2d833f7a1413
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-on: http://openocd.zylin.com/3196
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash: nor: mdr: implement read/verify for Info memory 27/3227/5
Paul Fertser [Sat, 6 Feb 2016 13:04:20 +0000 (16:04 +0300)]
flash: nor: mdr: implement read/verify for Info memory

This adds necessary code to obtain data from the Info region which is
not memory-mapped so can't be read the usual way.

With this "flash read_bank" and "flash verify_bank" commands should
start to work as expected for the Info memory block.

Change-Id: I57e4b80fff577500cfa85954b625fe9c9ff92aa5
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3227
Tested-by: jenkins
Reviewed-by: Eldar Khayrullin <eldar.khayrullin@mail.ru>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoarmv7m: Integrate build of erase check code 34/3134/3
Andreas Färber [Sun, 29 Nov 2015 02:35:51 +0000 (03:35 +0100)]
armv7m: Integrate build of erase check code

Instead of documenting the file path as a comment and inline-commenting
the THUMB bytecode, include the hex array via preprocessor.

This assures the path is actually up-to-date and facilitates updating
the code.

Change-Id: Ieb0a7cd0bc14882ac96750f524616d9768a0c6f5
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3134
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoxmc4xxx: Integrate build of erase check code 33/3133/3
Andreas Färber [Sun, 29 Nov 2015 02:09:46 +0000 (03:09 +0100)]
xmc4xxx: Integrate build of erase check code

Instead of pointing to the assembler sources in a comment and
inline-commenting the THUMB bytecode, place the hex array alongside the
assembler sources and include it via preprocessor.

Originally inspired by a typo in the file path during driver development,
but it also facilitates making changes to the assembler sources.

A Makefile is provided to help automate updating the bytecode. It is not
integrated with the automake system to avoid forcing an ARM cross-compiler
onto every user, i.e. after modifying the sources they need to be rebuilt
in that directory before building the usual way. ARM_CROSS_COMPILE= can
be passed on the make command line to deal with native ARM toolchains
or with varying prefixes of cross-toolchains.

Change-Id: I00ceb980a68c8554a180dd13719ac77b677a8bcd
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3133
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoflash: New Spansion FM4 flash driver 90/2190/15
Andreas Färber [Mon, 20 Apr 2015 00:51:23 +0000 (02:51 +0200)]
flash: New Spansion FM4 flash driver

The Spansion FM4 family of microcontrollers does not offer a way to
identify the chip model nor the flash size, except for Dual Flash vs.
regular layout. Therefore the family is passed as argument and
wildcard-matched - MB9BFx6x and S6E2CC families are supported.

Iterations showed that ...
1) Just doing the flash command sequence from SRAM loader code for each
half-word took 20 minutes for an 8 KB block.
2) Doing the busy-wait in the loader merely reduced the time to 19 minutes.
3) Significant performance gains were achieved by looping in loader code
rather than in OpenOCD and by maximizing the batch size across sectors,
getting us down to ~2 seconds for 8 KB and ~2.5 minutes for 1.1 MB.
(Tested with SK-FM4-176L-S6E2CC-ETH v11, CMSIS-DAP v23.)

gcc, objcopy -Obinary and bin2char.sh are used for automating the
integration of hand-written assembler snippets.

Change-Id: I092c81074662534f50b71b91d54eb8e0098fec76
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/2190
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoat91sam4 Flash: Added identification of atsam4n's 42/3242/2
Colin Helliwell [Wed, 17 Feb 2016 09:51:25 +0000 (09:51 +0000)]
at91sam4 Flash: Added identification of atsam4n's

The Flash driver for at91sam4 cpu's has been enhanced to recognise and support the SAM4N family.

Change-Id: I50c471a6053b52edffd8efdd8abfe516cc5c55ee
Signed-off-by: Colin Helliwell <colin.helliwell@ln-systems.com>
Reviewed-on: http://openocd.zylin.com/3242
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agostm32lx.c: Print device string as info. 62/3362/3
Uwe Bonnes [Thu, 25 Feb 2016 13:33:43 +0000 (14:33 +0100)]
stm32lx.c: Print device string as info.

Change-Id: I893f0d9a5095a9f122adc76cf403277639fa880c
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3362
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agostm32lx.c: Add STM32L0 categories 1, 2 and 5. 60/3360/5
Uwe Bonnes [Thu, 25 Feb 2016 13:29:44 +0000 (14:29 +0100)]
stm32lx.c: Add STM32L0 categories 1, 2 and 5.

Change-Id: I493072a856a66e4cd60de490a0937287db4b5c4d
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3360
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agotcl/target/stm32f4: fix: reduce adapter speed before reset 65/3365/3
Alexander Kurz [Sun, 28 Feb 2016 11:36:19 +0000 (12:36 +0100)]
tcl/target/stm32f4: fix: reduce adapter speed before reset

The reset-init hook for this target speeds up the CPU clock and JTAG adapter
speed. When the target is reset running with high adapter speed, a series of
warnings "DAP transaction stalled (WAIT) - slowing down" will be generated
since the adapter speed is not reduced to fit the slower CPU speed.
Fix: reduction of the adapter speed before a reset is performed.

Change-Id: Iabfc8e3f70311e0e71c8eed09b8a37fcbed9c58d
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3365
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash/nor/faux.c: fixing check for failed malloc 64/3364/2
Alexander Kurz [Fri, 26 Feb 2016 22:38:50 +0000 (23:38 +0100)]
flash/nor/faux.c: fixing check for failed malloc

Error found by static code analysis using the semantic pattern
null_ref2/mini_null_ref2.cocci, see coccinellery.org

Change-Id: Ic817c29f0ccf2b41fc8f7d9a480ad30d6e5b7ab8
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3364
Tested-by: jenkins
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoarm_disassembler: bugfix, MRRC instruction not recognized 63/3363/3
Alexander Kurz [Fri, 26 Feb 2016 20:54:22 +0000 (21:54 +0100)]
arm_disassembler: bugfix, MRRC instruction not recognized

A copy-and-paste error in the arm_disassembler opcode evaluation
disabled the recognition of MRRC instructions.
According to the arm architecture ref. manual issue E or later, MRRC and MCRR
instructions are identified by opcode bits 20-27: MCRR = 0xc4, MRRC = 0xc5.
Error found by static code analysis using a semantic pattern to
detect duplicated tests xand.cocci, see coccinellery.org

Change-Id: Ic41426edb51c6816e11dc3d35ef9382ab34af486
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3363
Reviewed-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash/nor/stellaris: fix: flash info RCC and RCC2 mixed up 68/3368/2
Alexander Kurz [Sun, 28 Feb 2016 21:45:54 +0000 (22:45 +0100)]
flash/nor/stellaris: fix: flash info RCC and RCC2 mixed up

The flash info command on stellaris platformes
"TI/LMI Stellaris information ... rcc is ..., rcc2 is ..."
presented the actual RCC2 register as rcc and an uninitialized variable
as rcc2 due to a copy and paste error.
Found using the semantic pattern da/da.cocci, see coccinellery.org

Change-Id: I6f920fc3e07fdc085ea8e2248fbc9453eb8393dc
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3368
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoflash/nor/non_cfi.c: cleanup, member double-intialization 69/3369/2
Alexander Kurz [Sun, 28 Feb 2016 22:21:47 +0000 (23:21 +0100)]
flash/nor/non_cfi.c: cleanup, member double-intialization

A struct member has been initialized twice. Found using the semantic
pattern da/da.cocci, see coccinellery.org

Change-Id: I0320afd60f1ba505758cc5bc0adcf27f572492fb
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3369
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoCleanup: removal of obsolete semicolons 67/3367/2
Alexander Kurz [Sun, 28 Feb 2016 20:21:40 +0000 (21:21 +0100)]
Cleanup: removal of obsolete semicolons

Obsolete C source code semicolons were removed using the semantic patch
semicolon/semicolon.cocci, see coccinellery.org

Change-Id: I153b4995a9e028ebaf5f58c947821dc78345a777
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3367
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agocfi intel: fixing faulty flash write error message 33/3233/3
Alexander Kurz [Sat, 13 Feb 2016 14:11:59 +0000 (15:11 +0100)]
cfi intel: fixing faulty flash write error message

Writing to Intel CFI flash with unaligned tail bytes raised a false
error message although all data was programmed successfully. e.g.:
> flash write_image image 0x602e0000 bin
> Programming at 0x602e0000, count 0x00000002 bytes remaining
> couldn't write word at base 0x60000000, address 0x602e0000
> error writing to flash at address 0x60000000 at offset 0x002e0000
Root cause for this false error was a mixup of two result variables
introduced with ecc8041c.

Change-Id: Ib6b85293dbed946a36a307e5b198c47b901145bf
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3233
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agonrf51: move hwid 0057 and add 0058 87/3187/3
Peter A. Bigot [Thu, 18 Feb 2016 11:58:29 +0000 (05:58 -0600)]
nrf51: move hwid 0057 and add 0058

Chip markings:
    N51822 / QFAAG2 / 1435CZ for HWID 0057
    N51822 / QFAAG3 / 1436AJ for HWID 0058

Change-Id: I242b94d6a2362aae0de970c7ac77811c76dacdc0
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3187
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agonrf51: move table entry for hwid 0084 to correct MCU section 05/3105/4
Peter A. Bigot [Thu, 12 Nov 2015 11:03:39 +0000 (05:03 -0600)]
nrf51: move table entry for hwid 0084 to correct MCU section

This is a nRF51822 variant, not a nRF51422 variant.

Change-Id: Ia199e0afa39408d7391a9655bad47eba2fd85f14
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3105
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoarm_adi_v5: Rewrite dap_rom_display 82/3182/3
Andreas Fritiofson [Tue, 29 Dec 2015 10:56:16 +0000 (11:56 +0100)]
arm_adi_v5: Rewrite dap_rom_display

Simplify by printing one component per call, instead of one complete ROM
Table per call. Print common information the same way for all components,
including ROM tables, because ROM tables (at least the top level) contain
useful information in their identification registers, such as the
manufacturer of the SoC.

Print component designer name using the JEP106 helper when available.

Change-Id: Ic51bccd98acfae6886243500153fbdd567be2fae
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3182
Tested-by: jenkins
Reviewed-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-by: James Mastros <james@mastros.biz>
8 years agoxmc4xxx: Add XMC4700 support 36/3136/4
Andreas Färber [Sun, 29 Nov 2015 04:26:23 +0000 (05:26 +0100)]
xmc4xxx: Add XMC4700 support

Tested with EES-AA revision chips on Relax Kit for 5V Shields and
Relax Lite Kit.

Change-Id: I17d4479657bad0516d4c10c2ad7e745d59e678b7
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-on: http://openocd.zylin.com/3136
Tested-by: jenkins
Reviewed-by: Jeff Ciesielski <jeffciesielski@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoadi_v5_swd: Avoid special handling the SELECT cache during connect 31/3231/2
Andreas Fritiofson [Wed, 10 Feb 2016 20:37:16 +0000 (21:37 +0100)]
adi_v5_swd: Avoid special handling the SELECT cache during connect

The cache is forced to zero to match the value expected by the DPIDR read
so the connect sequence is not destroyed by a SELECT update.

However, DPIDR and in fact all registers except address 4 are independent
of the current DPBANKSEL value. Change swd_queue_dp_bankselect() to use
this fact and avoid touching SELECT for those registers.

Change-Id: I0cd11925fb6adef481bbf45cc24ea2c6dab4b6fb
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3231
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 years agoadi_v5: Remove forgotten FIXME definition 43/3243/2
Alamy Liu [Mon, 10 Aug 2015 21:41:45 +0000 (14:41 -0700)]
adi_v5: Remove forgotten FIXME definition

Investigation:
 - mem_ap_read_buf_u32() no longer exists.
 - JTAG_DP_DPACC & JTAG_DP_APACC are defined in adi_v5_jtag.c now.

Change-Id: I136fc3f389a5a4eb9b68bc759ce653b6da7fa75e
Signed-off-by: Alamy Liu <alamy.liu@gmail.com>
Reviewed-on: http://openocd.zylin.com/3243
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoKinetis: flash driver described in openocd.texi 14/3014/3
Tomas Vanek [Tue, 13 Oct 2015 12:43:49 +0000 (14:43 +0200)]
Kinetis: flash driver described in openocd.texi

Change-Id: Id3410fc94f73191e3d7810115676046e5c760a0b
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3014
Tested-by: jenkins
8 years agoKinetis: check/switch run mode before flash operation 12/3012/3
Tomas Vanek [Mon, 12 Oct 2015 22:15:16 +0000 (00:15 +0200)]
Kinetis: check/switch run mode before flash operation

FTFx flash controller requires MCU in normal RUN mode.
Flash cannot be erased, programmed or blank checked in VLPR or HSRUN
modes.

VLPR mode is switched to RUN mode as it does not require any changes
in clock generator setting. VLPR can be active from reset on some
KLx devices (with some FOPT setting) so 'reset init' might not be
sufficient to get device to normal RUN.

Any other mode than RUN or VLPR is reported as an error.

Change-Id: I60f494ce0d534b04870c6219d9b05f66f7244433
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3012
Tested-by: jenkins
8 years agoKinetis: invalidate flash cache after erase/write 93/2993/3
Tomas Vanek [Fri, 2 Oct 2015 09:00:07 +0000 (11:00 +0200)]
Kinetis: invalidate flash cache after erase/write

Cached old flash contents broke verify readback on Kx devices.

Change-Id: I0effaf358f451b473f0d9c762a133ffd21bc64b4
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2993
Tested-by: jenkins
8 years agoKinetis: improve flash detection using SIM_FCFG2 MAXADDR0 and MAXADDR1 92/2992/4
Tomas Vanek [Tue, 29 Sep 2015 16:15:36 +0000 (18:15 +0200)]
Kinetis: improve flash detection using SIM_FCFG2 MAXADDR0 and MAXADDR1

Autodetect 1 or 2 flash blocks devices and recheck bank sizes.
Correct pf_size calculation for 2 MB devices.

Change-Id: Ib3b68db9ec5356b8d5dc73c9f12053f7476bf474
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2992
Tested-by: jenkins
8 years agoKinetis: nvm_partition command 91/2991/4
Tomas Vanek [Fri, 2 Oct 2015 05:58:46 +0000 (07:58 +0200)]
Kinetis: nvm_partition command

Command for partitioning FlexNVM to data flash and EEPROM blocks

Change-Id: Ia0ea65d72b0e5f23da330520284b0bd26435e444
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2991
Tested-by: jenkins
8 years agoKinetis: fix preparation of FlexRAM before flash programming 90/2990/4
Tomas Vanek [Thu, 1 Oct 2015 21:35:12 +0000 (23:35 +0200)]
Kinetis: fix preparation of FlexRAM before flash programming

FlexRAM should be requested before any section programming.
Test FCNFG RAMRDY bit before issuing FTFx_CMD_SETFLEXRAM
to speed up operation and to cover pflash only devices.

Change-Id: Ib0f2d8e8ab8b1507cbf2b7f8565178ab79941f5d
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2990
Tested-by: jenkins
8 years agoKinetis: kinetis_ftfx_command() based on target instead of flash bank 88/2988/5
Tomas Vanek [Thu, 1 Oct 2015 09:08:52 +0000 (11:08 +0200)]
Kinetis: kinetis_ftfx_command() based on target instead of flash bank

kinetis_ftfx_command() did not use other struct flash_bank* members
than base->target. Switching first parameter to struct target*
enables use of kinetis_ftfx_command() without unnecessary bank
getting and probing.

Removed kinetis_securing_test: kind of dead code, same function
as command flash erase_address pad 0x400 0x10

Removed "NAND" word from help as flash is obviously NOR

Change-Id: I3f5fc295ef2bf42f3e913549949f2a36377f6367
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2988
Tested-by: jenkins
8 years agoKinetis: FlexNVM handling 87/2987/6
Tomas Vanek [Tue, 29 Sep 2015 15:48:17 +0000 (17:48 +0200)]
Kinetis: FlexNVM handling

FlexNVM (data flash) is memory mapped at 0x10000000.
Driver used to send the same address to FTFx controller for erase/write ops.
This was wrong as FTFx accepts only low 24 bits of address.
To fix addressing for flash controller kinfo->prog_base was introduced.

Added FlexNVM protection check, blank check and data flash size calculation.
Blank check cannot use block operation on FlexNVM when EEPROM backup is enabled.

Removed non functional reassign logic and bank_ordinal stuff.
Now one can re-probe FlexNVM banks after nvm_partition change.

Change-Id: Ia60b938266963e5d056701278cdf7bf2f62a429a
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/2987
Tested-by: jenkins
8 years agoAdd board config for ST NUCLEO L476RG board 14/3214/3
Freddie Chopin [Thu, 21 Jan 2016 10:19:41 +0000 (11:19 +0100)]
Add board config for ST NUCLEO L476RG board

The file was contributed by Sébastien Lorquet.

Change-Id: I118f5b16181488b9e3327891e6130b908419f1c4
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/3214
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agojlink: Update for libjaylink API changes 25/3225/2
Marc Schink [Fri, 18 Dec 2015 08:09:08 +0000 (09:09 +0100)]
jlink: Update for libjaylink API changes

This patch also addresses a problem with devices where no serial
number is available. For further details, see:

http://repo.or.cz/libjaylink.git/commit/7e0508d8487f65f71411117dff2e0b093e00bc80

Such devices are now ignored if device selection via serial number is
used.
Nevertheless, these devices are still usable by using the USB address
for device selection or just by omitting device selection. The latter
one is only possible if only one device is connected.

Change-Id: I5763db25e97ba3d924cb642da7e64e951e09ecb7
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/3225
Tested-by: jenkins
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agocmsis-dap: Fix CMSIS-DAP serial number processing. 26/3226/4
anpilog [Fri, 29 Jan 2016 09:20:20 +0000 (17:20 +0800)]
cmsis-dap: Fix CMSIS-DAP serial number processing.

Check CMSIS-DAP adapter has serialnumber before pass it to wcscmp.
Keep looking for onother adapter if choosed one doesn't have correct
serialnumber.

Change-Id: I7d386a03cb49b9baf22073ae1c6b14269ed3b618
Signed-off-by: Andrii Anpilogov <anpilog@gmail.com>
Reviewed-on: http://openocd.zylin.com/3226
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoadd Digilent HS2 support 60/3160/2
Andrew Kohlsmith [Tue, 8 Dec 2015 21:14:52 +0000 (16:14 -0500)]
add Digilent HS2 support

Change-Id: If506c33f22d95f4c47f30c4348d461197c976fdd
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3160
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoflash: nor: nrf51: add hwid 0x0057 02/3102/2
Jacob Rosenthal [Thu, 5 Nov 2015 18:26:00 +0000 (13:26 -0500)]
flash: nor: nrf51: add hwid 0x0057

Change-Id: I43b9dc1ce254a8ee8c84ad8e25bb809eb8629e13
Signed-off-by: Jacob Rosenthal <jakerosenthal@gmail.com>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3102
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agocfi: support for 16-bit flash with reversed endianness 41/3041/4
Esben Haabendal [Fri, 23 Oct 2015 08:12:59 +0000 (10:12 +0200)]
cfi: support for 16-bit flash with reversed endianness

This is for targets where flash controller has reverse endianness
compared to target.  For these, the 'bus_swap' parameter can be given to the
CFI driver, which will cause command CFI commands to be written with
bytes swapped.  This is only for x16 CFI flash.

Change-Id: I698b768e92e65d160232e90b0e81a824e3c81a46
Signed-off-by: Esben Haabendal <esben@haabendal.dk>
Reviewed-on: http://openocd.zylin.com/3041
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoChange isa string 00/2400/3
Kent Brinkley [Fri, 21 Nov 2014 01:45:00 +0000 (18:45 -0700)]
Change isa string

Laying the ground work for adding microAptiv core

Change-Id: I161a8a8cb250240ebc8518c91e746d6f921c41c7
Signed-off-by: Kent Brinkley <jkbrinkley.imgtec@gmail.com>
Reviewed-on: http://openocd.zylin.com/2400
Tested-by: jenkins
Reviewed-by: Mindy Beseler <mbeseler@yahoo.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agojtag ftdi: sample TDO on falling edge of TCK 80/3180/13
Matthias Welwarsky [Tue, 19 Jan 2016 21:36:54 +0000 (22:36 +0100)]
jtag ftdi: sample TDO on falling edge of TCK

Due to signal propagation delays, sampling TDO on rising TCK can become
quite peculiar at fast TCK rates. However, FTDI chips offer a possiblity
to sample TDO on falling edge. With this change, stable operation can be
achieved at 30MHz clock even over 10cm ribbon cable.

Change-Id: Icaf240535dae15512e3c60a944e22a5fbc1b0b06
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3180
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoflash/nor/spi: reorder to group micron devices 07/3207/2
Robert Jordens [Sat, 16 Jan 2016 01:31:12 +0000 (18:31 -0700)]
flash/nor/spi: reorder to group micron devices

Change-Id: Ic5b13e8b994d0741a0a12cd7ed427191b42958e2
Signed-off-by: Robert Jordens <jordens@gmail.com>
Reviewed-on: http://openocd.zylin.com/3207
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
8 years agoquark: add Intel Quark mcu D2000 support 99/3199/2
Ivan De Cesaris [Tue, 12 Jan 2016 15:30:18 +0000 (16:30 +0100)]
quark: add Intel Quark mcu D2000 support

Add support for the Intel Quark mcu D2000 using the new quark_d2xx
target.

Changes to the lakemont part are needed for the D2000 core and
backwards compatible with the X1000 one.

Change-Id: I6e1ef5a5d116344942f08e413965abd3945235fa
Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com>
Reviewed-on: http://openocd.zylin.com/3199
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoHelper time_support: const function arguments 32/3232/2
Alexander Kurz [Sat, 13 Feb 2016 09:54:52 +0000 (10:54 +0100)]
Helper time_support: const function arguments

duration_elapsed and duration_kbps will not modify the struct duration
passed as function argument, hence it should be declared const.

Change-Id: I459c396952c78e907257e2c2f2c630abde92aaa8
Signed-off-by: Alexander Kurz <akurz@blala.de>
Reviewed-on: http://openocd.zylin.com/3232
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoadi_v5_swd: invalidate dap->select during (re)connect 94/3194/2
Tomas Vanek [Sat, 9 Jan 2016 17:56:23 +0000 (18:56 +0100)]
adi_v5_swd: invalidate dap->select during (re)connect

Commit 830d0c55c0920606366a15560d1945f1e1942744 introduced
a regression in error recovery after reconnect:
If first SWD queue run in dap_dp_init() fails, DP_SELECT
does not get reset.

Change-Id: I947e2afe9933e4645a6141ece7816af8e6082cf2
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3194
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agotcl: Support for the miniSpartan6+ board. 17/3117/4
Tim 'mithro' Ansell [Mon, 16 Nov 2015 08:47:53 +0000 (19:17 +1030)]
tcl: Support for the miniSpartan6+ board.

 * https://www.scarabhardware.com/minispartan6/
 * https://github.com/scarabhardware/miniSpartan6-plus/raw/master/miniSpartan6%2B_Rev_B.pdf

The miniSpartan6+ board is wired identically to the Pipistrello device but
sadly doesn't have a custom device description.

Change-Id: I07fd57b1ec87d72edf68860684928a3781e2f08a
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
Reviewed-on: http://openocd.zylin.com/3117
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agotlc/board: Add ATMEL SAM E70 Xplained config 08/3208/6
Manuel Limones [Sun, 17 Jan 2016 07:45:10 +0000 (01:45 -0600)]
tlc/board: Add ATMEL SAM E70 Xplained config

atmel_same70_xplained config using on board embedded debuger

Change-Id: I650ec538b42653662bc273e9f3581a6eda95cd39
Signed-off-by: Manuel Limones <limonesu.me@gmail.com>
Reviewed-on: http://openocd.zylin.com/3208
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
8 years agoflash: nor: {pic32mx,cfi}: fix register names 06/3206/2
Paul Fertser [Fri, 15 Jan 2016 10:22:28 +0000 (13:22 +0300)]
flash: nor: {pic32mx,cfi}: fix register names

Commit fd43be07265b5f3cf3146f2bb80c1c2fc0a44fcf introduced a
regression: since the register names were changed from those
traditional for MIPS to common GDB scheme the code that makes use of
them needs to be changed accordingly.

This commit restores pic32mx flash driver functionality.

Change-Id: Id18c739390fae36737a02dc30c363d0444f53b96
Reported-by: Louis Rannou <louson@users.sf.net>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3206
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoflash/nor/niietcm4: minor fixes 71/3171/7
Bogdan Kolbov [Mon, 14 Dec 2015 13:52:30 +0000 (16:52 +0300)]
flash/nor/niietcm4: minor fixes

niietcm4_write() buffer padding:
add correct buffer padding for 16 bytes.

Args check in FLASH_BANK_COMMAND_HANDLER():
first version of the driver had 7 args, current - 6. This patch will fix
error when flash is rejected (current k1921vk01t.cfg has flash bank init
with 6 args).

Timeouts in flash flag checking procedure:
increase timeouts in niietcm4_opstatus_check() and niietcm4_uopstatus_check()
cause there were problems in some hardware configurations.

JTAG ID:
wrong id in k1921vk01t.cfg replaced with right one.

Signed-off-by: Bogdan Kolbov <kolbov@niiet.ru>
Change-Id: I84296ba3eb4eeda4d4a68b18c94666f1269a500f
Reviewed-on: http://openocd.zylin.com/3171
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agohelper: Add converter from JEP106 ID to manufacturer name 77/3177/3
Andreas Fritiofson [Mon, 28 Dec 2015 17:05:54 +0000 (18:05 +0100)]
helper: Add converter from JEP106 ID to manufacturer name

Use it to print the manufacturer of detected TAPs

Change-Id: Ic4384c61c7f6f7ae2a9b860a805a5997542f72cc
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3177
Tested-by: jenkins
Reviewed-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoam437x: always use highest possible JTAG clock. 90/3190/6
Matthias Welwarsky [Thu, 7 Jan 2016 12:06:37 +0000 (13:06 +0100)]
am437x: always use highest possible JTAG clock.

With DAP WAIT support, it's no longer necessary to start with slow
JTAG clock.

Change-Id: I2cb62c44752b27e6854637e8073e9f9501f5a660
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3190
Tested-by: jenkins
Reviewed-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoarm_adi_v5: dap_partnums - correction of partnumbers, new added 98/3198/7
Jiri Kastner [Wed, 20 Jan 2016 10:21:41 +0000 (11:21 +0100)]
arm_adi_v5: dap_partnums - correction of partnumbers, new added

according to...
ARM DDI 0433B is:
  0x9a5 Cortex-A5 PMU
ARM DDI 0435C is:
  0x955 Cortex-A5 ETM
ARM DDI 0401C is:
  0x950 Cortex-A9 PTM
ARM DDI 0469B is:
  0x931 Cortex-R5 ETM
ARM DDI 0460D is:
  0xc15 Cortex-R5 Debug
ARM DDI 0458C is:
  0x9b7 Cortex-R7 PMU
  0xc17 Cortex-R7 Debug
ARM DDI 0535C is:
  0x95b Cortex-A17 PTM
  0x9ae Cortex-A17 PMU
  0xc0e Cortex-A17 Debug
ARM DDI 0500F is:
  0x9a8 Cortex-A53 CTI
  0x95d Cortex-A53 ETM
  0x9d3 Cortex-A53 PMU
  0xd03 Cortex-A53 Debug
ARM DDI 0488G is:
  0x906 Cortex-A57/A72 CTI
  0x95e Cortex-A57 ETM
  0x9d7 Cortex-A57 PMU
  0xd07 Cortex-A57 Debug
ARM 100095_0002_03_en is:
  0x95a Cortex-A72 ETM
  0x9d8 Cortex-A72 PMU
  0xd08 Cortex-A72 Debug

Change-Id: Ieffefb30f2e75c45fe1a2f9c8204e3a9b1af3d7a
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-on: http://openocd.zylin.com/3198
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoadiv5: introduce optional dap_sync() function 81/3181/14
Matthias Welwarsky [Mon, 28 Dec 2015 21:33:51 +0000 (22:33 +0100)]
adiv5: introduce optional dap_sync() function

dap_sync() executes all commands in the JTAG queue and then checks
if a WAIT condition happened inside the last batch. If yes, a recovery
is invoked. If not, processing continues without checking for
errors. This function should be called in long AP read or writes, e.g.
while uploading a new application binary, at intermediate points within
the transfer where the cost of flushing the JTAG queue and checking the
journal doesn't affect performance too much.

Change-Id: I99eeaf47cdf951e15e589a04e74b90b5ce911386
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3181
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agoadi_v5_jtag: implement DAP WAIT support 66/3166/23
Matthias Welwarsky [Fri, 11 Dec 2015 14:12:56 +0000 (15:12 +0100)]
adi_v5_jtag: implement DAP WAIT support

ADIv5 specifies that DP and AP accesses may generate a WAIT
response when the hardware is not able to complete a request for various
reasons in time before the next request is sent. Currently, the software
treats a WAIT response as a fatal error and aborts operation on the DAP.

This patch implements WAIT handling by keeping a journal of all
outstanding and completed accesses, including their response status.
At certain times (when dap_run() is called), the journal is inspected
for WAIT responses and all discarded accesses are replayed to complete
them. Special care is taken to not re-execute already successfully
completed operations.

Change-Id: I2790070388cf1ab2e8c9a042d74eb3ef776aa583
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3166
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agodrivers: jlink: rework to allow scans of arbitrary length, bump libjaylink 46/2946/4
Paul Fertser [Thu, 27 Aug 2015 11:03:16 +0000 (14:03 +0300)]
drivers: jlink: rework to allow scans of arbitrary length, bump libjaylink

Make the J-Link driver handle everything needed for FPGA programming,
this includes arbitrary long scans and STABLECLOCKS command.

Also, bump to the latest upstream libjaylink to properly support this.

This code is heavily inspired by Andreas Fritiofson's ftdi.c.

Change-Id: Ic5fd87aa88b58ff1138dc2e0a197bb52321b1541
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2946
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoCortex-A: Fix unicode quote in comment 00/3200/2
Evan Hunter [Tue, 12 Jan 2016 17:57:50 +0000 (17:57 +0000)]
Cortex-A: Fix unicode quote in comment

Change-Id: I4747c113ab6c02199f078d9b4a4ec372d011fb2d
Signed-off-by: Evan Hunter <ehunter@broadcom.com>
Reviewed-on: http://openocd.zylin.com/3200
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agojlink: deconflict local variables from global symbols 85/3185/2
Peter A. Bigot [Mon, 4 Jan 2016 20:37:43 +0000 (14:37 -0600)]
jlink: deconflict local variables from global symbols

BeagleBone debian 7 builds produce:
    jlink.c: In function 'jlink_speed':
    jlink.c:218:11: error: declaration of 'div' shadows a global declaration [-Werror=shadow]
    jlink.c: In function 'check_trace_freq':
    jlink.c:1065:54: error: declaration of 'div' shadows a global declaration [-Werror=shadow]
    jlink.c: In function 'config_trace':
    jlink.c:1101:11: error: declaration of 'div' shadows a global declaration [-Werror=shadow]

Fix this by changing the local variable to 'divider'.

Change-Id: I96a0cc0f7d4d4af5a56aa1e918e5416d3c61cbfe
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3185
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoarm_adi_v5: deconflict local variables from global symbols 84/3184/2
Peter A. Bigot [Thu, 31 Dec 2015 15:13:58 +0000 (09:13 -0600)]
arm_adi_v5: deconflict local variables from global symbols

BeagleBone debian 7 builds produce:
   adi_v5_jtag.c: In function 'jtag_ap_q_bankselect':
   adi_v5_jtag.c:336:11: error: declaration of 'select' shadows a global declaration [-Werror=shadow]

Fix this by changing the local variable to 'sel'.

Change-Id: I8e29662ac12bc77d38d5064046d59b7364853cd9
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3184
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agoARM ADIv5: CoreSight ROM decode part number and designer id 28/3128/12
Peter Lawrence [Mon, 28 Dec 2015 21:53:49 +0000 (22:53 +0100)]
ARM ADIv5: CoreSight ROM decode part number and designer id

The existing arm_adi_v5.c code decodes CoreSight peripherals based
on the part number field.  However, these are specific to a
particular manufacturer (often ARM).  The same part number from
two different manufacturers (distinct designer ids) should not
decode as the same CoreSight peripheral.

The Analog Devices ADSP-SC58x and ADSP-BF70x have peripherals that
overlap with existing OpenOCD decoding.  The part number is the
same as existing OpenOCD decoding, but have a different JEP106 code.

Most, if not all, of the existing part number entries in
arm_adi_v5.c are probably specific to ARM. Change all entries
suspected to be designed by ARM to match only ARM's designer ID.

However, to preserve legacy behavior, existing non-ARM entries are
encoded with a wildcard so that they will behave in the same way as
the existing legacy code.  It is desirable, however, to start
encoding the data with designer codes to avoid such ambiguity.

Revising the code to check both the part number and designer id
seemed to a warrant a const array lookup table instead of a
multi-tiered switch statement.

Also try to sync part identification IDs with relevant ARM docs.

Change-Id: Iac1374e4cfc6f04cebb479c0e3fa9bde527cc4a3
Signed-off-by: Peter Lawrence <majbthrd@gmail.com>
[andreas.fritiofson@gmail.com: change JEP106 to designer ID, cleanup]
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3128
Tested-by: jenkins
8 years agolibjaylink: use http mirror for submodule 72/3172/2
Spencer Oliver [Thu, 17 Dec 2015 10:40:50 +0000 (10:40 +0000)]
libjaylink: use http mirror for submodule

The other submodules default to http for users behind firewalls.

Change-Id: I58fce00478ec6c94f75992f4e8f0c24f556abe61
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/3172
Tested-by: jenkins
8 years agotarget: cortex_m: fix segfault with HLA 83/3183/2
Paul Fertser [Wed, 30 Dec 2015 07:43:32 +0000 (10:43 +0300)]
target: cortex_m: fix segfault with HLA

The HLA target shares an examine handler with cortex_m but since it
lacks direct access to DAP, some operations need to be omitted.

Change-Id: Ifdd9d3da4a3a3c2e1c9721284b21d041b3ccaa7a
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/3183
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
8 years agocortex_a: add 'dacrfixup' to cortex-a command group 07/3107/11
Matthias Welwarsky [Tue, 24 Nov 2015 21:11:56 +0000 (22:11 +0100)]
cortex_a: add 'dacrfixup' to cortex-a command group

work around issues with software breakpoints when the text segment
is mapped read-only by the OS. Set DACR to "all-manager" to bypass
TLB permission checks on memory access.

Change-Id: I79fd9b32b04a4d538d489896470ee30b26b72b30
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3107
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
8 years agotcl/fpga: add config file for Altera EP3C10 FPGA (Cyclone III family) 89/2889/2
Antony Pavlov [Mon, 27 Jul 2015 21:42:05 +0000 (00:42 +0300)]
tcl/fpga: add config file for Altera EP3C10 FPGA (Cyclone III family)

Change-Id: I4de5156b3c43f548305f8b9a3943a727fa6f0dbe
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2889
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
8 years agoAM335x: allow simultaneous debugging of A8 and M3 cores 13/3013/4
Matthias Welwarsky [Tue, 13 Oct 2015 10:02:58 +0000 (12:02 +0200)]
AM335x: allow simultaneous debugging of A8 and M3 cores

This patch fixes the tap order so that it matches the actual jtag
chain when all taps are enabled. It also introduces a variable
DEFAULT_TAPS that can be set outside of this script, e.g. on the
command line, to specify which taps are to be enabled on init.
Lastly, a new debug target "am335x.m3" is added so that the Wakeup-M3
can be selected for debugging.

Change-Id: Iccf177fda8d5e3737b1b2bb8fd1eaa7d3262ed9f
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3013
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)