summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRong Chang <rongchang@chromium.org>2012-07-03 18:54:58 +0800
committerGerrit <chrome-bot@google.com>2012-07-03 23:51:19 -0700
commit63368620c55fdc66696885fb963a54d31ddb3b2d (patch)
tree3eb13f8cde6a6aacec374cd97bc2e0242143bb09
parent717e556759304490548ee23973895d995ee88a05 (diff)
downloadchrome-ec-63368620c55fdc66696885fb963a54d31ddb3b2d.tar.gz
CHERRY-PICK: stm32: de-activate all flash accesses for pstate
Cherry-picked from factory-2475.B. This feature is not implemented and accessing random flash addresses. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10237 TEST=on Snow, run flashrom -p internal:bus=lpc --wp-status Reviewed-on: https://gerrit.chromium.org/gerrit/25979 Reviewed-by: Katie Roberts-Hoffman <katierh@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org> Change-Id: Idce19f4e2af37faa5fde9d6561779d981772c9ac Reviewed-on: https://gerrit.chromium.org/gerrit/26666 Reviewed-by: David Hendricks <dhendrix@chromium.org> Commit-Ready: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
-rw-r--r--common/flash_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/flash_common.c b/common/flash_common.c
index 48d34378b1..20bbaa2561 100644
--- a/common/flash_common.c
+++ b/common/flash_common.c
@@ -41,6 +41,7 @@ static int wp_pin_asserted(void)
/* Read persistent state into pstate. */
static int read_pstate(void)
{
+#ifndef CHIP_stm32
int i;
int rv = flash_physical_read(usable_flash_size, sizeof(pstate),
(char *)&pstate);
@@ -57,7 +58,7 @@ static int read_pstate(void)
pstate.lock &= FLASH_PROTECT_LOCK_SET;
for (i = 0; i < MAX_BANKS; i++)
pstate.blocks[i] &= FLASH_PROTECT_PERSISTENT;
-
+#endif /* CHIP_stm32 */
return EC_SUCCESS;
}
@@ -65,6 +66,7 @@ static int read_pstate(void)
/* Write persistent state from pstate, erasing if necessary. */
static int write_pstate(void)
{
+#ifndef CHIP_stm32
int rv;
/* Erase top protection block. Assumes pstate size is less than
@@ -84,6 +86,9 @@ static int write_pstate(void)
/* Rewrite the data */
return flash_physical_write(usable_flash_size, sizeof(pstate),
(const char *)&pstate);
+#else
+ return EC_SUCCESS;
+#endif /* CHIP_stm32 */
}