openocd/src
Matthias Welwarsky 332023fb23 cortex_a: fix fast-mode memory reads
cortex_a_read_apb_ab_memory_fast() uses the wrong order of ITR and DSCR
writes when setting up the transfer. ARM DDI0406C says in C8.2 regarding
"Fast mode" operation to first switch to fast mode and then latch the
instruction in ITR. Current implementation first wrote ITR, causing
the instruction to be executed immediately, then switched to fast mode
without an instruction latched. Repeated reading of DTRTX didn't
execute LDC and thus replicated its current content into the whole buffer.

This patch uses the following, revised algorithm:
1) switch to non-blocking mode and issue the LDC for the first word
2) if more than one word is to be read:
 - switch to fast mode
 - latch the LDC instruction into ITR (it is _not_ executed)
 - issue (count-1) reads of DTRTX register, each read returns the current
   content of DTRTX and re-issues the latched instruction
 -> now the second-to-last word is in the buffer and the LDC for the last
    word has been issued.
3) wait for the last instruction to complete
4) switch back to non-blocking mode
5) Read DTRTX for the last (or: only) word and put it into the buffer

Change-Id: I44f5c585962ffa5af257c3d5a2a802c122b6b1e4
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3122
Tested-by: jenkins
Reviewed-by: Christopher Head <chead@zaber.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-12-01 06:52:01 +00:00
..
flash adi_v5: Fix wrong ap value 2015-11-27 10:38:22 +00:00
helper helper/options: Use OPENOCD_SCRIPTS dir if set. 2015-11-03 22:19:36 +00:00
jtag jlink: Retrieve maximum speed from device. 2015-11-26 12:21:30 +00:00
pld cpld/virtex2: allow JSTART to be disabled 2015-08-06 13:14:01 +01:00
rtos rtos/mqx: Fix uninitialized parts of symbol table 2015-11-03 21:58:50 +00:00
server tcl_server: Support line buffers up to 4M (v3) 2015-09-30 22:01:00 +01:00
svf svf: fix progress reporting switch behaviour 2015-11-20 22:27:48 +00:00
target cortex_a: fix fast-mode memory reads 2015-12-01 06:52:01 +00:00
transport transport: make 'transport select' auto-select the first available transport if not set 2015-03-25 21:32:49 +00:00
xsvf xsvf: output a warning suggesting using SVF 2015-11-30 10:11:16 +00:00
hello.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
hello.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
main.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
Makefile.am Makefile.am: link libusb-1.0 after libusb-0.1 to fix dependencies 2015-02-04 21:56:45 +00:00
openocd.c docs: update OpenOCD url's to openocd.org domain 2015-04-16 20:28:21 +01:00
openocd.h Fix some problems with the bin2char utility 2014-08-02 09:01:32 +00:00