Commit Graph

8369 Commits (684d7d67642ef2805e3c5c25e5183c055464213a)

Author SHA1 Message Date
Tim Newsome 684d7d6764
Remove unused variable. (#284)
Change-Id: Iedebce86b5d914ff612a4747ffdc6f776edca783
2018-08-20 12:42:30 -07:00
Ken Zhang 37d0dd0844 Update s25fl256 flash device id, cypress now. (#285)
* Updated s25fl256 flash device id, cypress now.

* Put the old entry back to support older board.
2018-08-08 13:01:11 -07:00
craigblackmore e4d98b83da Fix target not halting when GDB jumps to a hardware breakpoint (#283)
* Fix target not halting when GDB jumps to a hardware breakpoint

This issue affects riscv-0.11. It is caused by OpenOCD manually
stepping over hardware breakpoints to resume or step after a halt.
This is not necessary as GDB should remove and add breakpoints as
required.

At the moment OpenOCD still steps over hardware watchpoints manually
as GDB needs to know which address triggered the watchpoint and
OpenOCD does not currently provide this information.

Tested on the freedom-e310-arty using the GDB regression suite.
There is one regression which is a corner case caused by a GDB bug.
If a breakpoint is set in GDB and then the executable file is
discarded, GDB reverts to its default information about address
sizes e.g. on the freedom-e310-arty, 0x20400000 becomes
0xffff20400000. As a result, GDB is unable to step over breakpoints
set before the executable was discarded.

* Fix style issues

* Revert "Fix style issues"

This reverts commit 43e7e4b60a0675dce686a6e83ba10b3f0ef62d8a.

* Revert "Fix target not halting when GDB jumps to a hardware breakpoint"

This reverts commit e2717e4cfa3df21b2878791f4b9b8fbcbc2f5195.

* Don't step over breakpoints
2018-08-06 12:41:42 -07:00
Tim Newsome 2d9904ada7
Merge pull request #277 from riscv/fespi_free
Define free_driver_priv for fespi flash driver
2018-07-19 15:21:58 -07:00
Tim Newsome fda1736be8
Merge pull request #282 from riscv/makefile
Mimic openrisc Makefile structure
2018-07-18 16:16:34 -07:00
Tim Newsome f0a9976eaa Mimic openrisc Makefile structure
That's better than inventing our own. Also this fixes a build issue in
the official OpenOCD regression build.

Change-Id: I042faa5b93b26e6f6b2d62bee62f21474ec74131
2018-07-18 13:42:30 -07:00
Tim Newsome 3fbad41f6c
Merge pull request #281 from riscv/docs
Explain what RISC-V targets are supported.
2018-07-17 15:03:35 -07:00
Tim Newsome bda019bdc2 Explain what RISC-V targets are supported.
Change-Id: I4c50a1507ca0fcbdd8340a851e8ab0ae1feca1a2
2018-07-17 14:09:55 -07:00
Tim Newsome 9c6aedac7f
Merge pull request #280 from riscv/docs
Document RISC-V commands.
2018-07-17 12:18:15 -07:00
Tim Newsome c7bcdab242
Merge pull request #275 from riscv/cleanup
Revert unnecessary change.
2018-07-17 12:06:24 -07:00
Tim Newsome 8b25d2f2ee
Merge pull request #279 from riscv/work_area
Use work area instead of riscv-specific config
2018-07-17 12:06:09 -07:00
Tim Newsome adf7ca4a46
Merge pull request #274 from riscv/comment
Explain why reg_cache_values isn't per-hart.
2018-07-17 12:05:53 -07:00
Tim Newsome b6f7cf4e08 Document RISC-V commands.
Change-Id: I7e858368e9bbdb866d2569c686f700693e313eb5
2018-07-16 15:21:50 -07:00
Tim Newsome ead2a595b8 Use work area instead of riscv-specific config
Per review requested at http://openocd.zylin.com/#/c/4578/3

Change-Id: I1a8117665d38844dc1479f33b4f9b7c8f9f101c8
2018-07-16 14:43:15 -07:00
Tim Newsome 29eaa1fac1 Define free_driver_priv for fespi flash driver
Fixes #276.

Change-Id: I42baabfef3e29d7d92de4f1c9211f9c567bcbd34
2018-07-12 16:59:01 -07:00
Tim Newsome d8c31bfd2c Revert unnecessary change.
This reduces the diff with upstream.

Change-Id: I83eaa6317b4ec183f76ca5f7eb69eefe84aaa17a
2018-06-25 14:09:47 -07:00
Tim Newsome 6c59fb8df4 Explain why reg_cache_values isn't per-hart.
Change-Id: Ie67e43bf89fdc68b4b2c12f37fa8a3ec3e6088ef
2018-06-20 14:52:38 -07:00
Tim Newsome 5d9f486404
Merge pull request #266 from gnu-mcu-eclipse/semihosting
target/riscv: add semihosting support
2018-06-12 14:09:59 -07:00
Liviu Ionescu 45921eecd8 target/riscv: fix trailing spaces 2018-06-12 23:58:56 +03:00
Liviu Ionescu 8022a315a6 target/riscv: explain why `arm` commands are used 2018-06-12 23:54:41 +03:00
Tim Newsome f40665c358
Merge pull request #267 from riscv/cleanup
Revert 7927e90a42
2018-06-12 12:52:21 -07:00
Tim Newsome ca93d610f0 Revert 7927e90a42
We don't use VPI anymore, and aren't certain that this must be
upstreamed.

Change-Id: I055bd565f71df3538dd7e186b0fd0a035dd9e988
2018-06-12 12:18:35 -07:00
Liviu Ionescu 08a814686d target/riscv: add semihosting support
- use the semihosting_common code
- to enable it, use the same commands as for arm

Signed-off-by: Liviu Ionescu <ilg@livius.net>
2018-06-12 18:21:01 +03:00
Tim Newsome 32f6d6a857
Merge pull request #265 from riscv/cleanup
Remove dead code.
2018-06-11 14:39:59 -07:00
Tim Newsome f098b553c9
Merge pull request #264 from riscv/from_upstream
From upstream
2018-06-11 14:38:00 -07:00
Tim Newsome 68336052f8 Remove dead code.
Change-Id: I1c9325c0f416a79992ee09b26766a2a18a8a061c
2018-06-11 13:04:44 -07:00
Tim Newsome 17a0523736 Merge branch 'master' into from_upstream 2018-06-11 12:08:08 -07:00
Tim Newsome 6766fa1dda
Merge pull request #263 from riscv/hartsel
Update debug defines to match spec
2018-06-08 10:14:03 -07:00
Tim Newsome 2a6332f620 Update debug defines to match spec
The main difference is we need to deal with hartsello/hartselhi. (Note
that there's a compile-time limit to 16 harts, but that can be changed.)
My largest target has 4 harts, so I can't tell how well this really
works. But it doesn't break anything.

Fixes #240.

Change-Id: Ie1a2a789b5e00f55174994568749da1cf3a33b92
2018-06-06 13:43:35 -07:00
Andreas Färber 06123153f3 psoc5lp: Add NV Latch flash driver
Erasing is not supported by the hardware, it can be written directly.

Tested on CY8CKIT-059, except modifying-write.

Change-Id: I6e920ed930dcd5c7f0b10c5b1b4791a828d9080a
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3434
Tested-by: jenkins
2018-06-06 18:12:21 +01:00
Tomas Vanek 53376dbbed flash/nor/psoc5lp: fix bad commit 2d5f2ede55
Change #3432 was merged into git master without adapting it
to #4297 "prepare infrastructure for multi-block blank check".
This is a fast fix of PSoC5LP specific blank check.
Not tested on real PSoC5LP device.

Change-Id: I7dc13ee7bd1f07b2bfe5a93a5030c0c482d30f00
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4557
Tested-by: jenkins
2018-06-06 17:42:24 +01:00
Edward Fewell fb287ec5f5 drivers: xds110: Remove unnecessary and deprecated libusb function.
libusb-1.0.22 has deprecated the libusb_set_debug function. This
function was present in the XDS110 driver as an artifact left over
from early debugging. It isn't required because logging is disabled
by default. Removing it to simplify the code and no longer need to
have libusb version specific #if's in the code.

Change-Id: I9c3f16c039da3f3fad9c4a1169978b0d85a1b45c
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/4553
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2018-06-06 15:50:39 +01:00
Andreas Färber f1427cca3c psoc5lp: Add EEPROM flash driver
Tested on CY8CKIT-059.

Change-Id: Ib02262e8eebf0df3d29492b8a7daa65b262da580
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/3433
Tested-by: jenkins
2018-06-06 15:49:14 +01:00
Andreas Färber 2d5f2ede55 flash/nor: Add PSoC 5LP flash driver
Always probe for ECC mode and display ECC sectors if disabled.
Non-ECC write is implemented as zeroing the ECC/config bytes.
Erasing ECC sectors is ignored, erase-checking takes them into account.

Tested with CY8CKIT-059 (CY8C5888), except ECC mode.

Change-Id: If63b9ffca7ad8de038be3c086c49712b629ec554
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Reviewed-on: http://openocd.zylin.com/3432
Tested-by: jenkins
2018-06-06 15:48:33 +01:00
Edward Fewell d02de3a8a9 flash/nor: Add support for TI CC3220SF internal flash
Added cc3220sf flash driver to support the TI CC3220SF
microcontrollers. Implemented flash driver to support the
internal flash of the CC3220SF. The implementation does not
support the serial flash of the CC32xx family that requires
connection over UART, and not via JTAG/SWD debug. Added config
files for both CC32xx devices (no flash) and CC3220SF (with
flash).

Updated to implement comments from code review.
Additional updates to handle remaining comments from review.
Additional updates per review.

Added code to only request aligned writes and full 32-bit
words down to flash helper algorithm. Updated for recent
changes in OpenOCD flash code.

Removed cc32xx.cfg file made obsolete by this patch.
Change-Id: I58fc1478d07238d39c7ef02339f1097a91668c47
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/4319
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-06-06 15:38:25 +01:00
Omair Javaid a077715b71 Fix Semihosting FileIO for targets using vcont packet
This patch fixes a bug where target fails to resume after completing GDB FileIO.
We need to update target last run control information to decide resumption. This
was not being done for vcont packets.

Change-Id: I44bea31720f8b877dba97d77a202303d546ea5bd
Signed-off-by: Omair Javaid <omair.javaid@linaro.org>
Reviewed-on: http://openocd.zylin.com/4539
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-06-06 15:23:04 +01:00
Liviu Ionescu 7028f53877 target/target.c: free semihosting member
When destroying the target, if the semihosting
pointer is set, free it.

Change-Id: I07d34918bb3fddab1eee11219dd66f4842708ec1
Signed-off-by: Liviu Ionescu <ilg@livius.net>
Reviewed-on: http://openocd.zylin.com/4552
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-06-06 15:22:51 +01:00
Khem Raj ebf2d73340 Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option
libusb_set_debug is deprecated in libusb >= 1.0.22 therefore replace
with equivalent libusb_set_option()  API

Change-Id: Ic0287a1bc0ccc90afe8e4c688085f0b25a7fb004
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-on: http://openocd.zylin.com/4540
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-06-05 12:36:53 +01:00
Christopher Head 95a0024ef2 target/cortex_m: constify some variables
Change-Id: I1f3fddd89597333fc1bb9535c0cd76ca3e008324
Signed-off-by: Christopher Head <chead@zaber.com>
Reviewed-on: http://openocd.zylin.com/4503
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-06-05 11:30:19 +01:00
Bohdan Tymkiv 69b0021846 flash/nor/virtual: copy missing fields from master flash_bank structure
Change-Id: I4ac71ad4b46ed613192310d85eb385b727649a11
Signed-off-by: Bohdan Tymkiv <bhdt@cypress.com>
Reviewed-on: http://openocd.zylin.com/4505
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
2018-06-05 11:29:57 +01:00
Bohdan Tymkiv 456f982868 flash/nor/core: fix double-free crash with 'virtual' flash banks
flash_bank structure of 'virtual' flash driver is a full copy of
the master flash_bank structure including bank->sectors and
bank->prot_blocks pointers. These pointers point to memory
locations allocated by the master driver and thus master driver
is responsible for deallocating them.
Do not free bank->sectors and bank->prot_blocks of 'virtual'
driver since they were already released by master flash driver.

Change-Id: I01f373d4adb3fc79e2724964926b9276442c5c52
Signed-off-by: Bohdan Tymkiv <bhdt@cypress.com>
Reviewed-on: http://openocd.zylin.com/4504
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-06-05 11:29:33 +01:00
Tim Newsome e5d4c99bd6
Merge pull request #262 from riscv/from_upstream
From upstream
2018-06-04 20:16:18 -07:00
Antonio Borneo 5952f5e50a breakpoints: simplify the test to find a breakpoint
The test is overly complicated and unreadable.
Simplify it while keeping the exact same behaviour.

Change-Id: I6b22291ca454e1eddeeab4024d3983dc4c603d3a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4512
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-06-04 09:17:14 +01:00
Antonio Borneo 74831e74c8 target: fix syntax in help message
The name of the command is already printed before the string
in ->usage, thus it appears twice.
E.g.
	> help examine
	  stm32f4x.cpu arp_examine arp_examine ['allow-defer']
	        used internally for reset processing
	  stm32f4x.cpu examine_deferred examine_deferred
	        used internally for reset processing
	  stm32f4x.cpu was_examined was_examined
	        used internally for reset processing

Remove the command name from the string in ->usage.

Change-Id: If3b1368ffff8a94eb629ae3679e2e5f2f11ae92e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4536
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-06-04 09:17:03 +01:00
Kamal Dasu cad39b7390 target: aarch64: Adding mcr, mrc 32-bit coprocesor read/write support
Adding mrc and mcr support for 32-bit boot mode on aarch64 target.

Change-Id: I3879908253ccdf79509dcad752871f422526ec64
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-on: http://openocd.zylin.com/4483
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-06-04 09:16:47 +01:00
Liviu Ionescu 2517bae6c1 Rework/update ARM semihosting
In 2016, ARM released the second edition of the semihosting specs
("Semihosting for AArch32 and AArch64"), adding support for 64-bits.

To ease the reuse of the semihosting logic for other platforms
(like RISC-V), the semihosting code was isolated from the ARM
target and updated to the latest specs.

The new code is already in use since January (in GNU MCU Eclipse
OpenOCD) and no problems were reported, neither for ARM nor for
RISC-V targets, after more than 7K downloads.

The 2 new files were formatted with uncrustify.

Change-Id: Ie84dbd86a547323bb8a5d24eab68fc7dad013d96
Signed-off-by: Liviu Ionescu <ilg@livius.net>
Reviewed-on: http://openocd.zylin.com/4518
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-06-04 09:16:08 +01:00
Paul Fertser cdf1e826eb jtag: drivers: sysfsgpio: lift upper gpio number limit
Recent Linux maps GPIOs from 1023 downwards so do not limit the number
to 1000.

This should fix #183.

Change-Id: I6d4f493b670be9ed9b82759f0fb686a9faddbbf5
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/4502
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-05-31 13:25:30 +01:00
Edward Fewell 2ba27e2f3e jtag/drivers: Add support for TI XDS110 debug probe
Add support for the XDS110 debug probe using the APIs in the
probe's firmware. Includes support for older versions of the
firmware (with reduced performance) and support for a newer
version that includes OpenOCD specific APIs. Tested on various
TI LauchPads including MSP432P4, MSP432E4, CC2650, CC2652, and
CC3220SF.

Updated to add better support for swd switch. Removed issues found with
clang static analysis.

Updated to add rules entry for the XDS110 probe and Tiva DFU mode (which
affects both XDS110 and ICDI probes).

Change-Id: Ib274143111a68e67e80003797c6a68e3e80976b2
Signed-off-by: Edward Fewell <efewell@ti.com>
Reviewed-on: http://openocd.zylin.com/4322
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-05-31 13:25:16 +01:00
Tim Newsome b39b05ff77 Merge branch 'master' into from_upstream 2018-05-30 16:06:08 -07:00
Paul Fertser b50fa9a19d Fix warnings exposed by GCC8
gcc (GCC) 8.1.0 generates new warnings and thus fails the build.

The ARM disassembler warnings actually exposed a bug in SMALW, SMULW and
SMUL instructions decoding.

Reported by Eimers on IRC.

Change-Id: I200c70f75a9e07a1f13a592addc1c5fb37714440
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/4526
Tested-by: jenkins
Reviewed-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2018-05-30 09:36:46 +01:00