diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2012-07-09 16:00:18 +0800 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-09 02:04:18 -0700 |
commit | edea097d55771083fd17075f2cc2c8c7a5449914 (patch) | |
tree | 4ec108d975f2295fd1733cc8a760cfa3e743f93b | |
parent | 053b7b682c60eb7bcf55a079ff7afccccef82fa6 (diff) | |
download | vboot-edea097d55771083fd17075f2cc2c8c7a5449914.tar.gz |
Revert "Read virtual switch current values correctly"
This reverts commit 7ec59576f6f61effdc35482c8cfd4aa32b643b1a.
We would like to keep dev_cur and recovery_cur output "(error)" so that
factory process knows that firmware uses virtual switches.
I think this is strange, but this is how factory process works for now.
Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
BUG=chromium-os:10007
TEST=none
Change-Id: I370a3e9f5a8847916445348abb81f7c4bbf3d27f
Reviewed-on: https://gerrit.chromium.org/gerrit/26909
Commit-Ready: Che-Liang Chiou <clchiou@chromium.org>
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r-- | host/arch/arm/lib/crossystem_arch.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index 1cb51c24..d1030c89 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -231,17 +231,14 @@ static int VbGetVarGpio(const char* name) { ret = ReadFdtBlock(name, &pp, &proplen); if (ret || !pp || proplen != 12) { - ret = -1; + ret = 2; goto out; } prop = pp; gpio_num = ntohl(prop[1]); polarity = ntohl(prop[2]); - if (gpio_num) - ret = VbGetGpioStatus(gpio_num) ^ polarity ^ 1; - else - ret = -1; + ret = VbGetGpioStatus(gpio_num) ^ polarity ^ 1; out: if (pp) free(pp); @@ -361,8 +358,6 @@ VbSharedDataHeader *VbSharedDataRead(void) { } int VbGetArchPropertyInt(const char* name) { - int value; - if (!strcasecmp(name, "fmap_base")) return ReadFdtInt("fmap-offset"); else if (!strcasecmp(name, "devsw_boot")) @@ -372,26 +367,15 @@ int VbGetArchPropertyInt(const char* name) { else if (!strcasecmp(name, "wpsw_boot")) return ReadFdtBool("boot-write-protect-switch"); else if (!strcasecmp(name, "devsw_cur")) - value = VbGetVarGpio("developer-switch"); + return VbGetVarGpio("developer-switch"); else if (!strcasecmp(name, "recoverysw_cur")) - value = VbGetVarGpio("recovery-switch"); + return VbGetVarGpio("recovery-switch"); else if (!strcasecmp(name, "wpsw_cur")) - return VbGetVarGpio("write-protect-switch"); + return VbGetVarGpio("write-protect-switch"); else if (!strcasecmp(name, "recoverysw_ec_boot")) return 0; else return -1; - - if (value < 0) { - if (!strcasecmp(name, "devsw_cur")) - return ReadFdtBool("boot-developer-switch"); - else if (!strcasecmp(name, "recoverysw_cur")) - return ReadFdtBool("boot-recovery-switch"); - else - return -1; - } else { - return value; - } } const char* VbGetArchPropertyString(const char* name, char* dest, int size) { |