diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-09-10 21:52:16 -0700 |
---|---|---|
committer | Vic Yang <victoryang@chromium.org> | 2014-09-11 05:15:12 +0000 |
commit | 2107fe8f3cfca756f0cfca6eaf4811f7e0832f83 (patch) | |
tree | 6144238c1d284d161953c92215def226c0ec69a4 | |
parent | f44593e20bf61a2243d7baaae901c912ca798d75 (diff) | |
download | chrome-ec-2107fe8f3cfca756f0cfca6eaf4811f7e0832f83.tar.gz |
stm32f07: change erase page size to 2kB
Change erase page size from 1kB to 2kB. The datasheet
specifies that the page size is 2kB.
This was causing occasional failures in flashrom because
flashrom only erases and writes pages where the flash
contents don't match the new binary.
BUG=none
BRANCH=factory-ryu-6212.B
TEST=Load onto samus_pd, and verify that flashrom
works successfully.
Also added console debugging to verify that the actual erase
page size is 2kB. I left the CONFIG_FLASH_ERASE_SIZE at 1024
and added the following code.
static int command_flash_is_erased(int argc, char **argv)
{
int offset = -1;
int size = CONFIG_FLASH_ERASE_SIZE;
int rv;
rv = parse_offset_size(argc, argv, 1, &offset, &size);
if (rv)
return rv;
ccprintf("Offset %d, size %d, is erased: %d\n", offset, size,
flash_is_erased(offset, size));
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(flashiserased, command_flash_is_erased,
"",
"",
NULL);
Then:
> flashiserased 2048
Offset 2048, size 1024, is erased: 0
> flashiserased 3072
Offset 3072, size 1024, is erased: 0
> flashiserased 4096
Offset 4096, size 1024, is erased: 0
> flasherase 2048
Erasing 1024 bytes at 0x800...
> flashiserased 2048
Offset 2048, size 1024, is erased: 1
> flashiserased 3072
Offset 3072, size 1024, is erased: 1
> flashiserased 4096
Offset 4096, size 1024, is erased: 0
You can see when it tries to erase 1kB at 2048, it actually erases
2kB.
Change-Id: I02772d4671784930765df63fa99968a07b15882e
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/217467
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
-rw-r--r-- | chip/stm32/config-stm32f07x.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32/config-stm32f07x.h b/chip/stm32/config-stm32f07x.h index 380cf51306..fd1b46bc98 100644 --- a/chip/stm32/config-stm32f07x.h +++ b/chip/stm32/config-stm32f07x.h @@ -8,7 +8,7 @@ #define CONFIG_FLASH_PHYSICAL_SIZE 0x00020000 #define CONFIG_FLASH_SIZE CONFIG_FLASH_PHYSICAL_SIZE #define CONFIG_FLASH_BANK_SIZE 0x1000 -#define CONFIG_FLASH_ERASE_SIZE 0x0400 /* erase bank size */ +#define CONFIG_FLASH_ERASE_SIZE 0x0800 /* erase bank size */ #define CONFIG_FLASH_WRITE_SIZE 0x0002 /* minimum write size */ /* No page mode on STM32F, so no benefit to larger write sizes */ |