summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2015-01-02 15:46:57 -0800
committerPatrick Georgi <pgeorgi@google.com>2015-04-13 12:23:05 +0200
commit4f928444812f5ed2aa810d08ec603b859a6d63c0 (patch)
tree63b4fec41be329b7d2191eda4e53fcdf2c6bf794
parenta7902edf56244d92e7529afc9391e8d49913914f (diff)
downloadcoreboot-4f928444812f5ed2aa810d08ec603b859a6d63c0.tar.xz
chromeos: add get_recovery_mode_from_vbnv() to vbnv_flash
The first platform that used flash-backed VBNV data has a physical recovery switch, get_recovery_mode_from_vbnv() was never implemented. This patch adds get_recovery_mode_from_vbnv() similarly to how it's implemented for other vbnv storage in other places. BUG=chrome-os-partner:34436 BRANCH=none TEST=needs testing Change-Id: Ifd795c5c1ff0f23619fd2125b4795571af03ece1 Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Original-Commit-Id: 09f1bf96089bf9d159e4220c1f4d99388d709545 Original-Signed-off-by: David Hendricks <dhendrix@chromium.org> Original-Change-Id: I9cf18c988eaa4b7e720d6c66a02b1c5c63b473e9 Original-Reviewed-on: https://chromium-review.googlesource.com/239978 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-on: http://review.coreboot.org/9563 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
-rw-r--r--src/vendorcode/google/chromeos/vbnv_flash.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/vbnv_flash.c b/src/vendorcode/google/chromeos/vbnv_flash.c
index e880ed4d5c..97a2a82d1b 100644
--- a/src/vendorcode/google/chromeos/vbnv_flash.c
+++ b/src/vendorcode/google/chromeos/vbnv_flash.c
@@ -15,6 +15,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * TODO: Make this CAR-friendly in case we use it on x86 some day.
*/
#include <cbfs.h>
@@ -25,6 +27,7 @@
#include <vb2_api.h>
#include <vboot_nvstorage.h>
#include "chromeos.h"
+#include "vbnv_layout.h"
#if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE)
#define BLOB_SIZE VBNV_BLOCK_SIZE
@@ -189,3 +192,10 @@ void save_vbnv(const uint8_t *vbnv_copy)
printk(BIOS_ERR, "failed to save nvdata\n");
}
}
+
+int get_recovery_mode_from_vbnv(void)
+{
+ if (!is_initialized())
+ init_vbnv();
+ return cache[RECOVERY_OFFSET];
+}