mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
crossystem: x86: Write VbNv with mosys if using vboot2
If this is an x86 system using vboot2 then write VbNv data to CMOS and also use mosys to write it directly to flash. BUG=chrome-os-partner:51846 BRANCH=none TEST=emerge-chell vboot_reference; emerge-oak vboot_reference verify on chell that "crossystem dev_disable_request=1" is written to both CMOS and flash. Change-Id: Ifd5dcee4d401f8de36801c5c0a7db3255e618e28 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/336311 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
e98431f52b
commit
eb0c8cc39b
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "crossystem.h"
|
||||
#include "crossystem_arch.h"
|
||||
#include "crossystem_vbnv.h"
|
||||
#include "host_common.h"
|
||||
#include "utility.h"
|
||||
#include "vboot_common.h"
|
||||
@@ -171,6 +172,7 @@ int VbReadNvStorage(VbNvContext* vnc) {
|
||||
|
||||
int VbWriteNvStorage(VbNvContext* vnc) {
|
||||
unsigned offs, blksz;
|
||||
VbSharedDataHeader *sh = VbSharedDataRead();
|
||||
|
||||
if (!vnc->raw_changed)
|
||||
return 0; /* Nothing changed, so no need to write */
|
||||
@@ -186,6 +188,10 @@ int VbWriteNvStorage(VbNvContext* vnc) {
|
||||
if (0 != VbCmosWrite(offs, VBNV_BLOCK_SIZE, vnc->raw))
|
||||
return -1;
|
||||
|
||||
/* Also attempt to write using mosys if using vboot2 */
|
||||
if (sh && (sh->flags & VBSD_BOOT_FIRMWARE_VBOOT2))
|
||||
VbWriteNvStorage_mosys(vnc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user