summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-09-10 13:17:05 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-09-10 13:17:05 +0000
commit3bade442b1f8c41895fba6428a850b20b7dd75c1 (patch)
tree858e8f2f1f8f31025e527f86d76f4a74e8d24dcf /src
parentb4acbee47fcb29afc9958b4a9e74b9916a415dec (diff)
downloadopenocd+libswd-3bade442b1f8c41895fba6428a850b20b7dd75c1.tar.gz
openocd+libswd-3bade442b1f8c41895fba6428a850b20b7dd75c1.tar.bz2
openocd+libswd-3bade442b1f8c41895fba6428a850b20b7dd75c1.tar.xz
openocd+libswd-3bade442b1f8c41895fba6428a850b20b7dd75c1.zip
Alexei Babich <a.babich@rez.ru> fix problems with unecessary tailend byte accesses. Use 16 bit access on tailend of a memory read if possible.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2684 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/target/target.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c
index b6ea6555..56e124f7 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1239,7 +1239,19 @@ int target_read_buffer(struct target_s *target, uint32_t address, uint32_t size,
address += aligned;
size -= aligned;
}
+
+ /*prevent byte access when possible (avoid AHB access limitations in some cases)*/
+ if(size >=2)
+ {
+ int aligned = size - (size%2);
+ retval = target_read_memory(target, address, 2, aligned / 2, buffer);
+ if (retval != ERROR_OK)
+ return retval;
+ buffer += aligned;
+ address += aligned;
+ size -= aligned;
+ }
/* handle tail writes of less than 4 bytes */
if (size > 0)
{