diff options
author | Ken Chang <kenc@nvidia.com> | 2015-02-06 14:06:16 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-02-23 22:41:29 +0000 |
commit | 12587293b756dec2e725a8071fd74f044cc483be (patch) | |
tree | 586fa09b70aa7c44ed61111f6cf31290f0a80167 | |
parent | 6343b0fd2ce0e0d7dc5b229359bfa2c5c15a58e0 (diff) | |
download | vboot-12587293b756dec2e725a8071fd74f044cc483be.tar.gz |
crossystem: read recovery switch status from chromeos_arm device
The kernel chromeos_arm platform device provides the recovery status
with the consideration of active polarity.
Thus make crossystem to read from chromeos_arm device first. If this
is not available, read directly from gpio pin status.
BUG=chrome-os-partner:36425
BRANCH=none
TEST=ran on kitty,
'crossystem recoverysw_cur' return 0 with recovery switch off
'crossystem recoverysw_cur' return 1 with recovery switch on
Change-Id: Ie20630d7d07aeadf24044cd3ffc495df7cdd8a4a
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/246883
Tested-by: Titan Lee <titanlee@nvidia.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Titan Lee <titanlee@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/252205
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | host/arch/arm/lib/crossystem_arch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index 21e21696..b032ed30 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -524,6 +524,11 @@ int VbGetArchPropertyInt(const char* name) { return VbGetVarGpio("developer-switch"); } else if (!strcasecmp(name, "recoverysw_cur")) { + int value; + value = VbGetPlatformGpioStatus("recovery"); + if (value != -1) + return value; + return VbGetVarGpio("recovery-switch"); } else if (!strcasecmp(name, "wpsw_cur")) { int value; |