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 Signed-off-by: David Hendricks <dhendrix@chromium.org> Change-Id: I9cf18c988eaa4b7e720d6c66a02b1c5c63b473e9 Reviewed-on: https://chromium-review.googlesource.com/239978 Reviewed-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit 09f1bf96089bf9d159e4220c1f4d99388d709545) Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/243120
This commit is contained in:
parent
f633844f44
commit
cc06a2a1ff
1 changed files with 10 additions and 0 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue