From a185b8d8f61ac165bc15c6b51d23b6e1be5b15cf Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 15 Jul 2011 16:28:38 -0700 Subject: Report mainfw_act based on VbSharedData Don't use FDT to report it on ARM. This fixes ARM reporting the wrong thing for RO-normal. BUG=none TEST=none Change-Id: Id3a1bd2a1d2502e1d9493ab362be5a58fa88d70e Reviewed-on: http://gerrit.chromium.org/gerrit/4213 Reviewed-by: Olof Johansson Reviewed-by: Simon Glass Tested-by: Randall Spangler --- host/lib/crossystem.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'host/lib/crossystem.c') diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index eea48998..34c1de17 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -26,7 +26,8 @@ typedef enum VdatStringField { VDAT_STRING_TIMERS = 0, /* Timer values */ VDAT_STRING_LOAD_FIRMWARE_DEBUG, /* LoadFirmware() debug information */ - VDAT_STRING_LOAD_KERNEL_DEBUG /* LoadKernel() debug information */ + VDAT_STRING_LOAD_KERNEL_DEBUG, /* LoadKernel() debug information */ + VDAT_STRING_MAINFW_ACT /* Active main firmware */ } VdatStringField; @@ -293,6 +294,22 @@ char* GetVdatString(char* dest, int size, VdatStringField field) value = GetVdatLoadKernelDebug(dest, size, sh); break; + case VDAT_STRING_MAINFW_ACT: + switch(sh->firmware_index) { + case 0: + StrCopy(dest, "A", size); + break; + case 1: + StrCopy(dest, "B", size); + break; + case 0xFF: + StrCopy(dest, "recovery", size); + break; + default: + value = NULL; + } + break; + default: value = NULL; break; @@ -403,6 +420,8 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { default: return NULL; } + } else if (!strcasecmp(name, "mainfw_act")) { + return GetVdatString(dest, size, VDAT_STRING_MAINFW_ACT); } else if (!strcasecmp(name, "vdat_timers")) { return GetVdatString(dest, size, VDAT_STRING_TIMERS); } else if (!strcasecmp(name, "vdat_lfdebug")) { -- cgit v1.2.1