summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2012-05-29 22:03:34 -0700
committerDavid Hendricks <dhendrix@chromium.org>2012-05-29 22:03:34 -0700
commitef7557b4fd1a6a889d9918b2811567af216ebaf3 (patch)
tree1ff297207d8dc0c174d8ff6dddcb68cdc02a1aef
parentf2678998617771edbfb3574b66c4573d75e6dda7 (diff)
downloadchrome-ec-ef7557b4fd1a6a889d9918b2811567af216ebaf3.tar.gz
stm32f: update flash write size
This CL updates the constant FLASH_WRITE_BYTES to 64 and modifies the decrement value in the flash_physical_write() loop. The constant value was changed so that it would agree with EC_FLASH_SIZE_MAX which is the size of the data payload. FLASH_WRITE_BYTES is provided as part of EC_CMD_FLASH_INFO, so programs which query size this way will can take advantage of 64-byte writes. The decrement value in the loop did not actually change in value, but instead uses the size of the half-word. Signed-off-by: David Hendricks <dhendrix@chromium.org> BUG=none TEST=Tested on Lucas Change-Id: If335bd8e11db0acc6464dcdef819d91f61ae0890
-rw-r--r--chip/stm32/flash-stm32f100.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/flash-stm32f100.c b/chip/stm32/flash-stm32f100.c
index 583b4225ab..ba8d7dd8bf 100644
--- a/chip/stm32/flash-stm32f100.c
+++ b/chip/stm32/flash-stm32f100.c
@@ -13,7 +13,7 @@
#include "util.h"
#include "watchdog.h"
-#define FLASH_WRITE_BYTES 2
+#define FLASH_WRITE_BYTES 64
#define FLASH_ERASE_BYTES 1024
#define FLASH_PROTECT_BYTES 4096
@@ -141,7 +141,7 @@ int flash_physical_write(int offset, int size, const char *data)
STM32_FLASH_CR |= (1<<0);
- for ( ; size > 0; size -= FLASH_WRITE_BYTES) {
+ for ( ; size > 0; size -= sizeof(*data16)) {
#ifdef CONFIG_TASK_WATCHDOG
/* Reload the watchdog timer to avoid watchdog reset when doing
* long writing with interrupt disabled.