diff options
author | Louis Yung-Chieh Lo <yjlou@chromium.org> | 2012-07-31 17:30:19 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-01 09:07:06 -0700 |
commit | d02cc2c9611dbd27a67fbcad7bf6cb2880f49575 (patch) | |
tree | 92a1140e6df11095f8f14035ca5f8840a9b7ccfe /chip | |
parent | 776374b028c3fe4708d8a1458c73805edb6895b1 (diff) | |
download | chrome-ec-d02cc2c9611dbd27a67fbcad7bf6cb2880f49575.tar.gz |
Snow has write protect pin (PB4) wired to EC.
Intend to keep fake_wp functions for test.
BUG=chrome-os-partner:9986
TEST=build only (success on link/snow/daisy/bds). Have no hardware to test.
Change-Id: I1e2ae923790d65b6c95819f5274dbe8c7f254429
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28793
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/stm32/flash-stm32f100.c | 4 | ||||
-rw-r--r-- | chip/stm32/system.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/chip/stm32/flash-stm32f100.c b/chip/stm32/flash-stm32f100.c index 2b2ee4ca46..68f2268198 100644 --- a/chip/stm32/flash-stm32f100.c +++ b/chip/stm32/flash-stm32f100.c @@ -551,8 +551,7 @@ uint32_t flash_get_protect(void) int i; int not_protected[2] = {0}; - /* TODO (vpalatin) : write protect scheme for stm32 */ - if (system_get_fake_wp()) + if (system_get_fake_wp() || !gpio_get_level(GPIO_WRITE_PROTECTn)) flags |= EC_FLASH_PROTECT_GPIO_ASSERTED; /* Read the current persist state from flash */ @@ -613,6 +612,7 @@ int flash_set_protect(uint32_t mask, uint32_t flags) return retval; } +/* TODO: crosbug.com/p/12036 */ static int command_set_fake_wp(int argc, char **argv) { int val; diff --git a/chip/stm32/system.c b/chip/stm32/system.c index f8b00371f0..4bfecf0812 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -287,12 +287,14 @@ const char *system_get_chip_revision(void) } +/* TODO: crosbug.com/p/12036 */ int system_set_fake_wp(int val) { return bkpdata_write(BKPDATA_INDEX_FAKE_WP, (uint16_t)val); } +/* TODO: crosbug.com/p/12036 */ int system_get_fake_wp(void) { return bkpdata_read(BKPDATA_INDEX_FAKE_WP); |