summaryrefslogtreecommitdiff
path: root/host/arch/arm/lib/crossystem_arch.c
diff options
context:
space:
mode:
Diffstat (limited to 'host/arch/arm/lib/crossystem_arch.c')
-rw-r--r--host/arch/arm/lib/crossystem_arch.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c
index 7120afe4..9025c8b8 100644
--- a/host/arch/arm/lib/crossystem_arch.c
+++ b/host/arch/arm/lib/crossystem_arch.c
@@ -19,6 +19,7 @@
#include "vboot_common.h"
#include "vboot_nvstorage.h"
#include "host_common.h"
+#include "crossystem.h"
#include "crossystem_arch.h"
#define MOSYS_PATH "/usr/sbin/mosys"
@@ -480,13 +481,18 @@ VbSharedDataHeader *VbSharedDataRead(void) {
}
int VbGetArchPropertyInt(const char* name) {
- if (!strcasecmp(name, "fmap_base"))
+ if (!strcasecmp(name, "fmap_base")) {
return ReadFdtInt("fmap-offset");
- else if (!strcasecmp(name, "devsw_cur"))
+ } else if (!strcasecmp(name, "devsw_cur")) {
+ /* Systems with virtual developer switches return at-boot value */
+ int flags = VbGetSystemPropertyInt("vdat_flags");
+ if ((flags != -1) && (flags & VBSD_HONOR_VIRT_DEV_SWITCH))
+ return VbGetSystemPropertyInt("devsw_boot");
+
return VbGetVarGpio("developer-switch");
- else if (!strcasecmp(name, "recoverysw_cur"))
+ } else if (!strcasecmp(name, "recoverysw_cur")) {
return VbGetVarGpio("recovery-switch");
- else if (!strcasecmp(name, "wpsw_cur")) {
+ } else if (!strcasecmp(name, "wpsw_cur")) {
int value;
/* Try finding the GPIO through the chromeos_arm platform device first. */
value = VbGetPlatformGpioStatus("write-protect");