[coreboot-gerrit] New patch to review for coreboot: 3ce2998 chromeos: add get_recovery_mode_from_vbnv() to vbnv_flash
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Fri Apr 10 22:02:51 CEST 2015
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9563
-gerrit
commit 3ce2998b8447ebefc83b669c8580a8f623dcb789
Author: David Hendricks <dhendrix at chromium.org>
Date: Fri Jan 2 15:46:57 2015 -0800
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 at chromium.org>
Original-Commit-Id: 09f1bf96089bf9d159e4220c1f4d99388d709545
Original-Signed-off-by: David Hendricks <dhendrix at chromium.org>
Original-Change-Id: I9cf18c988eaa4b7e720d6c66a02b1c5c63b473e9
Original-Reviewed-on: https://chromium-review.googlesource.com/239978
Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
---
src/vendorcode/google/chromeos/vbnv_flash.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/vendorcode/google/chromeos/vbnv_flash.c b/src/vendorcode/google/chromeos/vbnv_flash.c
index e880ed4..97a2a82 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];
+}
More information about the coreboot-gerrit
mailing list