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>
This commit is contained in:
David Hendricks 2015-01-02 15:46:57 -08:00 committed by Patrick Georgi
parent a7902edf56
commit 4f92844481
1 changed files with 10 additions and 0 deletions

View File

@ -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];
}