Commit Graph

8267 Commits

Author SHA1 Message Date
Tim Newsome 0d60a29c21
Merge pull request #178 from riscv/cleanup
Rename dummy variable to be correct.
2018-01-10 15:16:40 -08:00
Tim Newsome 160b794274
Merge pull request #181 from riscv/propagate_errors
Propagate register read errors
2018-01-10 15:16:19 -08:00
Tim Newsome 29c7a76708 Muck with mstatus to always be able to read FPRs
Change-Id: I7ff8bde4578c9ddd175c5cca370295c790cfbba7
2018-01-09 12:06:11 -08:00
Forest Crossman 6f5e9941df jtag/drivers/kitprog: Enable LOG_DEBUG_IO
Change-Id: Ic01b0acf01e18bcb2bf98c101c7b5888cdc10186
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Reviewed-on: http://openocd.zylin.com/4323
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-01-09 16:22:30 +00:00
Matthias Welwarsky 3cba4bd4cb aarch64: fix crash on single-stepping
Make sure to skip un-examined targets (e.g. targets with deferred
examination) on single-stepping

fixes bug #158

Change-Id: Ib40c6fee03079fd078bd52a84615e6f8a081d128
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/4184
Tested-by: jenkins
Reviewed-by: Yao Qi <qiyaoltc@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2018-01-09 09:37:14 +00:00
Tim Newsome fd506fa839 Propagate register read errors.
Change-Id: Idda111377873a2236b5b91e4ffdabd2be384b47a
2018-01-08 11:53:02 -08:00
Tim Newsome 0e3869cbf6
Merge pull request #179 from riscv/multicore_hart_selection
Select current hart before reading memory.
2018-01-05 14:07:38 -08:00
Tim Newsome 11e51af3b1
Merge pull request #173 from riscv/warn_names
Use register names instead of numbers in warnings
2018-01-05 13:07:08 -08:00
Tim Newsome 37434ffd77 Rename dummy variable to be correct.
Change-Id: I329404894227bb3cf563382e1adf0edda702543b
2018-01-05 13:05:33 -08:00
Tim Newsome a6b503217d
Merge pull request #174 from riscv/delay_info
Make delay update messages debug instead of info.
2018-01-05 13:03:14 -08:00
Tomas Vanek 81a33244df arm_adi_v5: reduce some CSW writes
MEM-AP access through banked data registers MEM_AP_REG_BD0..3
does not increment TAR regardless of the current autoincrement mode.
mem_ap_read_u32() and mem_ap_write_u32() can keep the current
autoincrement mode instead of switching autoincrement off.

Change-Id: Ib7ec688d3e04f1da678363cd2819ce90e8910e58
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4163
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2018-01-05 10:06:39 +00:00
Tomas Vanek 4553abf906 arm_adi_v5: fix wrong addressing after change of CSW_ADDRINC
Problem: If the same memory location is accessed alternatively
by MEM-AP banked data registers without autoincrement and by standard
autoincremented read/write, TAR register is not updated correctly.

How to replicate: On a Cortex-M issue
    mdw 0xe000edf0
multiple times. When poll is on (poll reads the same memory location)
only the first read is correct.
0xe000edf0: 01000000
0xe000edf0: 00000000
0xe000edf0: 20002640
0xe000edf0: 01000000
0xe000edf0: 00000000
0xe000edf0: 00000000

No problems with poll off.
0xe000edf0: 01000000
0xe000edf0: 01000000
0xe000edf0: 01000000

mem_ap_setup_tar() writes to MEM_AP_REG_TAR if requested TAR value
changed or CSW_ADDRINC_... is currently active.
However if an autoincremented access has been issued and autoinc
switched off in CSW afterwards, TAR does not get updated.

The change introduces mem_ap_update_tar_cache() which is called
after queuing of any access to MEM_AP_REG_DRW. It simulates
TAR increment to keep tar_value in sync with MEM_AP.
Crossing tar autoincrement block boundary invalidates cached value.

mem_ap_write() and mem_ap_read() do not check tar autoincrement
block boundary, mem_ap_setup_tar() is called before each transfer instead.

dap_invalidate_cache() is introduced to ensure invalidation
of all cached values during dap_dp_init() and swd_connect()

Change-Id: I815c2283d2989cffd6ea9a4100ce2f29dc3fb7b4
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4162
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2018-01-05 10:06:30 +00:00
Tim Newsome 6f3913cedc Select current hart before reading memory.
This avoids trying to read memory from the wrong hart, if the current
hart was changed by an earlier call (eg. to poll()).

Change-Id: I73da1e01c8d01d68f01ac7fdd6c548380a70cfd3
2018-01-04 17:12:01 -08:00
Tim Newsome 097d62d159 Make delay update messages debug instead of info.
They confuse users otherwise.

Change-Id: I3bc491352f5384e36c54696a0ecbf11ac623dd83
2018-01-04 13:36:53 -08:00
Megan Wachs 33aad3524b
Add a comment in dbus_read
This just comments the current behavior
2018-01-04 13:27:35 -08:00
Tim Newsome 07e19e17cb Use register names instead of numbers in warnings
Change-Id: Ie2295d30fd9dfeb7590f5e34d572497a93a3ce7b
2018-01-04 13:27:18 -08:00
Bas Vermeulen ada631cc5f target aarch64: rework memory read/write to use 8/16/32 bit operations
The existing code only used Memory Access mode to read memory,
which uses 32 bit operations only.
Rework the code to check the alignment/size of the read/write operation,
and use the Memory Access mode to read aligned 32 bit memory.
When using unaligned access, or 8 or 16 bit reads, use LDR{BHW} and STR{BHW}
instead.

The exception handling is still the same as it was before (meaning it breaks
when things go wrong), but I can now read an 8 bit register correctly.

Change-Id: I739a5ee825c0226ed4a89c32895cc2a047b8dc15
Signed-off-by: Bas Vermeulen <bas@daedalean.ai>
Reviewed-on: http://openocd.zylin.com/4301
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2018-01-04 09:09:46 +00:00
Tim Newsome 82529e71e0
Merge pull request #170 from riscv/strtoull
Parse 64-bit CRC addrs even on 32-bit hosts
2018-01-03 12:48:36 -08:00
Tomas Vanek bb976e3c38 jtag/drivers/cmsis-dap: fix connect under reset
Commit ef02b69b14 included
a call to cmsis_dap_cmd_DAP_Connect() before calling
cmsis_dap_cmd_DAP_SWJ_Sequence(). According to comment
it is necessary for at least Keil ULINK-ME.

Commit 72c3464be4 added
a cmsis_dap_cmd_DAP_Disconnect() before connect call to pair
connection/disconnection. It solves some problems on Atmel EDBG.

Unfortunately calling either of cmsis_dap_cmd_DAP_Connect()
or cmsis_dap_cmd_DAP_Disconnect() deasserts reset signal.
So these workarounds break ability to connect under reset.

Use cmsis_dap_cmd_DAP_Disconnect() and cmsis_dap_cmd_DAP_Connect()
pair only if both SRST and TRST are deasserted.

Change-Id: I0914dae0a1360b8c7fe48231ff3867caedfb2dbe
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reported-by: Leonardo Sabino dos Santos <leonardo.sabino@gmail.com>
Reviewed-on: http://openocd.zylin.com/4100
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2018-01-03 10:56:32 +00:00
Tim Newsome 2eddd8e092 Parse 64-bit CRC addrs even on 32-bit hosts
Change-Id: I38720163eff292b2c24f25da4e25feb8245ff672
2018-01-02 12:58:46 -08:00
Tim Newsome f822956994
Merge pull request #169 from riscv/unused_boards
Remove board files that I shouldn't have added
2018-01-02 12:19:55 -08:00
Tim Newsome 1ddbe70443 Remove board files that I shouldn't have added
There are 3 other ones for the SiFive target.

Change-Id: I987331a82186a3738096cc390c91889118bf9ac2
2017-12-29 13:11:27 -08:00
Tim Newsome ab5a98663e
Merge pull request #168 from gnu-mcu-eclipse/sifive-cfg
Add config files for the SiFive boards
2017-12-29 11:39:57 -08:00
Liviu Ionescu bd566a98bc add configs for the SiFive boards
- the HiFive1 board definition includes the FTDI interface
- the Arty boards require external interface definitions
2017-12-29 17:36:54 +02:00
Tim Newsome 603ed9c419
Merge pull request #167 from riscv/sifive_cfg
Add config files for SiFive RISC-V hardware.
2017-12-28 16:34:57 -08:00
Tim Newsome c27a777eb8
Merge pull request #165 from riscv/typo
Fix typo.
2017-12-28 16:13:11 -08:00
Tim Newsome 8150358cde Add config files for SiFive RISC-V hardware.
Copied from https://github.com/gnu-mcu-eclipse/openocd

Change-Id: Ia0b3e192ca8b3bae6035623d605c9980e9bccd2c
2017-12-28 16:10:41 -08:00
Tim Newsome 52368d6ea1 Fix typo.
Issue #164

Change-Id: I083ba0d7df72a83a802297baa25753f8d274519a
2017-12-28 11:52:59 -08:00
Tim Newsome 0774011e21
Merge pull request #163 from riscv/no_abort
Get rid of abort() calls.
2017-12-27 14:01:46 -08:00
Tim Newsome 365c79c3ff Get rid of abort() calls.
Also changed a few asserts that could trigger due to broken hardware.

Fixes Issue #142.

Change-Id: Ia2b99baa82f30ebcb2fd7e4902f0e67046ce4ed2
2017-12-27 13:45:50 -08:00
Tim Newsome d7ed191457
Merge pull request #162 from riscv/no_abort
Propagate error instead of calling abort().
2017-12-27 10:00:59 -08:00
Tim Newsome 06445f5743 Propagate error instead of calling abort().
As part of this I improved the memory read/write fatal error handling a
bit. Now at least we try to leave autoexec turned off, and will even
restore the temp registers if the situation isn't too hosed for that.

Partly addresses Issue #142

Change-Id: I79fe3f862f11c6d20441f39162423357e73a40c1
2017-12-26 15:04:02 -08:00
Tim Newsome ca700dcef0
Merge pull request #161 from riscv/dead_code
Remove unused code.
2017-12-26 14:54:00 -08:00
Tim Newsome 4fa3d819d2 Remove unused code.
Change-Id: Ibc72945ac76513c84d62616c0210e6013b21f7ef
2017-12-26 14:27:44 -08:00
Tim Newsome 561b0c94c0
Merge pull request #160 from riscv/style
Conform to OpenOCD style guide.
2017-12-26 14:01:54 -08:00
Tim Newsome d942bce996 Conform to OpenOCD style guide.
Change-Id: I2b23ac79639ed40e9d59db5c52ea2196df0349bc
2017-12-26 11:38:11 -08:00
Tim Newsome 19d9e3e32a
Merge pull request #159 from riscv/update
Merge changes from master
2017-12-26 11:37:41 -08:00
Tim Newsome d2c92be73f Merge branch 'master' into update
Change-Id: Icec244b174cc0c67ab58961649a369db7f344824
2017-12-22 13:03:58 -08:00
Tim Newsome 6c719f0ab8
Merge pull request #156 from riscv/fespi
fix fespi flash after registers were renamed.
2017-12-22 12:00:11 -08:00
Tim Newsome 1f66c7827b Fix flash/run algorithm with new register names
Change-Id: I8f539c880ee5da864956f56943411b228d8a5812
2017-12-21 16:41:50 -08:00
Tim Newsome fadf2c1b48 Make functions static. Free memory.
Change-Id: Iadf7b2a926d6d5abc4c8daa2f5620886bcb09b31
2017-12-21 16:23:46 -08:00
Megan Wachs 33ef457c6a
Merge pull request #155 from riscv/debug_defines
Update debug_defines to the one used with spike.
2017-12-21 15:17:43 -08:00
Megan Wachs a81ad34af3
Merge pull request #148 from riscv/macbuild
Use %ll instead of %L in scanf.
2017-12-21 15:16:57 -08:00
Tim Newsome 5892b26259 Update debug_defines to the one used with spike.
Change-Id: I627c6ee557d98239227324c33f9b89f6280cbf93
2017-12-21 15:05:12 -08:00
Tim Newsome b01075eaa5
Merge pull request #145 from riscv/rbb_win
Fix Windows build
2017-12-21 14:04:33 -08:00
Tim Newsome 105536089b
Merge pull request #151 from riscv/use_paren
Use parens after if.
2017-12-21 12:50:56 -08:00
Tim Newsome fa385bdcd5 Use parens after if.
I'm surprised this built with gcc before.

Fixes Issue #150.

Change-Id: I24d2957783c66ad53d5b532a4e930349a2059a97
2017-12-21 12:43:22 -08:00
Jiri Kastner 1c2e3d41de config for ESPRESSObin from Globalscale Tech. Inc.
Change-Id: I77f536a9d2e901ebcef0a7dd0f205e5332b1d382
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-on: http://openocd.zylin.com/4303
Tested-by: jenkins
Reviewed-by: Forest Crossman <cyrozap@gmail.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2017-12-20 19:47:11 +00:00
Jiri Kastner 84d68579eb configs for Marvell Armada 3700
Change-Id: I367f39c9bc9e58380d6d5b500d5368d5173d96bd
Signed-off-by: Jiri Kastner <cz172638@gmail.com>
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Reviewed-on: http://openocd.zylin.com/4302
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-12-20 19:46:20 +00:00
Tim Newsome f13093fff7
Merge pull request #149 from riscv/xml_registers
Send gdb an XML target description that contains only a list of registers we think exist on this target
2017-12-19 11:13:19 -08:00