summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2012-07-09 16:41:31 -0700
committerGerrit <chrome-bot@google.com>2012-07-10 11:27:08 -0700
commitae648cc520474359ec0bc3c84e8da6e255e16ccf (patch)
treec1472e8c31156494f755d67d1d3d17044d76ef0e
parent29af184eb7a79d2183307fbd4b685537aec3470b (diff)
downloadchrome-ec-ae648cc520474359ec0bc3c84e8da6e255e16ccf.tar.gz
stm32: fix data buffer increment bug in flash_physical_write
This fixes a small bug introduced in a previous refactoring CL where by the data buffer offset wasn't being incremented, thus causing writes to repeatedly write the first two bytes of the incoming data to each chunk of memory. BUG=chrome-os-partner:11097 TEST=successfully wrote and verified data on Snow Signed-off-by: David Hendricks <dhendrix@chromium.org> Change-Id: I8dae00652f4d74bc6ef449297b6e78b13b21255f Reviewed-on: https://gerrit.chromium.org/gerrit/26985 Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: David Hendricks <dhendrix@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r--chip/stm32/flash-stm32f100.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/chip/stm32/flash-stm32f100.c b/chip/stm32/flash-stm32f100.c
index abb9cfb9a9..670f715946 100644
--- a/chip/stm32/flash-stm32f100.c
+++ b/chip/stm32/flash-stm32f100.c
@@ -152,6 +152,7 @@ int flash_physical_write(int offset, int size, const char *data)
/* write the half word */
*address++ = data[0] + (data[1] << 8);
+ data += 2;
/* Wait for writes to complete */
for (i = 0; (STM32_FLASH_SR & 1) && (i < FLASH_TIMEOUT_LOOP) ;