diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-02-07 18:52:13 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-09 22:50:50 -0800 |
commit | b889e47410698986822712078ec232c1715b4845 (patch) | |
tree | 8d3ec71d39f90e60fb3f2ba00fc0d1e2f9350ad0 /board/cr50/wp.h | |
parent | 4ce529e25acd4683f7232dc627c72cb7f3f84d77 (diff) | |
download | chrome-ec-b889e47410698986822712078ec232c1715b4845.tar.gz |
cr50: Use BATT_PRES_L as source of write protect.
This commit changes the Cr50 write protect behaviour to simply follow
the state of the battery present pin. The state can still be overridden
both ways by using the `wp` console command. A user can either force
write protect enabled or force write protect disabled. Additionally,
the behaviour can be reset to follow the state of the battery pin by
issuing `wp follow_batt_pres`. However, the ability to force the write
protect state requires an unlocked console.
BUG=chrome-os-partner:62726
BRANCH=None
TEST=Plug in battery, verify that WP is enabled. Plug in AC and unplug
battery, verify that WP is disabled.
TEST=Unplug battery, unplug AC, plug in AC, verify that WP is disabled.
TEST=Unplug battery, verify that WP is disabled. Use `wp' command to
enable WP, verify that it is enabled.
TEST=Plug in battery, disable WP using `wp` command, put cr50 into deep
sleep, wake it up, verify that WP is still disabled.
TEST=Plug in AC, plug in battery, disable WP using `wp` command, unplug
and plug battery connector, verify that WP is still disabled.
Change-Id: I83d9820067800801ddbde311eab0853c3c2216d3
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/439485
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50/wp.h')
-rw-r--r-- | board/cr50/wp.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/board/cr50/wp.h b/board/cr50/wp.h new file mode 100644 index 0000000000..e2ae172df8 --- /dev/null +++ b/board/cr50/wp.h @@ -0,0 +1,13 @@ +/* Copyright 2017 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "common.h" + +/** + * Set the current write protect state in RBOX and long life scratch register. + * + * @param asserted: 0 to disable write protect, otherwise enable write protect. + */ +void set_wp_state(int asserted); |