summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-12 15:13:44 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-10-12 15:13:44 +0200
commit23c629a85eea7b927a179626e8aa377f63734e46 (patch)
treee84172797edc255a9fa938594710dc804ff21bbf /src
parent407061eaa6fb620778ff14cc2aa5d3ffd019d05e (diff)
downloadopenocd+libswd-23c629a85eea7b927a179626e8aa377f63734e46.tar.gz
openocd+libswd-23c629a85eea7b927a179626e8aa377f63734e46.tar.bz2
openocd+libswd-23c629a85eea7b927a179626e8aa377f63734e46.tar.xz
openocd+libswd-23c629a85eea7b927a179626e8aa377f63734e46.zip
arm11 burst writes are now only enabled for writes larger than 1 word. Single word writes are frequently used from reset init scripts to non-memory peripherals.
Diffstat (limited to 'src')
-rw-r--r--src/target/arm11.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c
index 16c8dd31..f7265dac 100644
--- a/src/target/arm11.c
+++ b/src/target/arm11.c
@@ -1408,6 +1408,15 @@ int arm11_write_memory_inner(struct target_s *target, uint32_t address, uint32_t
if (retval != ERROR_OK)
return retval;
+ /* burst writes are not used for single words as those may well be
+ * reset init script writes.
+ *
+ * The other advantage is that as burst writes are default, we'll
+ * now exercise both burst and non-burst code paths with the
+ * default settings, increasing code coverage.
+ */
+ bool burst = arm11_config_memwrite_burst && (count > 1);
+
switch (size)
{
case 1:
@@ -1463,7 +1472,7 @@ int arm11_write_memory_inner(struct target_s *target, uint32_t address, uint32_t
/** \todo TODO: buffer cast to uint32_t* causes alignment warnings */
uint32_t *words = (uint32_t*)buffer;
- if (!arm11_config_memwrite_burst)
+ if (!burst)
{
/* STC p14,c5,[R0],#4 */
/* STC p14,c5,[R0]*/
@@ -1501,7 +1510,7 @@ int arm11_write_memory_inner(struct target_s *target, uint32_t address, uint32_t
(unsigned) (address + size * count),
(unsigned) r0);
- if (arm11_config_memwrite_burst)
+ if (burst)
LOG_ERROR("use 'arm11 memwrite burst disable' to disable fast burst mode");
if (arm11_config_memwrite_error_fatal)