Commit Graph

7978 Commits (11e51af3b19e3e786693920d001a34603fcce328)

Author SHA1 Message Date
Tim Newsome 3ba6d46fc2 Remove unused functionality.
Change-Id: Ic70cebd62bbd04f7ae5566504fbb279a11de57f0
2017-10-23 14:45:58 -07:00
Tim Newsome 5425c871c9 Properly fix memory read when encountering busy.
Change-Id: I377054495e860076edc2f38d1cc0f11c23f98d3b
2017-10-23 14:13:46 -07:00
Freddie Chopin 079d78f7de Fix GCC7 warnings about string truncation
GCC7 with -Wall warns about possible string truncation with
snprint()-type functions with "directive output may be truncated writing
1 byte into a region of size between 0 and 9
[-Werror=format-truncation=]" + "note: ‘snprintf’ output between 5 and
14 bytes into a destination of size 12" (or similar). Fix this by
increasing sizes of buffers.

See https://gcc.gnu.org/gcc-7/changes.html

Change-Id: Ib848f2a56dd658783534158947ae1be7c0e99d45
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/4175
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
2017-10-23 10:54:24 +01:00
Freddie Chopin 9364b0dba4 Fix GCC7 warnings about switch-case fallthroughs
GCC7 with -Wextra warns about switch-case blocks which fallthrough with
"this statement may fall through [-Werror=implicit-fallthrough=]". This
can be fixed by adding "special" comments: "/* fallthrough */".

See https://gcc.gnu.org/gcc-7/changes.html

Change-Id: Iba0be791dbdd86984489b2d9a0592bb59828da1e
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-on: http://openocd.zylin.com/4174
Tested-by: jenkins
2017-10-23 10:54:16 +01:00
Andreas Fritiofson ef49b34b2a arm: semihosting: set command line arguments
Add "arm semihosting_cmdline [argv0 argv1 ...]" for setting the
command line arguments for the debuggee.

[andreas.fritiofson@gmail.com]: Dynamic allocation, empty default

Change-Id: I831ddd161d602f251940e29608a154e9590fdee1
Signed-off-by: Christian Groessler <chris@groessler.org>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3106
Tested-by: jenkins
2017-10-22 23:06:09 +01:00
Tim Newsome a3a137062d Pay attention to impebreak.
This required updating debug_defines.h, which caused a few other small
cleanups as well.

Change-Id: I3c2cb418d7eff3093d7664c5563b2af5e8b530eb
2017-10-18 14:21:23 -07:00
Tim Newsome 85bfab36ad Remove unused functionality.
Change-Id: I0c1464e2e6aa12d0cb1025ed0a7c1c483e7403b7
2017-10-18 12:47:07 -07:00
Tim Newsome 5d3f5c35d2 Still restore registers if an access failed.
Change-Id: I11571f0926f69a34f95b4929f633fdecd3a4e810
2017-10-18 12:32:41 -07:00
Tim Newsome 7edd9b1786 Fix FPR access.
Change-Id: I1379de87904f1cf40b45d1a5490249e3ba90d7d0
2017-10-18 11:47:15 -07:00
Tim Newsome 1662508911 Differentiate "target not halted" messages.
Change-Id: I8728fa007289d7af5c6791142e76eb5777c83ca4
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4244
Tested-by: jenkins
Reviewed-by: Liviu Ionescu <ilg@livius.net>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-10-18 08:38:18 +01:00
Tim Newsome 1356be121e Document `struct reg` fields.
Change-Id: I286316079e2e4d4f09427a4ffbecadb48c5dc9d9
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4250
Tested-by: jenkins
Reviewed-by: Liviu Ionescu <ilg@livius.net>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2017-10-18 08:35:42 +01:00
Tim Newsome a0623b2fa8 Don't crash when encountering RV64.
Change-Id: Ie915ce830c3499919e4918ad443a5e225cf8c4d9
2017-10-17 11:58:51 -07:00
Tim Newsome 65be0776d8 Memory read/write works if the core can keep up.
Change-Id: Ieca50ece266fbc9d2ff16a5cc2e6b4b926ad5e6f
2017-10-17 11:52:07 -07:00
Tim Newsome fbe2980eb7 MemTest64 passes.
Change-Id: I75996b71c3f31025c89ef596a08e01d191405336
2017-10-17 11:15:51 -07:00
Tim Newsome d94b38279a Memtest{16,32} pass.
Change-Id: I15c2a4fd2bb9a7b30762d07f3b3a74d2f477746b
2017-10-16 21:08:59 -07:00
Peter Griffin 0e02fe40c6 tcl: add hi3798 target and Tocoding Poplar board config
This config covers the 4x Cortex A53 CPUs. A custom connector
is required from J14 to standard ARM JTAG on v1 boards. However
v2 hardware should have a standard FTSH-105-01-L-DV connector.

Pinmuxing code to enable JTAG pins is included in l-loader-poplar
repository, so board is flashed with open source code, JTAG
is available at very early boot. Alternatively the following
pokes can be issued from U-Boot to enable JTAG (e.g. to debug
hisilicon SDK).

mw 0xf8a210ec 0x130;
mw 0xf8a210f0 0x130;
mw 0xf8a210f4 0x130;
mw 0xf8a210f8 0x130;
mw 0xf8a210fc 0x130;
mw 0xf8a21100 0x130;

Change-Id: I2b83dfcb3dc5461c1620f94dd99aa7b31fdda59b
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Reviewed-on: http://openocd.zylin.com/4161
Tested-by: jenkins
Reviewed-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-10-16 14:10:52 +01:00
Tim Newsome 7ec7bc32fe At least some memory writes work.
Change-Id: I6fcf261341f10ec34df01bb844744439d02471a8
2017-10-13 12:50:02 -07:00
Tim Newsome e7bb815e87 Register read/write might be working.
Change-Id: I6c51d6157dde56d8cd666b4d30ec7bbc7a4bef9f
2017-10-12 14:38:52 -07:00
Tim Newsome 94e8250713 WIP; doesn't work.
Change-Id: Ia407e82ccbd2044ad61e0845d285dd5765154476
2017-10-12 11:45:52 -07:00
Tim Newsome 77802af655 Remove duplicate progbuf size variable.
Change-Id: I662ff84d13ecfc7faae51406a4df57a3643116f0
2017-10-10 16:27:51 -07:00
Tim Newsome f06aaa9058 Merge pull request #123 from riscv/fast_rbb
Add read buffer to bitbang, improving performance.
2017-10-09 11:06:20 -07:00
Tim Newsome ed415c3cb6 Merge pull request #129 from riscv/minor_revert
Revert this LOG_INFO to LOG_DEBUG.
2017-10-09 11:06:08 -07:00
Tim Newsome 2da7820833 Revert this LOG_INFO to LOG_DEBUG.
Change-Id: I75dd7667a542aa1c6ea10f97fe1e00dd1ecba69d
2017-10-08 11:41:55 -07:00
Tim Newsome 7aafd61953 Clean up this JTAG debug code.
Change-Id: Ie7c773b98271d11085d5e50c40b64990710de387
2017-10-06 13:55:52 -07:00
Tim Newsome d5836dceff Merge pull request #126 from riscv/compile
Fix compile warnings.
2017-10-04 16:07:40 -07:00
Tim Newsome 24658db50e Fix compile warnings.
Partly fixes #124.

Change-Id: I3a7fd65c643e40b142709806cb9fb4cc62bb955f
2017-10-04 16:02:30 -07:00
Tim Newsome 77680cb23d Merge pull request #125 from riscv/cleanup
Revert ae74097f (extra ftdi debug).
2017-10-04 15:48:34 -07:00
Tim Newsome 916759e0de Revert ae74097f (extra ftdi debug).
Instead it makes more sense to push the debug changes to jtag/core.c.

Change-Id: I73bafa2a054e1f72b7752cfbce9ffc14303fc4c4
2017-10-04 15:44:07 -07:00
Tim Newsome 28eb10f43d Ensure the buffer doesn't overflow.
Tested with a variety of prime buffer sizes.

Change-Id: I2b4835d46adf4c971111da88e8de4b46eb8dad41
2017-10-04 15:23:38 -07:00
Tim Newsome abe7eba25a Merge pull request #118 from riscv/priv
Fix priv access
2017-10-04 12:52:21 -07:00
Tim Newsome 1b11d579ea Add read buffer to bitbang, improving performance.
This reduces the time for one testcase where OpenOCD connects to a
simulator from 12.30s to 5.35s!

Running all our tests went from 13m13s to 3m55s.

Change-Id: I7dc774e1e0f5752905ac4318fd9b85b930374a05
2017-10-03 15:38:31 -07:00
Tim Newsome a3c26250bf Merge pull request #116 from riscv/multigdb
Fix trigger code to work with multi-gdb mode instead of RTOS mode
2017-10-03 11:53:58 -07:00
Tim Newsome e94c809ce4 Merge pull request #120 from gnu-mcu-eclipse/riscv-warnings
Silence some clang warnings
2017-10-03 11:27:57 -07:00
Tim Newsome 2f6dd2a4b5 Merge pull request #121 from gnu-mcu-eclipse/riscv-reorder
flash/nor/Makefile.am: keep files in lexicographical order
2017-10-03 11:26:32 -07:00
Slowcoder 2168c475ff nrf5: Add nRF52832-QFAA support
Change-Id: Ica9e34e873cac182662b1e32a9b3164dbc0c935f
Signed-off-by: Slowcoder <slowcoder@gmail.com>
Reviewed-on: http://openocd.zylin.com/4210
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:28:20 +01:00
Slowcoder d43308af75 nrf51: Rename to nrf5
Renaming of all nrf51 NOR flash code to nrf5, as to prepare the
code for being able to flash nrf51 and nrf52 chips.

The nrf51 command is retained for backwards compatability.

"nRF5" is also the name Nordic Semiconductor uses to describe
both the nrf51 and nrf52 chips.

Change-Id: I5f4e3f1ec780184b28ad44f735a746e68908c502
Signed-off-by: Slowcoder <slowcoder@gmail.com>
Reviewed-on: http://openocd.zylin.com/4209
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:28:13 +01:00
Slowcoder 52885d2b53 nrf51: Refactor device-list
This cleans up the list of supported nrf51 chips considerably.

Change-Id: Ic74685657bb72a8703c0a49df4c48c54604ec2a7
Signed-off-by: Slowcoder <slowcoder@gmail.com>
Reviewed-on: http://openocd.zylin.com/4208
Tested-by: jenkins
Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:28:03 +01:00
Uwe Bonnes 9bbe299b35 stm32lx.c: Read IDcode at appropriate address.
Trying to read the L0 idcode at the L1 idcode address 0xE0042000 often
resulted in an uncatched error. Reading at the right L0 address 0x40015800
afterwards results in reading 0. So access to the device is denied..

Change-Id: I6de92cf99a5d5d46c72f9ba055613cbc5753a951
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3883
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:25:27 +01:00
Oleksij Rempel 5384d2c209 target: atheros_ar9344: add simple uart0 test
in some cases we need something to test if uart is actually
properly connected.

Change-Id: I5a16b053164b34bb30ae8370753be12887a85c51
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/4194
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:24:46 +01:00
Oleksij Rempel ffa745b835 board: add TP-Link WDR4300 config
tested on TP-Link WDR4300 v1.7

Change-Id: If2b456afac835ab3a3987d434d20824c7ba75b93
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/4192
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:24:39 +01:00
Oleksij Rempel e548d17f62 target: add atheros_ar9344.cfg
Change-Id: I005b4c78ccb0fec8d38a25430cb49c580dcd8df5
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/4191
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:24:15 +01:00
Oleksij Rempel f441f58ad6 board: tp-link_tl-mr3020: add ath79 support
Finally we can use this driver by default!

Change-Id: I09d215d1bd1dc16873a7379637e6869af65ad8f1
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/4193
Tested-by: jenkins
Reviewed-by: Dmytro <dioptimizer@hotmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:24:10 +01:00
Robert Foss f712098323 server: Add port number to socket bind error
Make this error message more useful by providing the port number
that we tried to bind to.

Change-Id: Ieb18adf0725a6ae99c77ebfaadc49d64ed407bbe
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-on: http://openocd.zylin.com/4157
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:23:15 +01:00
Diego Herranz 5a6f0495db tcl/interface/ftdi: improve minimodule config
- Tested on a real FT2232H MiniModule, so warning removed.
- Every pin initially set to high impedance except TCK, TDI,
  TDO and TMS: Safest values given it's an evaluation board
  and the rest of pins might be connected to something else.
- Reset is now initially de-asserted (it was asserted
  which is not recommended).
- nRST pin choice is arbitrary so comment added (wondering
  if it should be an "echo").
- "-oe" option added to NRST signal so it can be set as
  high impedance (tri-stated).

Change-Id: I967ab0c7bbccf72dbf6d6d78b3180b74e016e0d6
Signed-off-by: Diego Herranz <diegoherranz@diegoherranz.com>
Reviewed-on: http://openocd.zylin.com/4185
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:22:56 +01:00
Andrea Merello 10a3b24daf flash: efm32: add support for EFR-familty (e.g. bluegecko)
This patch adds support for Blue Gecko and Mighty Gecko chips from
Silabs.

They have different EFM32_MSC_REGBASE and LOCK register offset.

Based on the original patch from Andreas Kemnade.

Change-Id: I166c14960ced7c880b68083badd1b31372fefabe
Cc: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Reviewed-on: http://openocd.zylin.com/4034
Reviewed-by: Jonas Norling <jonas.norling@cyanconnode.com>
Tested-by: jenkins
Reviewed-by: Fredrik Hederstierna <fredrik@hederstierna.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: chrysn <chrysn@fsfe.org>
2017-10-03 11:22:18 +01:00
Jonathan McDowell f95f8b70fb tcl/interface/ftdi/sheevaplug: Fix FTDI channel configuration
The migration from the old ft2232 driver to the new generic ftdi driver
ended up breaking support for the SheevaPlug device. The old driver
defaulted to channel 1, but numbered the channels 1 to 4. The new driver
starts at 0. The SheevaPlug JTAG is on interface A (interface B is the
serial console), so it should be using channel 0. Fix this. Confirmed
as working; serial console remains available and a new u-boot image can
be transferred across using the JTAG link.

See also Debian Bug#837989; https://bugs.debian.org/837989

Change-Id: I4ac2bfeb0d1e7e99d70fa47dc55f186e6af2c542
Signed-off-by: Jonathan McDowell <noodles@earth.li>
Reviewed-on: http://openocd.zylin.com/4206
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
2017-10-03 11:20:18 +01:00
Fabio Utzig e8b6aaa8e5 Add missing break
Change-Id: Ie1de679fe6ab5ace05fc3e156c71f34b296b3d3b
Signed-off-by: Fabio Utzig <utzig@apache.org>
Reviewed-on: http://openocd.zylin.com/4200
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Esben Haabendal <esbenhaabendal@gmail.com>
2017-10-03 11:19:58 +01:00
Marc Schink 5fd8eaadf9 stm32f2x: Fix left shift of negative value
Use unsigned constant for left shift operation in order to avoid the
following error with GCC >= 6.0:

../src/flash/nor/stm32f2x.c: In function ‘stm32x_handle_unlock_command’:
../src/flash/nor/stm32f2x.c:1324:67: error: left shift of negative value [-Werror=shift-negative-value]
   stm32x_info->option_bytes.optcr2_pcrop = OPTCR2_PCROP_RDP | (~1 << bank->num_sectors);

Change-Id: I0ac082bd0dbb8dc2f61ffff8fdf486ab7962d2e0
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4207
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Anton Fosselius <anton.fosselius@gmail.com>
Reviewed-by: Esben Haabendal <esbenhaabendal@gmail.com>
2017-10-03 11:19:45 +01:00
Tim Newsome 18a94a1a8a Fix typo in comment.
Change-Id: I6567f85f399315e1dac98881765dfaa6eab5facb
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4238
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:19:26 +01:00
Marc Schink b0dcff5e34 jlink: Disable TCP/IP discovery
If no serial number is specified, disable TCP/IP device discovery to
ensure that a user does not unintentionally operate on a remote device.

Change-Id: I6a7e913b8b679fae003825468cd86d2014849b29
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4214
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2017-10-03 11:19:10 +01:00