summaryrefslogtreecommitdiff
path: root/host/arch/x86/lib/crossystem_arch.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-03 12:16:06 -0700
committerGerrit <chrome-bot@google.com>2012-10-04 09:31:00 -0700
commit09a8447862c7d111d6abdd7891508df1a8f1cc5b (patch)
tree7a918c9fa140d1c7926d5f30da3186ed5d7b4304 /host/arch/x86/lib/crossystem_arch.c
parent788dbc34b06a958285db0ea6a407aecaaed64045 (diff)
downloadvboot-09a8447862c7d111d6abdd7891508df1a8f1cc5b.tar.gz
crossystem devsw_cur returns devsw_boot if virtual dev switch
devsw_cur is really a meaningless concept on systems with virtual dev switches; it exists primarily to support factory test of physical developer switches. However, some plugins use this instead of the preferred devsw_boot, and it's easier to modify crossystem than the plugins at this point in time. BUG=chrome-os-partner:12928 BRANCH=none (affects all current products, but is an OS-level change, not FW) TEST=manual - On link, 'crossystem devsw_cur devsw_boot' with dev switch on -> '1 1' - On link, 'crossystem devsw_cur devsw_boot' with dev switch off -> '0 0' - On lumpy or earlier, 'crossystem devsw_cur' should return current dev switch position; check this by toggling the physical switch without rebooting and see that the reported value follows the switch value. Change-Id: Ie7416e5cb03c133572c32af677b55ed18884dfb8 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34531 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'host/arch/x86/lib/crossystem_arch.c')
-rw-r--r--host/arch/x86/lib/crossystem_arch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/host/arch/x86/lib/crossystem_arch.c b/host/arch/x86/lib/crossystem_arch.c
index 448a8ffa..23a3bcec 100644
--- a/host/arch/x86/lib/crossystem_arch.c
+++ b/host/arch/x86/lib/crossystem_arch.c
@@ -595,7 +595,12 @@ int VbGetArchPropertyInt(const char* name) {
/* Switch positions */
if (!strcasecmp(name,"devsw_cur")) {
- value = ReadGpio(GPIO_SIGNAL_TYPE_DEV);
+ /* Systems with virtual developer switches return at-boot value */
+ int flags = VbGetSystemPropertyInt("vdat_flags");
+ if ((flags != -1) && (flags & VBSD_HONOR_VIRT_DEV_SWITCH))
+ value = VbGetSystemPropertyInt("devsw_boot");
+ else
+ value = ReadGpio(GPIO_SIGNAL_TYPE_DEV);
} else if (!strcasecmp(name,"recoverysw_cur")) {
value = ReadGpio(GPIO_SIGNAL_TYPE_RECOVERY);
} else if (!strcasecmp(name,"wpsw_cur")) {